projects
/
super-star-trek.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dc314db
)
lrscan, scescan, and chart are working in the Python version.
author
Eric S. Raymond
<esr@thyrsus.com>
Thu, 5 Oct 2006 08:58:28 +0000
(08:58 +0000)
committer
Eric S. Raymond
<esr@thyrsus.com>
Thu, 5 Oct 2006 08:58:28 +0000
(08:58 +0000)
src/sst.py
patch
|
blob
|
history
diff --git
a/src/sst.py
b/src/sst.py
index 3f78e233d47ea7047d40c5cd11cb9943ae6cf4ac..c006da46d3916b2812738a4fdee8cd156c6ed502 100644
(file)
--- a/
src/sst.py
+++ b/
src/sst.py
@@
-3712,9
+3712,6
@@
def highvideo():
if game.options & OPTION_CURSES:
curwnd.attron(curses.A_REVERSE)
if game.options & OPTION_CURSES:
curwnd.attron(curses.A_REVERSE)
-def commandhook(cmd, before):
- pass
-
#
# Things past this point have policy implications.
#
#
# Things past this point have policy implications.
#
@@
-5455,14
+5452,14
@@
def chart():
else:
proutn(" ")
if game.state.galaxy[i][j].supernova:
else:
proutn(" ")
if game.state.galaxy[i][j].supernova:
- s
trcpy(buf, "***")
+ s
how = "***"
elif not game.state.galaxy[i][j].charted and game.state.galaxy[i][j].starbase:
elif not game.state.galaxy[i][j].charted and game.state.galaxy[i][j].starbase:
- s
trcpy(buf, ".1.")
+ s
how = ".1."
elif game.state.galaxy[i][j].charted:
elif game.state.galaxy[i][j].charted:
- s
printf(buf, "%3d" % (game.state.chart[i][j].klingons*100 + game.state.chart[i][j].starbase * 10 + game.state.chart[i][j].stars)
)
+ s
how = "%3d" % (game.state.chart[i][j].klingons*100 + game.state.chart[i][j].starbase * 10 + game.state.chart[i][j].stars
)
else:
else:
- s
trcpy(buf, "...")
- proutn(
buf
)
+ s
how = "..."
+ proutn(
show
)
if (game.options & OPTION_SHOWME) and i == game.quadrant.x and j == game.quadrant.y:
proutn(">")
else:
if (game.options & OPTION_SHOWME) and i == game.quadrant.x and j == game.quadrant.y:
proutn(">")
else:
@@
-6017,7
+6014,7
@@
def setup(needprompt):
if not game.state.galaxy[w.x][w.y].supernova and \
game.state.galaxy[w.x][w.y].klingons + klump <= MAXKLQUAD:
break
if not game.state.galaxy[w.x][w.y].supernova and \
game.state.galaxy[w.x][w.y].klingons + klump <= MAXKLQUAD:
break
- game.state.galaxy[w.x][w.y].klingons +=
klump
+ game.state.galaxy[w.x][w.y].klingons +=
int(klump)
if krem <= 0:
break
# Position Klingon Commander Ships
if krem <= 0:
break
# Position Klingon Commander Ships
@@
-6491,7
+6488,7
@@
def listCommands():
k = 0
proutn(_("LEGAL COMMANDS ARE:"))
for key in commands:
k = 0
proutn(_("LEGAL COMMANDS ARE:"))
for key in commands:
- if ACCEPT(
cmd
):
+ if ACCEPT(
key
):
if k % 5 == 0:
skip(1)
proutn("%-12s " % key)
if k % 5 == 0:
skip(1)
proutn("%-12s " % key)
@@
-6580,10
+6577,11
@@
def makemoves():
setwnd(message_window)
clrscr()
cmd = citem.upper()
setwnd(message_window)
clrscr()
cmd = citem.upper()
- if cmd not in commands:
+ if cmd in commands:
+ break
+ else:
listCommands()
continue
listCommands()
continue
- commandhook(commands[i].name, True)
if cmd == "SRSCAN": # srscan
srscan()
elif cmd == "STATUS": # status
if cmd == "SRSCAN": # srscan
srscan()
elif cmd == "STATUS": # status
@@
-6692,7
+6690,6
@@
def makemoves():
# elif cmd == "VISUAL":
# visual() # perform visual scan
#endif
# elif cmd == "VISUAL":
# visual() # perform visual scan
#endif
- commandhook(commands[i].name, False)
while True:
if game.alldone:
break # Game has ended
while True:
if game.alldone:
break # Game has ended
@@
-6994,7
+6991,7
@@
if __name__ == '__main__':
setwnd(fullscreen_window)
clrscr()
prelim()
setwnd(fullscreen_window)
clrscr()
prelim()
- setup(needprompt=not
lin
e)
+ setup(needprompt=not
inqueu
e)
if game.alldone:
score()
game.alldone = False
if game.alldone:
score()
game.alldone = False