Add marimba sounds for crystal hits

This commit is contained in:
2025-11-23 19:39:07 +00:00
parent 92e4552f66
commit 5f29c20d39
6 changed files with 231 additions and 180 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+34 -3
View File
@@ -24,7 +24,7 @@ damMatSideEffect dm = \case
Flesh -> damageFlesh dm Flesh -> damageFlesh dm
Dirt -> damageDirt dm Dirt -> damageDirt dm
Glass -> damageGlass dm Glass -> damageGlass dm
Crystal -> \ecw -> set _1 0 . defDamageMaterial dm ecw Crystal -> damageCrystal dm
_ -> defDamageMaterial dm _ -> defDamageMaterial dm
defDamageMaterial :: Damage -> ECW -> World -> (Int,World) defDamageMaterial :: Damage -> ECW -> World -> (Int,World)
@@ -153,12 +153,12 @@ damageDirt dm _ w =
damageGlass :: Damage -> ECW -> World -> (Int,World) damageGlass :: Damage -> ECW -> World -> (Int,World)
damageGlass dm ecw w = case dm of damageGlass dm ecw w = case dm of
Lasering _ _ t -> f 0 $ id Lasering {} -> f 0 $ id
Piercing _ p t -> Piercing _ p t ->
f dmam $ makeSpark NormalSpark (outTo p t) (rdir p t) f dmam $ makeSpark NormalSpark (outTo p t) (rdir p t)
-- . makeDustAt Stone 200 (addZ 20 (outTo p t)) -- . makeDustAt Stone 200 (addZ 20 (outTo p t))
. randsound p [smallGlass1S, smallGlass2S, smallGlass3S, smallGlass4S] . randsound p [smallGlass1S, smallGlass2S, smallGlass3S, smallGlass4S]
Blunt _ p t -> f dmam $ -- makeDustAt Stone 200 (addZ 20 (outTo p t)) Blunt _ p _ -> f dmam $ -- makeDustAt Stone 200 (addZ 20 (outTo p t))
randsound p [smallGlass1S, smallGlass2S, smallGlass3S, smallGlass4S] randsound p [smallGlass1S, smallGlass2S, smallGlass3S, smallGlass4S]
Shattering _ p t -> f dmam $ makeDustAt Glass 200 (addZ 20 (outTo p t)) Shattering _ p t -> f dmam $ makeDustAt Glass 200 (addZ 20 (outTo p t))
. randsound p [smallGlass1S, smallGlass2S, smallGlass3S, smallGlass4S] . randsound p [smallGlass1S, smallGlass2S, smallGlass3S, smallGlass4S]
@@ -216,3 +216,34 @@ damageGlass dm ecw w = case dm of
-- outTo = p +.+ squashNormalizeV (sp -.- p) -- outTo = p +.+ squashNormalizeV (sp -.- p)
-- pSparkCol = V4 5 1 0.5 2 -- pSparkCol = V4 5 1 0.5 2
-- lSparkCol = V4 20 (-5) 0 1 -- lSparkCol = V4 20 (-5) 0 1
damageCrystal :: Damage -> ECW -> World -> (Int,World)
damageCrystal dm ecw w = case dm of
Lasering {} -> f $ id
Piercing _ p t ->
f $ makeSpark NormalSpark (outTo p t) (rdir p t)
. randsound p [marimbaC5S,marimbaE5S,marimbaG5S,marimbaB6S]
Blunt _ p _ -> f $ -- makeDustAt Stone 200 (addZ 20 (outTo p t))
randsound p [marimbaC5S,marimbaE5S,marimbaG5S,marimbaB6S]
Shattering _ p _ -> f $ randsound p [marimbaC5S,marimbaE5S,marimbaG5S,marimbaB6S]
Crushing{} -> f id
Explosive _ p -> f -- the sound comes from the explosion center, which is not correct...
$ randsound p [smallGlass1S, smallGlass2S, smallGlass3S, smallGlass4S]
Sparking{} -> f id
Flaming{} -> f id
Electrical{} -> f id
Poison{} -> f id
Enterrement{} -> f id
Flashing{} -> f id
where
f g = (0, g w)
rdir p t = argV $ reflectIn v t
where
v = case ecw of
Right wl -> uncurry (-) $ _wlLine wl
Left cr -> vNormal (p - cr ^. crPos . _xy)
randsound p xs =
let (x, g) = runState (takeOne xs) $ _randGen w
in soundStart so p x Nothing . set randGen g
so = DamageHitSound (w ^. cWorld . lWorld . lClock)
outTo x t = x -.- squashNormalizeV t
+197 -177
View File
@@ -1,4 +1,4 @@
-- generated at 2025-07-30 11:38:32.680040921 UTC -- generated at 2025-11-23 19:28:30.076047705 UTC
module Dodge.SoundLogic.ExternallyGeneratedSounds where module Dodge.SoundLogic.ExternallyGeneratedSounds where
import Sound.Data import Sound.Data
soundToVol :: SoundID -> Float soundToVol :: SoundID -> Float
@@ -84,68 +84,72 @@ soundToVol v = case _getSoundID v of
78 -> 100 78 -> 100
79 -> 300 79 -> 300
80 -> 300 80 -> 300
81 -> 100 81 -> 200
82 -> 2000 82 -> 100
83 -> 1000 83 -> 2000
84 -> 1000 84 -> 1000
85 -> 1000 85 -> 1000
86 -> 100 86 -> 1000
87 -> 100 87 -> 100
88 -> 1000 88 -> 100
89 -> 1000 89 -> 1000
90 -> 40 90 -> 1000
91 -> 50 91 -> 40
92 -> 1000 92 -> 200
93 -> 500 93 -> 50
94 -> 500 94 -> 1000
95 -> 100 95 -> 500
96 -> 100 96 -> 500
97 -> 1000 97 -> 100
98 -> 20 98 -> 100
99 -> 500 99 -> 200
100 -> 300 100 -> 1000
101 -> 200 101 -> 20
102 -> 500 102 -> 500
103 -> 1000 103 -> 300
104 -> 200 104 -> 200
105 -> 1000 105 -> 500
106 -> 2000 106 -> 1000
107 -> 500 107 -> 200
108 -> 200 108 -> 1000
109 -> 100 109 -> 2000
110 -> 1000 110 -> 500
111 -> 300 111 -> 200
112 -> 2000 112 -> 200
113 -> 2000 113 -> 100
114 -> 100 114 -> 1000
115 -> 500 115 -> 300
116 -> 2000 116 -> 2000
117 -> 500 117 -> 2000
118 -> 100 118 -> 100
119 -> 300 119 -> 500
120 -> 1000 120 -> 2000
121 -> 50 121 -> 500
122 -> 200 122 -> 100
123 -> 100 123 -> 300
124 -> 200 124 -> 1000
125 -> 1000 125 -> 50
126 -> 2000 126 -> 200
127 -> 200 127 -> 100
128 -> 1000 128 -> 200
129 -> 100 129 -> 1000
130 -> 200 130 -> 2000
131 -> 500 131 -> 200
132 -> 100 132 -> 1000
133 -> 2000 133 -> 100
134 -> 200 134 -> 200
135 -> 300 135 -> 500
136 -> 1000 136 -> 100
137 -> 2000 137 -> 2000
138 -> 2000 138 -> 200
139 -> 250 139 -> 300
140 -> 200 140 -> 1000
141 -> 100 141 -> 2000
142 -> 200 142 -> 2000
143 -> 250
144 -> 200
145 -> 100
146 -> 200
_ -> 50 _ -> 50
soundToOnomato :: SoundID -> String soundToOnomato :: SoundID -> String
soundToOnomato v = case _getSoundID v of soundToOnomato v = case _getSoundID v of
@@ -230,68 +234,72 @@ soundToOnomato v = case _getSoundID v of
78 -> "SKWLCH" 78 -> "SKWLCH"
79 -> "TNKTNKTNK" 79 -> "TNKTNKTNK"
80 -> "CHPCHPCHP" 80 -> "CHPCHPCHP"
81 -> "SLP" 81 -> "DING"
82 -> "SCREE" 82 -> "SLP"
83 -> "DHDHL" 83 -> "SCREE"
84 -> "BRAP" 84 -> "DHDHL"
85 -> "CRSK" 85 -> "BRAP"
86 -> "SPLRT" 86 -> "CRSK"
87 -> "SKWLL" 87 -> "SPLRT"
88 -> "CRNKL" 88 -> "SKWLL"
89 -> "TRNKL" 89 -> "CRNKL"
90 -> "TAPP" 90 -> "TRNKL"
91 -> "SHUHP" 91 -> "TAPP"
92 -> "CRUMBL" 92 -> "DING"
93 -> "DEDEDUM" 93 -> "SHUHP"
94 -> "TAK" 94 -> "CRUMBL"
95 -> "SPLRT" 95 -> "DEDEDUM"
96 -> "SQLEE" 96 -> "TAK"
97 -> "CRISH" 97 -> "SPLRT"
98 -> "SWSH" 98 -> "SQLEE"
99 -> "BIPBIPBIP" 99 -> "DING"
100 -> "BEP" 100 -> "CRISH"
101 -> "CRSKRL" 101 -> "SWSH"
102 -> "KRTNKL" 102 -> "BIPBIPBIP"
103 -> "CRSNK" 103 -> "BEP"
104 -> "SHTCK" 104 -> "CRSKRL"
105 -> "TTRKL" 105 -> "KRTNKL"
106 -> "UGGAUGGA" 106 -> "CRSNK"
107 -> "DUDURAH" 107 -> "SHTCK"
108 -> "TING" 108 -> "TTRKL"
109 -> "KKSQWL" 109 -> "UGGAUGGA"
110 -> "CRMPL" 110 -> "DUDURAH"
111 -> "BWEP" 111 -> "TING"
112 -> "CHUGUGUG" 112 -> "DING"
113 -> "BANG" 113 -> "KKSQWL"
114 -> "SLPP" 114 -> "CRMPL"
115 -> "DEDA" 115 -> "BWEP"
116 -> "WHSSH" 116 -> "CHUGUGUG"
117 -> "CLANG" 117 -> "BANG"
118 -> "HNH" 118 -> "SLPP"
119 -> "BWAH" 119 -> "DEDA"
120 -> "CRUNK" 120 -> "WHSSH"
121 -> "FHFH" 121 -> "CLANG"
122 -> "SQWLTCH" 122 -> "HNH"
123 -> "DRR" 123 -> "BWAH"
124 -> "WHH" 124 -> "CRUNK"
125 -> "TRNKL" 125 -> "FHFH"
126 -> "BRAP" 126 -> "SQWLTCH"
127 -> "WHR" 127 -> "DRR"
128 -> "BLPCHCH" 128 -> "WHH"
129 -> "SKLE" 129 -> "TRNKL"
130 -> "ZMM" 130 -> "BRAP"
131 -> "WRRR" 131 -> "WHR"
132 -> "FWUMP" 132 -> "BLPCHCH"
133 -> "BRAHCHCH" 133 -> "SKLE"
134 -> "TING" 134 -> "ZMM"
135 -> "WHRR" 135 -> "WRRR"
136 -> "BWMP" 136 -> "FWUMP"
137 -> "BRPBRPBRP" 137 -> "BRAHCHCH"
138 -> "WE-OH" 138 -> "TING"
139 -> "WHRHH" 139 -> "WHRR"
140 -> "THCK" 140 -> "BWMP"
141 -> "FHP" 141 -> "BRPBRPBRP"
142 -> "QWLPH" 142 -> "WE-OH"
143 -> "WHRHH"
144 -> "THCK"
145 -> "FHP"
146 -> "QWLPH"
_ -> error "unitialised sound" _ -> error "unitialised sound"
soundPathList :: [String] soundPathList :: [String]
soundPathList = soundPathList =
@@ -376,6 +384,7 @@ soundPathList =
, "bloodShort8.SKWLCH.100.wav" , "bloodShort8.SKWLCH.100.wav"
, "reload.TNKTNKTNK.300.wav" , "reload.TNKTNKTNK.300.wav"
, "reload1.CHPCHPCHP.300.wav" , "reload1.CHPCHPCHP.300.wav"
, "marimbaC5.DING.200.wav"
, "slap.SLP.100.wav" , "slap.SLP.100.wav"
, "tone440sawtooth.SCREE.2000.wav" , "tone440sawtooth.SCREE.2000.wav"
, "metal3.DHDHL.1000.wav" , "metal3.DHDHL.1000.wav"
@@ -386,12 +395,14 @@ soundPathList =
, "glassShat2.CRNKL.1000.wav" , "glassShat2.CRNKL.1000.wav"
, "metal1.TRNKL.1000.wav" , "metal1.TRNKL.1000.wav"
, "foot3.TAPP.40.wav" , "foot3.TAPP.40.wav"
, "marimbaG5.DING.200.wav"
, "pickUp.SHUHP.50.wav" , "pickUp.SHUHP.50.wav"
, "stone5.CRUMBL.1000.wav" , "stone5.CRUMBL.1000.wav"
, "dededum.DEDEDUM.500.wav" , "dededum.DEDEDUM.500.wav"
, "tap1.TAK.500.wav" , "tap1.TAK.500.wav"
, "blood1.SPLRT.100.wav" , "blood1.SPLRT.100.wav"
, "bloodShort7.SQLEE.100.wav" , "bloodShort7.SQLEE.100.wav"
, "marimbaB6.DING.200.wav"
, "metal4.CRISH.1000.wav" , "metal4.CRISH.1000.wav"
, "knife.SWSH.20.wav" , "knife.SWSH.20.wav"
, "computerBeeping.BIPBIPBIP.500.wav" , "computerBeeping.BIPBIPBIP.500.wav"
@@ -404,6 +415,7 @@ soundPathList =
, "seagullBarkTransformed.UGGAUGGA.2000.wav" , "seagullBarkTransformed.UGGAUGGA.2000.wav"
, "eject.DUDURAH.500.wav" , "eject.DUDURAH.500.wav"
, "ting3.TING.200.wav" , "ting3.TING.200.wav"
, "marimbaE5.DING.200.wav"
, "blood3.KKSQWL.100.wav" , "blood3.KKSQWL.100.wav"
, "stone2.CRMPL.1000.wav" , "stone2.CRMPL.1000.wav"
, "tone440raise.BWEP.300.wav" , "tone440raise.BWEP.300.wav"
@@ -601,127 +613,135 @@ reloadS :: SoundID
reloadS = SoundID 79 reloadS = SoundID 79
reload1S :: SoundID reload1S :: SoundID
reload1S = SoundID 80 reload1S = SoundID 80
marimbaC5S :: SoundID
marimbaC5S = SoundID 81
slapS :: SoundID slapS :: SoundID
slapS = SoundID 81 slapS = SoundID 82
tone440sawtoothS :: SoundID tone440sawtoothS :: SoundID
tone440sawtoothS = SoundID 82 tone440sawtoothS = SoundID 83
metal3S :: SoundID metal3S :: SoundID
metal3S = SoundID 83 metal3S = SoundID 84
tap3S :: SoundID tap3S :: SoundID
tap3S = SoundID 84 tap3S = SoundID 85
glassShat4S :: SoundID glassShat4S :: SoundID
glassShat4S = SoundID 85 glassShat4S = SoundID 86
bloodShort1S :: SoundID bloodShort1S :: SoundID
bloodShort1S = SoundID 86 bloodShort1S = SoundID 87
bloodShort4S :: SoundID bloodShort4S :: SoundID
bloodShort4S = SoundID 87 bloodShort4S = SoundID 88
glassShat2S :: SoundID glassShat2S :: SoundID
glassShat2S = SoundID 88 glassShat2S = SoundID 89
metal1S :: SoundID metal1S :: SoundID
metal1S = SoundID 89 metal1S = SoundID 90
foot3S :: SoundID foot3S :: SoundID
foot3S = SoundID 90 foot3S = SoundID 91
marimbaG5S :: SoundID
marimbaG5S = SoundID 92
pickUpS :: SoundID pickUpS :: SoundID
pickUpS = SoundID 91 pickUpS = SoundID 93
stone5S :: SoundID stone5S :: SoundID
stone5S = SoundID 92 stone5S = SoundID 94
dededumS :: SoundID dededumS :: SoundID
dededumS = SoundID 93 dededumS = SoundID 95
tap1S :: SoundID tap1S :: SoundID
tap1S = SoundID 94 tap1S = SoundID 96
blood1S :: SoundID blood1S :: SoundID
blood1S = SoundID 95 blood1S = SoundID 97
bloodShort7S :: SoundID bloodShort7S :: SoundID
bloodShort7S = SoundID 96 bloodShort7S = SoundID 98
marimbaB6S :: SoundID
marimbaB6S = SoundID 99
metal4S :: SoundID metal4S :: SoundID
metal4S = SoundID 97 metal4S = SoundID 100
knifeS :: SoundID knifeS :: SoundID
knifeS = SoundID 98 knifeS = SoundID 101
computerBeepingS :: SoundID computerBeepingS :: SoundID
computerBeepingS = SoundID 99 computerBeepingS = SoundID 102
tone440S :: SoundID tone440S :: SoundID
tone440S = SoundID 100 tone440S = SoundID 103
gut6S :: SoundID gut6S :: SoundID
gut6S = SoundID 101 gut6S = SoundID 104
smallGlass2S :: SoundID smallGlass2S :: SoundID
smallGlass2S = SoundID 102 smallGlass2S = SoundID 105
glassShat1S :: SoundID glassShat1S :: SoundID
glassShat1S = SoundID 103 glassShat1S = SoundID 106
disconnectItemS :: SoundID disconnectItemS :: SoundID
disconnectItemS = SoundID 104 disconnectItemS = SoundID 107
metal5S :: SoundID metal5S :: SoundID
metal5S = SoundID 105 metal5S = SoundID 108
seagullBarkTransformedS :: SoundID seagullBarkTransformedS :: SoundID
seagullBarkTransformedS = SoundID 106 seagullBarkTransformedS = SoundID 109
ejectS :: SoundID ejectS :: SoundID
ejectS = SoundID 107 ejectS = SoundID 110
ting3S :: SoundID ting3S :: SoundID
ting3S = SoundID 108 ting3S = SoundID 111
marimbaE5S :: SoundID
marimbaE5S = SoundID 112
blood3S :: SoundID blood3S :: SoundID
blood3S = SoundID 109 blood3S = SoundID 113
stone2S :: SoundID stone2S :: SoundID
stone2S = SoundID 110 stone2S = SoundID 114
tone440raiseS :: SoundID tone440raiseS :: SoundID
tone440raiseS = SoundID 111 tone440raiseS = SoundID 115
seagullChatter1S :: SoundID seagullChatter1S :: SoundID
seagullChatter1S = SoundID 112 seagullChatter1S = SoundID 116
bangS :: SoundID bangS :: SoundID
bangS = SoundID 113 bangS = SoundID 117
slap1S :: SoundID slap1S :: SoundID
slap1S = SoundID 114 slap1S = SoundID 118
dedaS :: SoundID dedaS :: SoundID
dedaS = SoundID 115 dedaS = SoundID 119
missileLaunchS :: SoundID missileLaunchS :: SoundID
missileLaunchS = SoundID 116 missileLaunchS = SoundID 120
clang2S :: SoundID clang2S :: SoundID
clang2S = SoundID 117 clang2S = SoundID 121
gruntS :: SoundID gruntS :: SoundID
gruntS = SoundID 118 gruntS = SoundID 122
sineRaisePitchOneSecS :: SoundID sineRaisePitchOneSecS :: SoundID
sineRaisePitchOneSecS = SoundID 119 sineRaisePitchOneSecS = SoundID 123
metal2S :: SoundID metal2S :: SoundID
metal2S = SoundID 120 metal2S = SoundID 124
debrisS :: SoundID debrisS :: SoundID
debrisS = SoundID 121 debrisS = SoundID 125
gut5S :: SoundID gut5S :: SoundID
gut5S = SoundID 122 gut5S = SoundID 126
slideDoorS :: SoundID slideDoorS :: SoundID
slideDoorS = SoundID 123 slideDoorS = SoundID 127
whirdown2S :: SoundID whirdown2S :: SoundID
whirdown2S = SoundID 124 whirdown2S = SoundID 128
metal6S :: SoundID metal6S :: SoundID
metal6S = SoundID 125 metal6S = SoundID 129
autoGunS :: SoundID autoGunS :: SoundID
autoGunS = SoundID 126 autoGunS = SoundID 130
whirdownSmall1S :: SoundID whirdownSmall1S :: SoundID
whirdownSmall1S = SoundID 127 whirdownSmall1S = SoundID 131
oldMachineBootS :: SoundID oldMachineBootS :: SoundID
oldMachineBootS = SoundID 128 oldMachineBootS = SoundID 132
blood6S :: SoundID blood6S :: SoundID
blood6S = SoundID 129 blood6S = SoundID 133
buzzS :: SoundID buzzS :: SoundID
buzzS = SoundID 130 buzzS = SoundID 134
fireLoudS :: SoundID fireLoudS :: SoundID
fireLoudS = SoundID 131 fireLoudS = SoundID 135
tap4S :: SoundID tap4S :: SoundID
tap4S = SoundID 132 tap4S = SoundID 136
shotgunS :: SoundID shotgunS :: SoundID
shotgunS = SoundID 133 shotgunS = SoundID 137
ting5S :: SoundID ting5S :: SoundID
ting5S = SoundID 134 ting5S = SoundID 138
whirS :: SoundID whirS :: SoundID
whirS = SoundID 135 whirS = SoundID 139
sawtoothFailS :: SoundID sawtoothFailS :: SoundID
sawtoothFailS = SoundID 136 sawtoothFailS = SoundID 140
miniS :: SoundID miniS :: SoundID
miniS = SoundID 137 miniS = SoundID 141
seagullWhistleS :: SoundID seagullWhistleS :: SoundID
seagullWhistleS = SoundID 138 seagullWhistleS = SoundID 142
whirdownS :: SoundID whirdownS :: SoundID
whirdownS = SoundID 139 whirdownS = SoundID 143
connectItemS :: SoundID connectItemS :: SoundID
connectItemS = SoundID 140 connectItemS = SoundID 144
whiteNoiseFadeInS :: SoundID whiteNoiseFadeInS :: SoundID
whiteNoiseFadeInS = SoundID 141 whiteNoiseFadeInS = SoundID 145
gut1S :: SoundID gut1S :: SoundID
gut1S = SoundID 142 gut1S = SoundID 146