From 39b55476e6ae8a43c807476348351bb1509b26e2 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 22 May 2023 03:22:22 -0400 Subject: Queue Iceland Traps for later in map load This way they don't get overridden by the environment being set naturally. --- Archipelago/effects.gd | 15 +++++++++++++++ Archipelago/load.gd | 9 +++++++++ 2 files changed, 24 insertions(+) diff --git a/Archipelago/effects.gd b/Archipelago/effects.gd index 193ece1..a11ab42 100644 --- a/Archipelago/effects.gd +++ b/Archipelago/effects.gd @@ -1,8 +1,10 @@ extends Node +var activated = false var effect_running = false var slowness_remaining = 0 var iceland_remaining = 0 +var queued_iceland = 0 var orig_env var orig_walk @@ -31,6 +33,15 @@ func _ready(): add_child(label) +func activate(): + activated = true + + for _i in range(0, queued_iceland): + trigger_iceland_trap() + + queued_iceland = 0 + + func trigger_slowness_trap(): if slowness_remaining == 0: var player = get_tree().get_root().get_node("Spatial/player") @@ -44,6 +55,10 @@ func trigger_slowness_trap(): func trigger_iceland_trap(): + if not activated: + queued_iceland += 1 + return + if iceland_remaining == 0: get_tree().get_root().get_node("Spatial/player/pivot/camera").set_environment( load("res://environments/level_iceland.tres") diff --git a/Archipelago/load.gd b/Archipelago/load.gd index 052aa84..6860de7 100644 --- a/Archipelago/load.gd +++ b/Archipelago/load.gd @@ -324,6 +324,15 @@ func _load(): apclient.mapFinishedLoading() +func _load_user_textures(): + # We are using this function as a hook to process queued Iceland Traps + # because it happens after the environment gets set. + var effects_node = get_tree().get_root().get_node("Spatial/AP_Effects") + effects_node.activate() + + ._load_user_textures() + + func sort_by_link(a, b): return a["link"] < b["link"] -- cgit 1.4.1