Cleanup
This commit is contained in:
@@ -76,36 +76,13 @@ checkDeath' cr w = case cr ^. crHP of
|
||||
HP x | x > -200 && _crDeathTimer cr < 5 -> w
|
||||
& tocr . crDamage .~ []
|
||||
& tocr . crDeathTimer +~ 1
|
||||
HP x | x > -200 -> w
|
||||
& dropAll cr -- the order of
|
||||
-- & removecr -- these is important
|
||||
HP _ -> w
|
||||
& dropAll cr -- the order of these is possibly important
|
||||
& stopSoundFrom (CrWeaponSound (_crID cr) 0)
|
||||
& 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
|
||||
-- | otherwise = w
|
||||
-- & dropAll cr -- the order of
|
||||
-- & removecr -- these is important
|
||||
-- & stopSoundFrom (CrWeaponSound (_crID cr) 0)
|
||||
-- & corpseOrGib cr
|
||||
where
|
||||
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
|
||||
corpseOrGib :: Creature -> World -> World
|
||||
|
||||
@@ -12,8 +12,7 @@ import Data.Aeson.TH
|
||||
--import Sound.Data
|
||||
|
||||
data Manipulation -- should be ManipulatedObject?
|
||||
= Manipulator {_manObject :: ManipulatedObject
|
||||
}
|
||||
= Manipulator {_manObject :: ManipulatedObject }
|
||||
| Brute
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user