Start moving item records out into functions

This commit is contained in:
2025-06-03 11:46:56 +01:00
parent 6e187c7548
commit 589603e474
11 changed files with 68 additions and 21 deletions
+3 -4
View File
@@ -21,7 +21,7 @@ defaultBangCane :: Item
defaultBangCane =
defaultBulletWeapon
& itUse . heldParams . rifling .~ ConstFloat 0.9
& itUse . heldParams . recoil .~ 50
-- & itUse . heldParams . recoil .~ 50
& itUse . heldParams . torqueAfter .~ 0.1
& itUse . heldDelay . rateMax .~ 6
-- & itUse . heldMods .~ BangCaneMod
@@ -31,7 +31,6 @@ defaultBangCane =
volleyGun :: Int -> Item
volleyGun i =
defaultBangCane
-- & itUse . heldMods .~ VolleyGunMod
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandFlat
@@ -46,7 +45,7 @@ volleyGun i =
)
& itUse . heldParams . weaponInvLock .~ i + 1
& itUse . heldParams . torqueAfter .~ 0.1
& itUse . heldParams . recoil .~ 30
-- & itUse . heldParams . recoil .~ 30
& itType .~ HELD (VOLLEYGUN i)
& itAmmoSlots .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
& itUse . heldParams . weaponRepeat .~ [1..i-1]
@@ -106,7 +105,7 @@ miniGunX i =
& itUse . heldAim . aimMuzzles
.~ replicate i
(Muzzle (V2 30 0) 0 0.05 0 MiniGunFlare MuzzleShootBullet (UseExactly 1) 0)
& itUse . heldParams . recoil .~ 10 * fromIntegral i
-- & itUse . heldParams . recoil .~ 10 * fromIntegral i
& itUse . heldParams . torqueAfter .~ 0.04 + 0.02 * fromIntegral i
& itUse . heldParams . sidePush .~ 10 * fromIntegral i
& itUse . heldParams . randomOffset .~ 10
+2 -2
View File
@@ -18,7 +18,7 @@ bangCone =
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ BasicFlare
& itUse . heldParams . muzVel .~ UniRandFloat 0.5 0.8
& itUse . heldParams . rifling .~ UniRandFloat 0.3 0.8
& itUse . heldParams . recoil .~ 150
-- & itUse . heldParams . recoil .~ 150
& itUse . heldParams . torqueAfter .~ 0.1
& itUse . heldParams . randomOffset .~ 12
& itUse . heldParams . bulGunSound ?~ (bangEchoS,0)
@@ -37,6 +37,6 @@ grapeCannon :: Int -> Item
grapeCannon i =
blunderbuss
& itType .~ HELD (GRAPECANNON i)
& itUse . heldParams . recoil .~ (150 + fromIntegral i * 50)
-- & itUse . heldParams . recoil .~ (150 + fromIntegral i * 50)
& itUse . heldParams . torqueAfter .~ (0.1 + 0.2 * fromIntegral i)
& itUse . heldParams . randomOffset .~ (12 + 4 * fromIntegral i)
+1 -1
View File
@@ -23,7 +23,7 @@ rLauncher =
& itType .~ HELD RLAUNCHER
& itUse . heldParams . muzVel .~ ConstFloat 0
& itUse . heldParams . rifling .~ ConstFloat 0
& itUse . heldParams . recoil .~ 0
-- & itUse . heldParams . recoil .~ 0
& itUse . heldParams . torqueAfter .~ 0
& itUse . heldParams . bulGunSound ?~ (tap4S, 0)
+2 -2
View File
@@ -19,7 +19,7 @@ bangRod :: Item
bangRod =
defaultBulletWeapon
& itUse . heldParams . rifling .~ ConstFloat 1
& itUse . heldParams . recoil .~ 50
-- & itUse . heldParams . recoil .~ 50
& itUse . heldParams . torqueAfter .~ 0.3
& itUse . heldParams . bulGunSound ?~ (bangEchoS,0)
& itUse . heldDelay . rateMax .~ 12
@@ -39,7 +39,7 @@ elephantGun =
& itType .~ HELD ELEPHANTGUN
& itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05
& itUse . heldParams . recoil .~ 50
-- & itUse . heldParams . recoil .~ 50
amr :: Item
amr =
+2 -2
View File
@@ -20,7 +20,7 @@ poisonSprayer =
& itType .~ HELD POISONSPRAYER
& itAmmoSlots .~ singleAmmo GasAmmo
& itUse . heldParams . gasCreation .~ CreatePoisonGas --aGasCloud
& itUse . heldParams . recoil .~ 0
-- & itUse . heldParams . recoil .~ 0
& itUse . heldParams . torqueAfter .~ 0
& itUse . heldParams . randomOffset .~ 0
& itUse . heldParams . sidePush .~ 0
@@ -91,7 +91,7 @@ flameThrower =
& itType .~ HELD FLAMETHROWER
& itUse . heldParams .~ GasSprayParams
{_gasCreation = CreateFlame
, _recoil = 0
-- , _recoil = 0
, _torqueAfter = 0
, _randomOffset = 0
, _sidePush = 25
+3 -3
View File
@@ -16,7 +16,7 @@ import LensHelp
bangStick :: Int -> Item
bangStick i =
defaultBulletWeapon
& itUse . heldParams . recoil .~ 25
-- & itUse . heldParams . recoil .~ 25
& itUse . heldParams . torqueAfter .~ 0.18 + 0.02 * fromIntegral i
& itType .~ HELD (BANGSTICK i)
& itUse . heldDelay . rateMax .~ 8
@@ -49,7 +49,7 @@ pistol =
& itUse . heldParams
%~ ( (muzVel .~ ConstFloat 0.8)
. (rifling .~ ConstFloat 0.8)
. (recoil .~ 10)
-- . (recoil .~ 10)
. (torqueAfter .~ 0.2)
. (sidePush .~ 50)
)
@@ -67,7 +67,7 @@ machinePistol =
autoPistol
& itUse . heldDelay .~ WarmUpNoDelay{_warmTime = 0, _warmMax = 50, _warmSound = crankSlowS}
& itType .~ HELD MACHINEPISTOL
& itUse . heldParams . recoil .~ 20
-- & itUse . heldParams . recoil .~ 20
smg :: Item
smg =