Move towards simplifying terminal lines/effects
This commit is contained in:
@@ -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 ->
|
||||
|
||||
Reference in New Issue
Block a user