Refactor in lens direction
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user