Simplify shockwave damages

This commit is contained in:
2025-06-23 18:15:28 +01:00
parent 4e008366f4
commit 54eab6dd9e
12 changed files with 468 additions and 457 deletions
+12 -11
View File
@@ -59,10 +59,12 @@ damageMetal dm ecw w =
Lasering _ p t -> makeSpark FireSpark (outTo p t) (rdir p t)
Piercing _ p t ->
makeSpark NormalSpark (outTo p t) (rdir p t)
. randsound p [tingS, ting1S, ting2S, ting3S, ting4S, ting5S]
. randsound p [clangS,clang1S
,tingS, ting1S, ting2S, ting3S, ting4S, ting5S]
-- . randsound p [tingS, ting1S, ting2S, ting3S, ting4S, ting5S]
Blunt _ p t ->
makeSpark NormalSpark (outTo p t) (rdir p t)
. randsound p [tingS, ting1S, ting2S, ting3S, ting4S, ting5S]
. randsound p [clangS,clang1S,clang2S]
Shattering _ _ _ -> id
Crushing{} -> id
Explosive{} -> id
@@ -85,7 +87,7 @@ damageMetal dm ecw w =
so = DamageHitSound (w ^. cWorld . lWorld . lClock)
damageFlesh :: Damage -> ECW -> World -> World
damageFlesh dm ecw w = w & case dm of
damageFlesh dm _ w = w & case dm of
Lasering _ _ _ -> id
Piercing _ p t ->
randsound
@@ -101,7 +103,7 @@ damageFlesh dm ecw w = w & case dm of
]
. smokeCloudAt red 20 200 1 (addZ 20 (outTo p t))
Blunt _ p _ -> randsound p [hitS]
Shattering _ p t -> id
Shattering _ _ _ -> id
Crushing{} -> id
Explosive{} -> id
Sparking{} -> id
@@ -111,9 +113,6 @@ damageFlesh dm ecw w = w & case dm of
Enterrement{} -> id
Flashing{} -> id
where
v = case ecw of
Right wl -> uncurry (-) $ _wlLine wl
Left cr -> undefined
randsound p xs =
let (x, g) = runState (takeOne xs) $ _randGen w
in soundStart so p x Nothing . set randGen g
@@ -123,7 +122,7 @@ damageFlesh dm ecw w = w & case dm of
damageDirt :: Damage -> ECW -> World -> World
damageDirt dm ecw w =
w & case dm of
Lasering _ p t -> makeSpark FireSpark (outTo p t) (argV $ reflectIn v t)
Lasering _ p t -> makeSpark FireSpark (outTo p t) (rdir p t)
Piercing _ p t ->
smokeCloudAt orange 20 200 1 (addZ 20 (outTo p t))
. randsound p [slapS, slap1S]
@@ -138,9 +137,11 @@ damageDirt dm ecw w =
Enterrement{} -> id
Flashing{} -> id
where
v = case ecw of
Right wl -> uncurry (-) $ _wlLine wl
Left cr -> undefined
rdir p t = argV $ reflectIn v t
where
v = case ecw of
Right wl -> uncurry (-) $ _wlLine wl
Left cr -> vNormal (p - _crPos cr)
randsound p xs =
let (x, g) = runState (takeOne xs) $ _randGen w
in soundStart so p x Nothing . set randGen g
+2 -2
View File
@@ -11,8 +11,8 @@ destroyMatS mat = case mat of
Stone -> [stone1S, stone2S, stone3S, stone4S, stone5S]
Dirt -> [stone1S, stone3S]
Wood -> [stone1S, stone3S]
Metal -> [metal1S, metal2S, metal3S, metal4S, metal5S, metal6S, metal7S]
Electronics -> [metal1S, metal2S, metal3S, metal4S, metal5S, metal6S, metal7S]
Metal -> [metal1S, metal2S, metal3S, metal4S, metal5S, metal6S,metal7S]
Electronics -> [metal1S, metal2S, metal3S, metal4S, metal5S, metal6S,metal7S]
Flesh -> [gut1S, gut2S, gut3S, gut4S, gut5S, gut6S]
weakenMatS :: Material -> [SoundID]