Simplify shockwave damages

This commit is contained in:
2025-06-23 18:15:28 +01:00
parent 4e008366f4
commit 54eab6dd9e
12 changed files with 468 additions and 457 deletions
+258 -243
View File
@@ -1,4 +1,4 @@
-- generated at 2025-06-22 13:29:03.952552964 UTC
-- generated at 2025-06-22 21:26:57.684446959 UTC
module Dodge.SoundLogic.ExternallyGeneratedSounds where
import Sound.Data
soundToVol :: SoundID -> Float
@@ -44,89 +44,92 @@ soundToVol v = case _getSoundID v of
38 -> 1000
39 -> 200
40 -> 1000
41 -> 40
42 -> 400
43 -> 2000
44 -> 100
45 -> 300
46 -> 50
47 -> 2000
48 -> 50
49 -> 1000
50 -> 8000
51 -> 2000
52 -> 2000
53 -> 1000
54 -> 200
55 -> 2000
56 -> 100
57 -> 100
58 -> 40
41 -> 500
42 -> 40
43 -> 400
44 -> 2000
45 -> 100
46 -> 300
47 -> 50
48 -> 2000
49 -> 50
50 -> 500
51 -> 1000
52 -> 8000
53 -> 2000
54 -> 2000
55 -> 1000
56 -> 200
57 -> 2000
58 -> 100
59 -> 100
60 -> 40
61 -> 2000
62 -> 100
63 -> 500
64 -> 40
65 -> 100
66 -> 300
67 -> 300
68 -> 100
69 -> 2000
70 -> 1000
71 -> 1000
61 -> 100
62 -> 40
63 -> 2000
64 -> 100
65 -> 500
66 -> 40
67 -> 100
68 -> 300
69 -> 300
70 -> 100
71 -> 2000
72 -> 1000
73 -> 100
74 -> 100
75 -> 1000
76 -> 1000
77 -> 40
78 -> 50
79 -> 1000
80 -> 500
81 -> 500
82 -> 100
83 -> 100
84 -> 1000
85 -> 20
86 -> 500
87 -> 300
88 -> 200
89 -> 500
90 -> 1000
91 -> 200
73 -> 1000
74 -> 1000
75 -> 100
76 -> 100
77 -> 1000
78 -> 1000
79 -> 40
80 -> 50
81 -> 1000
82 -> 500
83 -> 500
84 -> 100
85 -> 100
86 -> 1000
87 -> 20
88 -> 500
89 -> 300
90 -> 200
91 -> 500
92 -> 1000
93 -> 2000
94 -> 500
95 -> 200
96 -> 100
97 -> 1000
98 -> 300
99 -> 2000
100 -> 2000
101 -> 100
102 -> 500
103 -> 2000
104 -> 100
105 -> 300
106 -> 1000
107 -> 200
108 -> 100
93 -> 200
94 -> 1000
95 -> 2000
96 -> 500
97 -> 200
98 -> 100
99 -> 1000
100 -> 300
101 -> 2000
102 -> 2000
103 -> 100
104 -> 500
105 -> 2000
106 -> 500
107 -> 100
108 -> 300
109 -> 1000
110 -> 2000
111 -> 1000
112 -> 100
113 -> 200
114 -> 500
110 -> 200
111 -> 100
112 -> 1000
113 -> 2000
114 -> 1000
115 -> 100
116 -> 2000
117 -> 200
118 -> 1000
116 -> 200
117 -> 500
118 -> 100
119 -> 2000
120 -> 2000
121 -> 200
122 -> 100
123 -> 200
120 -> 200
121 -> 1000
122 -> 2000
123 -> 2000
124 -> 200
125 -> 100
126 -> 200
_ -> 50
soundToOnomato :: SoundID -> String
soundToOnomato v = case _getSoundID v of
@@ -171,89 +174,92 @@ soundToOnomato v = case _getSoundID v of
38 -> "TRWNG"
39 -> "TING"
40 -> "CRASH"
41 -> "TAPTIP"
42 -> "CRNKCRNKCRNK"
43 -> "CHUGUGUG"
44 -> "SKWLL"
45 -> "WRRR"
46 -> "HSSS"
47 -> "BOOM"
48 -> "HSS"
49 -> "TAKH"
50 -> "RINGGG"
51 -> "CRH"
52 -> "UGGAUGGA"
53 -> "CRUMPLE"
54 -> "TING"
55 -> "CREUH"
56 -> "KKSQWL"
57 -> "SMACK"
58 -> "CLICK"
59 -> "SPRT"
60 -> "TIPTOP"
61 -> "CRUH"
62 -> "CHNKCHNKCHUNK"
63 -> "CLKCLK"
64 -> "TIPTAP"
65 -> "SKWLCH"
66 -> "TNKTNKTNK"
67 -> "CHPCHPCHP"
68 -> "SLP"
69 -> "SCREE"
70 -> "DHDHL"
71 -> "BRAP"
72 -> "CRSK"
73 -> "SPLRT"
74 -> "SKWLL"
75 -> "CRNKL"
76 -> "TRNKL"
77 -> "TAPP"
78 -> "SHUHP"
79 -> "CRUMBL"
80 -> "DEDEDUM"
81 -> "TAK"
82 -> "SPLRT"
83 -> "SQLEE"
84 -> "CRISH"
85 -> "SWSH"
86 -> "BIPBIPBIP"
87 -> "BEP"
88 -> "CRSKRL"
89 -> "KRTNKL"
90 -> "CRSNK"
91 -> "SHTCK"
92 -> "TTRKL"
93 -> "UGGAUGGA"
94 -> "DUDURAH"
95 -> "TING"
96 -> "KKSQWL"
97 -> "CRMPL"
98 -> "BWEP"
99 -> "CHUGUGUG"
100 -> "BANG"
101 -> "SLPP"
102 -> "DEDA"
103 -> "WHSSH"
104 -> "HNH"
105 -> "BWAH"
106 -> "CRUNK"
107 -> "SQWLTCH"
108 -> "DRR"
109 -> "TRNKL"
110 -> "BRAP"
111 -> "BLPCHCH"
112 -> "SKLE"
113 -> "ZMM"
114 -> "WRRR"
115 -> "FWUMP"
116 -> "BRAHCHCH"
117 -> "TING"
118 -> "BWMP"
119 -> "BRPBRPBRP"
120 -> "WE-OH"
121 -> "THCK"
122 -> "FHP"
123 -> "QWLPH"
41 -> "CLANG"
42 -> "TAPTIP"
43 -> "CRNKCRNKCRNK"
44 -> "CHUGUGUG"
45 -> "SKWLL"
46 -> "WRRR"
47 -> "HSSS"
48 -> "BOOM"
49 -> "HSS"
50 -> "CLANG"
51 -> "TAKH"
52 -> "RINGGG"
53 -> "CRH"
54 -> "UGGAUGGA"
55 -> "CRUMPLE"
56 -> "TING"
57 -> "CREUH"
58 -> "KKSQWL"
59 -> "SMACK"
60 -> "CLICK"
61 -> "SPRT"
62 -> "TIPTOP"
63 -> "CRUH"
64 -> "CHNKCHNKCHUNK"
65 -> "CLKCLK"
66 -> "TIPTAP"
67 -> "SKWLCH"
68 -> "TNKTNKTNK"
69 -> "CHPCHPCHP"
70 -> "SLP"
71 -> "SCREE"
72 -> "DHDHL"
73 -> "BRAP"
74 -> "CRSK"
75 -> "SPLRT"
76 -> "SKWLL"
77 -> "CRNKL"
78 -> "TRNKL"
79 -> "TAPP"
80 -> "SHUHP"
81 -> "CRUMBL"
82 -> "DEDEDUM"
83 -> "TAK"
84 -> "SPLRT"
85 -> "SQLEE"
86 -> "CRISH"
87 -> "SWSH"
88 -> "BIPBIPBIP"
89 -> "BEP"
90 -> "CRSKRL"
91 -> "KRTNKL"
92 -> "CRSNK"
93 -> "SHTCK"
94 -> "TTRKL"
95 -> "UGGAUGGA"
96 -> "DUDURAH"
97 -> "TING"
98 -> "KKSQWL"
99 -> "CRMPL"
100 -> "BWEP"
101 -> "CHUGUGUG"
102 -> "BANG"
103 -> "SLPP"
104 -> "DEDA"
105 -> "WHSSH"
106 -> "CLANG"
107 -> "HNH"
108 -> "BWAH"
109 -> "CRUNK"
110 -> "SQWLTCH"
111 -> "DRR"
112 -> "TRNKL"
113 -> "BRAP"
114 -> "BLPCHCH"
115 -> "SKLE"
116 -> "ZMM"
117 -> "WRRR"
118 -> "FWUMP"
119 -> "BRAHCHCH"
120 -> "TING"
121 -> "BWMP"
122 -> "BRPBRPBRP"
123 -> "WE-OH"
124 -> "THCK"
125 -> "FHP"
126 -> "QWLPH"
_ -> error "unitialised sound"
soundPathList :: [String]
soundPathList =
@@ -298,6 +304,7 @@ soundPathList =
, "metal7.TRWNG.1000.wav"
, "ting4.TING.200.wav"
, "stone1.CRASH.1000.wav"
, "clang.CLANG.500.wav"
, "twoStep1.TAPTIP.40.wav"
, "wrench1.CRNKCRNKCRNK.400.wav"
, "seagullChatter.CHUGUGUG.2000.wav"
@@ -306,6 +313,7 @@ soundPathList =
, "foamSprayLoop.HSSS.50.wav"
, "explosion.BOOM.2000.wav"
, "foamSprayFadeOut.HSS.50.wav"
, "clang1.CLANG.500.wav"
, "tap2.TAKH.1000.wav"
, "tinitus.RINGGG.8000.wav"
, "seagullCry1.CRH.2000.wav"
@@ -361,6 +369,7 @@ soundPathList =
, "slap1.SLPP.100.wav"
, "deda.DEDA.500.wav"
, "missileLaunch.WHSSH.2000.wav"
, "clang2.CLANG.500.wav"
, "grunt.HNH.100.wav"
, "sineRaisePitchOneSec.BWAH.300.wav"
, "metal2.CRUNK.1000.wav"
@@ -464,169 +473,175 @@ ting4S :: SoundID
ting4S = SoundID 39
stone1S :: SoundID
stone1S = SoundID 40
clangS :: SoundID
clangS = SoundID 41
twoStep1S :: SoundID
twoStep1S = SoundID 41
twoStep1S = SoundID 42
wrench1S :: SoundID
wrench1S = SoundID 42
wrench1S = SoundID 43
seagullChatterS :: SoundID
seagullChatterS = SoundID 43
seagullChatterS = SoundID 44
blood4S :: SoundID
blood4S = SoundID 44
blood4S = SoundID 45
fireFadeS :: SoundID
fireFadeS = SoundID 45
fireFadeS = SoundID 46
foamSprayLoopS :: SoundID
foamSprayLoopS = SoundID 46
foamSprayLoopS = SoundID 47
explosionS :: SoundID
explosionS = SoundID 47
explosionS = SoundID 48
foamSprayFadeOutS :: SoundID
foamSprayFadeOutS = SoundID 48
foamSprayFadeOutS = SoundID 49
clang1S :: SoundID
clang1S = SoundID 50
tap2S :: SoundID
tap2S = SoundID 49
tap2S = SoundID 51
tinitusS :: SoundID
tinitusS = SoundID 50
tinitusS = SoundID 52
seagullCry1S :: SoundID
seagullCry1S = SoundID 51
seagullCry1S = SoundID 53
seagullBarkS :: SoundID
seagullBarkS = SoundID 52
seagullBarkS = SoundID 54
stone3S :: SoundID
stone3S = SoundID 53
stone3S = SoundID 55
tingS :: SoundID
tingS = SoundID 54
tingS = SoundID 56
seagullCry2S :: SoundID
seagullCry2S = SoundID 55
seagullCry2S = SoundID 57
bloodShort3S :: SoundID
bloodShort3S = SoundID 56
bloodShort3S = SoundID 58
hit1S :: SoundID
hit1S = SoundID 57
hit1S = SoundID 59
click1S :: SoundID
click1S = SoundID 58
click1S = SoundID 60
bloodShort2S :: SoundID
bloodShort2S = SoundID 59
bloodShort2S = SoundID 61
twoStepSlowS :: SoundID
twoStepSlowS = SoundID 60
twoStepSlowS = SoundID 62
seagullCryS :: SoundID
seagullCryS = SoundID 61
seagullCryS = SoundID 63
crankSlowS :: SoundID
crankSlowS = SoundID 62
crankSlowS = SoundID 64
primeS :: SoundID
primeS = SoundID 63
primeS = SoundID 65
twoStepS :: SoundID
twoStepS = SoundID 64
twoStepS = SoundID 66
bloodShort8S :: SoundID
bloodShort8S = SoundID 65
bloodShort8S = SoundID 67
reloadS :: SoundID
reloadS = SoundID 66
reloadS = SoundID 68
reload1S :: SoundID
reload1S = SoundID 67
reload1S = SoundID 69
slapS :: SoundID
slapS = SoundID 68
slapS = SoundID 70
tone440sawtoothS :: SoundID
tone440sawtoothS = SoundID 69
tone440sawtoothS = SoundID 71
metal3S :: SoundID
metal3S = SoundID 70
metal3S = SoundID 72
tap3S :: SoundID
tap3S = SoundID 71
tap3S = SoundID 73
glassShat4S :: SoundID
glassShat4S = SoundID 72
glassShat4S = SoundID 74
bloodShort1S :: SoundID
bloodShort1S = SoundID 73
bloodShort1S = SoundID 75
bloodShort4S :: SoundID
bloodShort4S = SoundID 74
bloodShort4S = SoundID 76
glassShat2S :: SoundID
glassShat2S = SoundID 75
glassShat2S = SoundID 77
metal1S :: SoundID
metal1S = SoundID 76
metal1S = SoundID 78
foot3S :: SoundID
foot3S = SoundID 77
foot3S = SoundID 79
pickUpS :: SoundID
pickUpS = SoundID 78
pickUpS = SoundID 80
stone5S :: SoundID
stone5S = SoundID 79
stone5S = SoundID 81
dededumS :: SoundID
dededumS = SoundID 80
dededumS = SoundID 82
tap1S :: SoundID
tap1S = SoundID 81
tap1S = SoundID 83
blood1S :: SoundID
blood1S = SoundID 82
blood1S = SoundID 84
bloodShort7S :: SoundID
bloodShort7S = SoundID 83
bloodShort7S = SoundID 85
metal4S :: SoundID
metal4S = SoundID 84
metal4S = SoundID 86
knifeS :: SoundID
knifeS = SoundID 85
knifeS = SoundID 87
computerBeepingS :: SoundID
computerBeepingS = SoundID 86
computerBeepingS = SoundID 88
tone440S :: SoundID
tone440S = SoundID 87
tone440S = SoundID 89
gut6S :: SoundID
gut6S = SoundID 88
gut6S = SoundID 90
smallGlass2S :: SoundID
smallGlass2S = SoundID 89
smallGlass2S = SoundID 91
glassShat1S :: SoundID
glassShat1S = SoundID 90
glassShat1S = SoundID 92
disconnectItemS :: SoundID
disconnectItemS = SoundID 91
disconnectItemS = SoundID 93
metal5S :: SoundID
metal5S = SoundID 92
metal5S = SoundID 94
seagullBarkTransformedS :: SoundID
seagullBarkTransformedS = SoundID 93
seagullBarkTransformedS = SoundID 95
ejectS :: SoundID
ejectS = SoundID 94
ejectS = SoundID 96
ting3S :: SoundID
ting3S = SoundID 95
ting3S = SoundID 97
blood3S :: SoundID
blood3S = SoundID 96
blood3S = SoundID 98
stone2S :: SoundID
stone2S = SoundID 97
stone2S = SoundID 99
tone440raiseS :: SoundID
tone440raiseS = SoundID 98
tone440raiseS = SoundID 100
seagullChatter1S :: SoundID
seagullChatter1S = SoundID 99
seagullChatter1S = SoundID 101
bangS :: SoundID
bangS = SoundID 100
bangS = SoundID 102
slap1S :: SoundID
slap1S = SoundID 101
slap1S = SoundID 103
dedaS :: SoundID
dedaS = SoundID 102
dedaS = SoundID 104
missileLaunchS :: SoundID
missileLaunchS = SoundID 103
missileLaunchS = SoundID 105
clang2S :: SoundID
clang2S = SoundID 106
gruntS :: SoundID
gruntS = SoundID 104
gruntS = SoundID 107
sineRaisePitchOneSecS :: SoundID
sineRaisePitchOneSecS = SoundID 105
sineRaisePitchOneSecS = SoundID 108
metal2S :: SoundID
metal2S = SoundID 106
metal2S = SoundID 109
gut5S :: SoundID
gut5S = SoundID 107
gut5S = SoundID 110
slideDoorS :: SoundID
slideDoorS = SoundID 108
slideDoorS = SoundID 111
metal6S :: SoundID
metal6S = SoundID 109
metal6S = SoundID 112
autoGunS :: SoundID
autoGunS = SoundID 110
autoGunS = SoundID 113
oldMachineBootS :: SoundID
oldMachineBootS = SoundID 111
oldMachineBootS = SoundID 114
blood6S :: SoundID
blood6S = SoundID 112
blood6S = SoundID 115
buzzS :: SoundID
buzzS = SoundID 113
buzzS = SoundID 116
fireLoudS :: SoundID
fireLoudS = SoundID 114
fireLoudS = SoundID 117
tap4S :: SoundID
tap4S = SoundID 115
tap4S = SoundID 118
shotgunS :: SoundID
shotgunS = SoundID 116
shotgunS = SoundID 119
ting5S :: SoundID
ting5S = SoundID 117
ting5S = SoundID 120
sawtoothFailS :: SoundID
sawtoothFailS = SoundID 118
sawtoothFailS = SoundID 121
miniS :: SoundID
miniS = SoundID 119
miniS = SoundID 122
seagullWhistleS :: SoundID
seagullWhistleS = SoundID 120
seagullWhistleS = SoundID 123
connectItemS :: SoundID
connectItemS = SoundID 121
connectItemS = SoundID 124
whiteNoiseFadeInS :: SoundID
whiteNoiseFadeInS = SoundID 122
whiteNoiseFadeInS = SoundID 125
gut1S :: SoundID
gut1S = SoundID 123
gut1S = SoundID 126
+6 -3
View File
@@ -13,16 +13,19 @@ loadSound (i,s) = do
chnk <- Mix.load $ "./data/sound/" ++ s
return (i,chnk)
-- current thinking is to use group 0 for game sounds, group 1 for menu sounds
loadSounds :: IO (IM.IntMap Mix.Chunk)
loadSounds = do
Mix.openAudio Mix.defaultAudio 128
Mix.setChannels 32
x <- Mix.groupSpan 0 0 29
Mix.setChannels nchans
x <- Mix.groupSpan 0 0 (fromIntegral $ nchans - 3)
putStrLn $ show x <> " channels assigned to group 0"
y <- Mix.groupSpan 1 30 31
y <- Mix.groupSpan 1 (fromIntegral $ nchans - 2) (fromIntegral $ nchans - 1)
putStrLn $ show y <> " channels assigned to group 1"
fmap IM.fromList $ mapM loadSound $ zip [0..] soundPathList
where
nchans = (64::Int)
loadMusic :: IO (IM.IntMap Mix.Music)
loadMusic = do