Move towards adding corpses

This commit is contained in:
2022-06-04 12:42:18 +01:00
parent 602a004e87
commit 5f5b1dd422
8 changed files with 40 additions and 18 deletions
+9 -6
View File
@@ -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) %~