This commit is contained in:
2025-11-22 11:47:35 +00:00
parent b1bd52b09e
commit 4e6876c983
2 changed files with 3 additions and 27 deletions
+2 -25
View File
@@ -76,36 +76,13 @@ checkDeath' cr w = case cr ^. crHP of
HP x | x > -200 && _crDeathTimer cr < 5 -> w HP x | x > -200 && _crDeathTimer cr < 5 -> w
& tocr . crDamage .~ [] & tocr . crDamage .~ []
& tocr . crDeathTimer +~ 1 & tocr . crDeathTimer +~ 1
HP x | x > -200 -> w HP _ -> w
& dropAll cr -- the order of & dropAll cr -- the order of these is possibly important
-- & removecr -- these is important
& stopSoundFrom (CrWeaponSound (_crID cr) 0) & stopSoundFrom (CrWeaponSound (_crID cr) 0)
& corpseOrGib cr & corpseOrGib cr
HP _ -> w
& dropAll cr -- the order of
& tocr . crHP .~ CrIsGibs
-- & destroyCreature cr -- these is important
& stopSoundFrom (CrWeaponSound (_crID cr) 0)
& addCrGibs cr
_ -> w _ -> w
-- | otherwise = w
-- & dropAll cr -- the order of
-- & removecr -- these is important
-- & stopSoundFrom (CrWeaponSound (_crID cr) 0)
-- & corpseOrGib cr
where where
tocr = cWorld . lWorld . creatures . ix (_crID cr) tocr = cWorld . lWorld . creatures . ix (_crID cr)
-- removecr
-- | _crID cr == 0 = id
-- -- hack to get around player creature being killed but left with more than 0 hp
-- | otherwise = cWorld . lWorld . creatures . at (_crID cr) .~ Nothing
--destroyCreature :: Creature -> World -> World
--destroyCreature cr
-- | _crID cr == 0 = id
-- -- cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ 0
-- -- hack to get around player creature being killed but left with more than 0 hp
-- | otherwise = cWorld . lWorld . creatures . at (_crID cr) .~ Nothing
-- could look at the amount of damage here (given by maxDamage) too -- could look at the amount of damage here (given by maxDamage) too
corpseOrGib :: Creature -> World -> World corpseOrGib :: Creature -> World -> World
@@ -12,8 +12,7 @@ import Data.Aeson.TH
--import Sound.Data --import Sound.Data
data Manipulation -- should be ManipulatedObject? data Manipulation -- should be ManipulatedObject?
= Manipulator {_manObject :: ManipulatedObject = Manipulator {_manObject :: ManipulatedObject }
}
| Brute | Brute
deriving (Eq, Ord, Show, Read) --Generic, Flat) deriving (Eq, Ord, Show, Read) --Generic, Flat)