Remove destroyed creatures rather than setting flag
Sill only set flag for avatar
This commit is contained in:
@@ -138,7 +138,7 @@ hasAutoDoorBody cr = crittype && notdestroyed
|
||||
notdestroyed = case cr ^. crHP of
|
||||
HP {} -> True
|
||||
CrIsCorpse {} -> True
|
||||
CrDestroyed {} -> False
|
||||
AvatarDestroyed {} -> False
|
||||
crittype = case cr ^. crType of
|
||||
SlimeCrit {} -> False
|
||||
BeeCrit {} -> False
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user