about summary refs log tree commit diff stats
path: root/Archipelago
diff options
context:
space:
mode:
Diffstat (limited to 'Archipelago')
-rw-r--r--Archipelago/client.gd81
-rw-r--r--Archipelago/load.gd2
-rw-r--r--Archipelago/panel.gd9
3 files changed, 82 insertions, 10 deletions
diff --git a/Archipelago/client.gd b/Archipelago/client.gd index 7903df2..0944352 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd
@@ -23,7 +23,7 @@ const ap_version = {"major": 0, "minor": 4, "build": 6, "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,40 @@ 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":
40 [
41 {"item": "Hallway Room - First Room Panels", "display": "First Door"},
42 {"item": "Hallway Room - Second Room Panels", "display": "Second Door"},
43 {"item": "Hallway Room - Third Room Panels", "display": "Third Door"},
44 {"item": "Hallway Room - WHEEL", "display": "Fourth Door"},
45 ],
46 "Progressive Colorful":
47 [
48 {"item": "The Colorful - BEGIN (Panel)", "display": "White"},
49 {"item": "The Colorful - FOUND (Panel)", "display": "Black"},
50 {"item": "The Colorful - LOAF (Panel)", "display": "Red"},
51 {"item": "The Colorful - CREAM (Panel)", "display": "Yellow"},
52 {"item": "The Colorful - SUN (Panel)", "display": "Blue"},
53 {"item": "The Colorful - SPOON (Panel)", "display": "Purple"},
54 {"item": "The Colorful - LETTERS (Panel)", "display": "Orange"},
55 {"item": "The Colorful - WALLS (Panel)", "display": "Green"},
56 {"item": "The Colorful - IRON (Panel)", "display": "Brown"},
57 {"item": "The Colorful - OBSTACLE (Panel)", "display": "Gray"},
58 ],
59 "Progressive Number Hunt":
60 [
61 {"item": "Two Panels", "display": "Two"},
62 {"item": "Three Panels", "display": "Three"},
63 {"item": "Four Panels", "display": "Four"},
64 {"item": "Five Panels", "display": "Five"},
65 {"item": "Six Panels", "display": "Six"},
66 {"item": "Seven Panels", "display": "Seven"},
67 {"item": "Eight Panels", "display": "Eight"},
68 {"item": "Nine Panels", "display": "Nine"},
69 {"item": "Outside The Undeterred - ZERO (Panel)", "display": "Zero"},
70 ]
71}
38 72
39const kTHE_END = 0 73const kTHE_END = 0
40const kTHE_MASTER = 1 74const kTHE_MASTER = 1
@@ -87,6 +121,7 @@ var _localdata_file = ""
87var _death_link = false 121var _death_link = false
88var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 122var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2
89var _door_shuffle = false 123var _door_shuffle = false
124var _panel_door_shuffle = false
90var _color_shuffle = false 125var _color_shuffle = false
91var _panel_shuffle = 0 # none, rearrange 126var _panel_shuffle = 0 # none, rearrange
92var _painting_shuffle = false 127var _painting_shuffle = false
@@ -266,7 +301,12 @@ func _on_data():
266 if _slot_data.has("shuffle_colors"): 301 if _slot_data.has("shuffle_colors"):
267 _color_shuffle = _slot_data["shuffle_colors"] 302 _color_shuffle = _slot_data["shuffle_colors"]
268 if _slot_data.has("shuffle_doors"): 303 if _slot_data.has("shuffle_doors"):
269 _door_shuffle = (_slot_data["shuffle_doors"] > 0) 304 if _slot_data.has("group_doors"):
305 _door_shuffle = (_slot_data["shuffle_doors"] == 2)
306 _panel_door_shuffle = (_slot_data["shuffle_doors"] == 1)
307 else:
308 _door_shuffle = (_slot_data["shuffle_doors"] > 0)
309 _panel_door_shuffle = false
270 if _slot_data.has("shuffle_paintings"): 310 if _slot_data.has("shuffle_paintings"):
271 _painting_shuffle = _slot_data["shuffle_paintings"] 311 _painting_shuffle = _slot_data["shuffle_paintings"]
272 if _slot_data.has("shuffle_panels"): 312 if _slot_data.has("shuffle_panels"):
@@ -680,6 +720,12 @@ func processItem(item, index, from, flags):
680 for door_id in gamedata.door_ids_by_item_id[int(item)]: 720 for door_id in gamedata.door_ids_by_item_id[int(item)]:
681 doorsNode.get_node(door_id).openDoor() 721 doorsNode.get_node(door_id).openDoor()
682 722
723 if gamedata.panel_ids_by_item_id.has(int(item)):
724 var panelsNode = get_tree().get_root().get_node("Spatial/Panels")
725 for panel_id in gamedata.panel_ids_by_item_id[int(item)]:
726 panelsNode.get_node(panel_id).get_node("AP_Panel").locked = false
727 emit_signal("evaluate_solvability")
728
683 if gamedata.painting_ids_by_item_id.has(int(item)): 729 if gamedata.painting_ids_by_item_id.has(int(item)):
684 var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") 730 var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings")
685 var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") 731 var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings")
@@ -700,13 +746,26 @@ func processItem(item, index, from, flags):
700 warpsNode.get_node(warp_id).unlock_warp() 746 warpsNode.get_node(warp_id).unlock_warp()
701 747
702 # Handle progressive items. 748 # Handle progressive items.
703 if int(item) in gamedata.items_by_progressive_id.keys(): 749 var is_progressive_door = int(item) in gamedata.door_items_by_progressive_id
750 var is_progressive_panel = int(item) in gamedata.panel_items_by_progressive_id
751 var progitems = null
752
753 if is_progressive_door and is_progressive_panel:
754 if _door_shuffle:
755 progitems = gamedata.door_items_by_progressive_id[int(item)]
756 else:
757 progitems = gamedata.panel_items_by_progressive_id[int(item)]
758 elif is_progressive_door:
759 progitems = gamedata.door_items_by_progressive_id[int(item)]
760 elif is_progressive_panel:
761 progitems = gamedata.panel_items_by_progressive_id[int(item)]
762
763 if progitems != null:
704 if not int(item) in _progressive_progress: 764 if not int(item) in _progressive_progress:
705 _progressive_progress[int(item)] = 0 765 _progressive_progress[int(item)] = 0
706 766
707 if _progressive_progress[int(item)] < gamedata.items_by_progressive_id[int(item)].size(): 767 if _progressive_progress[int(item)] < progitems.size():
708 var subitems = gamedata.items_by_progressive_id[int(item)] 768 var subitem_id = progitems[_progressive_progress[int(item)]]
709 var subitem_id = subitems[_progressive_progress[int(item)]]
710 global._print("Subitem: %d" % subitem_id) 769 global._print("Subitem: %d" % subitem_id)
711 processItem(subitem_id, null, null, null) 770 processItem(subitem_id, null, null, null)
712 _progressive_progress[int(item)] += 1 771 _progressive_progress[int(item)] += 1
@@ -722,9 +781,13 @@ func processItem(item, index, from, flags):
722 _last_new_item = index 781 _last_new_item = index
723 saveLocaldata() 782 saveLocaldata()
724 783
725 if item_name in progressive_items: 784 if _door_shuffle and item_name in door_progressive_items:
726 var subitem = progressive_items[item_name][_progressive_progress[int(item)] - 1] 785 var subitem = door_progressive_items[item_name][_progressive_progress[int(item)] - 1]
727 item_name += " (%s)" % subitem 786 item_name += " (%s)" % subitem["display"]
787
788 if _panel_door_shuffle and item_name in panel_progressive_items:
789 var subitem = panel_progressive_items[item_name][_progressive_progress[int(item)] - 1]
790 item_name += " (%s)" % subitem["display"]
728 791
729 var player_name = "Unknown" 792 var player_name = "Unknown"
730 if _player_name_by_slot.has(from): 793 if _player_name_by_slot.has(from):
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 0ed978a..6ce4749 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd
@@ -571,6 +571,8 @@ func _load():
571 var script_instance = panel_script.new() 571 var script_instance = panel_script.new()
572 script_instance.name = "AP_Panel" 572 script_instance.name = "AP_Panel"
573 script_instance.data = panel 573 script_instance.data = panel
574 if apclient._panel_door_shuffle and gamedata.mentioned_panels.has(panel["id"]):
575 script_instance.locked = true
574 panel_node.add_child(script_instance) 576 panel_node.add_child(script_instance)
575 apclient.connect("evaluate_solvability", script_instance, "evaluate_solvability") 577 apclient.connect("evaluate_solvability", script_instance, "evaluate_solvability")
576 578
diff --git a/Archipelago/panel.gd b/Archipelago/panel.gd index fc5963a..9d30455 100644 --- a/Archipelago/panel.gd +++ b/Archipelago/panel.gd
@@ -5,6 +5,7 @@ var orig_text = ""
5var atbash_text = "" 5var atbash_text = ""
6var orig_color = Color(0, 0, 0, 0) 6var orig_color = Color(0, 0, 0, 0)
7var solvable = true 7var solvable = true
8var locked = false
8 9
9const kAtbashPre = "abcdefghijklmnopqrstuvwxyz1234567890+-" 10const kAtbashPre = "abcdefghijklmnopqrstuvwxyz1234567890+-"
10const kAtbashPost = "zyxwvutsrqponmlkjihgfedcba0987654321-+" 11const kAtbashPost = "zyxwvutsrqponmlkjihgfedcba0987654321-+"
@@ -45,7 +46,13 @@ func evaluate_solvability():
45 missing.append(color) 46 missing.append(color)
46 solvable = false 47 solvable = false
47 48
48 if solvable: 49 if locked:
50 self.get_parent().get_node("Viewport/GUI/Panel/Label").text = "Locked"
51 self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").editable = false
52 self.get_parent().get_node("Quad").get_surface_material(0).albedo_color = Color(
53 0.2, 0.7, 0.7
54 )
55 elif solvable:
49 if effects.atbash_remaining > 0: 56 if effects.atbash_remaining > 0:
50 self.get_parent().get_node("Viewport/GUI/Panel/Label").text = atbash_text 57 self.get_parent().get_node("Viewport/GUI/Panel/Label").text = atbash_text
51 else: 58 else: