Add sound on spawn, allow for filtering of to play sounds
This commit is contained in:
@@ -53,4 +53,3 @@ blockingLoad p str f u =
|
||||
--clearConcEff eff = do
|
||||
-- f <- eff
|
||||
-- return (f . (uvConcEffects .~ NoConcEffect))
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ data SoundOrigin
|
||||
| EBSound Int
|
||||
| DamageHitSound Int
|
||||
| PBSound Int
|
||||
| SpawnSound
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ module Dodge.Data.Universe (
|
||||
import Control.Lens
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import qualified Data.Map.Strict as M
|
||||
--import qualified Data.Map.Strict as M
|
||||
import Data.Preload
|
||||
import Data.Sequence (Seq (..))
|
||||
import Dodge.Data.Config
|
||||
@@ -26,8 +25,6 @@ import Loop.Data
|
||||
import Picture.Data
|
||||
import Sound.Data
|
||||
|
||||
--import SDL (Scancode)
|
||||
|
||||
data Universe = Universe
|
||||
{ _uvWorld :: World
|
||||
, _preloadData :: PreloadData
|
||||
|
||||
@@ -39,6 +39,7 @@ data World = World
|
||||
, _randGen :: StdGen
|
||||
, _toPlaySounds :: M.Map SoundOrigin Sound
|
||||
, _playingSounds :: M.Map SoundOrigin Sound
|
||||
, _wSoundFilter :: SoundFilter
|
||||
, _input :: Input
|
||||
, _testFloat :: Float
|
||||
, _rbState :: RightButtonState
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
module Dodge.Data.WorldEffect where
|
||||
|
||||
import qualified Data.Set as S
|
||||
import Dodge.Data.Item.Location
|
||||
import NewInt
|
||||
import Dodge.Data.LightSource
|
||||
@@ -17,6 +18,10 @@ data ItCrWdWd = ItCrWdItemHeldEffect
|
||||
| ItCrWdItemHeldEffectNoHammer
|
||||
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data SoundFilter
|
||||
= FilterBySoundOrigin (S.Set SoundOrigin)
|
||||
| NoSoundFilter
|
||||
|
||||
data WdWd
|
||||
= NoWorldEffect
|
||||
| SetTrigger Bool Int
|
||||
@@ -33,6 +38,7 @@ data WdWd
|
||||
| MakeTempLightFade Float LSParam Int
|
||||
| UseInvItem Int Int -- invid presstime
|
||||
| WdWdBurstFireRepetition Int (NewInt InvInt)
|
||||
| WdWdSetSoundFilter SoundFilter
|
||||
--deriving (Eq, Show, Read) --, Generic)
|
||||
--h--deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
@@ -61,6 +67,7 @@ data WdP2f
|
||||
= WdP2f0
|
||||
| WdP2fDoorPosition Int
|
||||
|
||||
deriveJSON defaultOptions ''SoundFilter
|
||||
deriveJSON defaultOptions ''ItCrWdWd
|
||||
deriveJSON defaultOptions ''WdWd
|
||||
deriveJSON defaultOptions ''WdP2
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
module Dodge.Default.World (defaultWorld) where
|
||||
|
||||
--import Data.Graph.Inductive.Graph hiding ((&))
|
||||
import qualified Data.Set as S
|
||||
import qualified Data.Map as M
|
||||
import Dodge.Data.World
|
||||
import Geometry.Data
|
||||
@@ -55,6 +56,7 @@ defaultWorld =
|
||||
, _gsZoning = mempty --Zoning IM.empty clZoneSize (zonePos _guPos)
|
||||
, _unpauseClock = 0
|
||||
, _coordinates = mempty
|
||||
, _wSoundFilter = FilterBySoundOrigin $ S.singleton SpawnSound
|
||||
}
|
||||
|
||||
defaultCWGen :: CWGen
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
|
||||
module Dodge.Render.MenuScreen (drawMenuScreen) where
|
||||
|
||||
import Geometry.Polygon
|
||||
import Linear
|
||||
import Dodge.Data.ScreenPos
|
||||
import Control.Lens
|
||||
import Dodge.Base.Window
|
||||
import Dodge.Data.CardinalPoint
|
||||
import Dodge.Data.ScreenPos
|
||||
import Dodge.Data.SelectionList
|
||||
import Dodge.Data.Universe
|
||||
import Dodge.ListDisplayParams
|
||||
import Dodge.Render.List
|
||||
import Dodge.ScreenPos
|
||||
import Geometry.Polygon
|
||||
import Linear
|
||||
import Picture
|
||||
|
||||
drawMenuScreen :: Maybe Int -> ScreenLayer -> Config -> Picture
|
||||
@@ -21,12 +22,12 @@ drawMenuScreen mi = \case
|
||||
LoadingScreen ss t -> drawLoadingScreen ss t
|
||||
|
||||
drawLoadingScreen :: [String] -> BlockStatus -> Config -> Picture
|
||||
drawLoadingScreen s _ cfig =
|
||||
polygon (rectWH (fromIntegral (cfig ^.windowX)) (fromIntegral (cfig ^. windowY))) <>
|
||||
translateScreenPos cfig
|
||||
(ScreenPos (V2 0 0.2) (V2 (-300) (10 * fromIntegral (length s))))
|
||||
(drawList $ map text s -- <> [text $ show t])
|
||||
)
|
||||
drawLoadingScreen s _ cfig =
|
||||
polygon (rectWH (fromIntegral (cfig ^. windowX)) (fromIntegral (cfig ^. windowY)))
|
||||
<> translateScreenPos
|
||||
cfig
|
||||
(ScreenPos (V2 0 0.2) (V2 (-300) (10 * fromIntegral (length s))))
|
||||
(drawList $ map text s)
|
||||
|
||||
drawInputMenu :: String -> Config -> Picture
|
||||
drawInputMenu s cf = darkenBackground cf <> drawTitle cf s
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- generated at 2025-11-23 19:28:30.076047705 UTC
|
||||
-- generated at 2025-12-05 22:38:12.419955631 UTC
|
||||
module Dodge.SoundLogic.ExternallyGeneratedSounds where
|
||||
import Sound.Data
|
||||
soundToVol :: SoundID -> Float
|
||||
@@ -37,119 +37,123 @@ soundToVol v = case _getSoundID v of
|
||||
31 -> 200
|
||||
32 -> 200
|
||||
33 -> 200
|
||||
34 -> 40
|
||||
35 -> 300
|
||||
36 -> 500
|
||||
37 -> 2000
|
||||
38 -> 500
|
||||
39 -> 200
|
||||
40 -> 100
|
||||
41 -> 200
|
||||
42 -> 500
|
||||
43 -> 1000
|
||||
44 -> 200
|
||||
45 -> 100
|
||||
34 -> 100
|
||||
35 -> 40
|
||||
36 -> 300
|
||||
37 -> 500
|
||||
38 -> 2000
|
||||
39 -> 500
|
||||
40 -> 200
|
||||
41 -> 100
|
||||
42 -> 200
|
||||
43 -> 500
|
||||
44 -> 1000
|
||||
45 -> 200
|
||||
46 -> 100
|
||||
47 -> 1000
|
||||
48 -> 200
|
||||
49 -> 1000
|
||||
50 -> 500
|
||||
51 -> 40
|
||||
52 -> 400
|
||||
53 -> 2000
|
||||
54 -> 100
|
||||
55 -> 300
|
||||
56 -> 50
|
||||
57 -> 2000
|
||||
58 -> 50
|
||||
59 -> 500
|
||||
60 -> 1000
|
||||
61 -> 200
|
||||
62 -> 8000
|
||||
63 -> 2000
|
||||
64 -> 2000
|
||||
65 -> 1000
|
||||
66 -> 200
|
||||
47 -> 100
|
||||
48 -> 1000
|
||||
49 -> 200
|
||||
50 -> 1000
|
||||
51 -> 500
|
||||
52 -> 40
|
||||
53 -> 400
|
||||
54 -> 2000
|
||||
55 -> 100
|
||||
56 -> 300
|
||||
57 -> 50
|
||||
58 -> 100
|
||||
59 -> 2000
|
||||
60 -> 50
|
||||
61 -> 50
|
||||
62 -> 500
|
||||
63 -> 1000
|
||||
64 -> 200
|
||||
65 -> 8000
|
||||
66 -> 2000
|
||||
67 -> 2000
|
||||
68 -> 100
|
||||
69 -> 100
|
||||
70 -> 40
|
||||
68 -> 1000
|
||||
69 -> 200
|
||||
70 -> 2000
|
||||
71 -> 100
|
||||
72 -> 40
|
||||
73 -> 2000
|
||||
74 -> 100
|
||||
75 -> 250
|
||||
76 -> 500
|
||||
77 -> 40
|
||||
72 -> 500
|
||||
73 -> 100
|
||||
74 -> 40
|
||||
75 -> 100
|
||||
76 -> 40
|
||||
77 -> 2000
|
||||
78 -> 100
|
||||
79 -> 300
|
||||
80 -> 300
|
||||
81 -> 200
|
||||
79 -> 250
|
||||
80 -> 500
|
||||
81 -> 40
|
||||
82 -> 100
|
||||
83 -> 2000
|
||||
84 -> 1000
|
||||
85 -> 1000
|
||||
86 -> 1000
|
||||
87 -> 100
|
||||
88 -> 100
|
||||
83 -> 300
|
||||
84 -> 300
|
||||
85 -> 200
|
||||
86 -> 100
|
||||
87 -> 2000
|
||||
88 -> 1000
|
||||
89 -> 1000
|
||||
90 -> 1000
|
||||
91 -> 40
|
||||
92 -> 200
|
||||
93 -> 50
|
||||
91 -> 100
|
||||
92 -> 100
|
||||
93 -> 1000
|
||||
94 -> 1000
|
||||
95 -> 500
|
||||
96 -> 500
|
||||
97 -> 100
|
||||
98 -> 100
|
||||
99 -> 200
|
||||
100 -> 1000
|
||||
101 -> 20
|
||||
102 -> 500
|
||||
103 -> 300
|
||||
104 -> 200
|
||||
105 -> 500
|
||||
106 -> 1000
|
||||
107 -> 200
|
||||
108 -> 1000
|
||||
109 -> 2000
|
||||
110 -> 500
|
||||
95 -> 40
|
||||
96 -> 200
|
||||
97 -> 50
|
||||
98 -> 1000
|
||||
99 -> 500
|
||||
100 -> 500
|
||||
101 -> 100
|
||||
102 -> 100
|
||||
103 -> 200
|
||||
104 -> 1000
|
||||
105 -> 20
|
||||
106 -> 500
|
||||
107 -> 300
|
||||
108 -> 200
|
||||
109 -> 500
|
||||
110 -> 1000
|
||||
111 -> 200
|
||||
112 -> 200
|
||||
113 -> 100
|
||||
114 -> 1000
|
||||
115 -> 300
|
||||
116 -> 2000
|
||||
117 -> 2000
|
||||
118 -> 100
|
||||
119 -> 500
|
||||
112 -> 1000
|
||||
113 -> 2000
|
||||
114 -> 500
|
||||
115 -> 200
|
||||
116 -> 200
|
||||
117 -> 100
|
||||
118 -> 1000
|
||||
119 -> 300
|
||||
120 -> 2000
|
||||
121 -> 500
|
||||
121 -> 2000
|
||||
122 -> 100
|
||||
123 -> 300
|
||||
124 -> 1000
|
||||
125 -> 50
|
||||
126 -> 200
|
||||
127 -> 100
|
||||
128 -> 200
|
||||
129 -> 1000
|
||||
130 -> 2000
|
||||
131 -> 200
|
||||
132 -> 1000
|
||||
133 -> 100
|
||||
134 -> 200
|
||||
135 -> 500
|
||||
136 -> 100
|
||||
137 -> 2000
|
||||
123 -> 500
|
||||
124 -> 2000
|
||||
125 -> 500
|
||||
126 -> 100
|
||||
127 -> 300
|
||||
128 -> 1000
|
||||
129 -> 50
|
||||
130 -> 200
|
||||
131 -> 100
|
||||
132 -> 200
|
||||
133 -> 1000
|
||||
134 -> 2000
|
||||
135 -> 200
|
||||
136 -> 1000
|
||||
137 -> 100
|
||||
138 -> 200
|
||||
139 -> 300
|
||||
140 -> 1000
|
||||
139 -> 500
|
||||
140 -> 100
|
||||
141 -> 2000
|
||||
142 -> 2000
|
||||
143 -> 250
|
||||
144 -> 200
|
||||
145 -> 100
|
||||
146 -> 200
|
||||
142 -> 200
|
||||
143 -> 300
|
||||
144 -> 1000
|
||||
145 -> 2000
|
||||
146 -> 2000
|
||||
147 -> 250
|
||||
148 -> 200
|
||||
149 -> 100
|
||||
150 -> 200
|
||||
_ -> 50
|
||||
soundToOnomato :: SoundID -> String
|
||||
soundToOnomato v = case _getSoundID v of
|
||||
@@ -187,119 +191,123 @@ soundToOnomato v = case _getSoundID v of
|
||||
31 -> "WH"
|
||||
32 -> "WH"
|
||||
33 -> "CRAKLE"
|
||||
34 -> "TAP"
|
||||
35 -> "DWAAH"
|
||||
36 -> "PRUM"
|
||||
37 -> "BANGG"
|
||||
38 -> "CRTINK"
|
||||
39 -> "WH"
|
||||
40 -> "PHF"
|
||||
41 -> "CRNCH"
|
||||
42 -> "PLH"
|
||||
43 -> "ZHM"
|
||||
44 -> "TING"
|
||||
45 -> "CLCLH"
|
||||
46 -> "THUD"
|
||||
47 -> "TRWNG"
|
||||
48 -> "TING"
|
||||
49 -> "CRASH"
|
||||
50 -> "CLANG"
|
||||
51 -> "TAPTIP"
|
||||
52 -> "CRNKCRNKCRNK"
|
||||
53 -> "CHUGUGUG"
|
||||
54 -> "SKWLL"
|
||||
55 -> "WRRR"
|
||||
56 -> "HSSS"
|
||||
57 -> "BOOM"
|
||||
58 -> "HSS"
|
||||
59 -> "CLANG"
|
||||
60 -> "TAKH"
|
||||
61 -> "WHH"
|
||||
62 -> "RINGGG"
|
||||
63 -> "CRH"
|
||||
64 -> "UGGAUGGA"
|
||||
65 -> "CRUMPLE"
|
||||
66 -> "TING"
|
||||
67 -> "CREUH"
|
||||
68 -> "KKSQWL"
|
||||
69 -> "SMACK"
|
||||
70 -> "CLICK"
|
||||
71 -> "SPRT"
|
||||
72 -> "TIPTOP"
|
||||
73 -> "CRUH"
|
||||
74 -> "CHNKCHNKCHUNK"
|
||||
75 -> "DMP"
|
||||
76 -> "CLKCLK"
|
||||
77 -> "TIPTAP"
|
||||
78 -> "SKWLCH"
|
||||
79 -> "TNKTNKTNK"
|
||||
80 -> "CHPCHPCHP"
|
||||
81 -> "DING"
|
||||
82 -> "SLP"
|
||||
83 -> "SCREE"
|
||||
84 -> "DHDHL"
|
||||
85 -> "BRAP"
|
||||
86 -> "CRSK"
|
||||
87 -> "SPLRT"
|
||||
88 -> "SKWLL"
|
||||
89 -> "CRNKL"
|
||||
90 -> "TRNKL"
|
||||
91 -> "TAPP"
|
||||
92 -> "DING"
|
||||
93 -> "SHUHP"
|
||||
94 -> "CRUMBL"
|
||||
95 -> "DEDEDUM"
|
||||
96 -> "TAK"
|
||||
97 -> "SPLRT"
|
||||
98 -> "SQLEE"
|
||||
99 -> "DING"
|
||||
100 -> "CRISH"
|
||||
101 -> "SWSH"
|
||||
102 -> "BIPBIPBIP"
|
||||
103 -> "BEP"
|
||||
104 -> "CRSKRL"
|
||||
105 -> "KRTNKL"
|
||||
106 -> "CRSNK"
|
||||
107 -> "SHTCK"
|
||||
108 -> "TTRKL"
|
||||
109 -> "UGGAUGGA"
|
||||
110 -> "DUDURAH"
|
||||
111 -> "TING"
|
||||
112 -> "DING"
|
||||
113 -> "KKSQWL"
|
||||
114 -> "CRMPL"
|
||||
115 -> "BWEP"
|
||||
116 -> "CHUGUGUG"
|
||||
117 -> "BANG"
|
||||
118 -> "SLPP"
|
||||
119 -> "DEDA"
|
||||
120 -> "WHSSH"
|
||||
121 -> "CLANG"
|
||||
122 -> "HNH"
|
||||
123 -> "BWAH"
|
||||
124 -> "CRUNK"
|
||||
125 -> "FHFH"
|
||||
126 -> "SQWLTCH"
|
||||
127 -> "DRR"
|
||||
128 -> "WHH"
|
||||
129 -> "TRNKL"
|
||||
130 -> "BRAP"
|
||||
131 -> "WHR"
|
||||
132 -> "BLPCHCH"
|
||||
133 -> "SKLE"
|
||||
134 -> "ZMM"
|
||||
135 -> "WRRR"
|
||||
136 -> "FWUMP"
|
||||
137 -> "BRAHCHCH"
|
||||
138 -> "TING"
|
||||
139 -> "WHRR"
|
||||
140 -> "BWMP"
|
||||
141 -> "BRPBRPBRP"
|
||||
142 -> "WE-OH"
|
||||
143 -> "WHRHH"
|
||||
144 -> "THCK"
|
||||
145 -> "FHP"
|
||||
146 -> "QWLPH"
|
||||
34 -> "WHUMWHUM"
|
||||
35 -> "TAP"
|
||||
36 -> "DWAAH"
|
||||
37 -> "PRUM"
|
||||
38 -> "BANGG"
|
||||
39 -> "CRTINK"
|
||||
40 -> "WH"
|
||||
41 -> "PHF"
|
||||
42 -> "CRNCH"
|
||||
43 -> "PLH"
|
||||
44 -> "ZHM"
|
||||
45 -> "TING"
|
||||
46 -> "CLCLH"
|
||||
47 -> "THUD"
|
||||
48 -> "TRWNG"
|
||||
49 -> "TING"
|
||||
50 -> "CRASH"
|
||||
51 -> "CLANG"
|
||||
52 -> "TAPTIP"
|
||||
53 -> "CRNKCRNKCRNK"
|
||||
54 -> "CHUGUGUG"
|
||||
55 -> "SKWLL"
|
||||
56 -> "WRRR"
|
||||
57 -> "HSSS"
|
||||
58 -> "VHHP"
|
||||
59 -> "BOOM"
|
||||
60 -> "HSS"
|
||||
61 -> "WHHH"
|
||||
62 -> "CLANG"
|
||||
63 -> "TAKH"
|
||||
64 -> "WHH"
|
||||
65 -> "RINGGG"
|
||||
66 -> "CRH"
|
||||
67 -> "UGGAUGGA"
|
||||
68 -> "CRUMPLE"
|
||||
69 -> "TING"
|
||||
70 -> "CREUH"
|
||||
71 -> "KKSQWL"
|
||||
72 -> "WHUAWUH"
|
||||
73 -> "SMACK"
|
||||
74 -> "CLICK"
|
||||
75 -> "SPRT"
|
||||
76 -> "TIPTOP"
|
||||
77 -> "CRUH"
|
||||
78 -> "CHNKCHNKCHUNK"
|
||||
79 -> "DMP"
|
||||
80 -> "CLKCLK"
|
||||
81 -> "TIPTAP"
|
||||
82 -> "SKWLCH"
|
||||
83 -> "TNKTNKTNK"
|
||||
84 -> "CHPCHPCHP"
|
||||
85 -> "DING"
|
||||
86 -> "SLP"
|
||||
87 -> "SCREE"
|
||||
88 -> "DHDHL"
|
||||
89 -> "BRAP"
|
||||
90 -> "CRSK"
|
||||
91 -> "SPLRT"
|
||||
92 -> "SKWLL"
|
||||
93 -> "CRNKL"
|
||||
94 -> "TRNKL"
|
||||
95 -> "TAPP"
|
||||
96 -> "DING"
|
||||
97 -> "SHUHP"
|
||||
98 -> "CRUMBL"
|
||||
99 -> "DEDEDUM"
|
||||
100 -> "TAK"
|
||||
101 -> "SPLRT"
|
||||
102 -> "SQLEE"
|
||||
103 -> "DING"
|
||||
104 -> "CRISH"
|
||||
105 -> "SWSH"
|
||||
106 -> "BIPBIPBIP"
|
||||
107 -> "BEP"
|
||||
108 -> "CRSKRL"
|
||||
109 -> "KRTNKL"
|
||||
110 -> "CRSNK"
|
||||
111 -> "SHTCK"
|
||||
112 -> "TTRKL"
|
||||
113 -> "UGGAUGGA"
|
||||
114 -> "DUDURAH"
|
||||
115 -> "TING"
|
||||
116 -> "DING"
|
||||
117 -> "KKSQWL"
|
||||
118 -> "CRMPL"
|
||||
119 -> "BWEP"
|
||||
120 -> "CHUGUGUG"
|
||||
121 -> "BANG"
|
||||
122 -> "SLPP"
|
||||
123 -> "DEDA"
|
||||
124 -> "WHSSH"
|
||||
125 -> "CLANG"
|
||||
126 -> "HNH"
|
||||
127 -> "BWAH"
|
||||
128 -> "CRUNK"
|
||||
129 -> "FHFH"
|
||||
130 -> "SQWLTCH"
|
||||
131 -> "DRR"
|
||||
132 -> "WHH"
|
||||
133 -> "TRNKL"
|
||||
134 -> "BRAP"
|
||||
135 -> "WHR"
|
||||
136 -> "BLPCHCH"
|
||||
137 -> "SKLE"
|
||||
138 -> "ZMM"
|
||||
139 -> "WRRR"
|
||||
140 -> "FWUMP"
|
||||
141 -> "BRAHCHCH"
|
||||
142 -> "TING"
|
||||
143 -> "WHRR"
|
||||
144 -> "BWMP"
|
||||
145 -> "BRPBRPBRP"
|
||||
146 -> "WE-OH"
|
||||
147 -> "WHRHH"
|
||||
148 -> "THCK"
|
||||
149 -> "FHP"
|
||||
150 -> "QWLPH"
|
||||
_ -> error "unitialised sound"
|
||||
soundPathList :: [String]
|
||||
soundPathList =
|
||||
@@ -337,6 +345,7 @@ soundPathList =
|
||||
, "whirdownShort2.WH.200.wav"
|
||||
, "whirdownShort4.WH.200.wav"
|
||||
, "elecCrackle.CRAKLE.200.wav"
|
||||
, "throbC4.WHUMWHUM.100.wav"
|
||||
, "foot2.TAP.40.wav"
|
||||
, "skwareFadeTwoSec.DWAAH.300.wav"
|
||||
, "insertOne.PRUM.500.wav"
|
||||
@@ -360,8 +369,10 @@ soundPathList =
|
||||
, "blood4.SKWLL.100.wav"
|
||||
, "fireFade.WRRR.300.wav"
|
||||
, "foamSprayLoop.HSSS.50.wav"
|
||||
, "reverseCymbal1.VHHP.100.wav"
|
||||
, "explosion.BOOM.2000.wav"
|
||||
, "foamSprayFadeOut.HSS.50.wav"
|
||||
, "backgroundSpace.WHHH.50.wav"
|
||||
, "clang1.CLANG.500.wav"
|
||||
, "tap2.TAKH.1000.wav"
|
||||
, "whirdown3.WHH.200.wav"
|
||||
@@ -372,6 +383,7 @@ soundPathList =
|
||||
, "ting.TING.200.wav"
|
||||
, "seagullCry2.CREUH.2000.wav"
|
||||
, "bloodShort3.KKSQWL.100.wav"
|
||||
, "warp1.WHUAWUH.500.wav"
|
||||
, "hit1.SMACK.100.wav"
|
||||
, "click1.CLICK.40.wav"
|
||||
, "bloodShort2.SPRT.100.wav"
|
||||
@@ -519,229 +531,237 @@ whirdownShort4S :: SoundID
|
||||
whirdownShort4S = SoundID 32
|
||||
elecCrackleS :: SoundID
|
||||
elecCrackleS = SoundID 33
|
||||
throbC4S :: SoundID
|
||||
throbC4S = SoundID 34
|
||||
foot2S :: SoundID
|
||||
foot2S = SoundID 34
|
||||
foot2S = SoundID 35
|
||||
skwareFadeTwoSecS :: SoundID
|
||||
skwareFadeTwoSecS = SoundID 35
|
||||
skwareFadeTwoSecS = SoundID 36
|
||||
insertOneS :: SoundID
|
||||
insertOneS = SoundID 36
|
||||
insertOneS = SoundID 37
|
||||
bangEchoS :: SoundID
|
||||
bangEchoS = SoundID 37
|
||||
bangEchoS = SoundID 38
|
||||
smallGlass3S :: SoundID
|
||||
smallGlass3S = SoundID 38
|
||||
smallGlass3S = SoundID 39
|
||||
whirdownShort3S :: SoundID
|
||||
whirdownShort3S = SoundID 39
|
||||
whirdownShort3S = SoundID 40
|
||||
whiteNoiseFadeOutS :: SoundID
|
||||
whiteNoiseFadeOutS = SoundID 40
|
||||
whiteNoiseFadeOutS = SoundID 41
|
||||
gut2S :: SoundID
|
||||
gut2S = SoundID 41
|
||||
gut2S = SoundID 42
|
||||
lasPulseS :: SoundID
|
||||
lasPulseS = SoundID 42
|
||||
lasPulseS = SoundID 43
|
||||
teleS :: SoundID
|
||||
teleS = SoundID 43
|
||||
teleS = SoundID 44
|
||||
ting2S :: SoundID
|
||||
ting2S = SoundID 44
|
||||
ting2S = SoundID 45
|
||||
blood5S :: SoundID
|
||||
blood5S = SoundID 45
|
||||
blood5S = SoundID 46
|
||||
hitS :: SoundID
|
||||
hitS = SoundID 46
|
||||
hitS = SoundID 47
|
||||
metal7S :: SoundID
|
||||
metal7S = SoundID 47
|
||||
metal7S = SoundID 48
|
||||
ting4S :: SoundID
|
||||
ting4S = SoundID 48
|
||||
ting4S = SoundID 49
|
||||
stone1S :: SoundID
|
||||
stone1S = SoundID 49
|
||||
stone1S = SoundID 50
|
||||
clangS :: SoundID
|
||||
clangS = SoundID 50
|
||||
clangS = SoundID 51
|
||||
twoStep1S :: SoundID
|
||||
twoStep1S = SoundID 51
|
||||
twoStep1S = SoundID 52
|
||||
wrench1S :: SoundID
|
||||
wrench1S = SoundID 52
|
||||
wrench1S = SoundID 53
|
||||
seagullChatterS :: SoundID
|
||||
seagullChatterS = SoundID 53
|
||||
seagullChatterS = SoundID 54
|
||||
blood4S :: SoundID
|
||||
blood4S = SoundID 54
|
||||
blood4S = SoundID 55
|
||||
fireFadeS :: SoundID
|
||||
fireFadeS = SoundID 55
|
||||
fireFadeS = SoundID 56
|
||||
foamSprayLoopS :: SoundID
|
||||
foamSprayLoopS = SoundID 56
|
||||
foamSprayLoopS = SoundID 57
|
||||
reverseCymbal1S :: SoundID
|
||||
reverseCymbal1S = SoundID 58
|
||||
explosionS :: SoundID
|
||||
explosionS = SoundID 57
|
||||
explosionS = SoundID 59
|
||||
foamSprayFadeOutS :: SoundID
|
||||
foamSprayFadeOutS = SoundID 58
|
||||
foamSprayFadeOutS = SoundID 60
|
||||
backgroundSpaceS :: SoundID
|
||||
backgroundSpaceS = SoundID 61
|
||||
clang1S :: SoundID
|
||||
clang1S = SoundID 59
|
||||
clang1S = SoundID 62
|
||||
tap2S :: SoundID
|
||||
tap2S = SoundID 60
|
||||
tap2S = SoundID 63
|
||||
whirdown3S :: SoundID
|
||||
whirdown3S = SoundID 61
|
||||
whirdown3S = SoundID 64
|
||||
tinitusS :: SoundID
|
||||
tinitusS = SoundID 62
|
||||
tinitusS = SoundID 65
|
||||
seagullCry1S :: SoundID
|
||||
seagullCry1S = SoundID 63
|
||||
seagullCry1S = SoundID 66
|
||||
seagullBarkS :: SoundID
|
||||
seagullBarkS = SoundID 64
|
||||
seagullBarkS = SoundID 67
|
||||
stone3S :: SoundID
|
||||
stone3S = SoundID 65
|
||||
stone3S = SoundID 68
|
||||
tingS :: SoundID
|
||||
tingS = SoundID 66
|
||||
tingS = SoundID 69
|
||||
seagullCry2S :: SoundID
|
||||
seagullCry2S = SoundID 67
|
||||
seagullCry2S = SoundID 70
|
||||
bloodShort3S :: SoundID
|
||||
bloodShort3S = SoundID 68
|
||||
bloodShort3S = SoundID 71
|
||||
warp1S :: SoundID
|
||||
warp1S = SoundID 72
|
||||
hit1S :: SoundID
|
||||
hit1S = SoundID 69
|
||||
hit1S = SoundID 73
|
||||
click1S :: SoundID
|
||||
click1S = SoundID 70
|
||||
click1S = SoundID 74
|
||||
bloodShort2S :: SoundID
|
||||
bloodShort2S = SoundID 71
|
||||
bloodShort2S = SoundID 75
|
||||
twoStepSlowS :: SoundID
|
||||
twoStepSlowS = SoundID 72
|
||||
twoStepSlowS = SoundID 76
|
||||
seagullCryS :: SoundID
|
||||
seagullCryS = SoundID 73
|
||||
seagullCryS = SoundID 77
|
||||
crankSlowS :: SoundID
|
||||
crankSlowS = SoundID 74
|
||||
crankSlowS = SoundID 78
|
||||
energyReleaseS :: SoundID
|
||||
energyReleaseS = SoundID 75
|
||||
energyReleaseS = SoundID 79
|
||||
primeS :: SoundID
|
||||
primeS = SoundID 76
|
||||
primeS = SoundID 80
|
||||
twoStepS :: SoundID
|
||||
twoStepS = SoundID 77
|
||||
twoStepS = SoundID 81
|
||||
bloodShort8S :: SoundID
|
||||
bloodShort8S = SoundID 78
|
||||
bloodShort8S = SoundID 82
|
||||
reloadS :: SoundID
|
||||
reloadS = SoundID 79
|
||||
reloadS = SoundID 83
|
||||
reload1S :: SoundID
|
||||
reload1S = SoundID 80
|
||||
reload1S = SoundID 84
|
||||
marimbaC5S :: SoundID
|
||||
marimbaC5S = SoundID 81
|
||||
marimbaC5S = SoundID 85
|
||||
slapS :: SoundID
|
||||
slapS = SoundID 82
|
||||
slapS = SoundID 86
|
||||
tone440sawtoothS :: SoundID
|
||||
tone440sawtoothS = SoundID 83
|
||||
tone440sawtoothS = SoundID 87
|
||||
metal3S :: SoundID
|
||||
metal3S = SoundID 84
|
||||
metal3S = SoundID 88
|
||||
tap3S :: SoundID
|
||||
tap3S = SoundID 85
|
||||
tap3S = SoundID 89
|
||||
glassShat4S :: SoundID
|
||||
glassShat4S = SoundID 86
|
||||
glassShat4S = SoundID 90
|
||||
bloodShort1S :: SoundID
|
||||
bloodShort1S = SoundID 87
|
||||
bloodShort1S = SoundID 91
|
||||
bloodShort4S :: SoundID
|
||||
bloodShort4S = SoundID 88
|
||||
bloodShort4S = SoundID 92
|
||||
glassShat2S :: SoundID
|
||||
glassShat2S = SoundID 89
|
||||
glassShat2S = SoundID 93
|
||||
metal1S :: SoundID
|
||||
metal1S = SoundID 90
|
||||
metal1S = SoundID 94
|
||||
foot3S :: SoundID
|
||||
foot3S = SoundID 91
|
||||
foot3S = SoundID 95
|
||||
marimbaG5S :: SoundID
|
||||
marimbaG5S = SoundID 92
|
||||
marimbaG5S = SoundID 96
|
||||
pickUpS :: SoundID
|
||||
pickUpS = SoundID 93
|
||||
pickUpS = SoundID 97
|
||||
stone5S :: SoundID
|
||||
stone5S = SoundID 94
|
||||
stone5S = SoundID 98
|
||||
dededumS :: SoundID
|
||||
dededumS = SoundID 95
|
||||
dededumS = SoundID 99
|
||||
tap1S :: SoundID
|
||||
tap1S = SoundID 96
|
||||
tap1S = SoundID 100
|
||||
blood1S :: SoundID
|
||||
blood1S = SoundID 97
|
||||
blood1S = SoundID 101
|
||||
bloodShort7S :: SoundID
|
||||
bloodShort7S = SoundID 98
|
||||
bloodShort7S = SoundID 102
|
||||
marimbaB6S :: SoundID
|
||||
marimbaB6S = SoundID 99
|
||||
marimbaB6S = SoundID 103
|
||||
metal4S :: SoundID
|
||||
metal4S = SoundID 100
|
||||
metal4S = SoundID 104
|
||||
knifeS :: SoundID
|
||||
knifeS = SoundID 101
|
||||
knifeS = SoundID 105
|
||||
computerBeepingS :: SoundID
|
||||
computerBeepingS = SoundID 102
|
||||
computerBeepingS = SoundID 106
|
||||
tone440S :: SoundID
|
||||
tone440S = SoundID 103
|
||||
tone440S = SoundID 107
|
||||
gut6S :: SoundID
|
||||
gut6S = SoundID 104
|
||||
gut6S = SoundID 108
|
||||
smallGlass2S :: SoundID
|
||||
smallGlass2S = SoundID 105
|
||||
smallGlass2S = SoundID 109
|
||||
glassShat1S :: SoundID
|
||||
glassShat1S = SoundID 106
|
||||
glassShat1S = SoundID 110
|
||||
disconnectItemS :: SoundID
|
||||
disconnectItemS = SoundID 107
|
||||
disconnectItemS = SoundID 111
|
||||
metal5S :: SoundID
|
||||
metal5S = SoundID 108
|
||||
metal5S = SoundID 112
|
||||
seagullBarkTransformedS :: SoundID
|
||||
seagullBarkTransformedS = SoundID 109
|
||||
seagullBarkTransformedS = SoundID 113
|
||||
ejectS :: SoundID
|
||||
ejectS = SoundID 110
|
||||
ejectS = SoundID 114
|
||||
ting3S :: SoundID
|
||||
ting3S = SoundID 111
|
||||
ting3S = SoundID 115
|
||||
marimbaE5S :: SoundID
|
||||
marimbaE5S = SoundID 112
|
||||
marimbaE5S = SoundID 116
|
||||
blood3S :: SoundID
|
||||
blood3S = SoundID 113
|
||||
blood3S = SoundID 117
|
||||
stone2S :: SoundID
|
||||
stone2S = SoundID 114
|
||||
stone2S = SoundID 118
|
||||
tone440raiseS :: SoundID
|
||||
tone440raiseS = SoundID 115
|
||||
tone440raiseS = SoundID 119
|
||||
seagullChatter1S :: SoundID
|
||||
seagullChatter1S = SoundID 116
|
||||
seagullChatter1S = SoundID 120
|
||||
bangS :: SoundID
|
||||
bangS = SoundID 117
|
||||
bangS = SoundID 121
|
||||
slap1S :: SoundID
|
||||
slap1S = SoundID 118
|
||||
slap1S = SoundID 122
|
||||
dedaS :: SoundID
|
||||
dedaS = SoundID 119
|
||||
dedaS = SoundID 123
|
||||
missileLaunchS :: SoundID
|
||||
missileLaunchS = SoundID 120
|
||||
missileLaunchS = SoundID 124
|
||||
clang2S :: SoundID
|
||||
clang2S = SoundID 121
|
||||
clang2S = SoundID 125
|
||||
gruntS :: SoundID
|
||||
gruntS = SoundID 122
|
||||
gruntS = SoundID 126
|
||||
sineRaisePitchOneSecS :: SoundID
|
||||
sineRaisePitchOneSecS = SoundID 123
|
||||
sineRaisePitchOneSecS = SoundID 127
|
||||
metal2S :: SoundID
|
||||
metal2S = SoundID 124
|
||||
metal2S = SoundID 128
|
||||
debrisS :: SoundID
|
||||
debrisS = SoundID 125
|
||||
debrisS = SoundID 129
|
||||
gut5S :: SoundID
|
||||
gut5S = SoundID 126
|
||||
gut5S = SoundID 130
|
||||
slideDoorS :: SoundID
|
||||
slideDoorS = SoundID 127
|
||||
slideDoorS = SoundID 131
|
||||
whirdown2S :: SoundID
|
||||
whirdown2S = SoundID 128
|
||||
whirdown2S = SoundID 132
|
||||
metal6S :: SoundID
|
||||
metal6S = SoundID 129
|
||||
metal6S = SoundID 133
|
||||
autoGunS :: SoundID
|
||||
autoGunS = SoundID 130
|
||||
autoGunS = SoundID 134
|
||||
whirdownSmall1S :: SoundID
|
||||
whirdownSmall1S = SoundID 131
|
||||
whirdownSmall1S = SoundID 135
|
||||
oldMachineBootS :: SoundID
|
||||
oldMachineBootS = SoundID 132
|
||||
oldMachineBootS = SoundID 136
|
||||
blood6S :: SoundID
|
||||
blood6S = SoundID 133
|
||||
blood6S = SoundID 137
|
||||
buzzS :: SoundID
|
||||
buzzS = SoundID 134
|
||||
buzzS = SoundID 138
|
||||
fireLoudS :: SoundID
|
||||
fireLoudS = SoundID 135
|
||||
fireLoudS = SoundID 139
|
||||
tap4S :: SoundID
|
||||
tap4S = SoundID 136
|
||||
tap4S = SoundID 140
|
||||
shotgunS :: SoundID
|
||||
shotgunS = SoundID 137
|
||||
shotgunS = SoundID 141
|
||||
ting5S :: SoundID
|
||||
ting5S = SoundID 138
|
||||
ting5S = SoundID 142
|
||||
whirS :: SoundID
|
||||
whirS = SoundID 139
|
||||
whirS = SoundID 143
|
||||
sawtoothFailS :: SoundID
|
||||
sawtoothFailS = SoundID 140
|
||||
sawtoothFailS = SoundID 144
|
||||
miniS :: SoundID
|
||||
miniS = SoundID 141
|
||||
miniS = SoundID 145
|
||||
seagullWhistleS :: SoundID
|
||||
seagullWhistleS = SoundID 142
|
||||
seagullWhistleS = SoundID 146
|
||||
whirdownS :: SoundID
|
||||
whirdownS = SoundID 143
|
||||
whirdownS = SoundID 147
|
||||
connectItemS :: SoundID
|
||||
connectItemS = SoundID 144
|
||||
connectItemS = SoundID 148
|
||||
whiteNoiseFadeInS :: SoundID
|
||||
whiteNoiseFadeInS = SoundID 145
|
||||
whiteNoiseFadeInS = SoundID 149
|
||||
gut1S :: SoundID
|
||||
gut1S = SoundID 146
|
||||
gut1S = SoundID 150
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
module Dodge.SoundSelection (newSoundsToPlay) where
|
||||
|
||||
import Sound.Data
|
||||
import Dodge.Data.Universe
|
||||
import qualified Data.Map.Strict as M
|
||||
import Control.Lens
|
||||
|
||||
newSoundsToPlay :: Universe -> M.Map SoundOrigin Sound
|
||||
newSoundsToPlay u = case u ^. uvWorld . wSoundFilter of
|
||||
NoSoundFilter -> u ^. uvWorld . toPlaySounds
|
||||
FilterBySoundOrigin ks -> (u ^. uvWorld . toPlaySounds) `M.restrictKeys` ks
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
module Dodge.SpawnAt (respawn) where
|
||||
|
||||
import qualified Data.Set as S
|
||||
import LensHelp
|
||||
import Dodge.SoundLogic
|
||||
import Linear
|
||||
--import Dodge.SoundLogic.ExternallyGeneratedSounds
|
||||
import Dodge.Creature
|
||||
import Geometry.Data
|
||||
import Dodge.Data.World
|
||||
import Control.Lens
|
||||
--import Control.Applicative
|
||||
--import Linear.V3
|
||||
|
||||
respawn :: World -> World
|
||||
respawn w = w & uncurry spawnAt (w ^. cWorld . lWorld . respawnPos)
|
||||
@@ -15,8 +14,13 @@ respawn w = w & uncurry spawnAt (w ^. cWorld . lWorld . respawnPos)
|
||||
spawnAt :: Point2 -> Float -> World -> World
|
||||
spawnAt p d w = w
|
||||
& wCam . camZoom .~ 1000
|
||||
& wSoundFilter .~ FilterBySoundOrigin (S.singleton SpawnSound)
|
||||
-- & cWorld . lWorld . creatures . at 0 %~ (fmap f . (<|> Just startCr))
|
||||
& cWorld . lWorld . creatures . at 0 ?~ f startCr
|
||||
& cWorld . lWorld . delayedEvents <>~
|
||||
[ (0,SoundStart SpawnSound 0 reverseCymbal1S Nothing)
|
||||
, (10,WdWdSetSoundFilter NoSoundFilter)
|
||||
]
|
||||
-- & cWorld . lWorld . worldEvents <>~
|
||||
---- SoundStart BackgroundSound p foamSprayFadeOutS Nothing :
|
||||
-- [MakeStartCloudAt (V3 x y 20 & _xy +~ p) | x <- [-5, -4 .. 5], y <- [-5, -4 .. 5]]
|
||||
|
||||
@@ -37,6 +37,7 @@ doWdWd we = case we of
|
||||
TorqueCr x cid -> torqueCr x cid
|
||||
SoundStart so p sid mi -> soundStart so p sid mi
|
||||
WdWdNegateTrig trid -> cWorld . lWorld . triggers . ix trid %~ not
|
||||
WdWdSetSoundFilter x -> wSoundFilter .~ x
|
||||
-- WdWdFromItCrixWdWd it crid f -> \w -> fromMaybe w $ do
|
||||
-- cr <- w ^? cWorld . lWorld . creatures . ix crid
|
||||
-- return $ doItCrWdWd f it cr w
|
||||
|
||||
@@ -8,7 +8,6 @@ module Dodge.WorldEvent.Explosion (
|
||||
makeTeslaExplosionAt,
|
||||
) where
|
||||
|
||||
import Linear
|
||||
import Control.Monad
|
||||
import Data.List
|
||||
import Dodge.Data.World
|
||||
@@ -18,6 +17,7 @@ import Dodge.WorldEvent.Shockwave
|
||||
import Dodge.WorldEvent.SpawnParticle
|
||||
import Geometry
|
||||
import LensHelp
|
||||
import Linear
|
||||
import Picture
|
||||
import RandomHelp
|
||||
|
||||
@@ -70,12 +70,11 @@ makeExplosionAt p vel w =
|
||||
w
|
||||
& soundStart (Explosion (w ^. cWorld . lWorld . lClock)) (p ^. _xy) bangS Nothing
|
||||
& addFlames
|
||||
& cWorld . lWorld . worldEvents
|
||||
.:~ MakeTempLight (LSParam p 150 (V3 1 0.5 0)) 20
|
||||
& cWorld . lWorld . worldEvents .:~ MakeTempLight (LSParam p 150 (V3 1 0.5 0)) 20
|
||||
& makeShockwaveAt [] p 50 100 1 white
|
||||
where
|
||||
fVs = fmap (`v2z` 0) $ replicateM 100 (randInCirc 8) & evalState $ _randGen w
|
||||
fdamps = replicateM 100 (state $ randomR (0,1)) & evalState $ _randGen w
|
||||
fdamps = replicateM 100 (state $ randomR (0, 1)) & evalState $ _randGen w
|
||||
sizes = randomRs (2, 9) $ _randGen w
|
||||
times = randomRs (15, 20) $ _randGen w
|
||||
mF v damp size time = makeFlamelet p (v + damp *^ vel) size time
|
||||
|
||||
+2
-1
@@ -91,7 +91,8 @@ tryPlay sd s = do
|
||||
& soundChannel ?~ i
|
||||
& soundStatus . playStatus .~ JustStartedPlaying
|
||||
where
|
||||
timesToPlay | _soundIsLooping (_soundStatus s) = Mix.Forever
|
||||
timesToPlay
|
||||
| _soundIsLooping (_soundStatus s) = Mix.Forever
|
||||
| otherwise = Mix.Once
|
||||
|
||||
tryGetChannel :: Sound -> MaybeT IO Mix.Channel
|
||||
|
||||
Reference in New Issue
Block a user