X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=sst.py;h=4b3fdfa8a44aadc33df2243abc2cfc38b201da06;hb=fa4cd8ef1eec9a5ec25cf574e29c3d33e11f3a9d;hp=064eba1a4c01430e59a5a208319f041feec6ec05;hpb=3c04db74235bbcbd7ba4e2bc210a3d3d6b8e2fa4;p=super-star-trek.git diff --git a/sst.py b/sst.py index 064eba1..4b3fdfa 100755 --- a/sst.py +++ b/sst.py @@ -416,7 +416,7 @@ def randreal(*args): def welcoming(iq): "Would this quadrant welcome another Klingon?" - return iq.valid_Quadrant() and \ + return iq.valid_quadrant() and \ not game.state.galaxy[iq.i][iq.j].supernova and \ game.state.galaxy[iq.i][iq.j].klingons < MAXKLQUAD @@ -2692,11 +2692,9 @@ def kaboom(): skip(1) if len(game.enemies) != 0: whammo = 25.0 * game.energy - l=1 - while l <= len(game.enemies): + for l in range(len(game.enemies)): if game.enemies[l].power*game.enemies[l].kdist <= whammo: deadkl(game.enemies[l].location, game.quad[game.enemies[l].location.i][game.enemies[l].location.j], game.enemies[l].location) - l += 1 finish(FDILITHIUM) def killrate(): @@ -3161,16 +3159,11 @@ def skip(i): "Skip i lines. Pause game if this would cause a scrolling event." for dummy in range(i): if game.options & OPTION_CURSES: - (y, x) = curwnd.getyx() - (my, mx) = curwnd.getmaxyx() - if curwnd == message_window and y >= my - 2: - pause_game() - clrscr() - else: - try: - curwnd.move(y+1, 0) - except curses.error: - pass + (y, x) = curwnd.getyx() + try: + curwnd.move(y+1, 0) + except curses.error: + pass else: global linecount linecount += 1 @@ -3182,6 +3175,11 @@ def skip(i): def proutn(line): "Utter a line with no following line feed." if game.options & OPTION_CURSES: + (y, x) = curwnd.getyx() + (my, mx) = curwnd.getmaxyx() + if curwnd == message_window and y >= my - 2: + pause_game() + clrscr() curwnd.addstr(line) curwnd.refresh() else: