X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=sst;h=45d60977dcd45e7743498cc07da649d2683631e9;hb=cac53a568884ecbecd5332949a3e50212de16d7a;hp=156868f803217d508c03e5e0a3717b10f963ee04;hpb=bf3f318f863f844f2446b55731d61c66424e8ff8;p=super-star-trek.git diff --git a/sst b/sst index 156868f..45d6097 100755 --- a/sst +++ b/sst @@ -101,7 +101,7 @@ FOREVER = 1e30 # Time for the indefinite future MAXBURST = 3 # Max # of torps you can launch in one turn MINCMDR = 10 # Minimum number of Klingon commanders DOCKFAC = 0.25 # Repair faster when docked -PHASEFAC = 2.0 # Unclear what this is, it was in the C version +PHASEFAC = 2.0 # Phaser attenuation factor ALGERON = 2311 # Date of the Treaty of Algeron @@ -3172,13 +3172,14 @@ def finish(ifin): prout(_("Your starship is now an expanding cloud of subatomic particles")) elif ifin == FMATERIALIZE: prout(_("Starbase was unable to re-materialize your starship.")) - prout(_("Sic transit gloria mundi")) + prout(_("Sic transit gloria mundi.")) elif ifin == FPHASER: prout(_("The %s has been cremated by its own phasers.") % crmshp()) elif ifin == FLOST: prout(_("You and your landing party have been")) prout(_("converted to energy, dissipating through space.")) elif ifin == FMINING: + # This does not seem to be reachable from any code path. prout(_("You are left with your landing party on")) prout(_("a wild jungle planet inhabited by primitive cannibals.")) skip(1) @@ -6241,6 +6242,7 @@ def setpassword(): proutn(_("Please type in a secret password- ")) scanner.nexttok() game.passwd = scanner.token + #game.passwd = getpass.getpass("Please type in a secret password- ") if game.passwd is not None: break else: @@ -6652,14 +6654,14 @@ class sstscanner: s = Coord() self.nexttok() if (game.options & OPTION_ALPHAMERIC): - if (self.type == "IHALPHA") and (self.token[0] in "abcdefghij") and (self.token[1] in "0123456789"): - s.i = ord(self.token[0]) - ord("a") - try: - s.j = int(self.token[-1:])-1 - except TypeError: - huh() - return None - return s + try: + if (self.type == "IHALPHA") and (self.token[0] in "abcdefghij") and (self.token[1] in "0123456789"): + s.i = ord(self.token[0]) - ord("a") + s.j = int(self.token[1:])-1 + return s + except (TypeError, IndexError): + huh() + return None if self.type != "IHREAL": huh() return None