Work on what happens when creatures fall down chasms

This commit is contained in:
2025-08-05 21:39:44 +01:00
parent df443744db
commit f69956750a
9 changed files with 112 additions and 109 deletions
+2 -4
View File
@@ -119,11 +119,9 @@ scorchSPic = _1 %~ overColSH (mixColors 0.9 0.1 black . normalizeColor)
poisonSPic :: SPic -> SPic
poisonSPic = _1 %~ overColSH (mixColors 0.5 0.5 green . normalizeColor)
{- | Drop items according to the creature state.
TODO make sure this doesn't mess up any ItemPosition
-}
-- reverse keys, otherwise two or more inv items will cause errors
dropAll :: Creature -> World -> World
dropAll cr w = foldl' (flip (dropItem cr)) w $ IM.keys $ _crInv cr
dropAll cr w = foldl' (flip (dropItem cr)) w . reverse . IM.keys $ _crInv cr
doDamage :: Creature -> World -> World
doDamage cr = applyPastDamages cr . applyCreatureDamage (cr ^. crDamage) cr