Add Read/Show instance for Creature
This commit is contained in:
@@ -2,6 +2,7 @@ module Dodge.Creature.State
|
||||
( stateUpdate
|
||||
, doDamage
|
||||
) where
|
||||
import Dodge.Corpse.Make
|
||||
import Dodge.Data
|
||||
import Dodge.Targeting
|
||||
import Dodge.ItEffect
|
||||
@@ -71,9 +72,9 @@ checkDeath cr w
|
||||
| otherwise = creatures . at (_crID cr) .~ Nothing
|
||||
corpseOrGib :: Creature -> World -> World
|
||||
corpseOrGib cr w = case maxDamageType (_csDamage (_crState cr)) of
|
||||
Just (FLAMING,_) -> w & plNew corpses cpID (thecorpse & cpPict %~ fmap scorchSPic)
|
||||
Just (FLAMING,_) -> w & plNew corpses cpID (thecorpse & cpSPic %~ scorchSPic)
|
||||
Just (ELECTRICAL,_) -> w & plNew corpses cpID thecorpse
|
||||
Just (POISONDAM,_) -> w & plNew corpses cpID (thecorpse & cpPict %~ fmap poisonSPic)
|
||||
Just (POISONDAM,_) -> w & plNew corpses cpID (thecorpse & cpSPic %~ poisonSPic)
|
||||
_ | _crPastDamage cr > 200 -> w & addCrGibs cr
|
||||
& bloodPuddleAt cpos
|
||||
& bloodPuddleAt cpos
|
||||
@@ -84,13 +85,7 @@ corpseOrGib cr w = case maxDamageType (_csDamage (_crState cr)) of
|
||||
& plNew corpses cpID thecorpse
|
||||
where
|
||||
cpos = _crPos cr
|
||||
thecorpse = Corpse
|
||||
{ _cpID = 0
|
||||
, _cpPos = _crPos cr
|
||||
, _cpDir = _crDir cr
|
||||
, _cpPict = _crCorpse cr cr
|
||||
, _cpRes = Nothing
|
||||
}
|
||||
thecorpse = makeDefaultCorpse cr
|
||||
|
||||
scorchSPic :: SPic -> SPic
|
||||
scorchSPic = over _1 $
|
||||
|
||||
Reference in New Issue
Block a user