diff options
-rw-r--r-- | Archipelago/effects.gd | 33 | ||||
-rw-r--r-- | Archipelago/panel.gd | 11 |
2 files changed, 26 insertions, 18 deletions
diff --git a/Archipelago/effects.gd b/Archipelago/effects.gd index 04c79b6..80eaa9c 100644 --- a/Archipelago/effects.gd +++ b/Archipelago/effects.gd | |||
@@ -4,7 +4,7 @@ var activated = false | |||
4 | var effect_running = false | 4 | var effect_running = false |
5 | var slowness_remaining = 0 | 5 | var slowness_remaining = 0 |
6 | var iceland_remaining = 0 | 6 | var iceland_remaining = 0 |
7 | var atbash_remaining = 0 | 7 | var atbash_activated = false |
8 | var queued_iceland = 0 | 8 | var queued_iceland = 0 |
9 | 9 | ||
10 | var orig_env | 10 | var orig_env |
@@ -72,33 +72,39 @@ func trigger_iceland_trap(): | |||
72 | 72 | ||
73 | 73 | ||
74 | func trigger_atbash_trap(): | 74 | func trigger_atbash_trap(): |
75 | if atbash_remaining == 0: | 75 | if not atbash_activated: |
76 | atbash_remaining += 60 | 76 | atbash_activated = true |
77 | 77 | ||
78 | var apclient = global.get_node("Archipelago") | 78 | var apclient = global.get_node("Archipelago") |
79 | apclient.evaluateSolvability() | 79 | apclient.evaluateSolvability() |
80 | else: | ||
81 | atbash_remaining += 60 | ||
82 | 80 | ||
83 | if not effect_running: | 81 | if not effect_running: |
84 | _process_effects() | 82 | _process_effects() |
85 | 83 | ||
86 | 84 | ||
85 | func deactivate_atbash_trap(): | ||
86 | if atbash_activated: | ||
87 | atbash_activated = false | ||
88 | |||
89 | var apclient = global.get_node("Archipelago") | ||
90 | apclient.evaluateSolvability() | ||
91 | |||
92 | |||
87 | func _process_effects(): | 93 | func _process_effects(): |
88 | effect_running = true | 94 | effect_running = true |
89 | 95 | ||
90 | while slowness_remaining > 0 or iceland_remaining > 0 or atbash_remaining > 0: | 96 | while slowness_remaining > 0 or iceland_remaining > 0 or atbash_activated: |
91 | var text = "" | 97 | var text = "" |
98 | if atbash_activated: | ||
99 | text += "Atbash Trap lasts until you solve a puzzle" | ||
92 | if slowness_remaining > 0: | 100 | if slowness_remaining > 0: |
101 | if not text.empty(): | ||
102 | text += "\n" | ||
93 | text += "Slowness: %d seconds" % slowness_remaining | 103 | text += "Slowness: %d seconds" % slowness_remaining |
94 | if iceland_remaining > 0: | 104 | if iceland_remaining > 0: |
95 | if not text.empty(): | 105 | if not text.empty(): |
96 | text += "\n" | 106 | text += "\n" |
97 | text += "Iceland: %d seconds" % iceland_remaining | 107 | text += "Iceland: %d seconds" % iceland_remaining |
98 | if atbash_remaining > 0: | ||
99 | if not text.empty(): | ||
100 | text += "\n" | ||
101 | text += "Atbash: %d seconds" % atbash_remaining | ||
102 | self.get_node("label").text = text | 108 | self.get_node("label").text = text |
103 | 109 | ||
104 | yield(get_tree().create_timer(1.0), "timeout") | 110 | yield(get_tree().create_timer(1.0), "timeout") |
@@ -119,12 +125,5 @@ func _process_effects(): | |||
119 | orig_env | 125 | orig_env |
120 | ) | 126 | ) |
121 | 127 | ||
122 | if atbash_remaining > 0: | ||
123 | atbash_remaining -= 1 | ||
124 | |||
125 | if atbash_remaining == 0: | ||
126 | var apclient = global.get_node("Archipelago") | ||
127 | apclient.evaluateSolvability() | ||
128 | |||
129 | self.get_node("label").text = "" | 128 | self.get_node("label").text = "" |
130 | effect_running = false | 129 | effect_running = false |
diff --git a/Archipelago/panel.gd b/Archipelago/panel.gd index bf43653..da11ddd 100644 --- a/Archipelago/panel.gd +++ b/Archipelago/panel.gd | |||
@@ -21,6 +21,15 @@ func _ready(): | |||
21 | else: | 21 | else: |
22 | atbash_text += old_char | 22 | atbash_text += old_char |
23 | 23 | ||
24 | self.get_parent().get_node("Viewport/GUI/Panel/TextEdit").connect( | ||
25 | "answer_correct", self, "answer_correct" | ||
26 | ) | ||
27 | |||
28 | |||
29 | func answer_correct(): | ||
30 | var effects = get_tree().get_root().get_node("Spatial/AP_Effects") | ||
31 | effects.deactivate_atbash_trap() | ||
32 | |||
24 | 33 | ||
25 | func evaluate_solvability(): | 34 | func evaluate_solvability(): |
26 | var apclient = global.get_node("Archipelago") | 35 | var apclient = global.get_node("Archipelago") |
@@ -36,7 +45,7 @@ func evaluate_solvability(): | |||
36 | solvable = false | 45 | solvable = false |
37 | 46 | ||
38 | if solvable: | 47 | if solvable: |
39 | if effects.atbash_remaining > 0: | 48 | if effects.atbash_activated: |
40 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = atbash_text | 49 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = atbash_text |
41 | else: | 50 | else: |
42 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = orig_text | 51 | self.get_parent().get_node("Viewport/GUI/Panel/Label").text = orig_text |