Continue inventory tweak

This commit is contained in:
2023-02-16 17:07:59 +00:00
parent 934dd64704
commit 4afc216b25
28 changed files with 106 additions and 94 deletions
+4 -4
View File
@@ -68,7 +68,7 @@ stateUpdate f =
heldAimEffects :: Creature -> World -> World
heldAimEffects cr = fromMaybe id $ do
guard (crIsAiming cr)
ipos <- cr ^? crManipulation . isel . ispItem
ipos <- cr ^? crManipulation . manObject . inInventory . ispItem
itm <- cr ^? crInv . ix ipos
f <- itm ^? itEffect . ieWhileAiming
return $ doInvEffect f itm cr
@@ -263,7 +263,7 @@ itemUpdate cr i = updateAutoRecharge
. (itLocation .~ InInv (_crID cr) i)
. (itIsHeld .~ itmisheld)
where
itmisheld = Just i == (cr ^? crManipulation . isel . ispItem)
itmisheld = Just i == (cr ^? crManipulation . manObject . inInventory . ispItem)
updateAutoRecharge :: Item -> Item
updateAutoRecharge it = case it ^? itUse . leftConsumption of
@@ -279,12 +279,12 @@ crGetTargeting cr = do
where
hastargeting itm = isJust (itm ^? itUse . useTargeting . _Just)
helditem = fromMaybe [] $ do
i <- cr ^? crManipulation . isel . ispItem
i <- cr ^? crManipulation . manObject . inInventory . ispItem
itm <- cr ^? crInv . ix i
return [itm]
weaponReloadSounds :: Creature -> World -> World
weaponReloadSounds cr w = case cr ^? crManipulation . isel . iselAction of
weaponReloadSounds cr w = case cr ^? crManipulation . manObject . inInventory . iselAction of
Just ReloadAction{_reloadAction = la} ->
soundContinue
(CrReloadSound cid)