diff options
Diffstat (limited to 'Archipelago/client.gd')
-rw-r--r-- | Archipelago/client.gd | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index bdd3905..2dcd375 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -5,6 +5,7 @@ var ap_user = "" | |||
5 | var ap_pass = "" | 5 | var ap_pass = "" |
6 | 6 | ||
7 | const ap_version = {"major": 0, "minor": 4, "build": 0, "class": "Version"} | 7 | const ap_version = {"major": 0, "minor": 4, "build": 0, "class": "Version"} |
8 | const orange_tower = ["Second", "Third", "Fourth", "Fifth", "Sixth", "Seventh"] | ||
8 | 9 | ||
9 | var _client = WebSocketClient.new() | 10 | var _client = WebSocketClient.new() |
10 | var _last_state = WebSocketPeer.STATE_CLOSED | 11 | var _last_state = WebSocketPeer.STATE_CLOSED |
@@ -33,6 +34,7 @@ var _panel_ids_by_location = {} | |||
33 | var _map_loaded = false | 34 | var _map_loaded = false |
34 | var _held_items = [] | 35 | var _held_items = [] |
35 | var _held_locations = [] | 36 | var _held_locations = [] |
37 | var _tower_floors = 0 | ||
36 | 38 | ||
37 | signal client_connected | 39 | signal client_connected |
38 | 40 | ||
@@ -142,6 +144,11 @@ func _on_data(): | |||
142 | global._print(message) | 144 | global._print(message) |
143 | 145 | ||
144 | elif cmd == "ReceivedItems": | 146 | elif cmd == "ReceivedItems": |
147 | if message["index"] == 0: | ||
148 | # We are being sent all of our items, so lets reset any progress | ||
149 | # on progressive items. | ||
150 | _tower_floors = 0 | ||
151 | |||
145 | for item in message["items"]: | 152 | for item in message["items"]: |
146 | if _map_loaded: | 153 | if _map_loaded: |
147 | processItem(item["item"]) | 154 | processItem(item["item"]) |
@@ -251,6 +258,11 @@ func processItem(item): | |||
251 | for painting_id in _painting_ids_by_item[stringified]: | 258 | for painting_id in _painting_ids_by_item[stringified]: |
252 | paintingsNode.get_node(painting_id).movePainting() | 259 | paintingsNode.get_node(painting_id).movePainting() |
253 | 260 | ||
261 | # Handle progressively opening up the tower. | ||
262 | if _item_name_to_id["Progressive Orange Tower"] == item and _tower_floors < orange_tower.size(): | ||
263 | processItem(_item_name_to_id["Orange Tower - %s Floor" % orange_tower[_tower_floors]]) | ||
264 | _tower_floors += 1 | ||
265 | |||
254 | 266 | ||
255 | func doorIsVanilla(door): | 267 | func doorIsVanilla(door): |
256 | return !_mentioned_doors.has(door) | 268 | return !_mentioned_doors.has(door) |