diff options
Diffstat (limited to 'Archipelago')
-rw-r--r-- | Archipelago/client.gd | 57 | ||||
-rw-r--r-- | Archipelago/load.gd | 2 | ||||
-rw-r--r-- | Archipelago/panel.gd | 11 |
3 files changed, 59 insertions, 11 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"} | |||
23 | const color_items = [ | 23 | const 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 | ] |
26 | const progressive_items = { | 26 | const 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 | } |
38 | const 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 | ||
39 | const kTHE_END = 0 | 48 | const kTHE_END = 0 |
40 | const kTHE_MASTER = 1 | 49 | const kTHE_MASTER = 1 |
@@ -89,6 +98,7 @@ var _localdata_file = "" | |||
89 | var _death_link = false | 98 | var _death_link = false |
90 | var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 | 99 | var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 |
91 | var _door_shuffle = false | 100 | var _door_shuffle = false |
101 | var _panel_door_shuffle = false | ||
92 | var _color_shuffle = false | 102 | var _color_shuffle = false |
93 | var _panel_shuffle = 0 # none, rearrange | 103 | var _panel_shuffle = 0 # none, rearrange |
94 | var _painting_shuffle = false | 104 | var _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] |
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 931dfde..9b20e6d 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd | |||
@@ -564,6 +564,8 @@ func _load(): | |||
564 | var script_instance = panel_script.new() | 564 | var script_instance = panel_script.new() |
565 | script_instance.name = "AP_Panel" | 565 | script_instance.name = "AP_Panel" |
566 | script_instance.data = panel | 566 | script_instance.data = panel |
567 | if apclient._panel_door_shuffle and gamedata.mentioned_panels.has(panel["id"]): | ||
568 | script_instance.locked = true | ||
567 | panel_node.add_child(script_instance) | 569 | panel_node.add_child(script_instance) |
568 | apclient.connect("evaluate_solvability", script_instance, "evaluate_solvability") | 570 | apclient.connect("evaluate_solvability", script_instance, "evaluate_solvability") |
569 | 571 | ||
diff --git a/Archipelago/panel.gd b/Archipelago/panel.gd index fc5963a..ce632c5 100644 --- a/Archipelago/panel.gd +++ b/Archipelago/panel.gd | |||
@@ -5,6 +5,7 @@ var orig_text = "" | |||
5 | var atbash_text = "" | 5 | var atbash_text = "" |
6 | var orig_color = Color(0, 0, 0, 0) | 6 | var orig_color = Color(0, 0, 0, 0) |
7 | var solvable = true | 7 | var solvable = true |
8 | var locked = false | ||
8 | 9 | ||
9 | const kAtbashPre = "abcdefghijklmnopqrstuvwxyz1234567890+-" | 10 | const kAtbashPre = "abcdefghijklmnopqrstuvwxyz1234567890+-" |
10 | const kAtbashPost = "zyxwvutsrqponmlkjihgfedcba0987654321-+" | 11 | const kAtbashPost = "zyxwvutsrqponmlkjihgfedcba0987654321-+" |
@@ -39,7 +40,9 @@ func evaluate_solvability(): | |||
39 | solvable = true | 40 | solvable = true |
40 | var missing = [] | 41 | var missing = [] |
41 | 42 | ||
42 | if apclient._color_shuffle: | 43 | if locked: |
44 | solvable = false | ||
45 | elif apclient._color_shuffle: | ||
43 | for color in data["color"]: | 46 | for color in data["color"]: |
44 | if not apclient._has_colors.has(color): | 47 | if not apclient._has_colors.has(color): |
45 | missing.append(color) | 48 | missing.append(color) |
@@ -52,6 +55,12 @@ func evaluate_solvability(): | |||
52 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = orig_text | 55 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = orig_text |
53 | self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").editable = true | 56 | self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").editable = true |
54 | self.get_parent().get_node("Quad").get_surface_material(0).albedo_color = orig_color | 57 | self.get_parent().get_node("Quad").get_surface_material(0).albedo_color = orig_color |
58 | elif locked: | ||
59 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = "Locked" | ||
60 | self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").editable = false | ||
61 | self.get_parent().get_node("Quad").get_surface_material(0).albedo_color = Color( | ||
62 | 0.2, 0.7, 0.7 | ||
63 | ) | ||
55 | else: | 64 | else: |
56 | var missing_text = "Missing: " | 65 | var missing_text = "Missing: " |
57 | for thing in missing: | 66 | for thing in missing: |