Move towards adding corpses
This commit is contained in:
@@ -18,7 +18,7 @@ import Dodge.WorldEvent
|
||||
import Dodge.Creature.Action
|
||||
--import Dodge.Hammer
|
||||
import Geometry
|
||||
import Picture
|
||||
--import Picture
|
||||
import qualified IntMapHelp as IM
|
||||
--import StrictHelp
|
||||
|
||||
@@ -71,7 +71,7 @@ checkDeath cr w
|
||||
-- & creatures . at (_crID cr) .~ Nothing
|
||||
& removecr
|
||||
& stopSoundFrom (CrWeaponSound (_crID cr) 0)
|
||||
& over decorations addCorpse
|
||||
& plNew corpses cpID thecorpse
|
||||
& dropByState cr
|
||||
where
|
||||
removecr
|
||||
@@ -79,10 +79,13 @@ checkDeath cr w
|
||||
. (creatures . ix (_crID cr) . crPict .~ const mempty)
|
||||
. addCrGibs cr
|
||||
| otherwise = creatures . at (_crID cr) .~ Nothing
|
||||
addCorpse = IM.insertNewKey
|
||||
$ uncurryV translate (_crOldPos cr)
|
||||
$ rotate (_crDir cr)
|
||||
(_crCorpse cr)
|
||||
thecorpse = Corpse
|
||||
{ _cpID = 0
|
||||
, _cpPos = _crPos cr
|
||||
, _cpDir = _crDir cr
|
||||
, _cpPict = _crCorpse cr cr
|
||||
, _cpRes = Nothing
|
||||
}
|
||||
|
||||
internalUpdate :: Creature -> World -> World
|
||||
internalUpdate cr = creatures . ix (_crID cr) %~
|
||||
|
||||
Reference in New Issue
Block a user