projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed up last test following up bug fix in transporter code.
[super-star-trek.git]
/
sst.py
diff --git
a/sst.py
b/sst.py
index b3264ee904fc341e370e8b4a9016f26f4467db88..09214f481c60c0f4704288efa7ccf9b08aeb2a5d 100755
(executable)
--- a/
sst.py
+++ b/
sst.py
@@
-2304,18
+2304,18
@@
def events():
#announce()
skip(1)
prout(_("Lt. Uhura- \"The deep space probe is now in Quadrant %s.\"") % game.probe.quadrant())
#announce()
skip(1)
prout(_("Lt. Uhura- \"The deep space probe is now in Quadrant %s.\"") % game.probe.quadrant())
- pdest = game.state.galaxy[game.probe.quadrant().i][game.probe.quadrant().j]
+ pquad = game.probe.quadrant()
+ pdest = game.state.galaxy[pquad.i][pquad.j]
if communicating():
if communicating():
- chp = game.state.chart[game.probe.quadrant().i][game.probe.quadrant().j]
- chp.klingons = pdest.klingons
- chp.starbase = pdest.starbase
- chp.stars = pdest.stars
+ game.state.chart[pquad.i][pquad.j].klingons = pdest.klingons
+ game.state.chart[pquad.i][pquad.j].starbase = pdest.starbase
+ game.state.chart[pquad.i][pquad.j].stars = pdest.stars
pdest.charted = True
game.probe.moves -= 1 # One less to travel
if game.probe.arrived() and game.isarmed and pdest.stars:
supernova(game.probe) # fire in the hole!
unschedule(FDSPROB)
pdest.charted = True
game.probe.moves -= 1 # One less to travel
if game.probe.arrived() and game.isarmed and pdest.stars:
supernova(game.probe) # fire in the hole!
unschedule(FDSPROB)
- if game.state.galaxy[
game.quadrant().i][game.quadrant()
.j].supernova:
+ if game.state.galaxy[
pquad.i][pquad
.j].supernova:
return
elif evcode == FDISTR: # inhabited system issues distress call
unschedule(FDISTR)
return
elif evcode == FDISTR: # inhabited system issues distress call
unschedule(FDISTR)
@@
-4553,7
+4553,7
@@
def beam():
skip(1)
prouts("WWHOOOIIIIIRRRRREEEE.E.E. . . . . . .")
skip(2)
skip(1)
prouts("WWHOOOIIIIIRRRRREEEE.E.E. . . . . . .")
skip(2)
- if withprob(0.98):
+ if
not
withprob(0.98):
prouts("BOOOIIIOOOIIOOOOIIIOIING . . .")
skip(2)
prout(_("Scotty- \"Oh my God! I've lost them.\""))
prouts("BOOOIIIOOOIIOOOOIIIOIING . . .")
skip(2)
prout(_("Scotty- \"Oh my God! I've lost them.\""))
@@
-5437,7
+5437,9
@@
def setup():
game.instar = 0
for i in range(GALSIZE):
for j in range(GALSIZE):
game.instar = 0
for i in range(GALSIZE):
for j in range(GALSIZE):
- k = randrange(1, QUADSIZE**2/10)
+ # Can't have more stars per quadrant than fit in one decimal digit,
+ # if we do the chart representation will break.
+ k = randrange(1, min(10, QUADSIZE**2/10))
game.instar += k
game.state.galaxy[i][j].stars = k
# Locate star bases in galaxy
game.instar += k
game.state.galaxy[i][j].stars = k
# Locate star bases in galaxy