Add fix bug in terminal destruction effects

This commit is contained in:
2022-06-07 01:25:36 +01:00
parent 1fe41889fe
commit d42538e3c0
13 changed files with 111 additions and 93 deletions
+1 -7
View File
@@ -85,17 +85,11 @@ keyCardRoomRunPast keyid rmid = do
keyCardAnalyserByDoor :: Int -> Int -> Room -> Room
keyCardAnalyserByDoor keyid = analyserByDoor
(machineAddSound fridgeHumS $ testYouHave (KEYCARD 0))
where
hic = "SECURITY CHECK"
bar = replicate 18 '-'
(machineAddSound fridgeHumS $ testYouHave (KEYCARD keyid))
healthAnalyserByDoor :: Int -> Room -> Room
healthAnalyserByDoor = analyserByDoor
(machineAddSound fridgeHumS $ testYourHealth 1100)
where
hic = "HEALTH INTEGRITY CHECK"
bar = replicate (length hic) '-'
analyserByDoor :: (Machine -> World -> World) -> Int -> Room -> Room
analyserByDoor mcf outplid rm = rm
+1 -3
View File
@@ -83,9 +83,7 @@ sensInsideDoor senseType outplid rm = rm
thinHighBar 0 (V2 20 (-1)) (V2 20 (-100))
<> thinHighBar 0 (V2 0 (-100)) (V2 20 (-100))
<> barPP 1.5 (V3 20 (-1) 0) (V3 20 (-1) 80))
, putTerminal terminalColor (defaultTermParams & addInputLine [damageCodeCommand,quitCommand]
[helpCommand,commandsCommand]
)
, putTerminal terminalColor (basicTerminal & tmScrollCommands .:~ damageCodeCommand)
& plSpot .~ rprBoolShift isUnusedLnk (shiftInBy 10)
]
& rmOutPmnt .~ [OutPlacement (sensAboveDoor senseType 10 (atFstLnkOutShiftInward 100)) outplid]
+4 -7
View File
@@ -30,6 +30,7 @@ import Dodge.RandomHelp
--import qualified Data.Set as S
import Data.Maybe
import qualified Data.Map.Strict as M
--import Data.Char
--import Data.Tree
import Control.Monad.State
@@ -47,18 +48,14 @@ warningRooms n = do
addWarningTerminal :: Int -> Room -> Room
addWarningTerminal outplid = (rmName .++~ "warningTerm-")
-- & rmOutPmnt .~ [OutPlacement (sensAboveDoor senseType 10 (atFstLnkOutShiftInward 100)) outplid]
. (rmOutPmnt .~ [OutPlacement outplace outplid])
where
outplace = extTrigLitPos
(atFstLnkOutShiftBy (\(p,a) -> (p +.+ rotateV a (V2 18.5 (-2.5)), a)))
(Just . set plSpot (rprShift moveToSideFirstOutLink) . putTerminal terminalColor . termMessages)
termMessages trid = defaultTermParams & addInputLine
[unlockCommand trid,quitCommand]
[helpCommand,infoCommand theinfo,commandsCommand]
unlockCommand trid = singleCommand ["DOOR OPENED"] "OPEN" ["YES","Y"] "OPEN THE CONNECTED DOOR." (toggledoor trid)
toggledoor trid w' = w' & triggers . ix (fromJust $ _plMID trid) .~ const True
theinfo = "DOOR CONTROLABLE WITH THE \"OPEN\" COMMAND. THIS TERMINAL CANNOT CLOSE THE DOOR."
termMessages trpl = basicTerminal & tmScrollCommands .:~ toggleCommand
& tmToggles .~ M.fromList
[("DOOR",TerminalToggle (fromJust $ _plMID trpl) (const (const True)))]
moveToSideFirstOutLink :: RoomPos -> Room -> Maybe (Point2,Float)
moveToSideFirstOutLink rp rm = case rp ^? rpLinkStatus . rplsChildNum of