rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
game.state.galaxy[game.quadrant.x][game.quadrant.y].planet = None
game.state.galaxy[game.quadrant.i][game.quadrant.j].planet = None
def torpedo(origin, course, dispersion, number, nburst): "Let a photon torpedo fly" shoved = False ac = course + 0.25*dispersion angle = (15.0-ac)*0.5235988 bullseye = (15.0 - course)*0.5235988 delta = coord(-math.sin(angle), math.cos(angle)) bigger = max(abs(delta.x), abs(delta.y)) delta /= bigger x = origin.x; y = or...
game.quad[w.x][w.y] = IHWEB
game.quad[w.i][w.j] = IHWEB
def torpedo(origin, course, dispersion, number, nburst): "Let a photon torpedo fly" shoved = False ac = course + 0.25*dispersion angle = (15.0-ac)*0.5235988 bullseye = (15.0 - course)*0.5235988 delta = coord(-math.sin(angle), math.cos(angle)) bigger = max(abs(delta.x), abs(delta.y)) delta /= bigger x = origin.x; y = or...
game.quad[w.x][w.y]=IHDOT game.quad[jw.x][jw.y]=iquad
game.quad[w.i][w.j]=IHDOT game.quad[jw.i][jw.j]=iquad
def torpedo(origin, course, dispersion, number, nburst): "Let a photon torpedo fly" shoved = False ac = course + 0.25*dispersion angle = (15.0-ac)*0.5235988 bullseye = (15.0 - course)*0.5235988 delta = coord(-math.sin(angle), math.cos(angle)) bigger = max(abs(delta.x), abs(delta.y)) delta /= bigger x = origin.x; y = or...
course = 1.90985*math.atan2(game.sector.y-enemy.kloc.y, enemy.kloc.x-game.sector.x)
course = 1.90985*math.atan2(game.sector.j-enemy.kloc.j, enemy.kloc.i-game.sector.i)
def attack(torps_ok): # bad guy attacks us # torps_ok == False forces use of phasers in an attack # game could be over at this point, check if game.alldone: return attempt = False; ihurt = False; hitmax=0.0; hittot=0.0; chgfac=1.0 where = "neither" if idebug: prout("=== ATTACK!") # Tholian gets to move before attacking...
if game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova or game.alldone:
if game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova or game.alldone:
def attack(torps_ok): # bad guy attacks us # torps_ok == False forces use of phasers in an attack # game could be over at this point, check if game.alldone: return attempt = False; ihurt = False; hitmax=0.0; hittot=0.0; chgfac=1.0 where = "neither" if idebug: prout("=== ATTACK!") # Tholian gets to move before attacking...
game.state.galaxy[game.quadrant.x][game.quadrant.y].romulans -= 1
game.state.galaxy[game.quadrant.i][game.quadrant.j].romulans -= 1
def deadkl(w, type, mv): "Kill a Klingon, Tholian, Romulan, or Thingy." # Added mv to allow enemy to "move" before dying proutn(crmena(True, type, "sector", mv)) # Decide what kind of enemy it is and update appropriately if type == IHR: # chalk up a Romulan game.state.galaxy[game.quadrant.x][game.quadrant.y].romulans -...
game.state.galaxy[game.quadrant.x][game.quadrant.y].klingons -= 1
game.state.galaxy[game.quadrant.i][game.quadrant.j].klingons -= 1
def deadkl(w, type, mv): "Kill a Klingon, Tholian, Romulan, or Thingy." # Added mv to allow enemy to "move" before dying proutn(crmena(True, type, "sector", mv)) # Decide what kind of enemy it is and update appropriately if type == IHR: # chalk up a Romulan game.state.galaxy[game.quadrant.x][game.quadrant.y].romulans -...
if not VALID_SECTOR(w.x, w.y):
if not VALID_SECTOR(w.i, w.j):
def targetcheck(w): "Return None if target is invalid, otherwise return a course angle." if not VALID_SECTOR(w.x, w.y): huh() return None delta = coord() # FIXME: C code this was translated from is wacky -- why the sign reversal? delta.y = (w.y - game.sector.y); delta.x = (game.sector.x - w.x); if delta == coord(0, 0):...
delta.y = (w.y - game.sector.y); delta.x = (game.sector.x - w.x);
delta.j = (w.j - game.sector.j); delta.i = (game.sector.i - w.i);
def targetcheck(w): "Return None if target is invalid, otherwise return a course angle." if not VALID_SECTOR(w.x, w.y): huh() return None delta = coord() # FIXME: C code this was translated from is wacky -- why the sign reversal? delta.y = (w.y - game.sector.y); delta.x = (game.sector.x - w.x); if delta == coord(0, 0):...
return 1.90985932*math.atan2(delta.y, delta.x)
return 1.90985932*math.atan2(delta.j, delta.i)
def targetcheck(w): "Return None if target is invalid, otherwise return a course angle." if not VALID_SECTOR(w.x, w.y): huh() return None delta = coord() # FIXME: C code this was translated from is wacky -- why the sign reversal? delta.y = (w.y - game.sector.y); delta.x = (game.sector.x - w.x); if delta == coord(0, 0):...
if game.alldone or game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova:
if game.alldone or game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova:
def photon(): "Launch photon torpedo." course = [] game.ididit = False if damaged(DPHOTON): prout(_("Photon tubes damaged.")) scanner.chew() return if game.torps == 0: prout(_("No torpedoes left.")) scanner.chew() return # First, get torpedo count while True: scanner.next() if scanner.token == IHALPHA: huh() return eli...
ienm = game.quad[w.x][w.y]
ienm = game.quad[w.i][w.j]
def hittem(hits): "Register a phaser hit on Klingons and Romulans." nenhr2 = len(game.enemies); kk=0 w = coord() skip(1) for (k, wham) in enumerate(hits): if wham==0: continue dustfac = randreal(0.9, 1.0) hit = wham*math.pow(dustfac,game.enemies[kk].kdist) kpini = game.enemies[kk].kpower kp = math.fabs(kpini) if PHASEF...
ienm = game.quad[aim.x][aim.y]
ienm = game.quad[aim.i][aim.j]
def phasers(): "Fire phasers at bad guys." hits = [] kz = 0; k = 1; irec=0 # Cheating inhibitor ifast = False; no = False; itarg = True; msgflag = True; rpow=0 automode = "NOTSET" key=0 skip(1) # SR sensors and Computer are needed for automode if damaged(DSRSENS) or damaged(DCOMPTR): itarg = False if game.condition == ...
game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT
game.state.chart[game.battle.i][game.battle.j].starbase = False game.quad[game.base.i][game.base.j] = IHDOT
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
game.state.chart[game.battle.x][game.battle.y].starbase = False
game.state.chart[game.battle.i][game.battle.j].starbase = False
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
game.state.galaxy[game.battle.x][game.battle.y].starbase = False
game.state.galaxy[game.battle.i][game.battle.j].starbase = False
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
hold.x = hold.y = 0
hold.i = hold.j = 0
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
if game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova:
if game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova:
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
game.battle = game.state.baseq[j]
game.battle = ibq
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
if not game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].starbase:
if not game.state.galaxy[game.state.kscmdr.i][game.state.kscmdr.j].starbase:
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
or not game.state.galaxy[game.battle.x][game.battle.y].starbase:
or not game.state.galaxy[game.battle.i][game.battle.j].starbase:
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
if game.probec.x != i or game.probec.y != j: game.probec.x = i game.probec.y = j
if game.probec.i != i or game.probec.j != j: game.probec.i = i game.probec.j = j
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
game.state.galaxy[game.probec.x][game.probec.y].supernova:
game.state.galaxy[game.probec.i][game.probec.j].supernova:
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
pdest = game.state.galaxy[game.probec.x][game.probec.y]
pdest = game.state.galaxy[game.probec.i][game.probec.j]
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
chp = game.state.chart[game.probec.x][game.probec.y]
chp = game.state.chart[game.probec.i][game.probec.j]
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
q = game.state.galaxy[w.x][w.y]
q = game.state.galaxy[w.i][w.j]
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
q.status = distressed
q.status = "distressed"
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
q = game.state.galaxy[ev.quadrant.x][ev.quadrant.y]
q = game.state.galaxy[ev.quadrant.i][ev.quadrant.j]
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
for i in range(w.x - 1, w.x + 2): for j in range(w.y - 1, w.y + 2):
for i in range(w.i - 1, w.i + 2): for j in range(w.j - 1, w.j + 2):
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
w.x = i; w.y = j
w.i = i; w.j = j
def destroybase(): "Code merges here for any commander destroying a starbase." # Not perfect, but will have to do # Handle case where base is in same quadrant as starship if game.battle == game.quadrant: game.state.chart[game.battle.x][game.battle.y].starbase = False game.quad[game.base.x][game.base.y] = IHDOT game.bas...
if game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova:
if game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova:
def wait(): "Wait on events." game.ididit = False while True: key = scanner.next() if key != IHEOL: break proutn(_("How long? ")) scanner.chew() if key != IHREAL: huh() return origTime = delay = scanner.real if delay <= 0.0: return if delay >= game.state.remtime or len(game.enemies) != 0: proutn(_("Are you sure? ")) i...
game.quad[nov.x][nov.y] = IHDOT
game.quad[nov.i][nov.j] = IHDOT
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
game.state.galaxy[game.quadrant.x][game.quadrant.y].stars -= 1
game.state.galaxy[game.quadrant.i][game.quadrant.j].stars -= 1
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
for offset.x in range(-1, 1+1): for offset.y in range(-1, 1+1): if offset.y==0 and offset.x==0:
for offset.i in range(-1, 1+1): for offset.j in range(-1, 1+1): if offset.j==0 and offset.i==0:
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
if not VALID_SECTOR(neighbor.y, neighbor.x):
if not VALID_SECTOR(neighbor.j, neighbor.i):
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
iquad = game.quad[neighbor.x][neighbor.y]
iquad = game.quad[neighbor.i][neighbor.j]
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
game.quad[neighbor.x][neighbor.y] = IHDOT
game.quad[neighbor.i][neighbor.j] = IHDOT
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
game.state.galaxy[game.quadrant.x][game.quadrant.y].planet = None
game.state.galaxy[game.quadrant.i][game.quadrant.j].planet = None
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
game.state.galaxy[game.quadrant.x][game.quadrant.y].starbase = False
game.state.galaxy[game.quadrant.i][game.quadrant.j].starbase = False
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
if not VALID_SECTOR(newc.x, newc.y):
if not VALID_SECTOR(newc.i, newc.j):
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
iquad1 = game.quad[newc.x][newc.y]
iquad1 = game.quad[newc.i][newc.j]
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
game.quad[neighbor.x][neighbor.y] = IHDOT game.quad[newc.x][newc.y] = iquad
game.quad[neighbor.i][neighbor.j] = IHDOT game.quad[newc.i][newc.j] = iquad
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
game.direc = course[3*(bump.x+1)+bump.y+2]
game.direc = course[3*(bump.i+1)+bump.j+2]
def nova(nov): "Star goes nova." course = (0.0, 10.5, 12.0, 1.5, 9.0, 0.0, 3.0, 7.5, 6.0, 4.5) newc = coord(); neighbor = coord(); bump = coord(0, 0) if withprob(0.05): # Wow! We've supernova'ed supernova(False, nov) return # handle initial nova game.quad[nov.x][nov.y] = IHDOT prout(crmena(False, IHSTAR, "sector", nov)...
for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): stars += game.state.galaxy[nq.x][nq.y].stars
for nq.i in range(GALSIZE): for nq.j in range(GALSIZE): stars += game.state.galaxy[nq.i][nq.j].stars
def supernova(induced, w=None): "Star goes supernova." num = 0; npdead = 0 nq = coord() if w != None: nq = w else: stars = 0 # Scheduled supernova -- select star # logic changed here so that we won't favor quadrants in top # left of universe for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): stars += game.state.ga...
for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): num -= game.state.galaxy[nq.x][nq.y].stars
for nq.i in range(GALSIZE): for nq.j in range(GALSIZE): num -= game.state.galaxy[nq.i][nq.j].stars
def supernova(induced, w=None): "Star goes supernova." num = 0; npdead = 0 nq = coord() if w != None: nq = w else: stars = 0 # Scheduled supernova -- select star # logic changed here so that we won't favor quadrants in top # left of universe for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): stars += game.state.ga...
num = randrange(game.state.galaxy[nq.x][nq.y].stars) + 1 for ns.x in range(QUADSIZE): for ns.y in range(QUADSIZE): if game.quad[ns.x][ns.y]==IHSTAR:
num = randrange(game.state.galaxy[nq.i][nq.j].stars) + 1 for ns.i in range(QUADSIZE): for ns.j in range(QUADSIZE): if game.quad[ns.i][ns.j]==IHSTAR:
def supernova(induced, w=None): "Star goes supernova." num = 0; npdead = 0 nq = coord() if w != None: nq = w else: stars = 0 # Scheduled supernova -- select star # logic changed here so that we won't favor quadrants in top # left of universe for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): stars += game.state.ga...
if (ns.x-game.sector.x)**2 + (ns.y-game.sector.y)**2 <= 2.1:
if (ns.i-game.sector.i)**2 + (ns.j-game.sector.j)**2 <= 2.1:
def supernova(induced, w=None): "Star goes supernova." num = 0; npdead = 0 nq = coord() if w != None: nq = w else: stars = 0 # Scheduled supernova -- select star # logic changed here so that we won't favor quadrants in top # left of universe for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): stars += game.state.ga...
kldead = game.state.galaxy[nq.x][nq.y].klingons game.state.galaxy[nq.x][nq.y].klingons = 0
kldead = game.state.galaxy[nq.i][nq.j].klingons game.state.galaxy[nq.i][nq.j].klingons = 0
def supernova(induced, w=None): "Star goes supernova." num = 0; npdead = 0 nq = coord() if w != None: nq = w else: stars = 0 # Scheduled supernova -- select star # logic changed here so that we won't favor quadrants in top # left of universe for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): stars += game.state.ga...
game.state.nscrem = game.state.kscmdr.x = game.state.kscmdr.y = game.isatb = 0
game.state.nscrem = game.state.kscmdr.i = game.state.kscmdr.j = game.isatb = 0
def supernova(induced, w=None): "Star goes supernova." num = 0; npdead = 0 nq = coord() if w != None: nq = w else: stars = 0 # Scheduled supernova -- select star # logic changed here so that we won't favor quadrants in top # left of universe for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): stars += game.state.ga...
nrmdead = game.state.galaxy[nq.x][nq.y].romulans game.state.galaxy[nq.x][nq.y].romulans = 0
nrmdead = game.state.galaxy[nq.i][nq.j].romulans game.state.galaxy[nq.i][nq.j].romulans = 0
def supernova(induced, w=None): "Star goes supernova." num = 0; npdead = 0 nq = coord() if w != None: nq = w else: stars = 0 # Scheduled supernova -- select star # logic changed here so that we won't favor quadrants in top # left of universe for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): stars += game.state.ga...
game.state.starkl += game.state.galaxy[nq.x][nq.y].stars game.state.basekl += game.state.galaxy[nq.x][nq.y].starbase
game.state.starkl += game.state.galaxy[nq.i][nq.j].stars game.state.basekl += game.state.galaxy[nq.i][nq.j].starbase
def supernova(induced, w=None): "Star goes supernova." num = 0; npdead = 0 nq = coord() if w != None: nq = w else: stars = 0 # Scheduled supernova -- select star # logic changed here so that we won't favor quadrants in top # left of universe for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): stars += game.state.ga...
game.state.galaxy[nq.x][nq.y].supernova = True
game.state.galaxy[nq.i][nq.j].supernova = True
def supernova(induced, w=None): "Star goes supernova." num = 0; npdead = 0 nq = coord() if w != None: nq = w else: stars = 0 # Scheduled supernova -- select star # logic changed here so that we won't favor quadrants in top # left of universe for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): stars += game.state.ga...
deadkl(game.enemies[l].kloc, game.quad[game.enemies[l].kloc.x][game.enemies[l].kloc.y], game.enemies[l].kloc)
deadkl(game.enemies[l].kloc, game.quad[game.enemies[l].kloc.i][game.enemies[l].kloc.j], game.enemies[l].kloc)
def kaboom(): stars() if game.ship==IHE: prouts("***") prouts(_("********* Entropy of %s maximized *********") % crmshp()) skip(1) stars() skip(1) if len(game.enemies) != 0: whammo = 25.0 * game.energy l=1 while l <= len(game.enemies): if game.enemies[l].kpower*game.enemies[l].kdist <= whammo: deadkl(game.enemies[l].kl...
srscan_window.move(w.x+1, w.y*2+2)
srscan_window.move(w.i+1, w.j*2+2)
def put_srscan_sym(w, sym): "Emit symbol for short-range scan." srscan_window.move(w.x+1, w.y*2+2) srscan_window.addch(sym) srscan_window.refresh()
put_srscan_sym(w, game.quad[w.x][w.y])
put_srscan_sym(w, game.quad[w.i][w.j])
def boom(w): "Enemy fall down, go boom." if game.options & OPTION_CURSES: drawmaps(2) setwnd(srscan_window) srscan_window.attron(curses.A_REVERSE) put_srscan_sym(w, game.quad[w.x][w.y]) #sound(500) #time.sleep(1.0) #nosound() srscan_window.attroff(curses.A_REVERSE) put_srscan_sym(w, game.quad[w.x][w.y]) curses.delay_ou...
proutn(_("Track for %s torpedo number %d- ") % (game.quad[origin.x][origin.y],i+1))
proutn(_("Track for %s torpedo number %d- ") % (game.quad[origin.i][origin.j],i+1))
def tracktorpedo(origin, w, step, i, n, iquad): "Torpedo-track animation." if not game.options & OPTION_CURSES: if step == 1: if n != 1: skip(1) proutn(_("Track for %s torpedo number %d- ") % (game.quad[origin.x][origin.y],i+1)) else: skip(1) proutn(_("Torpedo track- ")) elif step==4 or step==9: skip(1) proutn("%s "...
game.quad[game.sector.x][game.sector.y] = game.ship
game.quad[game.sector.i][game.sector.j] = game.ship
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
if not game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova:
if not game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova:
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
w.x = w.y = 0
w.i = w.j = 0
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
game.quad[game.sector.x][game.sector.y] = IHDOT x = game.sector.x y = game.sector.y
game.quad[game.sector.i][game.sector.j] = IHDOT x = game.sector.i y = game.sector.j
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
w.x = int(round(x)) w.y = int(round(y)) if not VALID_SECTOR(w.x, w.y):
w.i = int(round(x)) w.j = int(round(y)) if not VALID_SECTOR(w.i, w.j):
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
if game.skill > SKILL_GOOD and game.klhere > 0 and not game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova:
if game.skill > SKILL_GOOD and game.klhere > 0 and not game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova:
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
x = (QUADSIZE*game.quadrant.x)+game.sector.x y = (QUADSIZE*game.quadrant.y)+game.sector.y w.x = int(round(x+10.0*game.dist*bigger*deltax)) w.y = int(round(y+10.0*game.dist*bigger*deltay))
x = (QUADSIZE*game.quadrant.i)+game.sector.i y = (QUADSIZE*game.quadrant.j)+game.sector.j w.i = int(round(x+10.0*game.dist*bigger*deltax)) w.j = int(round(y+10.0*game.dist*bigger*deltay))
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
if w.x < 0: w.x = -w.x
if w.i < 0: w.i = -w.i
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
if w.y < 0: w.y = -w.y
if w.j < 0: w.j = -w.j
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
if w.x >= GALSIZE*QUADSIZE: w.x = (GALSIZE*QUADSIZE*2) - w.x
if w.i >= GALSIZE*QUADSIZE: w.i = (GALSIZE*QUADSIZE*2) - w.i
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
if w.y >= GALSIZE*QUADSIZE: w.y = (GALSIZE*QUADSIZE*2) - w.y
if w.j >= GALSIZE*QUADSIZE: w.j = (GALSIZE*QUADSIZE*2) - w.j
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
game.quadrant.x = w.x/QUADSIZE game.quadrant.y = w.y/QUADSIZE game.sector.x = w.x - (QUADSIZE*game.quadrant.x) game.sector.y = w.y - (QUADSIZE*game.quadrant.y)
game.quadrant.i = w.i/QUADSIZE game.quadrant.j = w.j/QUADSIZE game.sector.i = w.i - (QUADSIZE*game.quadrant.i) game.sector.j = w.j - (QUADSIZE*game.quadrant.j)
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
iquad = game.quad[w.x][w.y]
iquad = game.quad[w.i][w.j]
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
final.x = int(round(deltax)) final.y = int(round(deltay))
final.i = int(round(deltax)) final.j = int(round(deltay))
def no_quad_change(): # No quadrant change -- compute new average enemy distances game.quad[game.sector.x][game.sector.y] = game.ship if game.enemies: for enemy in game.enemies: finald = (w-enemy.kloc).distance() enemy.kavgd = 0.5 * (finald + enemy.kdist) enemy.kdist = finald game.enemies.sort(lambda x, y: cmp(x.kdist,...
if not game.base.is_valid() or abs(game.sector.x-game.base.x) > 1 or abs(game.sector.y-game.base.y) > 1:
if not game.base.is_valid() or abs(game.sector.i-game.base.i) > 1 or abs(game.sector.j-game.base.j) > 1:
def dock(verbose): "Dock our ship at a starbase." scanner.chew() if game.condition == "docked" and verbose: prout(_("Already docked.")) return if game.inorbit: prout(_("You must first leave standard orbit.")) return if not game.base.is_valid() or abs(game.sector.x-game.base.x) > 1 or abs(game.sector.y-game.base.y) > 1:...
dquad.x = xi dquad.y = xj dsect.y = xk dsect.x = xl
dquad.i = xi dquad.j = xj dsect.j = xk dsect.i = xl
def getcourse(isprobe, akey): "Get a course and distance from the user." key = 0 dquad = copy.copy(game.quadrant) navmode = "unspecified" itemp = "curt" dsect = coord() iprompt = False if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) scan...
dquad.x = xi dquad.y = xj dsect.y = dsect.x = 4
dquad.i = xi dquad.j = xj dsect.j = dsect.i = 4
def getcourse(isprobe, akey): "Get a course and distance from the user." key = 0 dquad = copy.copy(game.quadrant) navmode = "unspecified" itemp = "curt" dsect = coord() iprompt = False if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) scan...
dsect.y = xi dsect.x = xj
dsect.j = xi dsect.i = xj
def getcourse(isprobe, akey): "Get a course and distance from the user." key = 0 dquad = copy.copy(game.quadrant) navmode = "unspecified" itemp = "curt" dsect = coord() iprompt = False if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) scan...
if not VALID_QUADRANT(dquad.y,dquad.x) or not VALID_SECTOR(dsect.x,dsect.y):
if not VALID_QUADRANT(dquad.j,dquad.i) or not VALID_SECTOR(dsect.i,dsect.j):
def getcourse(isprobe, akey): "Get a course and distance from the user." key = 0 dquad = copy.copy(game.quadrant) navmode = "unspecified" itemp = "curt" dsect = coord() iprompt = False if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) scan...
delta.x = dquad.y-game.quadrant.y + 0.1*(dsect.x-game.sector.y) delta.y = game.quadrant.x-dquad.x + 0.1*(game.sector.x-dsect.y)
delta.i = dquad.j-game.quadrant.j + 0.1*(dsect.i-game.sector.j) delta.j = game.quadrant.i-dquad.i + 0.1*(game.sector.i-dsect.j)
def getcourse(isprobe, akey): "Get a course and distance from the user." key = 0 dquad = copy.copy(game.quadrant) navmode = "unspecified" itemp = "curt" dsect = coord() iprompt = False if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) scan...
delta.y = scanner.real
delta.j = scanner.real
def getcourse(isprobe, akey): "Get a course and distance from the user." key = 0 dquad = copy.copy(game.quadrant) navmode = "unspecified" itemp = "curt" dsect = coord() iprompt = False if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) scan...
delta.x = scanner.real
delta.i = scanner.real
def getcourse(isprobe, akey): "Get a course and distance from the user." key = 0 dquad = copy.copy(game.quadrant) navmode = "unspecified" itemp = "curt" dsect = coord() iprompt = False if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) scan...
if delta.x == 0 and delta.y == 0:
if delta.i == 0 and delta.j == 0:
def getcourse(isprobe, akey): "Get a course and distance from the user." key = 0 dquad = copy.copy(game.quadrant) navmode = "unspecified" itemp = "curt" dsect = coord() iprompt = False if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) scan...
x = game.sector.x y = game.sector.y
x = game.sector.i y = game.sector.j
def warp(timewarp): "ove under warp drive." blooey = False; twarp = False if not timewarp: # Not WARPX entry game.ididit = False if game.damage[DWARPEN] > 10.0: scanner.chew() skip(1) prout(_("Engineer Scott- \"The impulse engines are damaged, Sir.\"")) return if damaged(DWARPEN) and game.warpfac > 4.0: scanner.chew() ...
game.state.galaxy[game.quadrant.x][game.quadrant.y].charted = True
game.state.galaxy[game.quadrant.i][game.quadrant.j].charted = True
def atover(igrab): "Cope with being tossed out of quadrant by supernova or yanked by beam." scanner.chew() # is captain on planet? if game.landed: if damaged(DTRANSP): finish(FPNOVA) return prout(_("Scotty rushes to the transporter controls.")) if game.shldup: prout(_("But with the shields up it's hopeless.")) finish(F...
if not game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova:
if not game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova:
def atover(igrab): "Cope with being tossed out of quadrant by supernova or yanked by beam." scanner.chew() # is captain on planet? if game.landed: if damaged(DTRANSP): finish(FPNOVA) return prout(_("Scotty rushes to the transporter controls.")) if game.shldup: prout(_("But with the shields up it's hopeless.")) finish(F...
game.probex = game.quadrant.x*QUADSIZE + game.sector.x - 1 game.probey = game.quadrant.y*QUADSIZE + game.sector.y - 1
game.probex = game.quadrant.i*QUADSIZE + game.sector.i - 1 game.probey = game.quadrant.j*QUADSIZE + game.sector.j - 1
def probe(): "Launch deep-space probe." # New code to launch a deep space probe if game.nprobes == 0: scanner.chew() skip(1) if game.ship == IHE: prout(_("Engineer Scott- \"We have no more deep space probes, Sir.\"")) else: prout(_("Ye Faerie Queene has no deep space probes.")) return if damaged(DDSP): scanner.chew() s...
if game.base.x!=0:
if game.base.i!=0:
def mayday(): "Yell for help from nearest starbase." # There's more than one way to move in this game! scanner.chew() # Test for conditions which prevent calling for help if game.condition == "docked": prout(_("Lt. Uhura- \"But Captain, we're already docked.\"")) return if damaged(DRADIO): prout(_("Subspace radio dama...
game.quad[game.sector.x][game.sector.y]=IHDOT
game.quad[game.sector.i][game.sector.j]=IHDOT
def mayday(): "Yell for help from nearest starbase." # There's more than one way to move in this game! scanner.chew() # Test for conditions which prevent calling for help if game.condition == "docked": prout(_("Lt. Uhura- \"But Captain, we're already docked.\"")) return if damaged(DRADIO): prout(_("Subspace radio dama...
if VALID_SECTOR(w.x,w.y) and game.quad[w.x][w.y]==IHDOT:
if VALID_SECTOR(w.i,w.j) and game.quad[w.i][w.j]==IHDOT:
def mayday(): "Yell for help from nearest starbase." # There's more than one way to move in this game! scanner.chew() # Test for conditions which prevent calling for help if game.condition == "docked": prout(_("Lt. Uhura- \"But Captain, we're already docked.\"")) return if damaged(DRADIO): prout(_("Subspace radio dama...
q = game.state.galaxy[game.quadrant.x][game.quadrant.y]
q = game.state.galaxy[game.quadrant.i][game.quadrant.j]
def abandon(): "Abandon ship." scanner.chew() if game.condition=="docked": if game.ship!=IHE: prout(_("You cannot abandon Ye Faerie Queene.")) return else: # Must take shuttle craft to exit if game.damage[DSHUTTL]==-1: prout(_("Ye Faerie Queene has no shuttle craft.")) return if game.damage[DSHUTTL]<0: prout(_("Shuttle...
game.sector.x = game.sector.y = 5
game.sector.i = game.sector.j = 5
def abandon(): "Abandon ship." scanner.chew() if game.condition=="docked": if game.ship!=IHE: prout(_("You cannot abandon Ye Faerie Queene.")) return else: # Must take shuttle craft to exit if game.damage[DSHUTTL]==-1: prout(_("Ye Faerie Queene has no shuttle craft.")) return if game.damage[DSHUTTL]<0: prout(_("Shuttle...
game.quad[game.sector.x][game.sector.y] = IHDOT
game.quad[game.sector.i][game.sector.j] = IHDOT
def abandon(): "Abandon ship." scanner.chew() if game.condition=="docked": if game.ship!=IHE: prout(_("You cannot abandon Ye Faerie Queene.")) return else: # Must take shuttle craft to exit if game.damage[DSHUTTL]==-1: prout(_("Ye Faerie Queene has no shuttle craft.")) return if game.damage[DSHUTTL]<0: prout(_("Shuttle...
if VALID_SECTOR(game.sector.x, game.sector.y) and \ game.quad[game.sector.x][game.sector.y] == IHDOT:
if VALID_SECTOR(game.sector.i, game.sector.j) and \ game.quad[game.sector.i][game.sector.j] == IHDOT:
def abandon(): "Abandon ship." scanner.chew() if game.condition=="docked": if game.ship!=IHE: prout(_("You cannot abandon Ye Faerie Queene.")) return else: # Must take shuttle craft to exit if game.damage[DSHUTTL]==-1: prout(_("Ye Faerie Queene has no shuttle craft.")) return if game.damage[DSHUTTL]<0: prout(_("Shuttle...
game.sector.x=QUADSIZE/2 game.sector.y=QUADSIZE/2
game.sector.i=QUADSIZE/2 game.sector.j=QUADSIZE/2
def abandon(): "Abandon ship." scanner.chew() if game.condition=="docked": if game.ship!=IHE: prout(_("You cannot abandon Ye Faerie Queene.")) return else: # Must take shuttle craft to exit if game.damage[DSHUTTL]==-1: prout(_("Ye Faerie Queene has no shuttle craft.")) return if game.damage[DSHUTTL]<0: prout(_("Shuttle...
game.quad[game.sector.x][game.sector.y] = game.ship = IHF
game.quad[game.sector.i][game.sector.j] = game.ship = IHF
def abandon(): "Abandon ship." scanner.chew() if game.condition=="docked": if game.ship!=IHE: prout(_("You cannot abandon Ye Faerie Queene.")) return else: # Must take shuttle craft to exit if game.damage[DSHUTTL]==-1: prout(_("Ye Faerie Queene has no shuttle craft.")) return if game.damage[DSHUTTL]<0: prout(_("Shuttle...
if game.alldone or game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova or game.justin:
if game.alldone or game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova or game.justin:
def consumeTime(): "Abort a lengthy operation if an event interrupts it." game.ididit = True events() if game.alldone or game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova or game.justin: return True return False
if abs(game.sector.x-game.plnet.x)>1 or abs(game.sector.y-game.plnet.y)>1:
if abs(game.sector.i-game.plnet.i)>1 or abs(game.sector.j-game.plnet.j)>1:
def orbit(): "Enter standard orbit." skip(1) scanner.chew() if game.inorbit: prout(_("Already in standard orbit.")) return if damaged(DWARPEN) and damaged(DIMPULS): prout(_("Both warp and impulse engines damaged.")) return if not game.plnet.is_valid(): prout("There is no planet in this sector.") return if abs(game.sect...
deadkl(game.enemies[1].kloc, game.quad[game.enemies[1].kloc.x][game.enemies[1].kloc.y],game.enemies[1].kloc)
deadkl(game.enemies[1].kloc, game.quad[game.enemies[1].kloc.i][game.enemies[1].kloc.j],game.enemies[1].kloc)
def deathray(): "Use the big zapper." game.ididit = False skip(1) scanner.chew() if game.ship != IHE: prout(_("Ye Faerie Queene has no death ray.")) return if len(game.enemies)==0: prout(_("Sulu- \"But Sir, there are no enemies in this quadrant.\"")) return if damaged(DDRAY): prout(_("Death Ray is damaged.")) return p...
for x in range(game.quadrant.x-1, game.quadrant.x+2):
for x in range(game.quadrant.i-1, game.quadrant.i+2):
def lrscan(silent): "Long-range sensor scan." if damaged(DLRSENS): # Now allow base's sensors if docked if game.condition != "docked": if not silent: prout(_("LONG-RANGE SENSORS DAMAGED.")) return if not silent: prout(_("Starbase's long-range scan")) elif not silent: prout(_("Long-range scan")) for x in range(game.quad...
for y in range(game.quadrant.y-1, game.quadrant.y+2):
for y in range(game.quadrant.j-1, game.quadrant.j+2):
def lrscan(silent): "Long-range sensor scan." if damaged(DLRSENS): # Now allow base's sensors if docked if game.condition != "docked": if not silent: prout(_("LONG-RANGE SENSORS DAMAGED.")) return if not silent: prout(_("Starbase's long-range scan")) elif not silent: prout(_("Long-range scan")) for x in range(game.quad...
if (game.options & OPTION_SHOWME) and i == game.quadrant.x and j == game.quadrant.y:
if (game.options & OPTION_SHOWME) and i == game.quadrant.i and j == game.quadrant.j:
def chart(): "Display the star chart." scanner.chew() if (game.options & OPTION_AUTOSCAN): lrscan(silent=True) if not damaged(DRADIO): rechart() if game.lastchart < game.state.date and game.condition == "docked": prout(_("Spock- \"I revised the Star Chart from the starbase's records.\"")) rechart() prout(_(" STA...
if goodScan or (abs(i-game.sector.x)<= 1 and abs(j-game.sector.y) <= 1):
if goodScan or (abs(i-game.sector.i)<= 1 and abs(j-game.sector.j) <= 1):
def sectscan(goodScan, i, j): "Light up an individual dot in a sector." if goodScan or (abs(i-game.sector.x)<= 1 and abs(j-game.sector.y) <= 1): if (game.quad[i][j]==IHMATER0) or (game.quad[i][j]==IHMATER1) or (game.quad[i][j]==IHMATER2) or (game.quad[i][j]==IHE) or (game.quad[i][j]==IHF): if game.condition == "red":...
plnet = game.state.galaxy[game.quadrant.x][game.quadrant.y].planet
plnet = game.state.galaxy[game.quadrant.i][game.quadrant.j].planet
def status(req=0): "Emit status report lines" if not req or req == 1: prstat(_("Stardate"), _("%.1f, Time Left %.2f") \ % (game.state.date, game.state.remtime)) if not req or req == 2: if game.condition != "docked": newcnd() dam = 0 for t in range(NDEVICES): if game.damage[t]>0: dam += 1 prstat(_("Condition"), _("%s, %...