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.gd70
1 files changed, 63 insertions, 7 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index f15afe6..cafe2f9 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -21,7 +21,7 @@ const ap_version = {"major": 0, "minor": 4, "build": 5, "class": "Version"}
21const color_items = [ 21const color_items = [
22 "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" 22 "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow"
23] 23]
24const progressive_items = { 24const door_progressive_items = {
25 "Progressive Orange Tower": 25 "Progressive Orange Tower":
26 [ 26 [
27 {"item": "Orange Tower - Second Floor", "display": "Second Floor"}, 27 {"item": "Orange Tower - Second Floor", "display": "Second Floor"},
@@ -65,6 +65,40 @@ const progressive_items = {
65 {"item": "The Colorful - Gray Door", "display": "Gray"}, 65 {"item": "The Colorful - Gray Door", "display": "Gray"},
66 ] 66 ]
67} 67}
68const panel_progressive_items = {
69 "Progressive Hallway Room":
70 [
71 {"item": "Hallway Room - First Room Panels", "display": "First Door"},
72 {"item": "Hallway Room - Second Room Panels", "display": "Second Door"},
73 {"item": "Hallway Room - Third Room Panels", "display": "Third Door"},
74 {"item": "Hallway Room - WHEEL", "display": "Fourth Door"},
75 ],
76 "Progressive Colorful":
77 [
78 {"item": "The Colorful - BEGIN (Panel)", "display": "White"},
79 {"item": "The Colorful - FOUND (Panel)", "display": "Black"},
80 {"item": "The Colorful - LOAF (Panel)", "display": "Red"},
81 {"item": "The Colorful - CREAM (Panel)", "display": "Yellow"},
82 {"item": "The Colorful - SUN (Panel)", "display": "Blue"},
83 {"item": "The Colorful - SPOON (Panel)", "display": "Purple"},
84 {"item": "The Colorful - LETTERS (Panel)", "display": "Orange"},
85 {"item": "The Colorful - WALLS (Panel)", "display": "Green"},
86 {"item": "The Colorful - IRON (Panel)", "display": "Brown"},
87 {"item": "The Colorful - OBSTACLE (Panel)", "display": "Gray"},
88 ],
89 "Progressive Number Hunt":
90 [
91 {"item": "Two Panels", "display": "Two"},
92 {"item": "Three Panels", "display": "Three"},
93 {"item": "Four Panels", "display": "Four"},
94 {"item": "Five Panels", "display": "Five"},
95 {"item": "Six Panels", "display": "Six"},
96 {"item": "Seven Panels", "display": "Seven"},
97 {"item": "Eight Panels", "display": "Eight"},
98 {"item": "Nine Panels", "display": "Nine"},
99 {"item": "Outside The Undeterred - ZERO (Panel)", "display": "Zero"},
100 ]
101}
68 102
69const kTHE_END = 0 103const kTHE_END = 0
70const kTHE_MASTER = 1 104const kTHE_MASTER = 1
@@ -109,6 +143,7 @@ var _localdata_file = ""
109var _death_link = false 143var _death_link = false
110var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 144var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2
111var _door_shuffle = false 145var _door_shuffle = false
146var _panel_door_shuffle = false
112var _color_shuffle = false 147var _color_shuffle = false
113var _panel_shuffle = 0 # none, rearrange 148var _panel_shuffle = 0 # none, rearrange
114var _painting_shuffle = false 149var _painting_shuffle = false
@@ -278,7 +313,8 @@ func _on_data():
278 if _slot_data.has("shuffle_colors"): 313 if _slot_data.has("shuffle_colors"):
279 _color_shuffle = _slot_data["shuffle_colors"] 314 _color_shuffle = _slot_data["shuffle_colors"]
280 if _slot_data.has("shuffle_doors"): 315 if _slot_data.has("shuffle_doors"):
281 _door_shuffle = (_slot_data["shuffle_doors"] > 0) 316 _door_shuffle = (_slot_data["shuffle_doors"] == 2)
317 _panel_door_shuffle = (_slot_data["shuffle_doors"] == 1)
282 if _slot_data.has("shuffle_paintings"): 318 if _slot_data.has("shuffle_paintings"):
283 _painting_shuffle = _slot_data["shuffle_paintings"] 319 _painting_shuffle = _slot_data["shuffle_paintings"]
284 if _slot_data.has("shuffle_panels"): 320 if _slot_data.has("shuffle_panels"):
@@ -668,6 +704,12 @@ func processItem(item, index, from, flags):
668 for door_id in gamedata.door_ids_by_item_id[int(item)]: 704 for door_id in gamedata.door_ids_by_item_id[int(item)]:
669 doorsNode.get_node(door_id).openDoor() 705 doorsNode.get_node(door_id).openDoor()
670 706
707 if gamedata.panel_ids_by_item_id.has(int(item)):
708 var panelsNode = get_tree().get_root().get_node("Spatial/Panels")
709 for panel_id in gamedata.panel_ids_by_item_id[int(item)]:
710 panelsNode.get_node(panel_id).get_node("AP_Panel").locked = false
711 emit_signal("evaluate_solvability")
712
671 if gamedata.painting_ids_by_item_id.has(int(item)): 713 if gamedata.painting_ids_by_item_id.has(int(item)):
672 var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") 714 var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings")
673 var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") 715 var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings")
@@ -683,12 +725,22 @@ func processItem(item, index, from, flags):
683 painting_node.get_node("Script").movePainting() 725 painting_node.get_node("Script").movePainting()
684 726
685 # Handle progressive items. 727 # Handle progressive items.
686 if item_name in progressive_items.keys(): 728 if _door_shuffle and item_name in door_progressive_items.keys():
729 if not item_name in _progressive_progress:
730 _progressive_progress[item_name] = 0
731
732 if _progressive_progress[item_name] < door_progressive_items[item_name].size():
733 var subitem_name = door_progressive_items[item_name][_progressive_progress[item_name]]["item"]
734 global._print(subitem_name)
735 processItem(_item_name_to_id[subitem_name], null, null, null)
736 _progressive_progress[item_name] += 1
737
738 if _panel_door_shuffle and item_name in panel_progressive_items.keys():
687 if not item_name in _progressive_progress: 739 if not item_name in _progressive_progress:
688 _progressive_progress[item_name] = 0 740 _progressive_progress[item_name] = 0
689 741
690 if _progressive_progress[item_name] < progressive_items[item_name].size(): 742 if _progressive_progress[item_name] < panel_progressive_items[item_name].size():
691 var subitem_name = progressive_items[item_name][_progressive_progress[item_name]]["item"] 743 var subitem_name = panel_progressive_items[item_name][_progressive_progress[item_name]]["item"]
692 global._print(subitem_name) 744 global._print(subitem_name)
693 processItem(_item_name_to_id[subitem_name], null, null, null) 745 processItem(_item_name_to_id[subitem_name], null, null, null)
694 _progressive_progress[item_name] += 1 746 _progressive_progress[item_name] += 1
@@ -704,8 +756,12 @@ func processItem(item, index, from, flags):
704 _last_new_item = index 756 _last_new_item = index
705 saveLocaldata() 757 saveLocaldata()
706 758
707 if item_name in progressive_items: 759 if _door_shuffle and item_name in door_progressive_items:
708 var subitem = progressive_items[item_name][_progressive_progress[item_name] - 1] 760 var subitem = door_progressive_items[item_name][_progressive_progress[item_name] - 1]
761 item_name += " (%s)" % subitem["display"]
762
763 if _panel_door_shuffle and item_name in panel_progressive_items:
764 var subitem = panel_progressive_items[item_name][_progressive_progress[item_name] - 1]
709 item_name += " (%s)" % subitem["display"] 765 item_name += " (%s)" % subitem["display"]
710 766
711 var player_name = "Unknown" 767 var player_name = "Unknown"