Move weapon muzzles up a record

This commit is contained in:
2025-06-04 09:29:09 +01:00
parent a71e237789
commit e1ec4e1a89
18 changed files with 81 additions and 96 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -5
View File
@@ -32,7 +32,7 @@ import Geometry.Data
data ItemUse
= UseHeld
{ _heldDelay :: UseDelay
, _heldAim :: AimParams
, _heldMuzzles :: [Muzzle]
, _heldParams :: HeldParams
, _heldFrame :: Int
, _heldUseEffect :: HeldUseEffect
@@ -106,8 +106,8 @@ data AmmoParams
| NoAmmoParams
deriving (Eq, Show, Read) --Generic, Flat)
data AimParams = AimParams { _aimMuzzles :: [Muzzle] }
deriving (Eq, Ord, Show, Read) --Generic, Flat)
--data AimParams = AimParams { _aimMuzzles :: [Muzzle] }
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
data FlareType
= NoFlare
@@ -168,7 +168,7 @@ data Muzzle = Muzzle
deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''ItemUse
makeLenses ''AimParams
--makeLenses ''AimParams
makeLenses ''Muzzle
makeLenses ''HeldParams
makeLenses ''AttachParams
@@ -188,5 +188,5 @@ deriveJSON defaultOptions ''HeldParams
deriveJSON defaultOptions ''AmmoPerShot
deriveJSON defaultOptions ''Muzzle
deriveJSON defaultOptions ''AttachParams
deriveJSON defaultOptions ''AimParams
--deriveJSON defaultOptions ''AimParams
deriveJSON defaultOptions ''ItemUse
+1 -1
View File
@@ -42,7 +42,7 @@ defaultBulletWeapon :: Item
defaultBulletWeapon =
defaultHeldItem
& itAmmoSlots .~ singleAmmo BulletAmmo
& itUse . heldAim . aimMuzzles .~
& itUse . heldMuzzles .~
[Muzzle (V2 15 0) 0 0.01 0 BasicFlare MuzzleShootBullet (UseExactly 1) 0]
defaultItEffect :: ItEffect
+1 -1
View File
@@ -27,7 +27,7 @@ defaultHeldUse :: ItemUse
defaultHeldUse = UseHeld
{ _heldDelay = FixedRate{_rateMax = 8, _rateTimeLastUsed = 0}
-- , _heldHammer = HammerUp
, _heldAim = defaultAimParams
, _heldMuzzles = defaultMuzzles
, _heldParams = BulletShooterParams
{ _muzVel = ConstFloat 0.8
, _rifling = ConstFloat 0.8
+13 -25
View File
@@ -1,32 +1,20 @@
module Dodge.Default.Item.Use.AimParams (
defaultAimParams,
-- defaultItZoom,
defaultMuzzles,
) where
import Dodge.Data.Item.Use
import Linear
defaultAimParams :: AimParams
defaultAimParams =
AimParams
{ _aimMuzzles =
[ Muzzle
{ _mzPos = V2 20 0
, _mzRot = 0
, _mzInaccuracy = 0.05
, _mzAmmoSlot = 0
, _mzFlareType = NoFlare
, _mzEffect = MuzzleShootBullet
, _mzAmmoPerShot = UseExactly 1
, _mzFrame = 0
}
]
defaultMuzzles :: [Muzzle]
defaultMuzzles =
[ Muzzle
{ _mzPos = V2 20 0
, _mzRot = 0
, _mzInaccuracy = 0.05
, _mzAmmoSlot = 0
, _mzFlareType = NoFlare
, _mzEffect = MuzzleShootBullet
, _mzAmmoPerShot = UseExactly 1
, _mzFrame = 0
}
--defaultItZoom :: ItZoom
--defaultItZoom =
-- ItZoom
-- { _izMax = 20
-- , _izMin = 0.2
-- , _izFac = 1
-- }
]
+4 -6
View File
@@ -124,7 +124,7 @@ heldEffectMuzzles t cr w =
uncurry (applyCME (_ldtValue t) cr) cmew
& doWeaponRepetitions upitm cr
where
muzzles = t ^. ldtValue . itUse . heldAim . aimMuzzles
muzzles = t ^. ldtValue . itUse . heldMuzzles
(upitm, loadedmuzzles) = mapAccumR loadMuzzle t muzzles
cmew = foldl' (useLoadedAmmo t cr) (CME 0 0 False, w) $ zip [0 ..] loadedmuzzles
@@ -135,7 +135,7 @@ doHeldUseEffect t cr w = case t ^? ldtValue . itUse . heldUseEffect of
let g = w ^. randGen
(is, g') = runState (shuffle [0 .. x -1]) g
return $
w & cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix i . itUse . heldAim . aimMuzzles %~ zipWith (\j mz -> mz & mzFrame .~ j) is
w & cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix i . itUse . heldMuzzles %~ zipWith (\j mz -> mz & mzFrame .~ j) is
& randGen .~ g'
Just SwitchAlteRifle -> fromMaybe w $ do
i <- t ^? ldtValue . itLocation . ilInvID
@@ -143,8 +143,7 @@ doHeldUseEffect t cr w = case t ^? ldtValue . itUse . heldUseEffect of
w
& cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix i
. itUse
. heldAim
. aimMuzzles
. heldMuzzles
. ix 0
. mzAmmoSlot
%~ ((`mod` 2) . (+ 1))
@@ -488,8 +487,7 @@ walkNozzle mzid mz itm cr w = fromMaybe w $ do
& cWorld . lWorld . creatures . ix (_crID cr) . crInv
. ix invid
. itUse
. heldAim
. aimMuzzles
. heldMuzzles
. ix mzid
. mzEffect
. nzCurrentWalkAngle
+1 -1
View File
@@ -118,7 +118,7 @@ bgateCalc x l r = (x `div` ((2::Int) ^ ((2::Int)*f l + f r))) `mod` 2
itemScrollDisplay :: Item -> Maybe String
itemScrollDisplay itm
| HELD ALTERIFLE <- itm ^. itType = Just $
case itm ^? itUse . heldAim . aimMuzzles . ix 0 . mzAmmoSlot of
case itm ^? itUse . heldMuzzles . ix 0 . mzAmmoSlot of
Just 0 -> "L"
_ -> "R"
| UseScope OpticScope{_opticZoom = x} <- itm ^. itUse = Just $ shortShow x
+1 -1
View File
@@ -276,7 +276,7 @@ torchShape =
back = upperPrismPolySE 3 $ rectXH 1 2
baseStickShapeX :: Item -> Int -> Shape
baseStickShapeX it _ = foldMap f (it ^?! itUse . heldAim . aimMuzzles)
baseStickShapeX it _ = foldMap f (it ^?! itUse . heldMuzzles)
where
f brl = rotateSH (_mzRot brl) baseStickShape
+12 -13
View File
@@ -22,10 +22,10 @@ teslaGun =
& itUse . heldParams .~ BeamShooterParams-- (Just (elecCrackleS, 2))
& itParams .~ teslaParams
& itUse . heldDelay .~ NoDelay
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 10 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ TeslaGunFlare
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTesla
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 10 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzFlareType .~ TeslaGunFlare
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleTesla
& itType .~ HELD TESLAGUN
& itAmmoSlots .~ singleAmmo ElectricalAmmo
@@ -41,14 +41,13 @@ teslaParams =
laser :: Item
laser =
defaultHeldItem
-- & itUse . heldParams .~ BeamShooterParams (Just (tone440sawtoothquietS, 2))
& itUse . heldParams .~ BeamShooterParams-- Nothing
& itAmmoSlots .~ singleAmmo ElectricalAmmo
& itUse . heldDelay .~ NoDelay
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 6 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ LasGunFlare
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleLaser
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 6 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzFlareType .~ LasGunFlare
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleLaser
& itTargeting
.~ ItTargeting
{ _itTgPos = Nothing
@@ -63,8 +62,8 @@ tractorGun =
defaultHeldItem
& itUse . heldParams .~ BeamShooterParams
& itAmmoSlots .~ singleAmmo ElectricalAmmo
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ NoFlare
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTractor
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzFlareType .~ NoFlare
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleTractor
& itType .~ HELD TRACTORGUN
+5 -5
View File
@@ -31,7 +31,7 @@ volleyGun :: Int -> Item
volleyGun i =
defaultBangCane
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~ getZipList
& itUse . heldMuzzles .~ getZipList
(ZipList [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 6]
<*> ZipList [0..i-1]
<*> pure MiniGunFlare
@@ -52,7 +52,7 @@ rifle =
defaultBangCane
& itType .~ HELD RIFLE
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 25 0
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 25 0
alteRifle :: Item
alteRifle = rifle
@@ -75,11 +75,11 @@ burstRifle :: Item
burstRifle =
rifle
& itType .~ HELD BURSTRIFLE
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0.05
& itUse . heldDelay . rateMax .~ 6
& itUse . heldParams . weaponInvLock .~ 7
& itUse . heldParams . weaponRepeat .~ [3,6]
& itUse . heldAim . aimMuzzles %~ doreplicate
& itUse . heldMuzzles %~ doreplicate
where
doreplicate (x:_) = [x,x & mzFrame .~ 3,x & mzFrame .~ 6]
doreplicate [] = error "tried to replicate non-existing burstRifle muzzle"
@@ -91,7 +91,7 @@ miniGunX i =
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itAmmoSlots .~ singleAmmo BeltBulletAmmo
-- & itUse . heldParams . bulGunSound ?~ (mini1S,2)
& itUse . heldAim . aimMuzzles
& itUse . heldMuzzles
.~ replicate i
(Muzzle (V2 30 0) 0 0.05 0 MiniGunFlare MuzzleShootBullet (UseExactly 1) 0)
-- & itUse . heldParams . recoil .~ 10 * fromIntegral i
+3 -3
View File
@@ -14,11 +14,11 @@ bangCone :: Item
bangCone =
defaultBulletWeapon
& itUse . heldDelay . rateMax .~ 20
& itUse . heldAim . aimMuzzles
& itUse . heldMuzzles
.~ replicate
15
(Muzzle (V2 15 0) 0 0.5 0 NoFlare MuzzleShootBullet (UseExactly 1) 0)
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ BasicFlare
& itUse . heldMuzzles . ix 0 . mzFlareType .~ BasicFlare
& itUse . heldParams . muzVel .~ UniRandFloat 0.5 0.8
& itUse . heldParams . rifling .~ UniRandFloat 0.3 0.8
& itUse . heldParams . torqueAfter .~ 0.1
@@ -28,7 +28,7 @@ bangCone =
blunderbuss :: Item
blunderbuss =
bangCone
& itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 30
& itUse . heldMuzzles . ix 0 . mzPos . _x .~ 30
& itType .~ HELD BLUNDERBUSS
grapeCannon :: Int -> Item
+5 -5
View File
@@ -15,9 +15,9 @@ rLauncher :: Item
rLauncher =
defaultHeldItem
& itUse . heldDelay . rateMax .~ 20
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleRLauncher
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 20 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleRLauncher
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 20 0
& itAmmoSlots .~ singleAmmo LauncherAmmo
& itType .~ HELD RLAUNCHER
& itUse . heldParams . muzVel .~ ConstFloat 0
@@ -31,13 +31,13 @@ gLauncher :: Item
gLauncher =
rLauncher
& itType .~ HELD GLAUNCHER
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleGLauncher
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleGLauncher
rLauncherX :: Int -> Item
rLauncherX i =
rLauncher
& itType .~ HELD (RLAUNCHERX i)
& itUse . heldAim . aimMuzzles
& itUse . heldMuzzles
.~ getZipList
( ZipList [Muzzle (V2 20 0) a 0 | a <- angles]
<*> ZipList [0 ..]
+4 -4
View File
@@ -26,15 +26,15 @@ bangRod =
& itType .~ HELD BANGROD
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ HeavySmokeFlare
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldMuzzles . ix 0 . mzFlareType .~ HeavySmokeFlare
-- & itUse . heldConsumption . laAmmoType .~ hvBulletAmmo
elephantGun :: Item
elephantGun =
bangRod
& itType .~ HELD ELEPHANTGUN
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0.05
-- & itUse . heldParams . recoil .~ 50
amr :: Item
@@ -51,7 +51,7 @@ sniperRifle :: Item
sniperRifle =
elephantGun
& itType .~ HELD SNIPERRIFLE
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5,_izFac = 1}
--machineGun :: Item
+2 -2
View File
@@ -33,7 +33,7 @@ flameSpitter =
& itUse . heldDelay .~ FixedRate{_rateMax = 3, _rateTimeLastUsed = 0}
& itUse . heldParams . weaponInvLock .~ 10
& itUse . heldParams . weaponRepeat .~ [1..9]
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
& itUse . heldMuzzles . ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
flameTorrent :: Item
flameTorrent =
@@ -73,7 +73,7 @@ flameThrower =
& itParams .~ NoParams
& itUse . heldDelay .~ NoDelay
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 18 0) 0 0 0 NoFlare
& itUse . heldMuzzles .~ [Muzzle (V2 18 0) 0 0 0 NoFlare
MuzzleNozzle
{ _nzPressure = ConstFloat 4
, _nzMaxWalkAngle = 0.2
+9 -9
View File
@@ -20,7 +20,7 @@ bangStick i =
& itUse . heldParams . torqueAfter .~ 0.18 + 0.02 * fromIntegral i
& itType .~ HELD (BANGSTICK i)
& itUse . heldDelay . rateMax .~ 8
& itUse . heldAim . aimMuzzles
& itUse . heldMuzzles
.~ [ Muzzle
(V2 10 0)
a
@@ -32,9 +32,9 @@ bangStick i =
0
| a <- spreadAroundCenter i baseStickSpread
]
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ NoLightFlare
& itUse . heldAim . aimMuzzles . ix (i `div` 2) . mzFlareType .~ MiniGunFlare
& itUse . heldAim . aimMuzzles . ix (i-1) . mzFlareType .~ NoLightFlare
& itUse . heldMuzzles . ix 0 . mzFlareType .~ NoLightFlare
& itUse . heldMuzzles . ix (i `div` 2) . mzFlareType .~ MiniGunFlare
& itUse . heldMuzzles . ix (i-1) . mzFlareType .~ NoLightFlare
baseStickSpread :: Float
baseStickSpread = 0.2
@@ -43,9 +43,9 @@ pistol :: Item
pistol =
bangStick 1
& itUse . heldDelay . rateMax .~ 6
& itUse . heldAim . aimMuzzles . ix 0 . mzPos %~ const (V2 10 0)
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy %~ const 0.05
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType %~ const BasicFlare
& itUse . heldMuzzles . ix 0 . mzPos %~ const (V2 10 0)
& itUse . heldMuzzles . ix 0 . mzInaccuracy %~ const 0.05
& itUse . heldMuzzles . ix 0 . mzFlareType %~ const BasicFlare
& itUse . heldParams
%~ ( (muzVel .~ ConstFloat 0.8)
. (rifling .~ ConstFloat 0.8)
@@ -69,7 +69,7 @@ smg :: Item
smg =
autoPistol -- & some parameter affecting stability
& itType .~ HELD SMG
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 20 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 20 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldParams . torqueAfter .~ 0.05
& itUse . heldParams . sidePush .~ 30
+10 -10
View File
@@ -30,7 +30,7 @@ torch :: Item
torch =
defaultHeldItem
& itType .~ HELD TORCH
& itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 10
& itUse . heldMuzzles . ix 0 . mzPos . _x .~ 10
& itAmmoSlots .~ singleAmmo ElectricalAmmo
-- | Sends out pulses that display walls.
@@ -43,8 +43,8 @@ detector dt =
& itAmmoSlots .~ singleAmmo ElectricalAmmo
& itUse . heldParams .~ DefaultHeldParams
& itType .~ DETECTOR dt
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleDetector
& itUse . heldAim . aimMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleDetector
& itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100
blinker :: Item
blinker =
@@ -54,14 +54,14 @@ blinker =
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1}
& itAmmoSlots .~ singleAmmo ElectricalAmmo
& itUse . heldParams .~ DefaultHeldParams
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleBlink
& itUse . heldAim . aimMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 10000000
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleBlink
& itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 10000000
& itType .~ HELD BLINKER
unsafeBlinker :: Item
unsafeBlinker =
blinker
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleUnsafeBlink
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleUnsafeBlink
& itType .~ HELD BLINKERUNSAFE
-- & itUse . uequipEffect . eeViewDist ?~ 400
@@ -69,18 +69,18 @@ unsafeBlinker =
rewinder :: Item
rewinder =
blinker
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleRewind
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleRewind
& itType .~ HELD REWINDER
& itUse . heldAim . aimMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100000
& itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100000
timeStopper :: Item
timeStopper =
blinker
& itType .~ HELD TIMESTOPPER
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleStopper
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleStopper
timeScroller :: Item
timeScroller =
timeStopper
& itType .~ HELD TIMESCROLLER
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleScroller
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleScroller
+3 -3
View File
@@ -11,6 +11,6 @@ shatterGun =
& itType .~ HELD SHATTERGUN
& itUse . heldDelay . rateMax .~ 10
& itAmmoSlots .~ singleAmmo ElectricalAmmo
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleShatter
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleShatter
+1 -1
View File
@@ -56,7 +56,7 @@ itemScroll yi invid itm w
| HELD ALTERIFLE <- itm ^. itType
, yi /= 0 =
w
& itmlens . itUse . heldAim . aimMuzzles . ix 0 . mzAmmoSlot
& itmlens . itUse . heldMuzzles . ix 0 . mzAmmoSlot
%~ ((`mod` 2) . (+ 1))
| isJust $ itm ^? itScroll . itsInt = w & itmlens . itScroll . itsInt +~ yi
| Just y <- itm ^? itScroll . itsMax = w & itmlens . itScroll . itsRangeInt