Start moving creature properties out of records

This commit is contained in:
2025-06-06 08:46:27 +01:00
parent bae75a1e60
commit 4ae7c6ebd6
32 changed files with 609 additions and 672 deletions
+4 -4
View File
@@ -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