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
+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"