about summary refs log tree commit diff stats
path: root/Archipelago/client.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Archipelago/client.gd')
-rw-r--r--Archipelago/client.gd60
1 files changed, 45 insertions, 15 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 46b9ff0..be65eb2 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -6,10 +6,35 @@ var ap_pass = ""
6 6
7const my_version = "0.2.3" 7const my_version = "0.2.3"
8const ap_version = {"major": 0, "minor": 4, "build": 0, "class": "Version"} 8const ap_version = {"major": 0, "minor": 4, "build": 0, "class": "Version"}
9const orange_tower = ["Second", "Third", "Fourth", "Fifth", "Sixth", "Seventh"]
10const color_items = [ 9const color_items = [
11 "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" 10 "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow"
12] 11]
12const progressive_items = {
13 "Progressive Orange Tower":
14 [
15 {"item": "Orange Tower - Second Floor", "display": "Second Floor"},
16 {"item": "Orange Tower - Third Floor", "display": "Third Floor"},
17 {"item": "Orange Tower - Fourth Floor", "display": "Fourth Floor"},
18 {"item": "Orange Tower - Fifth Floor", "display": "Fifth Floor"},
19 {"item": "Orange Tower - Sixth Floor", "display": "Sixth Floor"},
20 {"item": "Orange Tower - Seventh Floor", "display": "Seventh Floor"},
21 ],
22 "Progressive Art Gallery":
23 [
24 {"item": "Art Gallery - Second Floor", "display": "Second Floor"},
25 {"item": "Art Gallery - Third Floor", "display": "Third Floor"},
26 {"item": "Art Gallery - Fourth Floor", "display": "Fourth Floor"},
27 {"item": "Art Gallery - Fifth Floor", "display": "Fifth Floor"},
28 {"item": "Art Gallery - Exit", "display": "Exit"},
29 ],
30 "Progressive Hallway Room":
31 [
32 {"item": "Outside The Agreeable - Hallway Door", "display": "First Door"},
33 {"item": "Hallway Room (2) - Exit", "display": "Second Door"},
34 {"item": "Hallway Room (3) - Exit", "display": "Third Door"},
35 {"item": "Hallway Room (4) - Exit", "display": "Fourth Door"},
36 ]
37}
13 38
14const kTHE_END = 0 39const kTHE_END = 0
15const kTHE_MASTER = 1 40const kTHE_MASTER = 1
@@ -61,7 +86,7 @@ var _map_loaded = false
61var _held_items = [] 86var _held_items = []
62var _held_locations = [] 87var _held_locations = []
63var _last_new_item = -1 88var _last_new_item = -1
64var _tower_floors = 0 89var _progressive_progress = {}
65var _has_colors = ["white"] 90var _has_colors = ["white"]
66 91
67signal could_not_connect 92signal could_not_connect
@@ -287,7 +312,7 @@ func _on_data():
287 if message["index"] == 0: 312 if message["index"] == 0:
288 # We are being sent all of our items, so lets reset any progress 313 # We are being sent all of our items, so lets reset any progress
289 # on progressive items. 314 # on progressive items.
290 _tower_floors = 0 315 _progressive_progress.clear()
291 _held_items = [] 316 _held_items = []
292 317
293 var i = 0 318 var i = 0
@@ -526,12 +551,20 @@ func processItem(item, index, from, flags):
526 if painting_node != null: 551 if painting_node != null:
527 painting_node.get_node("Script").movePainting() 552 painting_node.get_node("Script").movePainting()
528 553
529 # Handle progressively opening up the tower. 554 # Handle progressive items.
530 if _item_name_to_id["Progressive Orange Tower"] == item and _tower_floors < orange_tower.size(): 555 var item_name = "Unknown"
531 var subitem_name = "Orange Tower - %s Floor" % orange_tower[_tower_floors] 556 if _item_id_to_name.has(item):
532 global._print(subitem_name) 557 item_name = _item_id_to_name[item]
533 processItem(_item_name_to_id[subitem_name], null, null, null) 558
534 _tower_floors += 1 559 if item_name in progressive_items.keys():
560 if not item_name in _progressive_progress:
561 _progressive_progress[item_name] = 0
562
563 if _progressive_progress[item_name] < progressive_items[item_name].size():
564 var subitem_name = progressive_items[item_name][_progressive_progress[item_name]]["item"]
565 global._print(subitem_name)
566 processItem(_item_name_to_id[subitem_name], null, null, null)
567 _progressive_progress[item_name] += 1
535 568
536 if _color_shuffle and color_items.has(_item_id_to_name[item]): 569 if _color_shuffle and color_items.has(_item_id_to_name[item]):
537 var lcol = _item_id_to_name[item].to_lower() 570 var lcol = _item_id_to_name[item].to_lower()
@@ -544,12 +577,9 @@ func processItem(item, index, from, flags):
544 _last_new_item = index 577 _last_new_item = index
545 saveLocaldata() 578 saveLocaldata()
546 579
547 var item_name = "Unknown" 580 if item_name in progressive_items:
548 if _item_id_to_name.has(item): 581 var subitem = progressive_items[item_name][_progressive_progress[item_name] - 1]
549 item_name = _item_id_to_name[item] 582 item_name += " (%s)" % subitem["display"]
550
551 if item_name == "Progressive Orange Tower":
552 item_name = "Progressive Orange Tower (%s Floor)" % orange_tower[_tower_floors - 1]
553 583
554 var player_name = "Unknown" 584 var player_name = "Unknown"
555 if _player_name_by_slot.has(from): 585 if _player_name_by_slot.has(from):