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
|
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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user