Commit before removing stackable items
This commit is contained in:
@@ -14,6 +14,15 @@ import LensHelp
|
||||
import Picture
|
||||
import Shape
|
||||
import ShapePicture
|
||||
import Data.Maybe
|
||||
|
||||
itemHeldAmmoPic :: Item -> Item -> SPic
|
||||
itemHeldAmmoPic itm amit = itemSPic itm <> addAmmoClip itm amit
|
||||
|
||||
addAmmoClip :: Item -> Item -> SPic
|
||||
addAmmoClip itm amit = fromMaybe mempty $ do
|
||||
hit <- itm ^? itType . iyBase . ibtHeld
|
||||
return mempty
|
||||
|
||||
itemSPic :: Item -> SPic
|
||||
itemSPic it =
|
||||
|
||||
@@ -36,7 +36,7 @@ teslaGun =
|
||||
lasGun :: Item
|
||||
lasGun =
|
||||
defaultAutoBatteryGun
|
||||
& itUse . heldConsumption .~ [ElectricalAmmo]
|
||||
& itUse . heldAmmoTypes .~ [ElectricalAmmo]
|
||||
& itParams
|
||||
.~ Refracting
|
||||
{ _phaseV = 1
|
||||
|
||||
@@ -101,7 +101,7 @@ miniGunUse i =
|
||||
& heldAim . aimRange .~ 1
|
||||
& heldAim . aimStance .~ TwoHandUnder
|
||||
& heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||
& heldConsumption .~ [BulletAmmo]
|
||||
& heldAmmoTypes .~ [BulletAmmo]
|
||||
|
||||
miniGunX :: Int -> Item
|
||||
miniGunX i =
|
||||
|
||||
@@ -32,7 +32,7 @@ launcher =
|
||||
-- & itUse . heldAim . aimHandlePos .~ V2 3 0
|
||||
-- & itUse . heldAim . aimMuzPos .~ 20
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0]
|
||||
& itUse . heldConsumption .~ [ProjectileAmmo]
|
||||
& itUse . heldAmmoTypes .~ [ProjectileAmmo]
|
||||
& itType . iyBase .~ HELD LAUNCHER
|
||||
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ poisonSprayer :: Item
|
||||
poisonSprayer =
|
||||
flameThrower
|
||||
& itType . iyBase .~ HELD POISONSPRAYER
|
||||
& itUse . heldConsumption .~ [GasAmmo]
|
||||
& itUse . heldAmmoTypes .~ [GasAmmo]
|
||||
& itUse . heldParams .~ GasSprayParams CreatePoisonGas --aGasCloud
|
||||
& itUse . heldMods .~ PoisonSprayerMod
|
||||
|
||||
@@ -89,6 +89,6 @@ flameThrower =
|
||||
& itUse . heldAim . aimStance .~ TwoHandUnder
|
||||
-- & itUse . heldAim . aimHandlePos .~ 0
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 18 0) 0 0]
|
||||
& itUse . heldConsumption .~ [GasAmmo]
|
||||
& itUse . heldAmmoTypes .~ [GasAmmo]
|
||||
& itType . iyBase .~ HELD FLAMETHROWER
|
||||
& itUse . heldParams .~ GasSprayParams CreateFlame --aGasCloud
|
||||
|
||||
@@ -38,7 +38,7 @@ baseStickSpread = 0.2
|
||||
pistol :: Item
|
||||
pistol =
|
||||
bangStick 1
|
||||
& itUse . heldConsumption .~ [BulletAmmo]
|
||||
& itUse . heldAmmoTypes .~ [BulletAmmo]
|
||||
& itUse . heldDelay . rateMax .~ 6
|
||||
& itUse . heldMods .~ PistolMod
|
||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) 0 0.05]
|
||||
|
||||
@@ -43,7 +43,7 @@ forceFieldGun =
|
||||
-- than the list below
|
||||
--[ hammerCheckI , ammoCheckI , useAmmoAmount 1]
|
||||
& itType . iyBase .~ HELD FORCEFIELDGUN
|
||||
& itUse . heldConsumption .~ [ElectricalAmmo]
|
||||
& itUse . heldAmmoTypes .~ [ElectricalAmmo]
|
||||
|
||||
{- |
|
||||
Sends out pulses that display walls.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user