From bc69fb7fa05669a28d94f087f1eaf3e4a937bad6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 18 Feb 2017 15:03:26 -0500 Subject: [PATCH] Import SCORE command, tracking Tom Almy's change. --- NEWS | 4 ++-- TODO | 3 +++ doc/HACKING | 2 ++ doc/sst-doc.xml | 6 +++--- sst.py | 43 +++++++++++++++++++++++-------------------- 5 files changed, 33 insertions(+), 25 deletions(-) diff --git a/NEWS b/NEWS index 19e4f52..4163fb4 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ SST2K project news. -2.2 @ - Enable GNU readline keys. +2.2 @ + Enable GNU readline keys. Added SCORE command. 2.1 @ 2012-02-16 Packaging fixes, pychecker cleanup, cope with Freshmeat name changes. diff --git a/TODO b/TODO index dad330f..dcc8996 100644 --- a/TODO +++ b/TODO @@ -6,6 +6,9 @@ Short-term items: * Status display should update after kills so Klingons Left is correct. +* Add Tom Almy's CLOAK and CAPTURE features from 2013. See also + http://www.almy.us/sst.html + Long-term items: * Wrap a GUI around it. diff --git a/doc/HACKING b/doc/HACKING index 4bf7b49..0ec0784 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -210,6 +210,8 @@ and added more: the LRSCAN command is no longer needed. (Controlled by OPTION_AUTOSCAN and turned off if game type is "plain" or "almy".) +10. I imported Tom Almy's SCORE command from his 2013 version. + TESTING: This code has been designed to be tested. A simple shellscript diff --git a/doc/sst-doc.xml b/doc/sst-doc.xml index a7469a7..f912cb3 100644 --- a/doc/sst-doc.xml +++ b/doc/sst-doc.xml @@ -2,7 +2,7 @@ + ]> @@ -1633,7 +1633,7 @@ Impulse engines require 20 units to warm up, plus 100 units per The original Star Trek seems to have been written by Mike Mayfield at the beginning of the 1970s. His first version was in BASIC for a Sigma 7 in 1971; in 1972 he rewrote it in Hewlett Packard -BASIC. The source is inckuded in the SST2K repository. In January +BASIC. The source is included in the SST2K repository. In January 1975 it became part of the DECUS library under the name SPACWR. @@ -1840,7 +1840,7 @@ better anyway. -My changes got merged into SST2K in 2005, and I work on it now. +My changes got merged into SST2K in 2005. Eric Raymond's story diff --git a/sst.py b/sst.py index 757c8c8..69e963c 100755 --- a/sst.py +++ b/sst.py @@ -212,22 +212,22 @@ class Event: # game options OPTION_ALL = 0xffffffff OPTION_TTY = 0x00000001 # old interface -OPTION_CURSES = 0x00000002 # new interface -OPTION_IOMODES = 0x00000003 # cover both interfaces -OPTION_PLANETS = 0x00000004 # planets and mining -OPTION_THOLIAN = 0x00000008 # Tholians and their webs (UT 1979 version) -OPTION_THINGY = 0x00000010 # Space Thingy can shoot back (Stas, 2005) -OPTION_PROBE = 0x00000020 # deep-space probes (DECUS version, 1980) -OPTION_SHOWME = 0x00000040 # bracket Enterprise in chart -OPTION_RAMMING = 0x00000080 # enemies may ram Enterprise (Almy) -OPTION_MVBADDY = 0x00000100 # more enemies can move (Almy) -OPTION_BLKHOLE = 0x00000200 # black hole may timewarp you (Stas, 2005) -OPTION_BASE = 0x00000400 # bases have good shields (Stas, 2005) -OPTION_WORLDS = 0x00000800 # logic for inhabited worlds (ESR, 2006) -OPTION_AUTOSCAN = 0x00001000 # automatic LRSCAN before CHART (ESR, 2006) -OPTION_PLAIN = 0x01000000 # user chose plain game -OPTION_ALMY = 0x02000000 # user chose Almy variant -OPTION_COLOR = 0x04000000 # enable color display (experimental, ESR, 2010) +OPTION_CURSES = 0x00000002 # new interface +OPTION_IOMODES = 0x00000003 # cover both interfaces +OPTION_PLANETS = 0x00000004 # planets and mining +OPTION_THOLIAN = 0x00000008 # Tholians and their webs (UT 1979 version) +OPTION_THINGY = 0x00000010 # Space Thingy can shoot back (Stas, 2005) +OPTION_PROBE = 0x00000020 # deep-space probes (DECUS version, 1980) +OPTION_SHOWME = 0x00000040 # bracket Enterprise in chart +OPTION_RAMMING = 0x00000080 # enemies may ram Enterprise (Almy) +OPTION_MVBADDY = 0x00000100 # more enemies can move (Almy) +OPTION_BLKHOLE = 0x00000200 # black hole may timewarp you (Stas, 2005) +OPTION_BASE = 0x00000400 # bases have good shields (Stas, 2005) +OPTION_WORLDS = 0x00000800 # logic for inhabited worlds (ESR, 2006) +OPTION_AUTOSCAN = 0x00001000 # automatic LRSCAN before CHART (ESR, 2006) +OPTION_PLAIN = 0x01000000 # user chose plain game +OPTION_ALMY = 0x02000000 # user chose Almy variant +OPTION_COLOR = 0x04000000 # enable color display (ESR, 2010) # Define devices DSRSENS = 0 @@ -5691,17 +5691,17 @@ def choose(): scanner.nexttok() if scanner.sees("plain"): # Approximates the UT FORTRAN version. - game.options &=~ (OPTION_THOLIAN | OPTION_PLANETS | OPTION_THINGY | OPTION_PROBE | OPTION_RAMMING | OPTION_MVBADDY | OPTION_BLKHOLE | OPTION_BASE | OPTION_WORLDS) + game.options &=~ (OPTION_THOLIAN | OPTION_PLANETS | OPTION_THINGY | OPTION_PROBE | OPTION_RAMMING | OPTION_MVBADDY | OPTION_BLKHOLE | OPTION_BASE | OPTION_WORLDS | OPTION_COLOR) game.options |= OPTION_PLAIN elif scanner.sees("almy"): # Approximates Tom Almy's version. - game.options &=~ (OPTION_THINGY | OPTION_BLKHOLE | OPTION_BASE | OPTION_WORLDS) + game.options &=~ (OPTION_THINGY | OPTION_BLKHOLE | OPTION_BASE | OPTION_WORLDS | OPTION_COLOR) game.options |= OPTION_ALMY elif scanner.sees("fancy") or scanner.sees("\n"): - pass + # FIXME: color doesn not quite work yet + game.options &=~ OPTION_COLOR elif len(scanner.token): proutn(_("What is \"%s\"?") % scanner.token) - game.options &=~ OPTION_COLOR setpassword() if game.passwd == "debug": game.idebug = True @@ -5924,6 +5924,7 @@ commands = [ ("CALL", 0), # Synonym for MAYDAY ("QUIT", 0), ("HELP", 0), + ("SCORE", OPTION_ALMY), ("", 0), ] @@ -6131,6 +6132,8 @@ def makemoves(): game.alldone = True # quit the game elif cmd == "HELP": helpme() # get help + elif cmd == "SCORE": + score() # see current score while True: if game.alldone: break # Game has ended -- 2.31.1