Change weapon fixed rate delay not to require update every tick

This commit is contained in:
2025-01-04 21:06:07 +00:00
parent 39e3e4ae00
commit 698bb081dd
9 changed files with 877950 additions and 550608 deletions
+3 -5
View File
@@ -159,7 +159,7 @@ applyPastDamages cr w
-- a map updating all inventory items
updateInv :: Creature -> World -> World
updateInv cr = cWorld . lWorld . creatures . ix (_crID cr) . crInv . each
. itUse %~ useUpdate
. itUse . heldDelay %~ useDelayUpdate
-- a loop going over all inventory items
invSideEff :: Creature -> World -> World
@@ -426,10 +426,8 @@ setRBCreatureTargeting cr w ituse
cpos <- w ^? cWorld . lWorld . creatures . ix cid . crPos
Just $ hasLOS cpos (_crPos cr) w
useUpdate :: ItemUse -> ItemUse
useUpdate =
(heldDelay . warmTime %~ decreaseToZero)
. (heldDelay . rateTime %~ decreaseToZero)
useDelayUpdate :: UseDelay -> UseDelay
useDelayUpdate = ( warmTime %~ decreaseToZero)
--updateAutoRecharge :: Item -> Item
--updateAutoRecharge it = case it ^? itUse . leftConsumption of