Simplify and improve distributer

This commit is contained in:
2025-12-31 13:31:08 +00:00
parent fa07f989c2
commit 5b5a12be6e
7 changed files with 372 additions and 350 deletions
Binary file not shown.
+1
View File
@@ -28,6 +28,7 @@ data Terminal = Terminal
, _tmStatus :: TerminalStatus
, _tmCommandHistory :: [String]
, _tmToggles :: M.Map String TerminalToggle
, _tmRebootOnAccess :: Bool
}
data TerminalLineString = TerminalLineConst String Color
+1
View File
@@ -19,6 +19,7 @@ defaultTerminal =
, _tmStatus = TerminalOff
, _tmCommandHistory = []
, _tmToggles = mempty
, _tmRebootOnAccess = False
-- , _tmExternalColor = dark magenta
}
+3 -1
View File
@@ -428,7 +428,9 @@ distributerRoom atype aamount = do
store = sps (unusedOffPathAwayFromLink 50)
(PutMachine (reverse $ polyCirc 4 20) mcstore Nothing) & plExternalID ?~ i
dst gw = let mj = gw ^? genPmnt . ix i . plMID . _Just
in putTerminal (mcdist mj) (defaultTerminal & tmBootLines .~ tmDistributeLines)
in putTerminal (mcdist mj) (defaultTerminal & tmBootLines .~ tmDistributeLines
& tmRebootOnAccess .~ True
)
& plSpot .~ unusedOffPathAwayFromLink 50
& plExternalID ?~ i1
thepipe gw =
@@ -1,4 +1,4 @@
-- generated at 2025-12-31 13:02:57.083459577 UTC
-- generated at 2025-12-31 13:24:22.332967514 UTC
module Dodge.SoundLogic.ExternallyGeneratedSounds where
import Sound.Data
soundToVol :: SoundID -> Float
@@ -143,32 +143,33 @@ soundToVol v = case _getSoundID v of
137 -> 300
138 -> 100
139 -> 300
140 -> 100
140 -> 300
141 -> 100
142 -> 500
143 -> 100
142 -> 100
143 -> 500
144 -> 100
145 -> 500
146 -> 100
145 -> 100
146 -> 500
147 -> 100
148 -> 500
149 -> 40
150 -> 200
151 -> 50
152 -> 500
153 -> 2000
148 -> 100
149 -> 500
150 -> 40
151 -> 200
152 -> 50
153 -> 500
154 -> 2000
155 -> 40
156 -> 100
155 -> 2000
156 -> 40
157 -> 100
158 -> 500
159 -> 100
160 -> 1000
161 -> 100
162 -> 500
163 -> 8000
164 -> 200
165 -> 300
158 -> 100
159 -> 500
160 -> 100
161 -> 1000
162 -> 100
163 -> 500
164 -> 8000
165 -> 200
166 -> 300
_ -> 50
soundToOnomato :: SoundID -> String
soundToOnomato v = case _getSoundID v of
@@ -312,32 +313,33 @@ soundToOnomato v = case _getSoundID v of
137 -> "BWAAH"
138 -> "SLP"
139 -> "DWAAH"
140 -> "VFVFVF"
141 -> "SLP"
142 -> "CRTINK"
143 -> "VHHP"
144 -> "SPRT"
145 -> "PRUM"
146 -> "SLPP"
147 -> "FWUMP"
148 -> "CLANG"
149 -> "TIP"
150 -> "CRAKLE"
151 -> "HSSS"
152 -> "TRINKL"
153 -> "BANG"
154 -> "CHUGUGUG"
155 -> "TAPP"
156 -> "KKSQWL"
157 -> "SKWLL"
158 -> "DUDURAH"
159 -> "SKWLL"
160 -> "TRNKL"
161 -> "SLP"
162 -> "WHUAWUH"
163 -> "RINGGG"
164 -> "QWLPH"
165 -> "WRRR"
140 -> "TNKTONK"
141 -> "VFVFVF"
142 -> "SLP"
143 -> "CRTINK"
144 -> "VHHP"
145 -> "SPRT"
146 -> "PRUM"
147 -> "SLPP"
148 -> "FWUMP"
149 -> "CLANG"
150 -> "TIP"
151 -> "CRAKLE"
152 -> "HSSS"
153 -> "TRINKL"
154 -> "BANG"
155 -> "CHUGUGUG"
156 -> "TAPP"
157 -> "KKSQWL"
158 -> "SKWLL"
159 -> "DUDURAH"
160 -> "SKWLL"
161 -> "TRNKL"
162 -> "SLP"
163 -> "WHUAWUH"
164 -> "RINGGG"
165 -> "QWLPH"
166 -> "WRRR"
_ -> error "unitialised sound"
soundPathList :: [String]
soundPathList =
@@ -481,6 +483,7 @@ soundPathList =
, "sineRaisePitchTwoSec.BWAAH.300.wav"
, "slap4.SLP.100.wav"
, "skwareFadeTwoSec.DWAAH.300.wav"
, "reloadFail.TNKTONK.300.wav"
, "throb1.VFVFVF.100.wav"
, "slap5.SLP.100.wav"
, "smallGlass3.CRTINK.500.wav"
@@ -788,55 +791,57 @@ slap4S :: SoundID
slap4S = SoundID 138
skwareFadeTwoSecS :: SoundID
skwareFadeTwoSecS = SoundID 139
reloadFailS :: SoundID
reloadFailS = SoundID 140
throb1S :: SoundID
throb1S = SoundID 140
throb1S = SoundID 141
slap5S :: SoundID
slap5S = SoundID 141
slap5S = SoundID 142
smallGlass3S :: SoundID
smallGlass3S = SoundID 142
smallGlass3S = SoundID 143
reverseCymbal1S :: SoundID
reverseCymbal1S = SoundID 143
reverseCymbal1S = SoundID 144
blood2S :: SoundID
blood2S = SoundID 144
blood2S = SoundID 145
insertOneS :: SoundID
insertOneS = SoundID 145
insertOneS = SoundID 146
slap1S :: SoundID
slap1S = SoundID 146
slap1S = SoundID 147
tap4S :: SoundID
tap4S = SoundID 147
tap4S = SoundID 148
clang1S :: SoundID
clang1S = SoundID 148
clang1S = SoundID 149
foot1S :: SoundID
foot1S = SoundID 149
foot1S = SoundID 150
elecCrackleS :: SoundID
elecCrackleS = SoundID 150
elecCrackleS = SoundID 151
foamSprayLoopS :: SoundID
foamSprayLoopS = SoundID 151
foamSprayLoopS = SoundID 152
smallGlass1S :: SoundID
smallGlass1S = SoundID 152
smallGlass1S = SoundID 153
bangS :: SoundID
bangS = SoundID 153
bangS = SoundID 154
seagullChatterS :: SoundID
seagullChatterS = SoundID 154
seagullChatterS = SoundID 155
foot3S :: SoundID
foot3S = SoundID 155
foot3S = SoundID 156
bloodShort3S :: SoundID
bloodShort3S = SoundID 156
bloodShort3S = SoundID 157
blood4S :: SoundID
blood4S = SoundID 157
blood4S = SoundID 158
ejectS :: SoundID
ejectS = SoundID 158
ejectS = SoundID 159
bloodShort4S :: SoundID
bloodShort4S = SoundID 159
bloodShort4S = SoundID 160
metal1S :: SoundID
metal1S = SoundID 160
metal1S = SoundID 161
slapClean5S :: SoundID
slapClean5S = SoundID 161
slapClean5S = SoundID 162
warp1S :: SoundID
warp1S = SoundID 162
warp1S = SoundID 163
tinitusS :: SoundID
tinitusS = SoundID 163
tinitusS = SoundID 164
gut1S :: SoundID
gut1S = SoundID 164
gut1S = SoundID 165
fireFadeS :: SoundID
fireFadeS = SoundID 165
fireFadeS = SoundID 166
+6 -3
View File
@@ -72,6 +72,9 @@ accessTerminal tid w = fromMaybe w $ do
& cWorld . lWorld . terminals . ix tid %~ tryToBoot
where
tryToBoot tm = case _tmStatus tm of
_ | tm ^. tmRebootOnAccess -> tm
& tmFutureLines .~ _tmBootLines tm
& tmStatus .~ TerminalLineRead
TerminalTextInput{} -> tm
TerminalLineRead -> tm
TerminalPressTo{} -> tm
@@ -127,12 +130,12 @@ tmDistributeAmmo tm w = fromMaybe w $ do
[TLine 1 [TerminalLineConst (g (aamount - newaamount)) white] TmWdId
,TLine 1 [TerminalLineConst (shortShow newaamount <>" "<>show atype<>" AVAILABLE") white] TmWdId
,TLine 1 [] (TmWdWdTermSound (getsid (aamount - newaamount)))
,TLine 1 [TerminalLineConst "" yellow] (TmTmSetStatus (TerminalPressTo ""))
,TLine 1 [TerminalLineConst "" white] TmWdWdPowerDownTerminal
-- ,TLine 1 [TerminalLineConst "" yellow] (TmTmSetStatus (TerminalPressTo ""))
-- ,TLine 1 [TerminalLineConst "" white] (TmWdWdLeaveTerminal "")
]
where
getsid x | x > 0 = reloadS
| otherwise = dedumS
| otherwise = reloadFailS
g 0 = "NO SUITABLE RECIPIENTS"
g _ = "SUCCESFUL"
+282 -272
View File
File diff suppressed because it is too large Load Diff