Add newtype to floor item ids
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user