Improve sensor terminal messages
This commit is contained in:
@@ -6,6 +6,7 @@ module Dodge.WorldEffect (
|
||||
doTmWdWd,
|
||||
) where
|
||||
|
||||
import Dodge.Terminal
|
||||
import NewInt
|
||||
import Control.Monad
|
||||
import Data.Foldable
|
||||
@@ -93,6 +94,7 @@ doTmWdWd tmwdwd = case tmwdwd of
|
||||
TmWdId -> const id
|
||||
TmWdWdPowerDownTerminal -> resetTerminal TerminalOff
|
||||
TmWdWdDeactivateTerminal -> resetTerminal TerminalDeactivated
|
||||
TmWdWdLeaveTerminal -> leaveResetQuitTerminal
|
||||
TmWdWdTermSound sid -> \tm w -> fromMaybe w $ do
|
||||
tpos <- w ^? cWorld . lWorld . buttons . ix (_tmButtonID tm) . btPos
|
||||
return $ soundStart TerminalSound tpos sid Nothing w
|
||||
@@ -105,6 +107,12 @@ resetTerminal x tm =
|
||||
. (cWorld . lWorld . terminals . ix (_tmID tm) . tmDisplayedLines .~ [])
|
||||
. exitTerminalSubInv
|
||||
|
||||
leaveResetQuitTerminal :: Terminal -> World -> World
|
||||
leaveResetQuitTerminal tm =
|
||||
(cWorld . lWorld . terminals . ix (_tmID tm) . tmFutureLines
|
||||
.~ (tlSetStatus (TerminalPressTo "QUIT")) <> tlDoEffect TmWdWdLeaveTerminal)
|
||||
. exitTerminalSubInv
|
||||
|
||||
exitTerminalSubInv :: World -> World
|
||||
exitTerminalSubInv w = case w ^? hud . subInventory . termID of
|
||||
Just _ -> w & hud . subInventory .~ NoSubInventory
|
||||
|
||||
Reference in New Issue
Block a user