Remove destroyed creatures rather than setting flag

Sill only set flag for avatar
This commit is contained in:
2026-05-08 10:45:05 +01:00
parent 84e95da2b5
commit ad998fb622
7 changed files with 26 additions and 18 deletions
+5 -4
View File
@@ -46,10 +46,11 @@ import qualified Data.IntSet as IS
-- allow for knockbacks etc to be determined as well as intended movements
updateCreature :: Creature -> World -> World
updateCreature cr
| cr ^. crPos . _z < negate 300 = (tocr . crHP .~ CrDestroyed Pitted) . destroyAllInvItems cr
| cr ^. crPos . _z < negate 300 = (cWorld . lWorld . creatures . at (cr ^. crID) %~ destroyCreature)
. destroyAllInvItems cr
| otherwise = case cr ^. crHP of
CrIsCorpse{} -> cleardamage . updateCarriage (_crID cr) . damageCorpse (_crID cr) cr
CrDestroyed{} -> id
AvatarDestroyed{} -> id
HP{} -> cleardamage . updateLivingCreature cr
where
cleardamage = tocr . crDamage .~ mempty
@@ -251,7 +252,7 @@ updateCalmBee cr cid w
slimeCritUpdate :: Int -> World -> World
slimeCritUpdate cid w
| r < 5 = w & cWorld . lWorld . creatures . ix cid . crHP .~ CrDestroyed Gibbed
| r < 5 = w & cWorld . lWorld . creatures . at cid .~ Nothing
| Just hitp <- w ^? cWorld . lWorld . creatures . ix cid . crDamage . ix 0 . dmPos
, Just hitv <- w ^? cWorld . lWorld . creatures . ix cid . crDamage . ix 0 . dmVector
, Just w' <- splitSlimeCrit' hitp hitv cid cr w = w'
@@ -459,7 +460,7 @@ corpseOrGib cr w =
Just PhysicalDamage
| _crPain cr > 300 ->
makeCrGibs cr
. sethp (CrDestroyed Gibbed)
. (cWorld . lWorld . creatures . at (cr ^. crID) %~ destroyCreature)
. dodeathsound GibsDeath
_ ->
sethp (CrIsCorpse thecorpse)