Cleanup, redo damage direction

This commit is contained in:
2025-06-08 20:40:58 +01:00
parent 5b1e4fba4e
commit 70c78824f3
12 changed files with 105 additions and 147 deletions
+2 -6
View File
@@ -45,18 +45,14 @@ defaultApplyDamage ds cr w =
--p = _dmAt dm
applyIndividualDamage :: Creature -> World -> Damage -> World
--applyIndividualDamage cr w dm = applyDamageEffect dm (_dmEffect dm) cr $ applyIndividualDamage' cr w dm
applyIndividualDamage cr w dm = applyIndividualDamage' cr w dm
applyIndividualDamage' :: Creature -> World -> Damage -> World
applyIndividualDamage' cr w dm = case dm of
applyIndividualDamage cr w dm = case dm of
Piercing{} -> applyPiercingDamage cr dm w
_ -> w & damageHP cr (_dmAmount dm)
applyPiercingDamage :: Creature -> Damage -> World -> World
applyPiercingDamage cr dm
| crIsArmouredFrom p cr = f . makeSpark NormalSpark p1 (argV (p1 -.- p))
| otherwise = f . (damageHP cr $ _dmAmount dm)
| otherwise = f . damageHP cr (_dmAmount dm)
where
f = cWorld . lWorld . creatures . ix (_crID cr) . crPos -~ _dmVector dm
/ V2 x x