Separate incendiary ebs and flamelets

This commit is contained in:
2025-06-09 11:41:11 +01:00
parent 5d8b493636
commit 5286485d62
7 changed files with 223 additions and 213 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -1
View File
@@ -117,9 +117,11 @@ useBulletPayload bu = case _buPayload bu of
BulFrag -> makeFragBullets
BulGas -> (`makeGasCloud` V2 0 0)
BulBall ExplosiveBall -> \p -> cWorld . lWorld . shockwaves .:~ concBall p
BulBall ElectricalBall -> makeMovingEB (_buVel bu) ElectricalBall
BulBall ElectricalBall{} -> makeMovingEB (_buVel bu)
(ElectricalBall (round $ bu ^. buPos . _1))
BulBall FlashBall -> makeMovingEB (_buVel bu) FlashBall
BulBall (FlameletBall x r) -> makeMovingEB (_buVel bu) (FlameletBall x r)
BulBall IncendiaryBall -> makeMovingEB (_buVel bu) IncendiaryBall
makeFragBullets :: Point2 -> World -> World
makeFragBullets p w = w & cWorld . lWorld . bullets .++~ bus
+2 -2
View File
@@ -281,8 +281,8 @@ inventoryX c = case c of
, megaTinMag 10200
] <>
-- [bulletTargetingModule btt | btt <- [minBound .. maxBound]]
[bulletModule (BulletModPayload (BulBall x)) | x <- [ FlameletBall 5 0
, ElectricalBall
[bulletModule (BulletModPayload (BulBall x)) | x <- [ IncendiaryBall
, ElectricalBall 0
, ExplosiveBall
, FlashBall ]]
<> [bulletModule (BulletModEffect x) | x <- [minBound .. maxBound]]
+3 -2
View File
@@ -10,8 +10,9 @@ import Data.Aeson
import Data.Aeson.TH
data EnergyBallType
= FlameletBall {_fbSize :: Float, _fbRot :: Float}
| ElectricalBall
= IncendiaryBall
| FlameletBall {_fbSize :: Float, _fbRot :: Float}
| ElectricalBall {_ebID :: Int}
| ExplosiveBall
| FlashBall
deriving (Eq, Ord, Show, Read) --Generic, Flat)
+9 -8
View File
@@ -2,7 +2,6 @@
module Dodge.EnergyBall (
updateEnergyBall,
incBallAt,
makeFlashBall,
makeFlamelet,
makeMovingEB,
@@ -48,14 +47,17 @@ updateEnergyBall w eb
ebEffect :: EnergyBall -> World -> World
ebEffect eb = case _ebEff eb of
ElectricalBall ->
soundContinue (EBSound 0) (_ebPos eb) elecCrackleS (Just 2)
ElectricalBall i ->
soundContinue (EBSound i) (_ebPos eb) elecCrackleS (Just 2)
. randSparkExtraVel
(_ebVel eb)
ElectricSpark
(state (randomR (3, 6)))
(state (randomR (0, 2 * pi)))
(_ebPos eb)
IncendiaryBall{}
| _ebTimer eb == 20 ->
soundStart (EBSound (-1)) (_ebPos eb) fireFadeS Nothing
_ -> id
energyBallAt :: EnergyBallType -> Point2 -> World -> World
@@ -78,9 +80,6 @@ makeMovingEB v ebt p =
, _ebEff = ebt
}
incBallAt :: Point2 -> World -> World
incBallAt = energyBallAt (FlameletBall 5 0)
makeFlashBall :: Point2 -> World -> World
makeFlashBall = energyBallAt FlashBall
@@ -93,8 +92,9 @@ ebFlicker pt
ebColor :: EnergyBall -> Color
ebColor eb = case eb ^. ebEff of
IncendiaryBall{} -> red
FlameletBall{} -> red
ElectricalBall -> cyan
ElectricalBall{} -> cyan
ExplosiveBall -> yellow
FlashBall -> white
@@ -114,7 +114,8 @@ damageCircle sp dt w =
ebtToDamage :: Point2 -> EnergyBallType -> Damage
ebtToDamage p = \case
FlameletBall{} -> Flaming 1
ElectricalBall -> Electrical 10
IncendiaryBall{} -> Flaming 10
ElectricalBall{} -> Electrical 10
ExplosiveBall -> Explosive 10 p
FlashBall -> Flashing 10 p
+2 -1
View File
@@ -9,7 +9,8 @@ import Picture
drawEnergyBall :: EnergyBall -> Picture
drawEnergyBall eb = case _ebEff eb of
FlameletBall x a -> drawFlamelet x a eb
ElectricalBall -> drawStaticBall eb
IncendiaryBall -> drawFlamelet 5 0 eb
ElectricalBall{} -> drawStaticBall eb
ExplosiveBall -> mempty
FlashBall -> mempty
+203 -198
View File
@@ -1,4 +1,4 @@
-- generated at 2025-06-02 21:04:57.854200257 UTC
-- generated at 2025-06-09 10:19:06.449705157 UTC
module Dodge.SoundLogic.ExternallyGeneratedSounds where
import Sound.Data
soundToVol :: SoundID -> Float
@@ -43,75 +43,76 @@ soundToVol v = case _getSoundID v of
37 -> 400
38 -> 2000
39 -> 100
40 -> 50
41 -> 2000
42 -> 50
43 -> 1000
44 -> 8000
45 -> 2000
40 -> 300
41 -> 50
42 -> 2000
43 -> 50
44 -> 1000
45 -> 8000
46 -> 2000
47 -> 1000
48 -> 2000
49 -> 100
50 -> 40
47 -> 2000
48 -> 1000
49 -> 2000
50 -> 100
51 -> 40
52 -> 2000
53 -> 100
54 -> 500
55 -> 40
56 -> 300
52 -> 40
53 -> 2000
54 -> 100
55 -> 500
56 -> 40
57 -> 300
58 -> 100
59 -> 2000
60 -> 1000
58 -> 300
59 -> 100
60 -> 2000
61 -> 1000
62 -> 1000
63 -> 1000
64 -> 1000
65 -> 40
66 -> 50
67 -> 1000
68 -> 500
65 -> 1000
66 -> 40
67 -> 50
68 -> 1000
69 -> 500
70 -> 100
71 -> 1000
72 -> 20
73 -> 500
74 -> 300
75 -> 200
76 -> 500
77 -> 1000
78 -> 200
79 -> 1000
80 -> 2000
81 -> 500
82 -> 100
83 -> 1000
84 -> 300
85 -> 2000
70 -> 500
71 -> 100
72 -> 1000
73 -> 20
74 -> 500
75 -> 300
76 -> 200
77 -> 500
78 -> 1000
79 -> 200
80 -> 1000
81 -> 2000
82 -> 500
83 -> 100
84 -> 1000
85 -> 300
86 -> 2000
87 -> 100
88 -> 500
89 -> 2000
90 -> 100
91 -> 300
92 -> 1000
93 -> 200
94 -> 100
95 -> 1000
96 -> 2000
97 -> 1000
98 -> 100
99 -> 200
100 -> 500
101 -> 100
102 -> 2000
103 -> 1000
104 -> 2000
87 -> 2000
88 -> 100
89 -> 500
90 -> 2000
91 -> 100
92 -> 300
93 -> 1000
94 -> 200
95 -> 100
96 -> 1000
97 -> 2000
98 -> 1000
99 -> 100
100 -> 200
101 -> 500
102 -> 100
103 -> 2000
104 -> 1000
105 -> 2000
106 -> 200
107 -> 100
108 -> 200
106 -> 2000
107 -> 200
108 -> 100
109 -> 200
_ -> 50
soundToOnomato :: SoundID -> String
soundToOnomato v = case _getSoundID v of
@@ -155,75 +156,76 @@ soundToOnomato v = case _getSoundID v of
37 -> "CRNKCRNKCRNK"
38 -> "CHUGUGUG"
39 -> "SKWLL"
40 -> "HSSS"
41 -> "BOOM"
42 -> "HSS"
43 -> "TAKH"
44 -> "RINGGG"
45 -> "CRH"
46 -> "UGGAUGGA"
47 -> "CRUMPLE"
48 -> "CREUH"
49 -> "SMACK"
50 -> "CLICK"
51 -> "TIPTOP"
52 -> "CRUH"
53 -> "CHNKCHNKCHUNK"
54 -> "CLKCLK"
55 -> "TIPTAP"
56 -> "TNKTNKTNK"
57 -> "CHPCHPCHP"
58 -> "SLP"
59 -> "SCREE"
60 -> "DHDHL"
61 -> "BRAP"
62 -> "CRSK"
63 -> "CRNKL"
64 -> "TRNKL"
65 -> "TAPP"
66 -> "SHUHP"
67 -> "CRUMBL"
68 -> "DEDEDUM"
69 -> "TAK"
70 -> "SPLRT"
71 -> "CRISH"
72 -> "SWSH"
73 -> "BIPBIPBIP"
74 -> "BEP"
75 -> "CRSKRL"
76 -> "KRTNKL"
77 -> "CRSNK"
78 -> "SHTCK"
79 -> "TTRKL"
80 -> "UGGAUGGA"
81 -> "DUDURAH"
82 -> "KKSQWL"
83 -> "CRMPL"
84 -> "BWEP"
85 -> "CHUGUGUG"
86 -> "BANG"
87 -> "SLPP"
88 -> "DEDA"
89 -> "WHSSH"
90 -> "HNH"
91 -> "BWAH"
92 -> "CRUNK"
93 -> "SQWLTCH"
94 -> "DRR"
95 -> "TRNKL"
96 -> "BRAP"
97 -> "BLPCHCH"
98 -> "SKLE"
99 -> "ZMM"
100 -> "WRRR"
101 -> "FWUMP"
102 -> "BRAHCHCH"
103 -> "BWMP"
104 -> "BRPBRPBRP"
105 -> "WE-OH"
106 -> "THCK"
107 -> "FHP"
108 -> "QWLPH"
40 -> "WRRR"
41 -> "HSSS"
42 -> "BOOM"
43 -> "HSS"
44 -> "TAKH"
45 -> "RINGGG"
46 -> "CRH"
47 -> "UGGAUGGA"
48 -> "CRUMPLE"
49 -> "CREUH"
50 -> "SMACK"
51 -> "CLICK"
52 -> "TIPTOP"
53 -> "CRUH"
54 -> "CHNKCHNKCHUNK"
55 -> "CLKCLK"
56 -> "TIPTAP"
57 -> "TNKTNKTNK"
58 -> "CHPCHPCHP"
59 -> "SLP"
60 -> "SCREE"
61 -> "DHDHL"
62 -> "BRAP"
63 -> "CRSK"
64 -> "CRNKL"
65 -> "TRNKL"
66 -> "TAPP"
67 -> "SHUHP"
68 -> "CRUMBL"
69 -> "DEDEDUM"
70 -> "TAK"
71 -> "SPLRT"
72 -> "CRISH"
73 -> "SWSH"
74 -> "BIPBIPBIP"
75 -> "BEP"
76 -> "CRSKRL"
77 -> "KRTNKL"
78 -> "CRSNK"
79 -> "SHTCK"
80 -> "TTRKL"
81 -> "UGGAUGGA"
82 -> "DUDURAH"
83 -> "KKSQWL"
84 -> "CRMPL"
85 -> "BWEP"
86 -> "CHUGUGUG"
87 -> "BANG"
88 -> "SLPP"
89 -> "DEDA"
90 -> "WHSSH"
91 -> "HNH"
92 -> "BWAH"
93 -> "CRUNK"
94 -> "SQWLTCH"
95 -> "DRR"
96 -> "TRNKL"
97 -> "BRAP"
98 -> "BLPCHCH"
99 -> "SKLE"
100 -> "ZMM"
101 -> "WRRR"
102 -> "FWUMP"
103 -> "BRAHCHCH"
104 -> "BWMP"
105 -> "BRPBRPBRP"
106 -> "WE-OH"
107 -> "THCK"
108 -> "FHP"
109 -> "QWLPH"
_ -> error "unitialised sound"
soundPathList :: [String]
soundPathList =
@@ -267,6 +269,7 @@ soundPathList =
, "wrench1.CRNKCRNKCRNK.400.wav"
, "seagullChatter.CHUGUGUG.2000.wav"
, "blood4.SKWLL.100.wav"
, "fireFade.WRRR.300.wav"
, "foamSprayLoop.HSSS.50.wav"
, "explosion.BOOM.2000.wav"
, "foamSprayFadeOut.HSS.50.wav"
@@ -417,141 +420,143 @@ seagullChatterS :: SoundID
seagullChatterS = SoundID 38
blood4S :: SoundID
blood4S = SoundID 39
fireFadeS :: SoundID
fireFadeS = SoundID 40
foamSprayLoopS :: SoundID
foamSprayLoopS = SoundID 40
foamSprayLoopS = SoundID 41
explosionS :: SoundID
explosionS = SoundID 41
explosionS = SoundID 42
foamSprayFadeOutS :: SoundID
foamSprayFadeOutS = SoundID 42
foamSprayFadeOutS = SoundID 43
tap2S :: SoundID
tap2S = SoundID 43
tap2S = SoundID 44
tinitusS :: SoundID
tinitusS = SoundID 44
tinitusS = SoundID 45
seagullCry1S :: SoundID
seagullCry1S = SoundID 45
seagullCry1S = SoundID 46
seagullBarkS :: SoundID
seagullBarkS = SoundID 46
seagullBarkS = SoundID 47
stone3S :: SoundID
stone3S = SoundID 47
stone3S = SoundID 48
seagullCry2S :: SoundID
seagullCry2S = SoundID 48
seagullCry2S = SoundID 49
hit1S :: SoundID
hit1S = SoundID 49
hit1S = SoundID 50
click1S :: SoundID
click1S = SoundID 50
click1S = SoundID 51
twoStepSlowS :: SoundID
twoStepSlowS = SoundID 51
twoStepSlowS = SoundID 52
seagullCryS :: SoundID
seagullCryS = SoundID 52
seagullCryS = SoundID 53
crankSlowS :: SoundID
crankSlowS = SoundID 53
crankSlowS = SoundID 54
primeS :: SoundID
primeS = SoundID 54
primeS = SoundID 55
twoStepS :: SoundID
twoStepS = SoundID 55
twoStepS = SoundID 56
reloadS :: SoundID
reloadS = SoundID 56
reloadS = SoundID 57
reload1S :: SoundID
reload1S = SoundID 57
reload1S = SoundID 58
slapS :: SoundID
slapS = SoundID 58
slapS = SoundID 59
tone440sawtoothS :: SoundID
tone440sawtoothS = SoundID 59
tone440sawtoothS = SoundID 60
metal3S :: SoundID
metal3S = SoundID 60
metal3S = SoundID 61
tap3S :: SoundID
tap3S = SoundID 61
tap3S = SoundID 62
glassShat4S :: SoundID
glassShat4S = SoundID 62
glassShat4S = SoundID 63
glassShat2S :: SoundID
glassShat2S = SoundID 63
glassShat2S = SoundID 64
metal1S :: SoundID
metal1S = SoundID 64
metal1S = SoundID 65
foot3S :: SoundID
foot3S = SoundID 65
foot3S = SoundID 66
pickUpS :: SoundID
pickUpS = SoundID 66
pickUpS = SoundID 67
stone5S :: SoundID
stone5S = SoundID 67
stone5S = SoundID 68
dededumS :: SoundID
dededumS = SoundID 68
dededumS = SoundID 69
tap1S :: SoundID
tap1S = SoundID 69
tap1S = SoundID 70
blood1S :: SoundID
blood1S = SoundID 70
blood1S = SoundID 71
metal4S :: SoundID
metal4S = SoundID 71
metal4S = SoundID 72
knifeS :: SoundID
knifeS = SoundID 72
knifeS = SoundID 73
computerBeepingS :: SoundID
computerBeepingS = SoundID 73
computerBeepingS = SoundID 74
tone440S :: SoundID
tone440S = SoundID 74
tone440S = SoundID 75
gut6S :: SoundID
gut6S = SoundID 75
gut6S = SoundID 76
smallGlass2S :: SoundID
smallGlass2S = SoundID 76
smallGlass2S = SoundID 77
glassShat1S :: SoundID
glassShat1S = SoundID 77
glassShat1S = SoundID 78
disconnectItemS :: SoundID
disconnectItemS = SoundID 78
disconnectItemS = SoundID 79
metal5S :: SoundID
metal5S = SoundID 79
metal5S = SoundID 80
seagullBarkTransformedS :: SoundID
seagullBarkTransformedS = SoundID 80
seagullBarkTransformedS = SoundID 81
ejectS :: SoundID
ejectS = SoundID 81
ejectS = SoundID 82
blood3S :: SoundID
blood3S = SoundID 82
blood3S = SoundID 83
stone2S :: SoundID
stone2S = SoundID 83
stone2S = SoundID 84
tone440raiseS :: SoundID
tone440raiseS = SoundID 84
tone440raiseS = SoundID 85
seagullChatter1S :: SoundID
seagullChatter1S = SoundID 85
seagullChatter1S = SoundID 86
bangS :: SoundID
bangS = SoundID 86
bangS = SoundID 87
slap1S :: SoundID
slap1S = SoundID 87
slap1S = SoundID 88
dedaS :: SoundID
dedaS = SoundID 88
dedaS = SoundID 89
missileLaunchS :: SoundID
missileLaunchS = SoundID 89
missileLaunchS = SoundID 90
gruntS :: SoundID
gruntS = SoundID 90
gruntS = SoundID 91
sineRaisePitchOneSecS :: SoundID
sineRaisePitchOneSecS = SoundID 91
sineRaisePitchOneSecS = SoundID 92
metal2S :: SoundID
metal2S = SoundID 92
metal2S = SoundID 93
gut5S :: SoundID
gut5S = SoundID 93
gut5S = SoundID 94
slideDoorS :: SoundID
slideDoorS = SoundID 94
slideDoorS = SoundID 95
metal6S :: SoundID
metal6S = SoundID 95
metal6S = SoundID 96
autoGunS :: SoundID
autoGunS = SoundID 96
autoGunS = SoundID 97
oldMachineBootS :: SoundID
oldMachineBootS = SoundID 97
oldMachineBootS = SoundID 98
blood6S :: SoundID
blood6S = SoundID 98
blood6S = SoundID 99
buzzS :: SoundID
buzzS = SoundID 99
buzzS = SoundID 100
fireLoudS :: SoundID
fireLoudS = SoundID 100
fireLoudS = SoundID 101
tap4S :: SoundID
tap4S = SoundID 101
tap4S = SoundID 102
shotgunS :: SoundID
shotgunS = SoundID 102
shotgunS = SoundID 103
sawtoothFailS :: SoundID
sawtoothFailS = SoundID 103
sawtoothFailS = SoundID 104
miniS :: SoundID
miniS = SoundID 104
miniS = SoundID 105
seagullWhistleS :: SoundID
seagullWhistleS = SoundID 105
seagullWhistleS = SoundID 106
connectItemS :: SoundID
connectItemS = SoundID 106
connectItemS = SoundID 107
whiteNoiseFadeInS :: SoundID
whiteNoiseFadeInS = SoundID 107
whiteNoiseFadeInS = SoundID 108
gut1S :: SoundID
gut1S = SoundID 108
gut1S = SoundID 109