Add damage origins

This commit is contained in:
2026-04-24 20:34:20 +01:00
parent 011286ccb5
commit e0e346aade
43 changed files with 535 additions and 449 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ updateExpBarrel ps cr w = case cr ^. crHP of
& flip (foldl' f) ps
HP _ ->
w
& makeExplosionAt ((cr ^. crPos) & _z +~ 20) 0
& makeExplosionAt (CrIndirectO (cr ^. crID)) ((cr ^. crPos) & _z +~ 20) 0
& cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ CrDestroyed Gibbed
_ -> w
where
@@ -51,7 +51,7 @@ damsToExpBarrel = flip $ foldl' damToExpBarrel
damToExpBarrel :: Creature -> Damage -> Creature
damToExpBarrel cr dm = case dm of
Piercing x p _ ->
Piercing x p _ _ ->
cr & crHP . _HP -~ div x 200
& crType . barrelType . piercedPoints .:~ (p - cr ^. crPos . _xy)
Poison{} -> cr