"""
import os, sys, math, curses, time, readline, cPickle, random, copy, gettext, getpass
-version="2.0"
+version="2.1"
docpath = (".", "../doc", "/usr/share/doc/sst")
if icourse.origin.quadrant() != icourse.location.quadrant():
newquadrant(noattack)
break
- elif check_collision(icourse, w):
+ elif check_collision(w):
print "Collision detected"
break
else:
twarp = False
wcourse.reset()
# Activate Warp Engines and pay the cost
- imove(course, noattack=False)
+ imove(wcourse, noattack=False)
if game.alldone:
return
game.energy -= wcourse.power(game.warpfac)
if key != "IHALPHA":
huh()
return
- scanner.chew()
if '.' not in scanner.token:
scanner.token += ".trk"
try:
return
cPickle.dump(game, fp)
fp.close()
+ scanner.chew()
def thaw():
"Retrieve saved game."
global game
- game.passwd[0] = '\0'
+ game.passwd = None
key = scanner.next()
if key == "IHEOL":
proutn(_("File name: "))
if key != "IHALPHA":
huh()
return True
- scanner.chew()
if '.' not in scanner.token:
scanner.token += ".trk"
try:
return
game = cPickle.load(fp)
fp.close()
+ scanner.chew()
return False
# I used <http://www.memory-alpha.org> to find planets
game.nkinks = game.nhelp = game.casual = game.abandoned = 0
game.iscate = game.resting = game.imine = game.icrystl = game.icraft = False
game.isatb = game.state.nplankl = 0
- game.state.starkl = game.state.basekl = 0
+ game.state.starkl = game.state.basekl = game.state.nworldkl = 0
game.iscraft = "onship"
game.landed = False
game.alive = True
+
+ # the galaxy
+ game.state.galaxy = fill2d(GALSIZE, lambda i_unused, j_unused: Quadrant())
+ # the starchart
+ game.state.chart = fill2d(GALSIZE, lambda i_unused, j_unused: Page())
+
+ game.state.planets = [] # Planet information
+ game.state.baseq = [] # Base quadrant coordinates
+ game.state.kcmdr = [] # Commander quadrant coordinates
+ game.statekscmdr = Coord() # Supercommander quadrant coordinates
+
# Starchart is functional but we've never seen it
game.lastchart = FOREVER
# Put stars in the galaxy
return True
if scanner.sees("regular"):
break
- proutn(_("What is \"%s\"?") % scanner.token)
+ proutn(_("What is \"%s\"? ") % scanner.token)
scanner.chew()
while game.length==0 or game.skill==SKILL_NONE:
if scanner.next() == "IHALPHA":
if logfp:
logfp.close()
print ""
+
+# End.