From 49209d18a4a5a78f5ad997b948d7812a22e9da4e Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 4 Jan 2024 13:36:37 -0500 Subject: Stack/double proxying --- Archipelago/extradata.gd | 95 ++++++++++++++++++++++++++++++++++++++++++ Archipelago/load.gd | 23 +++++++++- Archipelago/settings_screen.gd | 5 +++ 3 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 Archipelago/extradata.gd diff --git a/Archipelago/extradata.gd b/Archipelago/extradata.gd new file mode 100644 index 0000000..89c41d2 --- /dev/null +++ b/Archipelago/extradata.gd @@ -0,0 +1,95 @@ +extends Node + +var proxies = { + "Synonym Room/Panel_compose_write": ["Synonym Room/Panel_record_write"], + "Synonym Room/Panel_duplicate_same": ["Synonym Room/Panel_identical_same"], + "Synonym Room/Panel_giggle_laugh": ["Synonym Room/Panel_chuckle_laugh"], + "Synonym Room/Panel_plunge_fall": ["Synonym Room/Panel_autumn_fall"], + "Heteronym Room/Panel_mine_mine": ["Heteronym Room/Panel_mine_mine_2"], + "Heteronym Room/Panel_mobile_mobile": ["Heteronym Room/Panel_mobile_mobile_2"], + "Heteronym Room/Panel_sow_so": ["Heteronym Room/Panel_sow_sow"], + "Heteronym Room/Panel_desert_dessert": ["Heteronym Room/Panel_desert_desert"], + "Heteronym Room/Panel_two_too": ["Heteronym Room/Panel_two_to"], + "Heteronym Room/Panel_not_naught": ["Heteronym Room/Panel_not_knot"], + "Truncate Room/Panel_needle_eye": ["Truncate Room/Panel_face_eye"], + "Truncate Room/Panel_undead_dead": ["Truncate Room/Panel_deadline_dead"], + "Truncate Room/Panel_landmass_mass": ["Truncate Room/Panel_massacred_mass"], + "Truncate Room/Panel_mouth_teeth": ["Truncate Room/Panel_saw_teeth"], + "Blue Room/Panel_mouth_face": ["Blue Room/Panel_eye_face"], + "Blue Room/Panel_ice_eyesight": ["Blue Room/Panel_height_eyesight"], + "Blue Room/Panel_just_readjust": ["Blue Room/Panel_read_readjust"], + "Blue Room/Panel_continent_planet": ["Blue Room/Panel_ocean_planet"], + "Sun Room/Panel_warred_drawer": ["Sun Room/Panel_redraw_drawer"], + "Sun Room/Panel_stone_notes": ["Sun Room/Panel_onset_notes"], + "Sun Room/Panel_tsar_star": ["Sun Room/Panel_arts_star"], + "Sun Room/Panel_dare_read": ["Sun Room/Panel_dear_read"], + "Shuffle Room/Panel_amen_mean": ["Shuffle Room/Panel_name_mean"], + "Look Room/Panel_blue_hi": ["Look Room/Panel_blue_hi2"], + "Rhyme Room/Panel_move_love": ["Rhyme Room/Panel_stove_love"], + "Rhyme Room/Panel_sweat_great": ["Rhyme Room/Panel_beat_great"], + "Rhyme Room/Panel_knight_write": ["Rhyme Room/Panel_byte_write"], + "Rhyme Room/Panel_chair_bear": ["Rhyme Room/Panel_cost_most"], + "Double Room/Panel_ascend_rhyme": ["Double Room/Panel_ascend_syn"], + "Double Room/Panel_double_rhyme": ["Double Room/Panel_double_syn"], + "Double Room/Panel_blocked_rhyme": ["Double Room/Panel_blocked_syn"], + "Double Room/Panel_rise_rhyme": ["Double Room/Panel_rise_syn"], + "Double Room/Panel_crystal_rhyme": ["Double Room/Panel_crystal_syn"], + "Double Room/Panel_creative_rhyme": ["Double Room/Panel_creative_syn"], + "Double Room/Panel_child_rhyme": ["Double Room/Panel_child_syn"], + "Double Room/Panel_hidden_rhyme": ["Double Room/Panel_hidden_syn"], + "Double Room/Panel_word_rhyme": ["Double Room/Panel_word_whole"], + "Double Room/Panel_silent_rhyme": ["Double Room/Panel_silent_syn"], + "Double Room/Panel_bones_rhyme": ["Double Room/Panel_bones_syn"], + "Double Room/Panel_sentence_rhyme": ["Double Room/Panel_sentence_whole"], + "Double Room/Panel_dream_rhyme": ["Double Room/Panel_dream_syn"], + "Double Room/Panel_mystery_rhyme": ["Double Room/Panel_mystery_syn"], + "Double Room/Panel_jump_rhyme": ["Double Room/Panel_jump_syn"], + "Double Room/Panel_fall_rhyme": ["Double Room/Panel_fall_syn"], + "Double Room/Panel_return_rhyme": ["Double Room/Panel_return_ant"], + "Double Room/Panel_descend_rhyme": ["Double Room/Panel_descend_ant"], + "Hallway Room/Panel_castle_1": + ["Hallway Room/Panel_castle_2", "Hallway Room/Panel_castle_3", "Hallway Room/Panel_castle_4"], + "Hallway Room/Panel_counterclockwise_1": + [ + "Hallway Room/Panel_counterclockwise_2", + "Hallway Room/Panel_counterclockwise_3", + "Hallway Room/Panel_counterclockwise_4" + ], + "Hallway Room/Panel_transformation_1": + [ + "Hallway Room/Panel_transformation_2", + "Hallway Room/Panel_transformation_3", + "Hallway Room/Panel_transformation_4" + ], + "Smiley Room/Panel_soundgram_1": ["Smiley Room/Panel_anagram_9_1"], + "Hangry Room/Panel_red_mid_5": ["Hangry Room/Panel_red_bot_5"], + "Hangry Room/Panel_red_mid_4": ["Hangry Room/Panel_red_bot_4"], + "Ceiling Room/Panel_blue_top_1": ["Ceiling Room/Panel_red_bot_1"], + "Ceiling Room/Panel_red_mid_2": ["Ceiling Room/Panel_blue_bot_2"], + "Ceiling Room/Panel_red_bot_3": ["Ceiling Room/Panel_blue_mid_3"], + "Ceiling Room/Panel_red_top_4": ["Ceiling Room/Panel_blue_mid_4"], + "Ceiling Room/Panel_blue_bot_5": ["Ceiling Room/Panel_yellow_top_5"], + "Ceiling Room/Panel_yellow_mid_6": ["Ceiling Room/Panel_blue_top_6"], + "Ceiling Room/Panel_blue_mid_7": ["Ceiling Room/Panel_yellow_bot_7"], + "Ceiling Room/Panel_black_bot_8": ["Ceiling Room/Panel_yellow_mid_8"], + "Ceiling Room/Panel_black_top_9": ["Ceiling Room/Panel_yellow_bot_9"], + "Ceiling Room/Panel_yellow_top_10": ["Ceiling Room/Panel_black_bot_10"], + "Ceiling Room/Panel_black_top_11": ["Ceiling Room/Panel_yellow_mid_11"], + "Ceiling Room/Panel_black_top_12": ["Ceiling Room/Panel_red_bot_12"], + "Ceiling Room/Panel_black_bot_13": ["Ceiling Room/Panel_red_top_13"], + "Ceiling Room/Panel_black_mid_14": ["Ceiling Room/Panel_red_bot_14"], + "Ceiling Room/Panel_black_top_15": ["Ceiling Room/Panel_red_mid_15"], + "Chemistry Room/Panel_blue_bot_3": + ["Chemistry Room/Panel_blue_bot_2", "Chemistry Room/Panel_blue_bot_4"], + "Chemistry Room/Panel_blue_bot_6": ["Chemistry Room/Panel_blue_bot_5"], + "Chemistry Room/Panel_blue_top_1": ["Chemistry Room/Panel_blue_top_2"], + "Chemistry Room/Panel_biology_4": ["Chemistry Room/Panel_biology_8"], + "Chemistry Room/Panel_physics_8": ["Chemistry Room/Panel_physics_5"], + "Chemistry Room/Panel_physics_7": ["Chemistry Room/Panel_physics_4"], + "Chemistry Room/Panel_physics_6": ["Chemistry Room/Panel_physics_3"], + "Chemistry Room/Panel_physics_2": ["Chemistry Room/Panel_physics_1"], + "Chemistry Room/Panel_physics_9": ["Chemistry Room/Panel_biology_10"], + "Challenge Room/Panel_bread_mold": ["Challenge Room/Panel_strawberries_mold"], + "Open Areas/Panel_rise_horizon": ["Open Areas/Panel_son_horizon"], + "Open Areas/Panel_son_sunrise": ["Open Areas/Panel_rise_sunrise"] +} diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 2835bb4..409b8c8 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -22,6 +22,7 @@ func _load(): global._print("Hooked Load Start") var apclient = global.get_node("Archipelago") + var panels_parent = self.get_node("Panels") # Override the YOU panel with the AP slot name. if self.get_node_or_null("Panels/Color Arrow Room/Panel_you") != null: @@ -117,7 +118,6 @@ func _load(): # This is the best time to create the location nodes, since the map is now # loaded but the panels haven't been solved from the save file yet. var gamedata = apclient.get_node("Gamedata") - var panels_parent = self.get_node("Panels") var location_script = apclient.SCRIPT_location for location_id in gamedata.panel_ids_by_location_id.keys(): if not (gamedata.classification_by_location_id[location_id] & apclient._location_classification_bit): @@ -437,6 +437,27 @@ func _load(): script_instance.name = "Hunt_Notifier" script_instance.key = "Hunt|%d" % panel["loc"] panel_node.add_child(script_instance) + + # Make stack/double puzzles into proxies, unless panelsanity is on. + if apclient._location_classification_bit != apclient.kCLASSIFICATION_LOCAL_INSANITY: + var proxyscript = load("res://scripts/panelProxy.gd") + + var extradata_proxies = apclient.get_node("Extradata").proxies + for truepanel in extradata_proxies: + var proxies = extradata_proxies[truepanel] + for proxypanel in proxies: + var proxynode = panels_parent.get_node(proxypanel) + var oldparent = proxynode.get_parent() + oldparent.remove_child(proxynode) + var oldtext = proxynode.text + var oldanswer = proxynode.answer + proxynode.set_script(proxyscript) + proxynode.text = oldtext + proxynode.answer = oldanswer + proxynode.proxied_panels = ["../../%s" % truepanel] + proxynode.exact_proxy = true + proxynode.request_ready() + oldparent.add_child(proxynode) # Attach a script to every panel so that we can do things like conditionally # disable them. diff --git a/Archipelago/settings_screen.gd b/Archipelago/settings_screen.gd index 8a81c4d..2cabe09 100644 --- a/Archipelago/settings_screen.gd +++ b/Archipelago/settings_screen.gd @@ -31,6 +31,11 @@ func _ready(): apdata_instance.name = "Gamedata" apclient_instance.add_child(apdata_instance) + var extradata = ResourceLoader.load("user://maps/Archipelago/extradata.gd") + var extradata_instance = extradata.new() + extradata_instance.name = "Extradata" + apclient_instance.add_child(extradata_instance) + # Let's also inject any scripts we need to inject now. installScriptExtension(apclient_instance.SCRIPT_doorControl) installScriptExtension(ResourceLoader.load("user://maps/Archipelago/load.gd")) -- cgit 1.4.1