Start moving creature properties out of records
This commit is contained in:
@@ -100,8 +100,8 @@ checkDeath cr w
|
||||
where
|
||||
removecr
|
||||
| _crID cr == 0 =
|
||||
(cWorld . lWorld . creatures . ix (_crID cr) . crType .~ NonDrawnCreature)
|
||||
. (cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ 0)
|
||||
-- (cWorld . lWorld . creatures . ix (_crID cr) . crType .~ NonDrawnCreature)
|
||||
(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
|
||||
|
||||
@@ -114,7 +114,7 @@ corpseOrGib cr = case cr ^? crState . csDamage . to maxDamageType . _Just . _1 o
|
||||
_ | _crPastDamage cr > 200 -> addCrGibs cr
|
||||
_ -> plNew (cWorld . lWorld . corpses) cpID thecorpse
|
||||
where
|
||||
thecorpse = makeDefaultCorpse cr
|
||||
thecorpse = makeCorpse cr
|
||||
|
||||
scorchSPic :: SPic -> SPic
|
||||
scorchSPic = _1 %~ overColSH (mixColors 0.9 0.1 black . normalizeColor)
|
||||
@@ -190,7 +190,7 @@ invItemLocUpdate cr loc w = doAnyEquipmentEffect loc cr $ case itm ^. itType of
|
||||
|
||||
doAnyEquipmentEffect :: LocationLDT ItemLink ComposedItem -> Creature -> World -> World
|
||||
doAnyEquipmentEffect loc cr = case itm ^? itLocation . ilEquipSite . _Just of
|
||||
Just _ -> useE loc cr
|
||||
Just _ -> equipBackgroundEffect loc cr
|
||||
_ -> id
|
||||
where
|
||||
itm = loc ^. locLDT . ldtValue . _1
|
||||
|
||||
Reference in New Issue
Block a user