X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=sst.py;h=ea8d7c6eaf1a5b1928e8461f8ffe59f50844b86b;hp=e79dd5b58d4d8ec3daa65b6eba15f84e808bfe75;hb=b51fd3a5d643134a0ff5a3b1ab1f5f4eaa4cb92b;hpb=9023547111577e2cda6f4d88fdff7303b3cfc726 diff --git a/sst.py b/sst.py index e79dd5b..ea8d7c6 100755 --- a/sst.py +++ b/sst.py @@ -1607,16 +1607,16 @@ def deadkl(w, etype, mv): # Killed some type of Klingon game.state.galaxy[game.quadrant.i][game.quadrant.j].klingons -= 1 game.klhere -= 1 - if type == 'C': + if etype == 'C': game.state.kcmdr.remove(game.quadrant) unschedule(FTBEAM) if game.state.kcmdr: schedule(FTBEAM, expran(1.0*game.incom/len(game.state.kcmdr))) if is_scheduled(FCDBAS) and game.battle == game.quadrant: unschedule(FCDBAS) - elif type == 'K': + elif etype == 'K': game.state.remkl -= 1 - elif type == 'S': + elif etype == 'S': game.state.nscrem -= 1 game.state.kscmdr.invalidate() game.isatb = 0 @@ -1801,6 +1801,9 @@ def hittem(hits): skip(1) kk = 0 for wham in hits: + if not kk < len(game.enemies): + # Should never happen. + break if wham == 0: continue dustfac = randreal(0.9, 1.0) @@ -1832,7 +1835,6 @@ def hittem(hits): finish(FWON) if game.alldone: return - kk -= 1 # don't do the increment continue else: # decide whether or not to emasculate klingon if kpow > 0 and withprob(0.9) and kpow <= randreal(0.4, 0.8)*kpini: @@ -6284,6 +6286,7 @@ def makemoves(): huh() else: break + prout("COMMAND> %s" % cmd) if cmd == "SRSCAN": # srscan srscan() elif cmd == "STATUS": # status