فهرست منبع

Handle danger override when trading. :O

Steve Thielemann 5 سال پیش
والد
کامیت
6ce2f3ad4a
1فایلهای تغییر یافته به همراه32 افزوده شده و 0 حذف شده
  1. 32 0
      flexible.py

+ 32 - 0
flexible.py

@@ -522,6 +522,33 @@ class ScriptPort(object):
         there is more then one.
         Option Trade_Turns, will use this as default turns, without 
         asking.
+
+        state = 1   "D"
+                    Get current sector, store possible warps.
+        state = 2   Done with display sector.
+                    Look for possible trades.
+                    If possible, or only one, state to 3.
+        state = 3   Command prompt, state = 4
+                    Prompt for port to trade with (If not Trade_UserFirst).
+                    Port found/given to trade with, state = 5, trade()
+
+        trade()     "PT"
+
+        state = 5   "-----" in line, state = 6
+
+        state = 6   "We are buying", "\r" (sell all!), state = 7
+                    "We are selling", state = 8
+
+        state = 7   "Haggle sell"
+                    "We are buying", "\r" (sell all!), state = 7
+                    "We are selling", state = 8
+        
+        state = 8   "Haggle buy"
+                    Done, if times_left > 0 then
+                    move and state = 10
+
+
+
     """
     def __init__(self, game):
         self.game = game
@@ -842,6 +869,11 @@ class ScriptPort(object):
 
                 self.queue_player.put("{0}\r".format(self.this_sector))
                 self.state = 10
+                
+        elif self.state == 10:
+            # DANGER! You have marked sector X to be avoided!
+            if prompt.startswith('Do you really want to warp there? (Y/N) '):
+                self.queue_player.put("Y")
 
         elif self.state == 99:
             # This is a good place to deactivate at.