Allow for pump attachment to flamethrower

This commit is contained in:
2026-03-17 15:16:24 +00:00
parent 902d8e0c00
commit 4cacb45252
18 changed files with 384 additions and 323 deletions
+34 -7
View File
@@ -50,6 +50,7 @@ gadgetEffect :: Int -> LocationDT OItem -> Creature -> World -> World
gadgetEffect pt loc
| UseHeld{} <- loc ^. locDT . dtValue . _1 . itUse = heldEffect pt loc
| PulseBallSF <- loc ^. locDT . dtValue . _2 = heldEffect pt loc
| PlasmaSF <- loc ^. locDT . dtValue . _2 = heldEffect pt loc
| DROPPER x <- loc ^. locDT . dtValue . _1 . itType
, Just i <- loc ^? locDT . dtValue . _1 . itUse . uInt
, pt == 0 =
@@ -153,17 +154,24 @@ locMuzzles loc
& ix 0 . mzFlareType .~ TeslaGunFlare
& ix 0 . mzEffect .~ MuzzlePulseLaser
& ix 0 . mzAmmoSlot .~ CapacitorBelow (UseExactly 200)
| PlasmaSF <- loc ^. locDT . dtValue . _2 =
dbwMuzzles
& ix 0 . mzEffect .~ MuzzlePlasmaBall
& ix 0 . mzAmmoSlot .~ CapacitorSelf (UseExactly 1)
& ix 0 . mzInaccuracy .~ 0
& ix 0 . mzFlareType .~ TeslaGunFlare
| PulseBallSF <- loc ^. locDT . dtValue . _2 =
dbwMuzzles
& ix 0 . mzEffect .~ MuzzlePulseBall
& ix 0 . mzAmmoSlot .~ CapacitorSelf (UseExactly 200)
& ix 0 . mzInaccuracy .~ 0
& ix 0 . mzFlareType .~ TeslaGunFlare
| otherwise = itemMuzzles $ loc ^. locDT . dtValue . _1
-- | otherwise = itemMuzzles $ loc ^. locDT . dtValue . _1
| otherwise = itemMuzzles $ loc
itemMuzzles :: Item -> [Muzzle]
itemMuzzles itm = case itm ^. itType of
HELD hit -> heldItemMuzzles itm hit
itemMuzzles :: LocationDT OItem -> [Muzzle]
itemMuzzles loc = case itm ^. itType of
HELD hit -> heldItemMuzzles loc hit
DETECTOR{} ->
dbwMuzzles & ix 0 . mzEffect .~ MuzzleDetector
& ix 0 . mzAmmoSlot . aps .~ UseExactly 100
@@ -174,9 +182,11 @@ itemMuzzles itm = case itm ^. itType of
& ix 0 . mzFlareType .~ LasGunFlare
& ix 0 . mzEffect .~ MuzzleLaser
_ -> []
where
itm = loc ^. locDT . dtValue . _1
heldItemMuzzles :: Item -> HeldItemType -> [Muzzle]
heldItemMuzzles itm = \case
heldItemMuzzles :: LocationDT OItem -> HeldItemType -> [Muzzle]
heldItemMuzzles loc = \case
ALTERIFLE ->
dbwMuzzles & ix 0 . mzPos .~ V2 25 0
& ix 0 . mzAmmoSlot .~ MagBelow (_alteRifleSwitch (_itParams itm)) (UseExactly 1)
@@ -246,6 +256,8 @@ heldItemMuzzles itm = \case
BLUNDERBUSS -> [Muzzle (V2 30 0) 0 0.5 magupto15 BasicFlare MuzzleShootBullet 12]
GRAPECANNON i -> [Muzzle (V2 30 0) 0 0.5 magupto15 BasicFlare MuzzleShootBullet (12 + 4 * fromIntegral i)]
LED -> dbwMuzzles & ix 0 . mzPos .~ V2 10 0
FLAMETHROWER | Just PumpSF <- loc ^? locDT. dtRight . ix 0 . dtValue ._2
-> flameMuzzles & ix 0 . mzEffect . nzPressure .~ UniRandFloat 2 8
FLAMETHROWER -> flameMuzzles
FLAMESPITTER -> flameMuzzles & ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
RLAUNCHER ->
@@ -318,6 +330,7 @@ heldItemMuzzles itm = \case
where
maguse1 = MagBelow 0 (UseExactly 1)
magupto15 = MagBelow 0 (UseUpTo 15)
itm = loc ^. locDT . dtValue . _1
baseStickSpread :: Float
baseStickSpread = 0.2
@@ -334,7 +347,8 @@ flameMuzzles =
(MagBelow 0 (UseExactly 1))
NoFlare
MuzzleNozzle
{ _nzPressure = ConstFloat 4
--{ _nzPressure = ConstFloat 4
{ _nzPressure = UniRandFloat 3.5 4
, _nzMaxWalkAngle = 0.2
, _nzWalkSpeed = 0.01
}
@@ -728,6 +742,7 @@ useLoadedAmmo loc cr mz m w =
MuzzleLaser -> creatureShootLaser pq' loc (w & randGen .~ g)
MuzzlePulseLaser -> creatureShootPulseLaser pq' cr (w & randGen .~ g)
MuzzlePulseBall -> shootPulseBall pq' (w & randGen .~ g)
MuzzlePlasmaBall -> shootPlasmaBall pq' (w & randGen .~ g)
MuzzleTesla -> shootTeslaArc pq' loc (w & randGen .~ g)
MuzzleTractor -> shootTractorBeam cr w
MuzzleRLauncher -> createProjectileR pq loc magtree cr w
@@ -888,6 +903,18 @@ shootPulseLaser so p dir w =
}
& soundStart so p lasPulseS Nothing
shootPlasmaBall :: Point3Q -> World -> World
shootPlasmaBall (p, q) w =
w
& cWorld . lWorld . plasmaBalls .:~
PBall
{ _pbPos = p ^. _xy
, _pbVel = 6 * unitVectorAtAngle (Q.qToAng q)
, _pbType = DefaultPlasma
}
-- & soundStart (PBSound i) (p ^. _xy) energyReleaseS Nothing
shootPulseBall :: Point3Q -> World -> World
shootPulseBall (p, q) w =
w