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 -3
View File
@@ -108,9 +108,9 @@ checkDeath cr w
-- could look at the amount of damage here (given by maxDamage) too
corpseOrGib :: Creature -> World -> World
corpseOrGib cr = case cr ^? crState . csDamage . to maxDamageType . _Just . _1 of
Just FLAMING -> plNew (cWorld . lWorld . corpses) cpID (thecorpse & cpSPic %~ scorchSPic)
Just ELECTRICAL -> plNew (cWorld . lWorld . corpses) cpID thecorpse
Just POISONDAM -> plNew (cWorld . lWorld . corpses) cpID (thecorpse & cpSPic %~ poisonSPic)
Just Flaming{} -> plNew (cWorld . lWorld . corpses) cpID (thecorpse & cpSPic %~ scorchSPic)
Just Electrical{} -> plNew (cWorld . lWorld . corpses) cpID thecorpse
Just Poison{} -> plNew (cWorld . lWorld . corpses) cpID (thecorpse & cpSPic %~ poisonSPic)
_ | _crPastDamage cr > 200 -> addCrGibs cr
_ -> plNew (cWorld . lWorld . corpses) cpID thecorpse
where