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.gd59
1 files changed, 48 insertions, 11 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 3973f0e..5f8be4e 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -19,12 +19,12 @@ var enable_multiplayer = false
19var track_player = false 19var track_player = false
20var connection_history = [] 20var connection_history = []
21 21
22const my_version = "4.1.0" 22const my_version = "panels-beta6"
23const ap_version = {"major": 0, "minor": 5, "build": 0, "class": "Version"} 23const ap_version = {"major": 0, "minor": 5, "build": 0, "class": "Version"}
24const color_items = [ 24const color_items = [
25 "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow" 25 "White", "Black", "Red", "Blue", "Green", "Brown", "Gray", "Orange", "Purple", "Yellow"
26] 26]
27const progressive_items = { 27const door_progressive_items = {
28 "Progressive Orange Tower": 28 "Progressive Orange Tower":
29 ["Second Floor", "Third Floor", "Fourth Floor", "Fifth Floor", "Sixth Floor", "Seventh Floor"], 29 ["Second Floor", "Third Floor", "Fourth Floor", "Fifth Floor", "Sixth Floor", "Seventh Floor"],
30 "Progressive Art Gallery": 30 "Progressive Art Gallery":
@@ -36,6 +36,15 @@ const progressive_items = {
36 "Progressive Pilgrimage": 36 "Progressive Pilgrimage":
37 ["1 Sunwarp", "2 Sunwarp", "3 Sunwarp", "4 Sunwarp", "5 Sunwarp", "6 Sunwarp"] 37 ["1 Sunwarp", "2 Sunwarp", "3 Sunwarp", "4 Sunwarp", "5 Sunwarp", "6 Sunwarp"]
38} 38}
39const panel_progressive_items = {
40 "Progressive Hallway Room": ["First Door", "Second Door", "Third Door", "Fourth Door"],
41 "Progressive Colorful":
42 ["White", "Black", "Red", "Yellow", "Blue", "Purple", "Orange", "Green", "Brown", "Gray"],
43 "Progressive Number Hunt":
44 ["Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Zero"],
45 "Progressive Symmetry Room": ["Near Far", "Warts Straw", "Leaf Feel"],
46 "Progressive Suits Area": ["Words Sword", "Lost", "Amen Name"]
47}
39 48
40const kTHE_END = 0 49const kTHE_END = 0
41const kTHE_MASTER = 1 50const kTHE_MASTER = 1
@@ -90,6 +99,7 @@ var _localdata_file = ""
90var _death_link = false 99var _death_link = false
91var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 100var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2
92var _door_shuffle = false 101var _door_shuffle = false
102var _panel_door_shuffle = false
93var _color_shuffle = false 103var _color_shuffle = false
94var _panel_shuffle = 0 # none, rearrange 104var _panel_shuffle = 0 # none, rearrange
95var _painting_shuffle = false 105var _painting_shuffle = false
@@ -276,9 +286,15 @@ func _on_data():
276 _color_shuffle = _slot_data["shuffle_colors"] 286 _color_shuffle = _slot_data["shuffle_colors"]
277 287
278 if _slot_data.has("shuffle_doors"): 288 if _slot_data.has("shuffle_doors"):
279 _door_shuffle = (_slot_data["shuffle_doors"] > 0) 289 if _slot_data.has("group_doors"):
290 _door_shuffle = (_slot_data["shuffle_doors"] == 2)
291 _panel_door_shuffle = (_slot_data["shuffle_doors"] == 1)
292 else:
293 _door_shuffle = (_slot_data["shuffle_doors"] > 0)
294 _panel_door_shuffle = false
280 else: 295 else:
281 _door_shuffle = false 296 _door_shuffle = false
297 _panel_door_shuffle = false
282 298
283 if _slot_data.has("shuffle_paintings"): 299 if _slot_data.has("shuffle_paintings"):
284 _painting_shuffle = _slot_data["shuffle_paintings"] 300 _painting_shuffle = _slot_data["shuffle_paintings"]
@@ -734,6 +750,12 @@ func processItem(item, index, from, flags):
734 for door_id in gamedata.door_ids_by_item_id[int(item)]: 750 for door_id in gamedata.door_ids_by_item_id[int(item)]:
735 doorsNode.get_node(door_id).openDoor() 751 doorsNode.get_node(door_id).openDoor()
736 752
753 if gamedata.panel_ids_by_item_id.has(int(item)):
754 var panelsNode = get_tree().get_root().get_node("Spatial/Panels")
755 for panel_id in gamedata.panel_ids_by_item_id[int(item)]:
756 panelsNode.get_node(panel_id).get_node("AP_Panel").locked = false
757 emit_signal("evaluate_solvability")
758
737 if gamedata.painting_ids_by_item_id.has(int(item)): 759 if gamedata.painting_ids_by_item_id.has(int(item)):
738 var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") 760 var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings")
739 var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") 761 var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings")
@@ -754,15 +776,34 @@ func processItem(item, index, from, flags):
754 warpsNode.get_node(warp_id).unlock_warp() 776 warpsNode.get_node(warp_id).unlock_warp()
755 777
756 # Handle progressive items. 778 # Handle progressive items.
757 if int(item) in gamedata.items_by_progressive_id.keys(): 779 var is_progressive_door = int(item) in gamedata.door_items_by_progressive_id
780 var is_progressive_panel = int(item) in gamedata.panel_items_by_progressive_id
781 var progitems = null
782 var prognames = null
783
784 if is_progressive_door and is_progressive_panel:
785 if _door_shuffle:
786 progitems = gamedata.door_items_by_progressive_id[int(item)]
787 prognames = door_progressive_items
788 else:
789 progitems = gamedata.panel_items_by_progressive_id[int(item)]
790 prognames = panel_progressive_items
791 elif is_progressive_door:
792 progitems = gamedata.door_items_by_progressive_id[int(item)]
793 prognames = door_progressive_items
794 elif is_progressive_panel:
795 progitems = gamedata.panel_items_by_progressive_id[int(item)]
796 prognames = panel_progressive_items
797
798 if progitems != null:
758 if not int(item) in _progressive_progress: 799 if not int(item) in _progressive_progress:
759 _progressive_progress[int(item)] = 0 800 _progressive_progress[int(item)] = 0
760 801
761 if _progressive_progress[int(item)] < gamedata.items_by_progressive_id[int(item)].size(): 802 if _progressive_progress[int(item)] < progitems.size():
762 var subitems = gamedata.items_by_progressive_id[int(item)] 803 var subitem_id = progitems[_progressive_progress[int(item)]]
763 var subitem_id = subitems[_progressive_progress[int(item)]]
764 global._print("Subitem: %d" % subitem_id) 804 global._print("Subitem: %d" % subitem_id)
765 processItem(subitem_id, null, null, null) 805 processItem(subitem_id, null, null, null)
806 item_name += " (%s)" % prognames[item_name][_progressive_progress[int(item)]]
766 _progressive_progress[int(item)] += 1 807 _progressive_progress[int(item)] += 1
767 808
768 if _color_shuffle and color_items.has(_item_id_to_name["Lingo"][item]): 809 if _color_shuffle and color_items.has(_item_id_to_name["Lingo"][item]):
@@ -776,10 +817,6 @@ func processItem(item, index, from, flags):
776 _last_new_item = index 817 _last_new_item = index
777 saveLocaldata() 818 saveLocaldata()
778 819
779 if item_name in progressive_items:
780 var subitem = progressive_items[item_name][_progressive_progress[int(item)] - 1]
781 item_name += " (%s)" % subitem
782
783 var player_name = "Unknown" 820 var player_name = "Unknown"
784 if _player_name_by_slot.has(from): 821 if _player_name_by_slot.has(from):
785 player_name = _player_name_by_slot[from] 822 player_name = _player_name_by_slot[from]