X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Fsst.py;h=fbd85f9b1c29460412f28205ab2f050d2c89de62;hp=baaea8c0fa5be65d90d9d912e8254ed678f5693f;hb=4162df86eb0d33c39014a02075294128fd2ca84d;hpb=9166a6df132fa18c32881b2019e1fcc41716a3ab diff --git a/src/sst.py b/src/sst.py index baaea8c..fbd85f9 100644 --- a/src/sst.py +++ b/src/sst.py @@ -1345,13 +1345,12 @@ def torpedo(origin, course, dispersion, number, nburst): game.sector = jw proutn(crmshp()) shoved = True - elif iquad in (IHC, IHS): # Hit a commander + elif iquad in (IHC, IHS, IHR, IHK): # Hit a regular enemy + # find the enemy if withprob(0.05): prout(crmena(True, iquad, "sector", w) + _(" uses anti-photon device;")) prout(_(" torpedo neutralized.")) return None - elif iquad in (IHR, IHK): # Hit a regular enemy - # find the enemy for enemy in game.enemies: if w == enemy.kloc: break @@ -2429,12 +2428,14 @@ def events(): for ibq in game.state.baseq: for cmdr in game.state.kcmdr: if ibq == cmdr and ibq != game.quadrant and ibq != game.state.kscmdr: - raise "foundit" - except "foundit": - # no match found -- try later - schedule(FBATTAK, expran(0.3*game.intime)) - unschedule(FCDBAS) - continue + raise ibq + else: + # no match found -- try later + schedule(FBATTAK, expran(0.3*game.intime)) + unschedule(FCDBAS) + continue + except coord: + pass # commander + starbase combination found -- launch attack game.battle = ibq schedule(FCDBAS, randreal(1.0, 4.0))