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 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Archipelago/effects.gd') 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") -- cgit 1.4.1