Add in "linear" lWorld to separate time reversable worlds

This commit is contained in:
2022-10-28 12:24:51 +01:00
parent 5f6bd43599
commit 7e790b7153
130 changed files with 827 additions and 980 deletions
+6 -6
View File
@@ -186,7 +186,7 @@ getSensor f tm w =
maybe
[]
(makeTermPara . map toUpper . show . f)
(w ^? cWorld . machines . ix (_tmMachineID tm) . mcType . _McSensor)
(w ^? cWorld . lWorld . machines . ix (_tmMachineID tm) . mcType . _McSensor)
toggleCommand :: TerminalCommand
toggleCommand =
@@ -212,14 +212,14 @@ sensorCommand =
disconnectTerminal :: Terminal -> World -> World
disconnectTerminal tm w =
w
& cWorld . terminals . ix (_tmID tm) . tmStatus .~ TerminalOff
& cWorld . lWorld . terminals . ix (_tmID tm) . tmStatus .~ TerminalOff
& exitTerminalSubInv
& cWorld . terminals . ix (_tmID tm) . tmFutureLines
& cWorld . lWorld . terminals . ix (_tmID tm) . tmFutureLines
.~ [TerminalLineTerminalEffect 0 TmTmClearDisplayedLines]
exitTerminalSubInv :: World -> World
exitTerminalSubInv w = case w ^? cWorld . hud . hudElement . subInventory . termID of
Just _ -> w & cWorld . hud . hudElement . subInventory .~ NoSubInventory
exitTerminalSubInv w = case w ^? cWorld . lWorld . hud . hudElement . subInventory . termID of
Just _ -> w & cWorld . lWorld . hud . hudElement . subInventory .~ NoSubInventory
_ -> w
damageCodeCommand :: TerminalCommand
@@ -233,7 +233,7 @@ damageCodeCommand =
infoClearInput :: Terminal -> [TerminalLine] -> World -> World
infoClearInput tm tls =
cWorld . terminals . ix (_tmID tm)
cWorld . lWorld . terminals . ix (_tmID tm)
%~ ( (tmInput .~ TerminalInput T.empty True (0, 0))
. (tmFutureLines ++.~ tls)
)