This commit is contained in:
2022-06-08 22:14:50 +01:00
parent b90e8a2118
commit 970858e129
9 changed files with 41 additions and 40 deletions
+7 -5
View File
@@ -211,12 +211,14 @@ equipmentEffects :: Creature -> World -> World
equipmentEffects cr = flip (foldr $ useEquipment cr) (IM.keys $ _crInvEquipped cr)
-- a loop going over all inventory items
invSideEff :: Creature -> World -> World
invSideEff cr w = weaponReloadSounds cr
$ IM.foldrWithKey f w (_crInv cr)
invSideEff cr w = weaponReloadSounds cr $ IM.foldrWithKey f w (_crInv cr)
where
f i it w' = doItemTargeting i cr w' & case it ^? itEffect . itInvEffect of
Nothing -> id
Just g -> g it cr
f i it w' = doItemTargeting i cr w' & maybe id (\g -> g it cr) (it ^? itEffect . ieInv)
-- Nothing -> id
-- Just g -> g it cr
-- f i it w' = doItemTargeting i cr w' & case it ^? itEffect . ieInv of
-- Nothing -> id
-- Just g -> g it cr
itemUpdate :: Creature -> Int -> Item -> Item
itemUpdate cr i