Reinstate damagecode terminal commands

This commit is contained in:
2025-08-18 14:39:30 +01:00
parent 33b90d637a
commit 1c9d58c716
6 changed files with 111 additions and 94 deletions
+10
View File
@@ -95,6 +95,10 @@ doTmWdWd tmwdwd = case tmwdwd of
TmTmClearDisplayedLines -> \tm -> fromMaybe id $ do
tid <- tm ^? tmID
return $ cWorld . lWorld . terminals . ix tid . tmDisplayedLines .~ []
TmGetDamageCoding st -> \tm w -> fromMaybe w $ do
tid <- tm ^? tmID
return $ w & cWorld . lWorld . terminals . ix tid . tmFutureLines
.~ decodeSensorType st w
TmTmSetStatus x -> \tm -> fromMaybe id $ do
tid <- tm ^? tmID
return $ cWorld . lWorld . terminals . ix tid . tmStatus .~ x
@@ -114,3 +118,9 @@ doTmWdWd tmwdwd = case tmwdwd of
in soundStart TerminalSound tpos sid Nothing w
TmWdWdDoDeathTriggers -> doDeathTriggers
TmWdWdfromWdWd f -> \_ -> doWdWd f
decodeSensorType :: SensorType -> World -> [TerminalLine]
decodeSensorType st w = fromMaybe [] $ do
x <- w ^? cWorld . cwGen . cwgParams . sensorCoding . ix st
return [makeTermLine $ show x]