Refactor damages

This commit is contained in:
2025-06-07 14:26:00 +01:00
parent 7a192e7631
commit 81a7dcd962
24 changed files with 271 additions and 277 deletions
+3 -8
View File
@@ -30,7 +30,7 @@ moveShockwave w sw
doDams w' =
over (cWorld . lWorld . creatures) (IM.map damCr) $
foldl'
(flip $ damageWall (Damage EXPLOSIVE 1000 p p p))
(flip $ damageWall (Explosive 1000 p))
w'
hitBlocks
hitBlocks = map snd . overlapCircWalls p rad $ wlsNearCirc p rad w
@@ -39,12 +39,7 @@ moveShockwave w sw
| _crID cr `elem` is || dist (_crPos cr) p >= rad + crRad (cr ^. crType) = cr
| otherwise =
cr & crState . csDamage
.:~ Damage
CONCUSSIVE
dam
(cpos -.- v)
cpos
(cpos +.+ v)
.:~ Explosive dam p
where
cpos = _crPos cr
v = normalizeV (cpos -.- p)
@@ -67,7 +62,7 @@ moveInverseShockwave w sw
| dist (_crPos cr) p >= rad + crRad (cr ^. crType) = cr
| otherwise =
cr & crState . csDamage
.:~ Damage CONCUSSIVE 1 (cpos +.+ v) cpos (cpos -.- v)
.:~ Explosive 1 p
where
cpos = _crPos cr
v = normalizeV (cpos -.- p)