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
+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