This commit is contained in:
2024-09-30 12:54:31 +01:00
parent 65564c993b
commit fc5539cb38
58 changed files with 802 additions and 1255 deletions
+11 -15
View File
@@ -1,4 +1,9 @@
module Dodge.Item.Held.BatteryGuns where
module Dodge.Item.Held.BatteryGuns
( sparkGun
, teslaGun
, lasGun
, tractorGun
) where
import Dodge.SoundLogic.ExternallyGeneratedSounds
import Dodge.Default.Item
@@ -6,7 +11,7 @@ import Dodge.Default.Item
--import Dodge.Data.Beam
import Color
import Control.Lens
import qualified Data.Map.Strict as M
--import qualified Data.Map.Strict as M
import Dodge.Data.Item
--import Dodge.Reloading.Action
import Dodge.Tesla.ItemParams
@@ -16,36 +21,30 @@ import qualified IntMapHelp as IM
sparkGun :: Item
sparkGun =
teslaGun
& itType . iyBase .~ HELD SPARKGUN
& itType .~ HELD SPARKGUN
& itParams . arcSize .~ 10
teslaGun :: Item
teslaGun =
--defaultBatteryGun
defaultHeldItem
& itUse . heldParams .~ BeamShooterParams (Just (elecCrackleS,2))
& itDimension . dimRad .~ 9
& itDimension . dimCenter .~ V3 4 0 0
& itParams .~ teslaParams
-- & itUse . heldUse .~ HeldTeslaArc --shootTeslaArc
& itUse . heldDelay .~ NoDelay
-- & itUse . heldMods .~ PistolMod
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimStance .~ TwoHandFlat
-- & itUse . heldAim . aimMuzPos .~ 4
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 4 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ TeslaGunFlare
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTesla
& itType . iyBase .~ HELD TESLAGUN
& itType .~ HELD TESLAGUN
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
& itUse . heldTriggerType .~ AutoTrigger
lasGun :: Item
lasGun =
defaultHeldItem
-- & itType . iyModules .~ batteryModules
-- & itUse . heldMods .~ PistolMod
& itUse . heldParams .~ BeamShooterParams (Just (tone440sawtoothquietS,2))
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
& itUse . heldDelay .~ NoDelay
@@ -74,7 +73,7 @@ lasGun =
& itUse . heldAim . aimStance .~ TwoHandUnder
-- & itUse . heldAim . aimHandlePos .~ 5
-- & itUse . heldAim . aimMuzPos .~ 30
& itType . iyBase .~ HELD LASGUN
& itType .~ HELD LASGUN
lasGunTweak :: TweakParam
lasGunTweak =
@@ -92,15 +91,12 @@ tractorGun =
.~ Tweakable
{ _tweakParams = IM.fromList [(0, tractorGunTweak)]
}
-- & itUse . heldUse .~ HeldTractor --aTractorBeam
& itUse . heldDelay .~ NoDelay
-- & itUse . heldMods .~ AmmoCheckMod
-- & itUse . heldMods .~ TractorMod
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ DefaultFlareType
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTractor
& itType . iyBase .~ HELD TRACTORGUN
& itType .~ HELD TRACTORGUN
tractorGunTweak :: TweakParam
tractorGunTweak =
+6 -11
View File
@@ -45,14 +45,14 @@ volleyGun i =
)
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
& itUse . heldParams . recoil .~ 20 + 10 * fromIntegral i
& itType . iyBase .~ HELD (VOLLEYGUN i)
& itType .~ HELD (VOLLEYGUN i)
& itUse . heldAmmoTypes .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
rifle :: Item
rifle =
defaultBangCane
& itUse . heldAim . aimStance .~ TwoHandUnder
& itType . iyBase .~ HELD RIFLE
& itType .~ HELD RIFLE
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
@@ -68,20 +68,15 @@ rifle =
autoRifle :: Item
autoRifle =
rifle
& itType . iyBase .~ HELD AUTORIFLE
& itType .~ HELD AUTORIFLE
& itUse . heldTriggerType .~ AutoTrigger
-- & itUse . heldMods .~ AutoRifleMod
-- & itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
-- & itUse . useDelay . rateMax .~ 6
burstRifle :: Item
burstRifle =
rifle
& itType . iyBase .~ HELD BURSTRIFLE
& itType .~ HELD BURSTRIFLE
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05
-- & itUse . heldDelay . rateMax .~ 18
& itUse . heldDelay . rateMax .~ 6
-- & itUse . heldMods .~ BurstRifleMod
& itUse . heldParams . weaponInvLock .~ 7
& itUse . heldParams . weaponRepeat .~ [3,6]
@@ -102,8 +97,8 @@ miniGunX i =
& itUse . heldParams . sidePush .~ 10 * fromIntegral i
& itUse . heldParams . randomOffset .~ 10
& itUse . heldParams . rifling .~ UniRandFloat 0.8 0.9
& itInvSize .~ fromIntegral i + 1
& itInvSize .~ (i + 3) `div` 2
& itDimension . dimRad .~ 20
& itDimension . dimCenter .~ V3 5 0 0
& itDimension . dimAttachPos .~ V3 5 (-5) 0
& itType . iyBase .~ HELD (MINIGUNX i)
& itType .~ HELD (MINIGUNX i)
+3 -3
View File
@@ -24,7 +24,7 @@ bangCone =
& itUse . heldParams . torqueAfter .~ 0.1
& itUse . heldParams . randomOffset .~ 12
& itUse . heldParams . bulGunSound ?~ (bangEchoS,0)
& itType . iyBase .~ HELD BANGCONE
& itType .~ HELD BANGCONE
blunderbuss :: Item
blunderbuss =
@@ -33,12 +33,12 @@ blunderbuss =
& itUse . heldAim . aimWeight .~ 6
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 30
& itType . iyBase .~ HELD BLUNDERBUSS
& itType .~ HELD BLUNDERBUSS
grapeCannon :: Int -> Item
grapeCannon i =
blunderbuss
& itType . iyBase .~ HELD (GRAPECANNON i)
& itType .~ HELD (GRAPECANNON i)
& itUse . heldParams . recoil .~ (150 + fromIntegral i * 50)
& itUse . heldParams . torqueAfter .~ (0.1 + 0.2 * fromIntegral i)
& itUse . heldParams . randomOffset .~ (12 + 4 * fromIntegral i)
+2 -10
View File
@@ -26,19 +26,13 @@ launcher =
& itDimension . dimRad .~ 9
& itDimension . dimCenter .~ V3 10 0 0
& itUse . heldDelay . rateMax .~ 20
-- & itUse . heldUse .~ HeldPJCreation --usePjCreation
-- & itUse . heldMods .~ LauncherMod
-- & itUse . heldMods .~ PistolMod
& itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 0.5
& itUse . heldAim . aimStance .~ TwoHandOver
-- & itUse . heldAim . aimHandlePos .~ V2 3 0
-- & itUse . heldAim . aimMuzPos .~ 20
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleLauncher
& itUse . heldAmmoTypes .~ singleAmmo ProjectileAmmo
& itType . iyBase .~ HELD LAUNCHER
-- & itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
& itType .~ HELD LAUNCHER
& itUse . heldParams . muzVel .~ ConstFloat 0
& itUse . heldParams . rifling .~ ConstFloat 0
& itUse . heldParams . recoil .~ 0
@@ -48,9 +42,7 @@ launcher =
launcherX :: Int -> Item
launcherX i =
launcher
& itType . iyBase .~ HELD (LAUNCHERX i)
-- & itUse . heldUse .~ HeldPJCreationX i
-- & itUse . heldMods .~ LauncherXMod i
& itType .~ HELD (LAUNCHERX i)
& itUse . heldAim . aimMuzzles .~ getZipList
(ZipList [Muzzle (V2 20 0) a 0 | a <- angles]
<*> ZipList [0..]
+5 -5
View File
@@ -25,7 +25,7 @@ bangRod =
& itUse . heldDelay . rateMax .~ 12
& itDimension . dimRad .~ 12
& itDimension . dimCenter .~ V3 5 0 0
& itType . iyBase .~ HELD BANGROD
& itType .~ HELD BANGROD
& itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ OneHand
@@ -38,7 +38,7 @@ bangRod =
elephantGun :: Item
elephantGun =
bangRod
& itType . iyBase .~ HELD ELEPHANTGUN
& itType .~ HELD ELEPHANTGUN
& itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05
& itUse . heldParams . recoil .~ 50
@@ -46,17 +46,17 @@ elephantGun =
amr :: Item
amr =
elephantGun
& itType . iyBase .~ HELD AMR
& itType .~ HELD AMR
autoAmr :: Item
autoAmr =
amr
& itType . iyBase .~ HELD AUTOAMR
& itType .~ HELD AUTOAMR
sniperRifle :: Item
sniperRifle =
elephantGun
& itType . iyBase .~ HELD SNIPERRIFLE
& itType .~ HELD SNIPERRIFLE
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5,_izFac = 1}
+6 -9
View File
@@ -17,9 +17,8 @@ import LensHelp
poisonSprayer :: Item
poisonSprayer =
flameThrower
& itType . iyBase .~ HELD POISONSPRAYER
& itType .~ HELD POISONSPRAYER
& itUse . heldAmmoTypes .~ singleAmmo GasAmmo
-- & itUse . heldMods .~ PoisonSprayerMod
& itUse . heldParams . gasCreation .~ CreatePoisonGas --aGasCloud
& itUse . heldParams . recoil .~ 0
& itUse . heldParams . torqueAfter .~ 0
@@ -30,11 +29,9 @@ poisonSprayer =
flameSpitter :: Item
flameSpitter =
flameThrower
& itType . iyBase .~ HELD FLAMESPITTER
-- & itParams . sprayNozzles . ix 0 . nzPressure .~ 4
& itType .~ HELD FLAMESPITTER
& itUse . heldAim . aimStance .~ OneHand
& itUse . heldDelay .~ FixedRate{_rateMax = 3, _rateTime = 0}
-- & itUse . heldMods .~ FlameSpitterMod
& itUse . heldParams . weaponInvLock .~ 10
& itUse . heldParams . weaponRepeat .~ [1..9]
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
@@ -43,7 +40,7 @@ flameSpitter =
flameTorrent :: Item
flameTorrent =
flameThrower
& itType . iyBase .~ HELD FLAMETORRENT
& itType .~ HELD FLAMETORRENT
& itUse . heldAim . aimZoom .~ defaultItZoom
-- & itParams . sprayNozzles . ix 0
-- %~ ( (nzPressure .~ 10)
@@ -54,12 +51,12 @@ flameTorrent =
blowTorch :: Item
blowTorch =
flameThrower
& itType . iyBase .~ HELD BLOWTORCH
& itType .~ HELD BLOWTORCH
flameWall :: Item
flameWall =
flameThrower
& itType . iyBase .~ HELD FLAMEWALL
& itType .~ HELD FLAMEWALL
-- & itParams . sprayNozzles .~ zipWith makeNozzle [0, 0.6, -0.6] [2, 2.5, 2.5]
-- where
-- makeNozzle dir pres =
@@ -94,7 +91,7 @@ flameThrower =
}
]
& itUse . heldAmmoTypes .~ singleAmmo GasAmmo
& itType . iyBase .~ HELD FLAMETHROWER
& itType .~ HELD FLAMETHROWER
& itUse . heldParams .~ GasSprayParams
{_gasCreation = CreateFlame
, _recoil = 0
+6 -15
View File
@@ -19,8 +19,8 @@ bangStick i =
defaultBulletWeapon
& itUse . heldParams . recoil .~ 25
& itUse . heldParams . torqueAfter .~ 0.18 + 0.02 * fromIntegral i
& itType . iyBase .~ HELD (BANGSTICK i)
& itInvSize .~ fromIntegral i / 3
& itType .~ HELD (BANGSTICK i)
& itInvSize .~ max 1 (i `div` 2)
& itDimension . dimRad .~ 5
& itDimension . dimCenter .~ V3 5 0 0
& itUse . heldDelay . rateMax .~ 8
@@ -35,9 +35,7 @@ baseStickSpread = 0.2
pistol :: Item
pistol =
bangStick 1
-- & itUse . heldAmmoTypes .~ [BulletAmmo]
& itUse . heldDelay . rateMax .~ 6
-- & itUse . heldMods .~ PistolMod
& itUse . heldAim . aimMuzzles . ix 0 . mzPos %~ const (V2 10 0)
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy %~ const 0.05
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType %~ const PistolFlare
@@ -48,35 +46,28 @@ pistol =
. (torqueAfter .~ 0.2)
. (sidePush .~ 50)
)
& itType . iyBase .~ HELD PISTOL
& itType .~ HELD PISTOL
autoPistol :: Item
autoPistol =
pistol
-- & itUse . heldMods .~ PistolMod
& itUse . heldTriggerType .~ AutoTrigger
& itUse . heldParams . bulGunSound ?~ (tap1S,0)
& itType . iyBase .~ HELD AUTOPISTOL
-- & itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
& itType .~ HELD AUTOPISTOL
machinePistol :: Item
machinePistol =
autoPistol
& itUse . heldDelay .~ WarmUpNoDelay {_warmTime = 0, _warmMax = 50, _warmSound = crankSlowS}
--rateMax .~ 2
-- & itUse . heldMods .~ PistolMod -- (ammoCheckI : machinePistolAfterHamMods)
& itType . iyBase .~ HELD MACHINEPISTOL
-- & itType . iyModules . at ModAutoMag .~ Nothing
& itType .~ HELD MACHINEPISTOL
& itUse . heldParams . recoil .~ 20
smg :: Item
smg =
autoPistol -- & some parameter affecting stability
-- & itUse . heldMods .~ PistolMod --(ammoCheckI : smgAfterHamMods)
& itType . iyBase .~ HELD SMG
& itType .~ HELD SMG
& itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 20 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
-- & itUse . heldAim . aimHandlePos .~ 2
& itUse . heldParams . torqueAfter .~ 0.05
& itUse . heldParams . sidePush .~ 30
+5 -8
View File
@@ -15,10 +15,10 @@ flatShield =
& itUse . heldAim . aimStance .~ TwoHandFlat
-- & itUse . heldAim . aimHandlePos .~ 0
& itInvSize .~ 3
& itType . iyBase .~ HELD FLATSHIELD
& itType .~ HELD FLATSHIELD
keyCard :: Int -> Item
keyCard n = defaultHeldItem & itType . iyBase .~ HELD (KEYCARD n)
keyCard n = defaultHeldItem & itType .~ HELD (KEYCARD n)
latchkey :: Int -> Item
latchkey _ = defaultHeldItem
@@ -27,7 +27,7 @@ torch :: Item
torch =
defaultHeldItem
& itEffect . ieInv .~ EffectWhileRoot CreateHeldLight
& itType . iyBase .~ HELD TORCH
& itType .~ HELD TORCH
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 10
@@ -43,7 +43,7 @@ forceFieldGun =
-- & itUse . heldMods .~ ForceFieldMod -- this is slightly different
-- than the list below
--[ hammerCheckI , ammoCheckI , useAmmoAmount 1]
& itType . iyBase .~ HELD FORCEFIELDGUN
& itType .~ HELD FORCEFIELDGUN
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleForceField
@@ -54,10 +54,7 @@ clickDetector :: Detector -> Item
clickDetector dt =
defaultHeldItem
& itUse . heldDelay . rateMax .~ 20
-- & itUse . heldUse .~ HeldDetectorEffect dt --detectorEffect dt
-- & itUse . heldMods .~ AmmoUseCheckMod
-- & itUse . heldMods .~ DetectorMod dt --detectorEffect dt
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1}
& itType . iyBase .~ HELD (HELDDETECTOR dt)
& itType .~ HELD (HELDDETECTOR dt)
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleDetector
+1 -3
View File
@@ -8,12 +8,10 @@ import Linear.V2
shatterGun :: Item
shatterGun =
defaultHeldItem
& itType . iyBase .~ HELD SHATTERGUN
& itType .~ HELD SHATTERGUN
& itUse . heldDelay . rateMax .~ 10
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleShatter
-- & itUse . heldUse .~ HeldShatter --shootShatter
-- & itUse . heldMods .~ ShatterMod
& itUse . heldAim . aimStance .~ TwoHandFlat