Move weapon muzzles up a record

This commit is contained in:
2025-06-04 09:29:09 +01:00
parent a71e237789
commit e1ec4e1a89
18 changed files with 81 additions and 96 deletions
+1 -1
View File
@@ -276,7 +276,7 @@ torchShape =
back = upperPrismPolySE 3 $ rectXH 1 2
baseStickShapeX :: Item -> Int -> Shape
baseStickShapeX it _ = foldMap f (it ^?! itUse . heldAim . aimMuzzles)
baseStickShapeX it _ = foldMap f (it ^?! itUse . heldMuzzles)
where
f brl = rotateSH (_mzRot brl) baseStickShape
+12 -13
View File
@@ -22,10 +22,10 @@ teslaGun =
& itUse . heldParams .~ BeamShooterParams-- (Just (elecCrackleS, 2))
& itParams .~ teslaParams
& itUse . heldDelay .~ NoDelay
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 10 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ TeslaGunFlare
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTesla
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 10 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzFlareType .~ TeslaGunFlare
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleTesla
& itType .~ HELD TESLAGUN
& itAmmoSlots .~ singleAmmo ElectricalAmmo
@@ -41,14 +41,13 @@ teslaParams =
laser :: Item
laser =
defaultHeldItem
-- & itUse . heldParams .~ BeamShooterParams (Just (tone440sawtoothquietS, 2))
& itUse . heldParams .~ BeamShooterParams-- Nothing
& itAmmoSlots .~ singleAmmo ElectricalAmmo
& itUse . heldDelay .~ NoDelay
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 6 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ LasGunFlare
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleLaser
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 6 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzFlareType .~ LasGunFlare
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleLaser
& itTargeting
.~ ItTargeting
{ _itTgPos = Nothing
@@ -63,8 +62,8 @@ tractorGun =
defaultHeldItem
& itUse . heldParams .~ BeamShooterParams
& itAmmoSlots .~ singleAmmo ElectricalAmmo
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ NoFlare
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTractor
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzFlareType .~ NoFlare
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleTractor
& itType .~ HELD TRACTORGUN
+5 -5
View File
@@ -31,7 +31,7 @@ volleyGun :: Int -> Item
volleyGun i =
defaultBangCane
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~ getZipList
& itUse . heldMuzzles .~ getZipList
(ZipList [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 6]
<*> ZipList [0..i-1]
<*> pure MiniGunFlare
@@ -52,7 +52,7 @@ rifle =
defaultBangCane
& itType .~ HELD RIFLE
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 25 0
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 25 0
alteRifle :: Item
alteRifle = rifle
@@ -75,11 +75,11 @@ burstRifle :: Item
burstRifle =
rifle
& itType .~ HELD BURSTRIFLE
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0.05
& itUse . heldDelay . rateMax .~ 6
& itUse . heldParams . weaponInvLock .~ 7
& itUse . heldParams . weaponRepeat .~ [3,6]
& itUse . heldAim . aimMuzzles %~ doreplicate
& itUse . heldMuzzles %~ doreplicate
where
doreplicate (x:_) = [x,x & mzFrame .~ 3,x & mzFrame .~ 6]
doreplicate [] = error "tried to replicate non-existing burstRifle muzzle"
@@ -91,7 +91,7 @@ miniGunX i =
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itAmmoSlots .~ singleAmmo BeltBulletAmmo
-- & itUse . heldParams . bulGunSound ?~ (mini1S,2)
& itUse . heldAim . aimMuzzles
& itUse . heldMuzzles
.~ replicate i
(Muzzle (V2 30 0) 0 0.05 0 MiniGunFlare MuzzleShootBullet (UseExactly 1) 0)
-- & itUse . heldParams . recoil .~ 10 * fromIntegral i
+3 -3
View File
@@ -14,11 +14,11 @@ bangCone :: Item
bangCone =
defaultBulletWeapon
& itUse . heldDelay . rateMax .~ 20
& itUse . heldAim . aimMuzzles
& itUse . heldMuzzles
.~ replicate
15
(Muzzle (V2 15 0) 0 0.5 0 NoFlare MuzzleShootBullet (UseExactly 1) 0)
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ BasicFlare
& itUse . heldMuzzles . ix 0 . mzFlareType .~ BasicFlare
& itUse . heldParams . muzVel .~ UniRandFloat 0.5 0.8
& itUse . heldParams . rifling .~ UniRandFloat 0.3 0.8
& itUse . heldParams . torqueAfter .~ 0.1
@@ -28,7 +28,7 @@ bangCone =
blunderbuss :: Item
blunderbuss =
bangCone
& itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 30
& itUse . heldMuzzles . ix 0 . mzPos . _x .~ 30
& itType .~ HELD BLUNDERBUSS
grapeCannon :: Int -> Item
+5 -5
View File
@@ -15,9 +15,9 @@ rLauncher :: Item
rLauncher =
defaultHeldItem
& itUse . heldDelay . rateMax .~ 20
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleRLauncher
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 20 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleRLauncher
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 20 0
& itAmmoSlots .~ singleAmmo LauncherAmmo
& itType .~ HELD RLAUNCHER
& itUse . heldParams . muzVel .~ ConstFloat 0
@@ -31,13 +31,13 @@ gLauncher :: Item
gLauncher =
rLauncher
& itType .~ HELD GLAUNCHER
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleGLauncher
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleGLauncher
rLauncherX :: Int -> Item
rLauncherX i =
rLauncher
& itType .~ HELD (RLAUNCHERX i)
& itUse . heldAim . aimMuzzles
& itUse . heldMuzzles
.~ getZipList
( ZipList [Muzzle (V2 20 0) a 0 | a <- angles]
<*> ZipList [0 ..]
+4 -4
View File
@@ -26,15 +26,15 @@ bangRod =
& itType .~ HELD BANGROD
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ HeavySmokeFlare
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldMuzzles . ix 0 . mzFlareType .~ HeavySmokeFlare
-- & itUse . heldConsumption . laAmmoType .~ hvBulletAmmo
elephantGun :: Item
elephantGun =
bangRod
& itType .~ HELD ELEPHANTGUN
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0.05
-- & itUse . heldParams . recoil .~ 50
amr :: Item
@@ -51,7 +51,7 @@ sniperRifle :: Item
sniperRifle =
elephantGun
& itType .~ HELD SNIPERRIFLE
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5,_izFac = 1}
--machineGun :: Item
+2 -2
View File
@@ -33,7 +33,7 @@ flameSpitter =
& itUse . heldDelay .~ FixedRate{_rateMax = 3, _rateTimeLastUsed = 0}
& itUse . heldParams . weaponInvLock .~ 10
& itUse . heldParams . weaponRepeat .~ [1..9]
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
& itUse . heldMuzzles . ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
flameTorrent :: Item
flameTorrent =
@@ -73,7 +73,7 @@ flameThrower =
& itParams .~ NoParams
& itUse . heldDelay .~ NoDelay
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 5, _izMin = 1.5}
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 18 0) 0 0 0 NoFlare
& itUse . heldMuzzles .~ [Muzzle (V2 18 0) 0 0 0 NoFlare
MuzzleNozzle
{ _nzPressure = ConstFloat 4
, _nzMaxWalkAngle = 0.2
+9 -9
View File
@@ -20,7 +20,7 @@ bangStick i =
& itUse . heldParams . torqueAfter .~ 0.18 + 0.02 * fromIntegral i
& itType .~ HELD (BANGSTICK i)
& itUse . heldDelay . rateMax .~ 8
& itUse . heldAim . aimMuzzles
& itUse . heldMuzzles
.~ [ Muzzle
(V2 10 0)
a
@@ -32,9 +32,9 @@ bangStick i =
0
| a <- spreadAroundCenter i baseStickSpread
]
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ NoLightFlare
& itUse . heldAim . aimMuzzles . ix (i `div` 2) . mzFlareType .~ MiniGunFlare
& itUse . heldAim . aimMuzzles . ix (i-1) . mzFlareType .~ NoLightFlare
& itUse . heldMuzzles . ix 0 . mzFlareType .~ NoLightFlare
& itUse . heldMuzzles . ix (i `div` 2) . mzFlareType .~ MiniGunFlare
& itUse . heldMuzzles . ix (i-1) . mzFlareType .~ NoLightFlare
baseStickSpread :: Float
baseStickSpread = 0.2
@@ -43,9 +43,9 @@ pistol :: Item
pistol =
bangStick 1
& itUse . heldDelay . rateMax .~ 6
& 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 BasicFlare
& itUse . heldMuzzles . ix 0 . mzPos %~ const (V2 10 0)
& itUse . heldMuzzles . ix 0 . mzInaccuracy %~ const 0.05
& itUse . heldMuzzles . ix 0 . mzFlareType %~ const BasicFlare
& itUse . heldParams
%~ ( (muzVel .~ ConstFloat 0.8)
. (rifling .~ ConstFloat 0.8)
@@ -69,7 +69,7 @@ smg :: Item
smg =
autoPistol -- & some parameter affecting stability
& itType .~ HELD SMG
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 20 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 20 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldParams . torqueAfter .~ 0.05
& itUse . heldParams . sidePush .~ 30
+10 -10
View File
@@ -30,7 +30,7 @@ torch :: Item
torch =
defaultHeldItem
& itType .~ HELD TORCH
& itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 10
& itUse . heldMuzzles . ix 0 . mzPos . _x .~ 10
& itAmmoSlots .~ singleAmmo ElectricalAmmo
-- | Sends out pulses that display walls.
@@ -43,8 +43,8 @@ detector dt =
& itAmmoSlots .~ singleAmmo ElectricalAmmo
& itUse . heldParams .~ DefaultHeldParams
& itType .~ DETECTOR dt
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleDetector
& itUse . heldAim . aimMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleDetector
& itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100
blinker :: Item
blinker =
@@ -54,14 +54,14 @@ blinker =
-- & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1}
& itAmmoSlots .~ singleAmmo ElectricalAmmo
& itUse . heldParams .~ DefaultHeldParams
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleBlink
& itUse . heldAim . aimMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 10000000
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleBlink
& itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 10000000
& itType .~ HELD BLINKER
unsafeBlinker :: Item
unsafeBlinker =
blinker
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleUnsafeBlink
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleUnsafeBlink
& itType .~ HELD BLINKERUNSAFE
-- & itUse . uequipEffect . eeViewDist ?~ 400
@@ -69,18 +69,18 @@ unsafeBlinker =
rewinder :: Item
rewinder =
blinker
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleRewind
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleRewind
& itType .~ HELD REWINDER
& itUse . heldAim . aimMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100000
& itUse . heldMuzzles . ix 0 . mzAmmoPerShot .~ UseExactly 100000
timeStopper :: Item
timeStopper =
blinker
& itType .~ HELD TIMESTOPPER
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleStopper
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleStopper
timeScroller :: Item
timeScroller =
timeStopper
& itType .~ HELD TIMESCROLLER
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleScroller
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleScroller
+3 -3
View File
@@ -11,6 +11,6 @@ shatterGun =
& itType .~ HELD SHATTERGUN
& itUse . heldDelay . rateMax .~ 10
& itAmmoSlots .~ 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 . heldMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldMuzzles . ix 0 . mzEffect .~ MuzzleShatter