This commit is contained in:
2025-11-22 11:53:18 +00:00
parent 4e6876c983
commit 229350120a
2 changed files with 30 additions and 29 deletions
+6 -6
View File
@@ -86,11 +86,11 @@ checkDeath' cr w = case cr ^. crHP of
-- could look at the amount of damage here (given by maxDamage) too
corpseOrGib :: Creature -> World -> World
corpseOrGib cr w = w & case cr ^? crDamage . to maxDamageType . _Just . _1 of
corpseOrGib cr = case cr ^? crDamage . to maxDamageType . _Just . _1 of
Just CookingDamage -> sethp (CrIsCorpse $ scorchSPic thecorpse)
Just PoisonDamage -> sethp (CrIsCorpse $ poisonSPic thecorpse)
Just PhysicalDamage | _crPain cr > 200 -> addCrGibs cr
. sethp CrIsGibs
Just PhysicalDamage | _crPain cr > 200
-> addCrGibs cr . sethp CrIsGibs
_ -> sethp (CrIsCorpse thecorpse)
where
sethp x = cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ x
@@ -121,6 +121,6 @@ chasmTest cr w
f = circInPolygon (cr ^. crPos . _xy) (crRad $ cr ^. crType)
updatePulse :: Pulse -> Pulse
updatePulse PulseStatus{_pulseRate = pr, _pulseProgress = pp}
| pp >= pr = PulseStatus pr 0
| otherwise = PulseStatus pr (pp + 1)
updatePulse p
| p ^. pulseProgress >= p ^. pulseRate = p & pulseProgress .~ 0
| otherwise = p & pulseProgress +~ 1