From c02fecd74adf1c58c2db2e20b7c3f9a5e1fe321a Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 28 Feb 2017 10:11:24 -0500 Subject: [PATCH] Add CURSES command. --- doc/sst-doc.xml | 14 +++++++++++++- sst.py | 4 ++++ test/test4.chk | 12 ++++++------ test/test5.chk | 24 +----------------------- test/test5.log | 2 -- 5 files changed, 24 insertions(+), 32 deletions(-) diff --git a/doc/sst-doc.xml b/doc/sst-doc.xml index a5f73ad..cb1858f 100644 --- a/doc/sst-doc.xml +++ b/doc/sst-doc.xml @@ -1490,6 +1490,17 @@ Full command: HELP <command> This command reads the appropriate section from the SST.DOC file, providing the file is in the current directory. + +Curses switch + + +Mnemonic: CURSES +Full command: CURSES + + +Switch from tty to curses interface. Mainly useful for +debugging, when continuing a replayed game. + Miscellaneous Notes @@ -1645,7 +1656,8 @@ orientation. ST STATUS (none) T TRANSPORT transporter W WARP <FACTOR> (none) - + CU CURSES (none) + L. R. Scan: thousands digit: supernova hundreds digit: Klingons tens digit: starbases diff --git a/sst.py b/sst.py index a9aa1a4..3b00bd6 100755 --- a/sst.py +++ b/sst.py @@ -6161,6 +6161,7 @@ commands = [ ("QUIT", 0), ("HELP", 0), ("SCORE", 0), + ("CURSES", 0), ("", 0), ] @@ -6381,6 +6382,9 @@ def makemoves(): helpme() # get help elif cmd == "SCORE": score() # see current score + elif cmd == "CURSES": + game.options |= (OPTION_CURSES | OPTION_COLOR) + iostart() while True: if game.alldone: break # Game has ended diff --git a/test/test4.chk b/test/test4.chk index 133e85e..e3cfdd5 100644 --- a/test/test4.chk +++ b/test/test4.chk @@ -115,7 +115,7 @@ CRYSTALS SHUTTLE PLANETS REPORT COMPUTER COMMANDS EMEXIT PROBE SAVE FREEZE ABANDON DESTRUCT DEATHRAY CAPTURE CLOAK DEBUG MAYDAY SOS CALL QUIT -HELP SCORE +HELP SCORE CURSES COMMAND> COMMAND> warp 7 Engineer Scott- "Aye, but our maximum safe speed is warp 6." @@ -137,14 +137,14 @@ CRYSTALS SHUTTLE PLANETS REPORT COMPUTER COMMANDS EMEXIT PROBE SAVE FREEZE ABANDON DESTRUCT DEATHRAY CAPTURE CLOAK DEBUG MAYDAY SOS CALL QUIT -HELP SCORE +HELP SCORE CURSES COMMAND> COMMAND> move aut 5 8 5 5 Ensign Chekov- "Course laid in, Captain." First Officer Spock- "Captain, I compute that such - a trip would require approximately 151 percent of our + a trip would require approximately 135 percent of our remaining time. Are you sure this is wise?" n COMMAND> move aut 9 9 @@ -158,7 +158,7 @@ CRYSTALS SHUTTLE PLANETS REPORT COMPUTER COMMANDS EMEXIT PROBE SAVE FREEZE ABANDON DESTRUCT DEATHRAY CAPTURE CLOAK DEBUG MAYDAY SOS CALL QUIT -HELP SCORE +HELP SCORE CURSES COMMAND> n LEGAL COMMANDS ARE: SRSCAN STATUS REQUEST LRSCAN @@ -169,13 +169,13 @@ CRYSTALS SHUTTLE PLANETS REPORT COMPUTER COMMANDS EMEXIT PROBE SAVE FREEZE ABANDON DESTRUCT DEATHRAY CAPTURE CLOAK DEBUG MAYDAY SOS CALL QUIT -HELP SCORE +HELP SCORE CURSES COMMAND> move aut 5 8 5 5 Ensign Chekov- "Course laid in, Captain." First Officer Spock- "Captain, I compute that such - a trip would require approximately 168 percent of our + a trip would require approximately 145 percent of our remaining time. Are you sure this is wise?" y Entering Quadrant 5 - 8. diff --git a/test/test5.chk b/test/test5.chk index c47db12..f3ed6ce 100644 --- a/test/test5.chk +++ b/test/test5.chk @@ -220,7 +220,7 @@ CRYSTALS SHUTTLE PLANETS REPORT COMPUTER COMMANDS EMEXIT PROBE SAVE FREEZE ABANDON DESTRUCT DEATHRAY CAPTURE CLOAK DEBUG MAYDAY SOS CALL QUIT -HELP SCORE +HELP SCORE CURSES COMMAND> COMMAND> move aut 6 7 2 2 @@ -237,28 +237,6 @@ Message from Starfleet Command Stardate 4077.10 Message from Starfleet Command Stardate 4077.67 Supernova in Quadrant 5 - 7; caution advised. -COMMAND> y -LEGAL COMMANDS ARE: -SRSCAN STATUS REQUEST LRSCAN -PHASERS TORPEDO PHOTONS MOVE SHIELDS -DOCK DAMAGES CHART IMPULSE REST -WARP SENSORS ORBIT TRANSPORT MINE -CRYSTALS SHUTTLE PLANETS REPORT COMPUTER -COMMANDS EMEXIT PROBE SAVE FREEZE -ABANDON DESTRUCT DEATHRAY CAPTURE CLOAK -DEBUG MAYDAY SOS CALL QUIT -HELP SCORE -COMMAND> n -LEGAL COMMANDS ARE: -SRSCAN STATUS REQUEST LRSCAN -PHASERS TORPEDO PHOTONS MOVE SHIELDS -DOCK DAMAGES CHART IMPULSE REST -WARP SENSORS ORBIT TRANSPORT MINE -CRYSTALS SHUTTLE PLANETS REPORT COMPUTER -COMMANDS EMEXIT PROBE SAVE FREEZE -ABANDON DESTRUCT DEATHRAY CAPTURE CLOAK -DEBUG MAYDAY SOS CALL QUIT -HELP SCORE COMMAND> quit May the Great Bird of the Galaxy roost upon your home planet. diff --git a/test/test5.log b/test/test5.log index 4861ea1..cfe40dd 100644 --- a/test/test5.log +++ b/test/test5.log @@ -59,6 +59,4 @@ move aut 8 5 2 2 n move aut 6 7 2 2 -y -n quit -- 2.31.1