|
@@ -2425,7 +2425,7 @@ class PlanetUpScript(object):
|
|
|
"You don't have any planets? You poor, poor dear.", base="red"
|
|
|
)
|
|
|
)
|
|
|
- self.deactivate()
|
|
|
+ self.deactivate(True)
|
|
|
return
|
|
|
|
|
|
# I need this to know if I can just land, or need to move to the planet.
|
|
@@ -2516,7 +2516,7 @@ class PlanetUpScript(object):
|
|
|
if self.citadel:
|
|
|
# Need extra Quit to get out of citadel, then out of planet.
|
|
|
self.queue_player.put("Q")
|
|
|
- self.deactivate()
|
|
|
+ self.deactivate(True)
|
|
|
return
|
|
|
if "construct one" in prompt:
|
|
|
# No, but start moving things around to build one.
|
|
@@ -2565,7 +2565,7 @@ class PlanetUpScript(object):
|
|
|
self.queue_game.put(
|
|
|
self.nl + Boxes.alert("Find Nearest Failed!")
|
|
|
)
|
|
|
- self.deactivate()
|
|
|
+ self.deactivate(True)
|
|
|
return
|
|
|
self.queue_player.put("{0}\r".format(place))
|
|
|
# self.queue_player.put("{0}\rE".format(place))
|
|
@@ -2596,7 +2596,7 @@ class PlanetUpScript(object):
|
|
|
elif re.match(r"How many holds of .+ do you want to sell", prompt):
|
|
|
# This shouldn't occur...
|
|
|
self.queue_game.put("OH NOSE!" + self.nl)
|
|
|
- self.deactivate()
|
|
|
+ self.deactivate(True)
|
|
|
return
|
|
|
elif prompt.startswith("Do you want to engage the TransWarp drive? "):
|
|
|
self.queue_player.put("N")
|
|
@@ -2850,7 +2850,7 @@ class PlanetUpScript(object):
|
|
|
turns = int(parts[3])
|
|
|
if turns < 200:
|
|
|
self.queue_game.put(self.nl + Boxes.alert("LOW TURNS.") + self.nl)
|
|
|
- self.deactivate()
|
|
|
+ self.deactivate(True)
|
|
|
elif self.state == 9:
|
|
|
if re.match(r"You have \d turns left.", line):
|
|
|
parts = line.split()
|
|
@@ -2865,14 +2865,17 @@ class PlanetUpScript(object):
|
|
|
# Call this to chain something after we exit.
|
|
|
return self.defer
|
|
|
|
|
|
- def deactivate(self):
|
|
|
+ def deactivate(self, andExit=False):
|
|
|
self.state = 0
|
|
|
if not self.defer is None:
|
|
|
# We have something, so:
|
|
|
self.game.to_player = self.to_player
|
|
|
self.observer.load(self.save)
|
|
|
self.save = None
|
|
|
- self.defer.callback(1)
|
|
|
+ if andExit:
|
|
|
+ self.defer.callback({"exit": True})
|
|
|
+ else:
|
|
|
+ self.defer.callback("done")
|
|
|
self.defer = None
|
|
|
else:
|
|
|
# Still "exit" out.
|