sc = game.state.kscmdr
for (i, base) in enumerate(game.state.baseq):
basetbl.append((i, (base - sc).distance()))
sc = game.state.kscmdr
for (i, base) in enumerate(game.state.baseq):
basetbl.append((i, (base - sc).distance()))
basetbl.sort(key=lambda x: x[1])
# look for nearest base without a commander, no Enterprise, and
# without too many Klingons, and not already under attack.
basetbl.sort(key=lambda x: x[1])
# look for nearest base without a commander, no Enterprise, and
# without too many Klingons, and not already under attack.
prout(_("Lt. Uhura- \"Captain, the starbase in Quadrant %s") \
% game.state.kscmdr)
prout(_(" reports that it is under attack from the Klingon Super-commander."))
prout(_("Lt. Uhura- \"Captain, the starbase in Quadrant %s") \
% game.state.kscmdr)
prout(_(" reports that it is under attack from the Klingon Super-commander."))
# do nothing if we are blocked
if game.quad[tid.i][tid.j] not in ('.', '#'):
return
# do nothing if we are blocked
if game.quad[tid.i][tid.j] not in ('.', '#'):
return
hits.append(scanner.real)
rpow += scanner.real
# If total requested is too much, inform and start over
hits.append(scanner.real)
rpow += scanner.real
# If total requested is too much, inform and start over