From 38e8f9134647f1e8db8693d207b520f7b31569e7 Mon Sep 17 00:00:00 2001 From: justin Date: Sun, 10 Aug 2025 19:17:38 +0100 Subject: [PATCH] Remove Machine Pistol update when fail firing --- src/Dodge/HeldUse.hs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/Dodge/HeldUse.hs b/src/Dodge/HeldUse.hs index 5d66d5d1c..f95c2aec6 100644 --- a/src/Dodge/HeldUse.hs +++ b/src/Dodge/HeldUse.hs @@ -373,16 +373,9 @@ applyCME loc cr cme . applySidePush spush cr . applyTorqueCME itm cr . applyRecoil loc cr - | otherwise = case itm ^. itType of - HELD MACHINEPISTOL -> - cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix itid . itParams - .~ WarmTime (coolstart - 1) True Nothing - -- the above is quite hacky for now - _ -> failsound + | otherwise = failsound where itm = loc ^. locDT . dtValue . _1 - coolstart = fromMaybe 0 $ baseItemTriggerType itm ^? coolStart - itid = itm ^?! itLocation . ilInvID -- unsafe 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 @@ -632,10 +625,11 @@ heldTorqueAmount = \case BLINKER -> 0 BLINKERUNSAFE -> 0 +-- fugly loadMuzzle :: LocationDT OItem -> Creature -> (Bool, World) -> Muzzle -> (Bool, World) loadMuzzle loc cr (b, w) mz = maybe (b, w) (True,) $ do case mz ^. mzAmmoSlot of - NoAmmoRequired -> return (doMuzzleEffect loc cr mz Nothing w) + NoAmmoRequired -> return (useLoadedAmmo loc cr mz Nothing w) as -> do mag <- case as of MagBelow mi _ -> find (isAmmoIntLink mi . (^. dtValue . _2)) (loc ^. locDT . dtLeft) @@ -723,10 +717,6 @@ basicMuzFlare pos dir = isAmmoIntLink :: Int -> ItemSF -> Bool isAmmoIntLink i sf = Just i == sf ^? amsfLink -doMuzzleEffect :: LocationDT OItem -> Creature -> Muzzle - -> Maybe (Int, DTree OItem) -> World -> World -doMuzzleEffect _ _ _ _ = id - useLoadedAmmo :: LocationDT OItem -> Creature ->