Work on windows
This commit is contained in:
@@ -10,7 +10,7 @@ materialColor = \case
|
||||
Wood -> dark yellow
|
||||
Dirt -> dark $ dark orange
|
||||
Stone -> greyN 0.5
|
||||
Glass -> aquamarine
|
||||
Glass -> azure
|
||||
Metal -> orange
|
||||
Crystal -> green
|
||||
Flesh -> red
|
||||
|
||||
@@ -23,7 +23,7 @@ damMatSideEffect dm = \case
|
||||
Metal -> damageMetal dm
|
||||
Flesh -> damageFlesh dm
|
||||
Dirt -> damageDirt dm
|
||||
-- Glass -> damageGlass dm
|
||||
Glass -> damageGlass dm
|
||||
Crystal -> \ecw -> set _1 0 . defDamageMaterial dm ecw
|
||||
_ -> defDamageMaterial dm
|
||||
|
||||
@@ -151,6 +151,40 @@ damageDirt dm _ w =
|
||||
so = DamageHitSound (w ^. cWorld . lWorld . lClock)
|
||||
outTo x t = x -.- squashNormalizeV t
|
||||
|
||||
damageGlass :: Damage -> ECW -> World -> (Int,World)
|
||||
damageGlass dm ecw w = case dm of
|
||||
Lasering _ _ t -> f 0 $ id
|
||||
Piercing _ p t ->
|
||||
f dmam $ makeSpark NormalSpark (outTo p t) (rdir p t)
|
||||
-- . makeDustAt Stone 200 (addZ 20 (outTo p t))
|
||||
. randsound p [smallGlass1S, smallGlass2S, smallGlass3S, smallGlass4S]
|
||||
Blunt _ p t -> f dmam $ -- makeDustAt Stone 200 (addZ 20 (outTo p t))
|
||||
randsound p [smallGlass1S, smallGlass2S, smallGlass3S, smallGlass4S]
|
||||
Shattering _ p t -> f dmam $ makeDustAt Glass 200 (addZ 20 (outTo p t))
|
||||
. randsound p [smallGlass1S, smallGlass2S, smallGlass3S, smallGlass4S]
|
||||
Crushing{} -> f dmam id
|
||||
Explosive _ p -> f dmam -- the sound comes from the explosion center, which is not correct...
|
||||
$ randsound p [smallGlass1S, smallGlass2S, smallGlass3S, smallGlass4S]
|
||||
Sparking{} -> f 0 id
|
||||
Flaming{} -> f 0 id
|
||||
Electrical{} -> f 0 id
|
||||
Poison{} -> f 0 id
|
||||
Enterrement{} -> f 0 id
|
||||
Flashing{} -> f 0 id
|
||||
where
|
||||
f x g = (x, g w)
|
||||
dmam = dm ^. dmAmount
|
||||
rdir p t = argV $ reflectIn v t
|
||||
where
|
||||
v = case ecw of
|
||||
Right wl -> uncurry (-) $ _wlLine wl
|
||||
Left cr -> vNormal (p - cr ^. crPos . _xy)
|
||||
randsound p xs =
|
||||
let (x, g) = runState (takeOne xs) $ _randGen w
|
||||
in soundStart so p x Nothing . set randGen g
|
||||
so = DamageHitSound (w ^. cWorld . lWorld . lClock)
|
||||
outTo x t = x -.- squashNormalizeV t
|
||||
|
||||
--damageGlass :: Damage -> Float -> World -> (World,Int)
|
||||
--damageGlass dm dir w = w & case _dmType dm of
|
||||
-- LASERING -> a 0 $ id
|
||||
|
||||
Reference in New Issue
Block a user