about summary refs log tree commit diff stats
path: root/Archipelago/effects.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Archipelago/effects.gd')
-rw-r--r--Archipelago/effects.gd22
1 files changed, 13 insertions, 9 deletions
diff --git a/Archipelago/effects.gd b/Archipelago/effects.gd index 7d9df35..e6d2dcd 100644 --- a/Archipelago/effects.gd +++ b/Archipelago/effects.gd
@@ -4,7 +4,7 @@ var activated = false
4var effect_running = false 4var effect_running = false
5var slowness_remaining = 0 5var slowness_remaining = 0
6var iceland_remaining = 0 6var iceland_remaining = 0
7var atbash_activated = false 7var atbash_remaining = 0
8var queued_iceland = 0 8var queued_iceland = 0
9var skip_available = false 9var skip_available = false
10var puzzle_focused = false 10var puzzle_focused = false
@@ -93,21 +93,23 @@ func trigger_iceland_trap():
93 93
94 94
95func trigger_atbash_trap(): 95func trigger_atbash_trap():
96 if not atbash_activated: 96 var newly_atbash = (atbash_remaining == 0)
97 atbash_activated = true 97 atbash_remaining += 1
98 98
99 if newly_atbash:
99 var apclient = global.get_node("Archipelago") 100 var apclient = global.get_node("Archipelago")
100 apclient.evaluateSolvability() 101 apclient.evaluateSolvability()
101 102
102 text_dirty = true 103 text_dirty = true
103 104
104 105
105func deactivate_atbash_trap(): 106func deactivate_atbash_trap():
106 if atbash_activated: 107 if atbash_remaining > 0:
107 atbash_activated = false 108 atbash_remaining -= 1
108 109
109 var apclient = global.get_node("Archipelago") 110 if atbash_remaining == 0:
110 apclient.evaluateSolvability() 111 var apclient = global.get_node("Archipelago")
112 apclient.evaluateSolvability()
111 113
112 text_dirty = true 114 text_dirty = true
113 115
@@ -209,8 +211,10 @@ func _process(_delta):
209 text_dirty = false 211 text_dirty = false
210 212
211 var text = "" 213 var text = ""
212 if atbash_activated: 214 if atbash_remaining == 1:
213 text += "Atbash Trap lasts until you solve a puzzle" 215 text += "Atbash Trap lasts until you solve a puzzle"
216 if atbash_remaining > 1:
217 text += ("Atbash Trap lasts until you solve %d puzzles" % atbash_remaining)
214 if slowness_remaining > 0: 218 if slowness_remaining > 0:
215 if not text.empty(): 219 if not text.empty():
216 text += "\n" 220 text += "\n"