Move hotkeys out of Creature into LWorld
This commit is contained in:
@@ -52,10 +52,10 @@ chargeIfInInventory itm cr w =
|
||||
maxcharge = itm ^?! itUse . leftConsumption . wpMaxCharge
|
||||
|
||||
chargeIfEquipped :: Item -> Creature -> World -> World
|
||||
chargeIfEquipped itm cr
|
||||
| invid `IM.member` (cr ^. crInvHotkeys) =
|
||||
chargeIfEquipped itm cr w
|
||||
| invid `IM.member` (w ^. cWorld . lWorld . imHotkeys) = w &
|
||||
ptrWpCharge %~ (min maxcharge . (+ 1))
|
||||
| otherwise = ptrWpCharge .~ 0
|
||||
| otherwise = w & ptrWpCharge .~ 0
|
||||
where
|
||||
invid = _ilInvID $ _itLocation itm
|
||||
ptrWpCharge = cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix invid . itUse . leftConsumption . wpCharge
|
||||
|
||||
Reference in New Issue
Block a user