Fold some ammo data into its own type
This commit is contained in:
+5
-5
@@ -120,16 +120,16 @@ wheelEvent y w = case (_carteDisplay w, _inventoryMode w) of
|
||||
invKeyDown = ScancodeCapsLock `S.member` _keys w
|
||||
|
||||
moveYourAmmoSel :: Int -> World -> World
|
||||
moveYourAmmoSel i w = case yourItem w ^? wpAmmo . amPjParams of
|
||||
moveYourAmmoSel i w = case yourItem w ^? wpAmmo . aoType. amPjParams of
|
||||
Just l -> w & creatures . ix (_yourID w) . crInv . ix (_crInvSel (you w))
|
||||
. wpAmmo . amParamSel %~ (`mod` length l) . subtract i
|
||||
. wpAmmo . aoType. amParamSel %~ (`mod` length l) . subtract i
|
||||
_ -> w
|
||||
moveYourAmmoParam :: Int -> World -> World
|
||||
moveYourAmmoParam i w = case yourItem w ^? wpAmmo . amPjParams . ix paramid . pjMaxParam of
|
||||
moveYourAmmoParam i w = case yourItem w ^? wpAmmo . aoType. amPjParams . ix paramid . pjMaxParam of
|
||||
Just n -> w & creatures . ix (_yourID w) . crInv . ix (_crInvSel (you w))
|
||||
. wpAmmo . amPjParams . ix paramid . pjIntParam %~ (`mod` n) . (+ i)
|
||||
. wpAmmo . aoType. amPjParams . ix paramid . pjIntParam %~ (`mod` n) . (+ i)
|
||||
_ -> w
|
||||
where
|
||||
paramid = _amParamSel $ _wpAmmo $ yourItem w
|
||||
paramid = _amParamSel $ _aoType $ _wpAmmo $ yourItem w
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user