Add newtype to floor item ids

This commit is contained in:
2024-09-23 22:42:09 +01:00
parent 43b365185d
commit 265da89791
20 changed files with 193 additions and 158 deletions
+7 -7
View File
@@ -226,7 +226,7 @@ useEquipment cr i = useE (_eeUse (_equipEffect $ _itUse itm)) itm cr
-- a map updating all inventory items
updateInv :: Creature -> World -> World
updateInv cr = cWorld . lWorld . creatures . ix (_crID cr) . crInv %~ IM.mapWithKey (itemUpdate cr)
updateInv cr = cWorld . lWorld . creatures . ix (_crID cr) . crInv %~ IM.map itemUpdate
-- a loop going over equipped items
equipmentEffects :: Creature -> World -> World
@@ -259,14 +259,14 @@ itemInvSideEffect _ _
-- where
-- attachoff = it ^?! itDimension . dimAttachPos
itemUpdate :: Creature -> Int -> Item -> Item
itemUpdate cr i =
itemUpdate :: Item -> Item
itemUpdate =
updateAutoRecharge
. (itUse %~ useUpdate)
. (itLocation .~ InInv (_crID cr) i itmisselected itmisroot)
where
itmisroot = Just i == (cr ^? crManipulation . manObject . inInventory . imRootItem)
itmisselected = Just i == (cr ^? crManipulation . manObject . inInventory . imSelectedItem)
-- . (itLocation .~ InInv (_crID cr) i itmisselected itmisroot)
-- where
-- itmisroot = Just i == (cr ^? crManipulation . manObject . inInventory . imRootItem)
-- itmisselected = Just i == (cr ^? crManipulation . manObject . inInventory . imSelectedItem)
updateAutoRecharge :: Item -> Item
updateAutoRecharge it = case it ^? itUse . leftConsumption of