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