Refactor in lens direction

This commit is contained in:
2025-01-04 19:14:18 +00:00
parent 31a74b9ac0
commit 39e3e4ae00
9 changed files with 549485 additions and 824485 deletions
+2 -8
View File
@@ -158,7 +158,8 @@ applyPastDamages cr w
-- a map updating all inventory items
updateInv :: Creature -> World -> World
updateInv cr = cWorld . lWorld . creatures . ix (_crID cr) . crInv %~ IM.map itemUpdate
updateInv cr = cWorld . lWorld . creatures . ix (_crID cr) . crInv . each
. itUse %~ useUpdate
-- a loop going over all inventory items
invSideEff :: Creature -> World -> World
@@ -425,15 +426,8 @@ setRBCreatureTargeting cr w ituse
cpos <- w ^? cWorld . lWorld . creatures . ix cid . crPos
Just $ hasLOS cpos (_crPos cr) w
itemUpdate :: Item -> Item
--itemUpdate = updateAutoRecharge . (itUse %~ useUpdate)
itemUpdate = itUse %~ useUpdate
useUpdate :: ItemUse -> ItemUse
useUpdate =
-- (heldHammer %~ moveHammerUp)
-- . (leftHammer %~ moveHammerUp)
-- . (leftDelay . rateTime %~ decreaseToZero)
(heldDelay . warmTime %~ decreaseToZero)
. (heldDelay . rateTime %~ decreaseToZero)