Move sidepush out of records

This commit is contained in:
2025-06-04 11:43:35 +01:00
parent a8aab75739
commit e77721fe7d
8 changed files with 230 additions and 200 deletions
+45 -1
View File
@@ -173,11 +173,55 @@ applyCME itm cr cme
. applyRecoil itm cr
| otherwise = failsound
where
spush = fromMaybe 0 $ itm ^? itUse . heldParams . sidePush
spush = maybe 0 itemSidePush $ itm ^? itType . ibtHeld
failsound w = case w ^? input . mouseButtons . ix SDL.ButtonLeft of
Just 0 -> soundStart (CrWeaponFailSound (_crID cr)) (_crPos cr) click1S Nothing w
_ -> soundContinue (CrWeaponFailSound (_crID cr)) (_crPos cr) click1S Nothing w
itemSidePush :: HeldItemType -> Float
itemSidePush = \case
BANGSTICK {} -> 0
REWINDER -> 0
TIMESTOPPER -> 0
TIMESCROLLER -> 0
PISTOL -> 50
MACHINEPISTOL -> 50
AUTOPISTOL -> 50
SMG -> 30
BANGCONE -> 0
BLUNDERBUSS -> 0
GRAPECANNON {} -> 0
MINIGUNX i -> 10 + fromIntegral i
VOLLEYGUN{} -> 0
RIFLE -> 0
ALTERIFLE -> 0
AUTORIFLE -> 0
BURSTRIFLE -> 0
BANGROD -> 0
ELEPHANTGUN -> 0
AMR -> 0
AUTOAMR -> 0
SNIPERRIFLE -> 0
FLAMESPITTER -> 0
FLAMETHROWER -> 25
FLAMETORRENT -> 0
FLAMEWALL -> 0
BLOWTORCH -> 0
SPARKGUN -> 0
TESLAGUN -> 0
LASER -> 0
TRACTORGUN -> 0
RLAUNCHER -> 0
RLAUNCHERX{} -> 0
GLAUNCHER -> 0
POISONSPRAYER -> 0
SHATTERGUN -> 0
TORCH -> 0
FLATSHIELD -> 0
KEYCARD{} -> 0
BLINKER -> 0
BLINKERUNSAFE -> 0
applyInvLock :: Item -> Creature -> World -> World
applyInvLock itm cr = case itm ^? itUse . heldParams . weaponInvLock of
Just i