From e0ffa141c91e40171c367a2aca777d22be824c98 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 17 Nov 2023 11:44:08 -0500 Subject: Track hunt panels --- Archipelago/load.gd | 9 ++++++++- util/generate_gamedata.rb | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 4c6c178..ce97918 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -115,7 +115,7 @@ func _load(): var panels_parent = self.get_node("Panels") var location_script = ResourceLoader.load("user://maps/Archipelago/location.gd") for location_id in gamedata.panel_ids_by_location_id.keys(): - if !(gamedata.classification_by_location_id[location_id] & apclient._location_classification_bit): + if not (gamedata.classification_by_location_id[location_id] & apclient._location_classification_bit): continue var location = location_script.new() @@ -421,6 +421,13 @@ func _load(): script_instance.key = "Achievement|%s" % panel["achievement"] panel_node.add_child(script_instance) + if "hunt" in panel and panel["hunt"] and not (gamedata.classification_by_location_id[panel["loc"]] & apclient._location_classification_bit): + var panel_node = panels_parent.get_node(panel["id"]) + var script_instance = notifier_script.new() + script_instance.name = "Hunt_Notifier" + script_instance.key = "Hunt|%d" % panel["loc"] + panel_node.add_child(script_instance) + # Attach a script to every panel so that we can do things like conditionally # disable them. var panel_script = ResourceLoader.load("user://maps/Archipelago/panel.gd") diff --git a/util/generate_gamedata.rb b/util/generate_gamedata.rb index e130572..5e03655 100644 --- a/util/generate_gamedata.rb +++ b/util/generate_gamedata.rb @@ -34,6 +34,7 @@ config.each do |room_name, room_data| ret = {} ret["id"] = "\"#{panel["id"]}\"" + ret["loc"] = location_id if panel.include? "colors" if panel["colors"].kind_of? String ret["color"] = "[\"#{panel["colors"]}\"]" @@ -62,6 +63,9 @@ config.each do |room_name, room_data| if panel.include? "achievement" ret["achievement"] = "\"#{panel["achievement"]}\"" end + if panel.include? "hunt" and panel["hunt"] + ret["hunt"] = "true" + end panel_output << ret panel_ids_by_location_id[location_id] = [panel["id"]] -- cgit 1.4.1