projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Suppress questions after quit on replay (for regression testing.
[super-star-trek.git]
/
sst.py
diff --git
a/sst.py
b/sst.py
index f731668af5e908420807f0ec6549521219a70e2c..8e3db850c8450900fce64db42d966748eb8847a4 100755
(executable)
--- a/
sst.py
+++ b/
sst.py
@@
-386,7
+386,7
@@
class Gamestate:
# He says the existing expression is prone to divide-by-zero errors
# after killing the last klingon when score is shown -- perhaps also
# if the only remaining klingon is SCOM.
# He says the existing expression is prone to divide-by-zero errors
# after killing the last klingon when score is shown -- perhaps also
# if the only remaining klingon is SCOM.
-
game.state.remtime = game.state.remres/(game.state.remkl + 4*len(game
.state.kcmdr))
+
self.state.remtime = self.state.remres/(self.state.remkl + 4*len(self
.state.kcmdr))
FWON = 0
FDEPLETE = 1
FWON = 0
FDEPLETE = 1
@@
-2492,7
+2492,7
@@
def nova(nov):
if iquad == 'P':
game.state.nplankl += 1
else:
if iquad == 'P':
game.state.nplankl += 1
else:
- game.state.worldkl += 1
+ game.state.
n
worldkl += 1
prout(crmena(True, 'B', "sector", neighbor) + _(" destroyed."))
game.iplnet.pclass = "destroyed"
game.iplnet = None
prout(crmena(True, 'B', "sector", neighbor) + _(" destroyed."))
game.iplnet.pclass = "destroyed"
game.iplnet = None
@@
-6318,6
+6318,7
@@
if __name__ == '__main__':
game.options |= OPTION_TTY
seed = int(time.time())
(options, arguments) = getopt.getopt(sys.argv[1:], "r:s:txV")
game.options |= OPTION_TTY
seed = int(time.time())
(options, arguments) = getopt.getopt(sys.argv[1:], "r:s:txV")
+ replay = False
for (switch, val) in options:
if switch == '-r':
try:
for (switch, val) in options:
if switch == '-r':
try:
@@
-6327,11
+6328,12
@@
if __name__ == '__main__':
raise SystemExit, 1
try:
line = replayfp.readline().strip()
raise SystemExit, 1
try:
line = replayfp.readline().strip()
- (leader,
key
, seed) = line.split()
+ (leader,
__
, seed) = line.split()
seed = eval(seed)
sys.stderr.write("sst2k: seed set to %s\n" % seed)
line = replayfp.readline().strip()
arguments += line.split()[2:]
seed = eval(seed)
sys.stderr.write("sst2k: seed set to %s\n" % seed)
line = replayfp.readline().strip()
arguments += line.split()[2:]
+ replay = True
except ValueError:
sys.stderr.write("sst: replay file %s is ill-formed\n"% val)
raise SystemExit(1)
except ValueError:
sys.stderr.write("sst: replay file %s is ill-formed\n"% val)
raise SystemExit(1)
@@
-6380,6
+6382,8
@@
if __name__ == '__main__':
game.alldone = False
else:
makemoves()
game.alldone = False
else:
makemoves()
+ if replay:
+ break
skip(1)
stars()
skip(1)
skip(1)
stars()
skip(1)