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 01f812c..8cddb83 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd | |||
@@ -24,7 +24,7 @@ const ap_version = {"major": 0, "minor": 5, "build": 0, "class": "Version"} | |||
24 | const color_items = [ | 24 | const 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 | ] |
27 | const progressive_items = { | 27 | const 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 | } |
39 | const 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 | ||
40 | const kTHE_END = 0 | 49 | const kTHE_END = 0 |
41 | const kTHE_MASTER = 1 | 50 | const kTHE_MASTER = 1 |
@@ -90,6 +99,7 @@ var _localdata_file = "" | |||
90 | var _death_link = false | 99 | var _death_link = false |
91 | var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 | 100 | var _victory_condition = 0 # THE END, THE MASTER, LEVEL 2 |
92 | var _door_shuffle = false | 101 | var _door_shuffle = false |
102 | var _panel_door_shuffle = false | ||
93 | var _color_shuffle = false | 103 | var _color_shuffle = false |
94 | var _panel_shuffle = 0 # none, rearrange | 104 | var _panel_shuffle = 0 # none, rearrange |
95 | var _painting_shuffle = false | 105 | var _painting_shuffle = false |
@@ -280,9 +290,15 @@ func _on_data(): | |||
280 | _color_shuffle = _slot_data["shuffle_colors"] | 290 | _color_shuffle = _slot_data["shuffle_colors"] |
281 | 291 | ||
282 | if _slot_data.has("shuffle_doors"): | 292 | if _slot_data.has("shuffle_doors"): |
283 | _door_shuffle = (_slot_data["shuffle_doors"] > 0) | 293 | if _slot_data.has("group_doors"): |
294 | _door_shuffle = (_slot_data["shuffle_doors"] == 2) | ||
295 | _panel_door_shuffle = (_slot_data["shuffle_doors"] == 1) | ||
296 | else: | ||
297 | _door_shuffle = (_slot_data["shuffle_doors"] > 0) | ||
298 | _panel_door_shuffle = false | ||
284 | else: | 299 | else: |
285 | _door_shuffle = false | 300 | _door_shuffle = false |
301 | _panel_door_shuffle = false | ||
286 | 302 | ||
287 | if _slot_data.has("shuffle_paintings"): | 303 | if _slot_data.has("shuffle_paintings"): |
288 | _painting_shuffle = _slot_data["shuffle_paintings"] | 304 | _painting_shuffle = _slot_data["shuffle_paintings"] |
@@ -762,6 +778,12 @@ func processItem(item, index, from, flags): | |||
762 | for door_id in gamedata.door_ids_by_item_id[int(item)]: | 778 | for door_id in gamedata.door_ids_by_item_id[int(item)]: |
763 | doorsNode.get_node(door_id).openDoor() | 779 | doorsNode.get_node(door_id).openDoor() |
764 | 780 | ||
781 | if gamedata.panel_ids_by_item_id.has(int(item)): | ||
782 | var panelsNode = get_tree().get_root().get_node("Spatial/Panels") | ||
783 | for panel_id in gamedata.panel_ids_by_item_id[int(item)]: | ||
784 | panelsNode.get_node(panel_id).get_node("AP_Panel").locked = false | ||
785 | emit_signal("evaluate_solvability") | ||
786 | |||
765 | if gamedata.painting_ids_by_item_id.has(int(item)): | 787 | if gamedata.painting_ids_by_item_id.has(int(item)): |
766 | var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") | 788 | var real_parent_node = get_tree().get_root().get_node("Spatial/Decorations/Paintings") |
767 | var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") | 789 | var fake_parent_node = get_tree().get_root().get_node_or_null("Spatial/AP_Paintings") |
@@ -782,15 +804,34 @@ func processItem(item, index, from, flags): | |||
782 | warpsNode.get_node(warp_id).unlock_warp() | 804 | warpsNode.get_node(warp_id).unlock_warp() |
783 | 805 | ||
784 | # Handle progressive items. | 806 | # Handle progressive items. |
785 | if int(item) in gamedata.items_by_progressive_id.keys(): | 807 | var is_progressive_door = int(item) in gamedata.door_items_by_progressive_id |
808 | var is_progressive_panel = int(item) in gamedata.panel_items_by_progressive_id | ||
809 | var progitems = null | ||
810 | var prognames = null | ||
811 | |||
812 | if is_progressive_door and is_progressive_panel: | ||
813 | if _door_shuffle: | ||
814 | progitems = gamedata.door_items_by_progressive_id[int(item)] | ||
815 | prognames = door_progressive_items | ||
816 | else: | ||
817 | progitems = gamedata.panel_items_by_progressive_id[int(item)] | ||
818 | prognames = panel_progressive_items | ||
819 | elif is_progressive_door: | ||
820 | progitems = gamedata.door_items_by_progressive_id[int(item)] | ||
821 | prognames = door_progressive_items | ||
822 | elif is_progressive_panel: | ||
823 | progitems = gamedata.panel_items_by_progressive_id[int(item)] | ||
824 | prognames = panel_progressive_items | ||
825 | |||
826 | if progitems != null: | ||
786 | if not int(item) in _progressive_progress: | 827 | if not int(item) in _progressive_progress: |
787 | _progressive_progress[int(item)] = 0 | 828 | _progressive_progress[int(item)] = 0 |
788 | 829 | ||
789 | if _progressive_progress[int(item)] < gamedata.items_by_progressive_id[int(item)].size(): | 830 | if _progressive_progress[int(item)] < progitems.size(): |
790 | var subitems = gamedata.items_by_progressive_id[int(item)] | 831 | var subitem_id = progitems[_progressive_progress[int(item)]] |
791 | var subitem_id = subitems[_progressive_progress[int(item)]] | ||
792 | global._print("Subitem: %d" % subitem_id) | 832 | global._print("Subitem: %d" % subitem_id) |
793 | processItem(subitem_id, null, null, null) | 833 | processItem(subitem_id, null, null, null) |
834 | item_name += " (%s)" % prognames[item_name][_progressive_progress[int(item)]] | ||
794 | _progressive_progress[int(item)] += 1 | 835 | _progressive_progress[int(item)] += 1 |
795 | 836 | ||
796 | if _color_shuffle and color_items.has(_item_id_to_name["Lingo"][item]): | 837 | if _color_shuffle and color_items.has(_item_id_to_name["Lingo"][item]): |
@@ -804,10 +845,6 @@ func processItem(item, index, from, flags): | |||
804 | _last_new_item = index | 845 | _last_new_item = index |
805 | saveLocaldata() | 846 | saveLocaldata() |
806 | 847 | ||
807 | if item_name in progressive_items: | ||
808 | var subitem = progressive_items[item_name][_progressive_progress[int(item)] - 1] | ||
809 | item_name += " (%s)" % subitem | ||
810 | |||
811 | var player_name = "Unknown" | 848 | var player_name = "Unknown" |
812 | if _player_name_by_slot.has(from): | 849 | if _player_name_by_slot.has(from): |
813 | player_name = _player_name_by_slot[from] | 850 | player_name = _player_name_by_slot[from] |
diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 09aaee2..4811b47 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: |