Move towards simplifying terminal lines/effects

This commit is contained in:
2025-08-15 11:55:56 +01:00
parent 91d19e7c42
commit 56f4670493
12 changed files with 175 additions and 145 deletions
+11
View File
@@ -6,6 +6,7 @@ module Dodge.WorldEffect (
) where
--import Dodge.DoubleTree
import Dodge.Data.Terminal.Status
import Dodge.Item.Grammar
import Dodge.Creature.Impulse.UseItem
import Dodge.BlBl
@@ -59,6 +60,7 @@ accessTerminal mtmid w = fromMaybe w $ do
tryToBoot tm = case _tmStatus tm of
TerminalTextInput {} -> tm
TerminalBusy -> tm
TerminalPressTo {} -> tm
TerminalOff ->
tm
& tmFutureLines .~ _tmBootLines tm
@@ -93,6 +95,15 @@ doDeathToggle (TerminalToggle trid f) = ix trid %~ doBlBl f
doTmWdWd :: TmWdWd -> Terminal -> World -> World
doTmWdWd tmwdwd = case tmwdwd of
TmTmClearDisplayedLines -> \tm -> fromMaybe id $ do
tid <- tm ^? tmID
return $ cWorld . lWorld . terminals . ix tid . tmDisplayedLines .~ []
TmTmSetStatus x -> \tm -> fromMaybe id $ do
tid <- tm ^? tmID
return $ cWorld . lWorld . terminals . ix tid . tmStatus .~ x
TmTmSetPartialCommand x -> \tm -> fromMaybe id $ do
tid <- tm ^? tmID
return $ cWorld . lWorld . terminals . ix tid . tmPartialCommand .~ x
TmWdId -> const id
TmWdWdDisconnectTerminal -> disconnectTerminal
TmWdWdTermSound sid -> \tm w ->