Work on inventory management
This commit is contained in:
@@ -68,7 +68,7 @@ stateUpdate f =
|
||||
heldAimEffects :: Creature -> World -> World
|
||||
heldAimEffects cr = fromMaybe id $ do
|
||||
guard (crIsAiming cr)
|
||||
ipos <- cr ^? crInvSel . isel . ispItem
|
||||
ipos <- cr ^? crManipulation . isel . 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 ^? crInvSel . isel . ispItem)
|
||||
itmisheld = Just i == (cr ^? crManipulation . isel . 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 ^? crInvSel . isel . ispItem
|
||||
i <- cr ^? crManipulation . isel . ispItem
|
||||
itm <- cr ^? crInv . ix i
|
||||
return [itm]
|
||||
|
||||
weaponReloadSounds :: Creature -> World -> World
|
||||
weaponReloadSounds cr w = case cr ^? crInvSel . isel . iselAction of
|
||||
weaponReloadSounds cr w = case cr ^? crManipulation . isel . iselAction of
|
||||
Just ReloadAction{_reloadAction = la} ->
|
||||
soundContinue
|
||||
(CrReloadSound cid)
|
||||
|
||||
Reference in New Issue
Block a user