Move towards adding corpses
This commit is contained in:
@@ -28,7 +28,7 @@ smallChaseCrit = chaseCrit
|
||||
, _crRad = 4
|
||||
, _crPict = basicCrPict
|
||||
, _crInv = IM.fromList [(0,medkit 200)]
|
||||
, _crCorpse = setDepth 5 $ color (greyN 0.5) $ circleSolid 4
|
||||
, _crCorpse = basicCrCorpse
|
||||
}
|
||||
invisibleChaseCrit :: Creature
|
||||
invisibleChaseCrit = chaseCrit
|
||||
|
||||
@@ -9,6 +9,7 @@ module Dodge.Creature.Picture
|
||||
, picAtCrPos
|
||||
, shapeAtCrPos
|
||||
, picAtCrPosNoRot
|
||||
, basicCrCorpse
|
||||
) where
|
||||
import Dodge.Data
|
||||
--import Dodge.Base
|
||||
@@ -264,3 +265,18 @@ picAtCrPos thePic cr _ _ = (,) emptySH $ tranRot (_crPos cr) (_crDir cr) thePic
|
||||
picAtCrPosNoRot :: Picture -> Creature -> Configuration -> World -> SPic
|
||||
--{-# INLINE picAtCrPos #-}
|
||||
picAtCrPosNoRot thePic cr _ _ = (,) emptySH $ uncurryV translate (_crPos cr) thePic
|
||||
|
||||
basicCrCorpse :: Creature -> SPic
|
||||
basicCrCorpse cr = noPic . tr . scaleSH (V3 crsize crsize crsize) $ mconcat
|
||||
[ --rotdir . _spShape $ drawEquipment cr
|
||||
rotdir . dm . colorSH (_skinHead cskin) . translateSHz 20 $ scalp cr
|
||||
, rotdir . dm $ colorSH (_skinUpper cskin) $ upperBody cr
|
||||
, dm . rotmdir $ colorSH (_skinLower cskin) $ feet cr
|
||||
]
|
||||
where
|
||||
cskin = _crSkin cr
|
||||
crsize = 0.1 * _crRad cr
|
||||
dm = damageModSH cr
|
||||
tr = uncurryV translateSHf (_crPos cr)
|
||||
rotdir = rotateSH (_crDir cr)
|
||||
rotmdir = rotateSH (_crMvDir cr)
|
||||
|
||||
@@ -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) %~
|
||||
|
||||
@@ -31,7 +31,7 @@ swarmCrit = defaultCreature
|
||||
, _crRad = 2
|
||||
, _crMass = 2
|
||||
, _crPict = basicCrPict
|
||||
, _crCorpse = setDepth 5 $ color (greyN 0.5) $ circleSolid 2
|
||||
, _crCorpse = basicCrCorpse
|
||||
, _crFaction = ColorFaction yellow
|
||||
, _crMeleeCooldown = 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user