Simplify and improve distributer
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user