Cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user