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.gd57
1 files changed, 47 insertions, 10 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index aa50069..325418f 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -23,7 +23,7 @@ const ap_version = {"major": 0, "minor": 5, "build": 0, "class": "Version"}
23const color_items = [ 23const color_items = [
24 "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" 24 "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow"
25] 25]
26const progressive_items = { 26const door_progressive_items = {
27 "Progressive Orange Tower": 27 "Progressive Orange Tower":
28 ["Second Floor", "Third Floor", "Fourth Floor", "Fifth Floor", "Sixth Floor", "Seventh Floor"], 28 ["Second Floor", "Third Floor", "Fourth Floor", "Fifth Floor", "Sixth Floor", "Seventh Floor"],
29 "Progressive Art Gallery": 29 "Progressive Art Gallery":
@@ -35,6 +35,15 @@ const progressive_items = {
35 "Progressive Pilgrimage": 35 "Progressive Pilgrimage":
36 ["1 Sunwarp", "2 Sunwarp", "3 Sunwarp", "4 Sunwarp", "5 Sunwarp", "6 Sunwarp"] 36 ["1 Sunwarp", "2 Sunwarp", "3 Sunwarp", "4 Sunwarp", "5 Sunwarp", "6 Sunwarp"]
37} 37}
38const panel_progressive_items = {
39 "Progressive Hallway Room": ["First Door", "Second Door", "Third Door", "Fourth Door"],
40 "Progressive Colorful":
41 ["White", "Black", "Red", "Yellow", "Blue", "Purple", "Orange", "Green", "Brown", "Gray"],
42 "Progressive Number Hunt":
43 ["Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Zero"],
44 "Progressive Symmetry Room": ["Near Far", "Warts Straw", "Leaf Feel"],
45 "Progressive Suits Area": ["Words Sword", "Lost", "Amen Name"]
46}
38 47
39const kTHE_END = 0 48const kTHE_END = 0
40const kTHE_MASTER = 1 49const kTHE_MASTER = 1
@@ -89,6 +98,7 @@ var _localdata_file = ""
89var _death_link = false 98var _death_link = false
90var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 99var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2
91var _door_shuffle = false 100var _door_shuffle = false
101var _panel_door_shuffle = false
92var _color_shuffle = false 102var _color_shuffle = false
93var _panel_shuffle = 0 # none, rearrange 103var _panel_shuffle = 0 # none, rearrange
94var _painting_shuffle = false 104var _painting_shuffle = false
@@ -275,9 +285,15 @@ func _on_data():
275 _color_shuffle = _slot_data["shuffle_colors"] 285 _color_shuffle = _slot_data["shuffle_colors"]
276 286
277 if _slot_data.has("shuffle_doors"): 287 if _slot_data.has("shuffle_doors"):
278 _door_shuffle = (_slot_data["shuffle_doors"] > 0) 288 if _slot_data.has("group_doors"):
289 _door_shuffle = (_slot_data["shuffle_doors"] == 2)
290 _panel_door_shuffle = (_slot_data["shuffle_doors"] == 1)
291 else:
292 _door_shuffle = (_slot_data["shuffle_doors"] > 0)
293 _panel_door_shuffle = false
279 else: 294 else:
280 _door_shuffle = false 295 _door_shuffle = false
296 _panel_door_shuffle = false
281 297
282 if _slot_data.has("shuffle_paintings"): 298 if _slot_data.has("shuffle_paintings"):
283 _painting_shuffle = _slot_data["shuffle_paintings"] 299 _painting_shuffle = _slot_data["shuffle_paintings"]
@@ -727,6 +743,12 @@ func processItem(item, index, from, flags):
727 for door_id in gamedata.door_ids_by_item_id[int(item)]: 743 for door_id in gamedata.door_ids_by_item_id[int(item)]:
728 doorsNode.get_node(door_id).openDoor() 744 doorsNode.get_node(door_id).openDoor()
729 745
746 if gamedata.panel_ids_by_item_id.has(int(item)):
747 var panelsNode = get_tree().get_root().get_node("Spatial/Panels")
748 for panel_id in gamedata.panel_ids_by_item_id[int(item)]:
749 panelsNode.get_node(panel_id).get_node("AP_Panel").locked = false
750 emit_signal("evaluate_solvability")
751
730 if gamedata.painting_ids_by_item_id.has(int(item)): 752 if gamedata.painting_ids_by_item_id.has(int(item)):
731 var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") 753 var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings")
732 var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") 754 var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings")
@@ -747,15 +769,34 @@ func processItem(item, index, from, flags):
747 warpsNode.get_node(warp_id).unlock_warp() 769 warpsNode.get_node(warp_id).unlock_warp()
748 770
749 # Handle progressive items. 771 # Handle progressive items.
750 if int(item) in gamedata.items_by_progressive_id.keys(): 772 var is_progressive_door = int(item) in gamedata.door_items_by_progressive_id
773 var is_progressive_panel = int(item) in gamedata.panel_items_by_progressive_id
774 var progitems = null
775 var prognames = null
776
777 if is_progressive_door and is_progressive_panel:
778 if _door_shuffle:
779 progitems = gamedata.door_items_by_progressive_id[int(item)]
780 prognames = door_progressive_items
781 else:
782 progitems = gamedata.panel_items_by_progressive_id[int(item)]
783 prognames = panel_progressive_items
784 elif is_progressive_door:
785 progitems = gamedata.door_items_by_progressive_id[int(item)]
786 prognames = door_progressive_items
787 elif is_progressive_panel:
788 progitems = gamedata.panel_items_by_progressive_id[int(item)]
789 prognames = panel_progressive_items
790
791 if progitems != null:
751 if not int(item) in _progressive_progress: 792 if not int(item) in _progressive_progress:
752 _progressive_progress[int(item)] = 0 793 _progressive_progress[int(item)] = 0
753 794
754 if _progressive_progress[int(item)] < gamedata.items_by_progressive_id[int(item)].size(): 795 if _progressive_progress[int(item)] < progitems.size():
755 var subitems = gamedata.items_by_progressive_id[int(item)] 796 var subitem_id = progitems[_progressive_progress[int(item)]]
756 var subitem_id = subitems[_progressive_progress[int(item)]]
757 global._print("Subitem: %d" % subitem_id) 797 global._print("Subitem: %d" % subitem_id)
758 processItem(subitem_id, null, null, null) 798 processItem(subitem_id, null, null, null)
799 item_name += " (%s)" % prognames[item_name][_progressive_progress[int(item)]]
759 _progressive_progress[int(item)] += 1 800 _progressive_progress[int(item)] += 1
760 801
761 if _color_shuffle and color_items.has(_item_id_to_name["Lingo"][item]): 802 if _color_shuffle and color_items.has(_item_id_to_name["Lingo"][item]):
@@ -769,10 +810,6 @@ func processItem(item, index, from, flags):
769 _last_new_item = index 810 _last_new_item = index
770 saveLocaldata() 811 saveLocaldata()
771 812
772 if item_name in progressive_items:
773 var subitem = progressive_items[item_name][_progressive_progress[int(item)] - 1]
774 item_name += " (%s)" % subitem
775
776 var player_name = "Unknown" 813 var player_name = "Unknown"
777 if _player_name_by_slot.has(from): 814 if _player_name_by_slot.has(from):
778 player_name = _player_name_by_slot[from] 815 player_name = _player_name_by_slot[from]