Redo maxDamageType

This commit is contained in:
2025-06-08 20:56:56 +01:00
parent 70c78824f3
commit 1b769ad504
4 changed files with 81 additions and 73 deletions
+4 -4
View File
@@ -3,6 +3,7 @@ module Dodge.Creature.State (
doDamage,
) where
import Dodge.Data.Damage.Type
import Dodge.Item.BackgroundEffect
import Dodge.Item.MaxAmmo
import Control.Applicative
@@ -108,10 +109,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 Poison{} -> plNew (cWorld . lWorld . corpses) cpID (thecorpse & cpSPic %~ poisonSPic)
_ | _crPastDamage cr > 200 -> addCrGibs cr
Just CookingDamage -> plNew (cWorld . lWorld . corpses) cpID (thecorpse & cpSPic %~ scorchSPic)
Just PoisonDamage -> plNew (cWorld . lWorld . corpses) cpID (thecorpse & cpSPic %~ poisonSPic)
Just PhysicalDamage | _crPastDamage cr > 200 -> addCrGibs cr
_ -> plNew (cWorld . lWorld . corpses) cpID thecorpse
where
thecorpse = makeCorpse cr