about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-05-22 03:22:22 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-05-22 03:22:22 -0400
commit39b55476e6ae8a43c807476348351bb1509b26e2 (patch)
tree8ea49df2c6b8a0d0247698aad4b8e4f7a686596a
parentb78271615d1b0f0d2f71c1467b63af5e405b02e5 (diff)
downloadlingo-archipelago-39b55476e6ae8a43c807476348351bb1509b26e2.tar.gz
lingo-archipelago-39b55476e6ae8a43c807476348351bb1509b26e2.tar.bz2
lingo-archipelago-39b55476e6ae8a43c807476348351bb1509b26e2.zip
Queue Iceland Traps for later in map load
This way they don't get overridden by the environment being set naturally.
-rw-r--r--Archipelago/effects.gd15
-rw-r--r--Archipelago/load.gd9
2 files changed, 24 insertions, 0 deletions
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 @@
1extends Node 1extends Node
2 2
3var activated = false
3var effect_running = false 4var effect_running = false
4var slowness_remaining = 0 5var slowness_remaining = 0
5var iceland_remaining = 0 6var iceland_remaining = 0
7var queued_iceland = 0
6 8
7var orig_env 9var orig_env
8var orig_walk 10var orig_walk
@@ -31,6 +33,15 @@ func _ready():
31 add_child(label) 33 add_child(label)
32 34
33 35
36func activate():
37 activated = true
38
39 for _i in range(0, queued_iceland):
40 trigger_iceland_trap()
41
42 queued_iceland = 0
43
44
34func trigger_slowness_trap(): 45func trigger_slowness_trap():
35 if slowness_remaining == 0: 46 if slowness_remaining == 0:
36 var player = get_tree().get_root().get_node("Spatial/player") 47 var player = get_tree().get_root().get_node("Spatial/player")
@@ -44,6 +55,10 @@ func trigger_slowness_trap():
44 55
45 56
46func trigger_iceland_trap(): 57func trigger_iceland_trap():
58 if not activated:
59 queued_iceland += 1
60 return
61
47 if iceland_remaining == 0: 62 if iceland_remaining == 0:
48 get_tree().get_root().get_node("Spatial/player/pivot/camera").set_environment( 63 get_tree().get_root().get_node("Spatial/player/pivot/camera").set_environment(
49 load("res://environments/level_iceland.tres") 64 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():
324 apclient.mapFinishedLoading() 324 apclient.mapFinishedLoading()
325 325
326 326
327func _load_user_textures():
328 # We are using this function as a hook to process queued Iceland Traps
329 # because it happens after the environment gets set.
330 var effects_node = get_tree().get_root().get_node("Spatial/AP_Effects")
331 effects_node.activate()
332
333 ._load_user_textures()
334
335
327func sort_by_link(a, b): 336func sort_by_link(a, b):
328 return a["link"] < b["link"] 337 return a["link"] < b["link"]
329 338