Add alteRifle

This commit is contained in:
2024-12-23 10:53:35 +00:00
parent 34c7186aa1
commit a4e1fcf384
11 changed files with 271 additions and 240 deletions
+4
View File
@@ -99,6 +99,10 @@ doHeldUseEffect t cr w = case t ^? ldtValue . itUse . heldUseEffect of
(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
& randGen .~ g'
Just SwitchAlteRifle -> fromMaybe w $ do
i <- t ^? ldtValue . itLocation . ilInvID
return $ w & cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix i
. itUse . heldAim . aimMuzzles . ix 0 . mzAmmoSlot %~ ((`mod` 2) . (+1))
Just NoHeldUseEffect -> w
Nothing -> w