Commit before door refactor
This commit is contained in:
@@ -220,8 +220,13 @@ itemUpdate cr i
|
||||
| i == crSel cr = baseupdate True
|
||||
| otherwise = baseupdate False
|
||||
where
|
||||
baseupdate bool = (itUse %~ useUpdate) . (itInvPos ?~ i) . (itIsHeld .~ bool)
|
||||
|
||||
baseupdate bool = updateAutoRecharge . (itUse %~ useUpdate) . (itInvPos ?~ i) . (itIsHeld .~ bool)
|
||||
updateAutoRecharge :: Item -> Item
|
||||
updateAutoRecharge it = case _itConsumption it of
|
||||
AutoRecharging l m t p
|
||||
| l < m && p <= 0 -> it & itConsumption .~ AutoRecharging (l+1) m t t
|
||||
| l < m -> it & itConsumption . arProgress -~ 1
|
||||
_ -> it
|
||||
doItemTargeting :: Int -> Creature -> World -> World
|
||||
doItemTargeting invid cr w = case cr ^? crInv . ix invid . itTargeting of
|
||||
Nothing -> w
|
||||
|
||||
Reference in New Issue
Block a user