X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Fsst.py;h=51ad07b53cdf03fa18d9e7a55bad2bddfbb6c357;hp=56ce6fa09ebbc18b4d79fa9bfdb3133d0e51b925;hb=8e7c8e784c1c049639c3c08d93e4c29d4cc4f012;hpb=535058c64dde042fa0938e1df5d136760abb3caf diff --git a/src/sst.py b/src/sst.py index 56ce6fa..51ad07b 100644 --- a/src/sst.py +++ b/src/sst.py @@ -240,9 +240,9 @@ class coord: def is_valid(self): return self.x != None and self.y != None def __eq__(self, other): - return other != None and self.x == other.y and self.x == other.y + return other != None and self.x == other.x and self.y == other.y def __add__(self, other): - return coord(self.x+self.x, self.y+self.y) + return coord(self.x+other.x, self.y+other.y) def __sub__(self, other): return coord(self.x-other.x, self.y-other.y) def __mul__(self, other): @@ -615,10 +615,9 @@ def randreal(*args): def welcoming(iq): "Would this quadrant welcome another Klingon?" return VALID_QUADRANT(iq.x,iq.y) and \ - not game.state.galaxy[iq.x][iq.y].supernova or \ + not game.state.galaxy[iq.x][iq.y].supernova and \ game.state.galaxy[iq.x][iq.y].klingons < MAXKLQUAD - def tryexit(enemy, look, irun): "A bad guy attempts to bug out." iq = coord() @@ -1536,7 +1535,7 @@ def fry(hit): 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 + # game could be over at this point, check if game.alldone: return attempt = False; ihurt = False; @@ -1735,8 +1734,8 @@ def targetcheck(w): return None delta = coord() # FIXME: C code this was translated from is wacky -- why the sign reversal? - delta.y = 0.1*(w.y - game.sector.y); - delta.x = 0.1*(game.sector.x - w.x); + delta.y = (w.y - game.sector.y); + delta.x = (game.sector.x - w.x); if delta == coord(0, 0): skip(1) prout(_("Spock- \"Bridge to sickbay. Dr. McCoy,")) @@ -3987,12 +3986,12 @@ def getcourse(isprobe, akey): if key != IHREAL: huh() return False - delta.x = scanner.real + delta.y = scanner.real key = scanner.next() if key != IHREAL: huh() return False - delta.y = scanner.real + delta.x = scanner.real # Check for zero movement if delta.x == 0 and delta.y == 0: scanner.chew()