Commit before removing stackable items

This commit is contained in:
2024-09-08 15:17:59 +01:00
parent 1006bb5529
commit 86795f1a10
20 changed files with 73 additions and 39 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ droneLauncher =
& itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 0.5
& itUse . heldAim . aimStance .~ TwoHandOver
& itUse . heldConsumption .~ [DroneAmmo]
& itUse . heldAmmoTypes .~ [DroneAmmo]
& itType . iyBase .~ HELD DRONELAUNCHER
lasDronesPic :: Item -> SPic
+3 -3
View File
@@ -145,13 +145,13 @@ ammoCheckI eff ams itm cr w = fromMaybe (failsound w) $ do
x <- ams ^? ix 0 . itUse . amagLoadStatus . iaLoaded
guard $ x > 0
matype <- ams ^? ix 0 . itUse . amagType
iatype <- itm ^? itUse . heldConsumption . ix 0
iatype <- itm ^? itUse . heldAmmoTypes . ix 0
guard $ matype == iatype
return $ eff ams itm cr $ w -- & cWorld . lWorld . creatures . ix (_crID cr) %~ crCancelReloading
where
failsound = case w ^? input . mouseButtons . ix SDL.ButtonLeft of
Just 0 -> soundStart (CrReloadSound (_crID cr)) (_crPos cr) click1S Nothing
_ -> soundContinue (CrReloadSound (_crID cr)) (_crPos cr) click1S Nothing
Just 0 -> soundStart (CrWeaponSound (_crID cr) 0) (_crPos cr) click1S Nothing
_ -> soundContinue (CrWeaponSound (_crID cr) 0) (_crPos cr) click1S Nothing
itUseCharge :: Int -> Item -> Item
itUseCharge x = itUse . leftConsumption . arLoaded %~ (max 0 . subtract x)