about summary refs log tree commit diff stats
path: root/Archipelago/effects.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-08-03 21:57:04 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-08-03 21:57:04 -0400
commita3cc416a21297747b412dabe75fc4532cd5c8d68 (patch)
tree1eeb76f7e3d7463c133b2ce36aeab59787ee3943 /Archipelago/effects.gd
parentcb6db408f38338edb451f323d7e5aa2856854d15 (diff)
downloadlingo-archipelago-a3cc416a21297747b412dabe75fc4532cd5c8d68.tar.gz
lingo-archipelago-a3cc416a21297747b412dabe75fc4532cd5c8d68.tar.bz2
lingo-archipelago-a3cc416a21297747b412dabe75fc4532cd5c8d68.zip
Puzzle skips
Diffstat (limited to 'Archipelago/effects.gd')
-rw-r--r--Archipelago/effects.gd59
1 files changed, 58 insertions, 1 deletions
diff --git a/Archipelago/effects.gd b/Archipelago/effects.gd index 80eaa9c..3d6e036 100644 --- a/Archipelago/effects.gd +++ b/Archipelago/effects.gd
@@ -6,6 +6,10 @@ var slowness_remaining = 0
6var iceland_remaining = 0 6var iceland_remaining = 0
7var atbash_activated = false 7var atbash_activated = false
8var queued_iceland = 0 8var queued_iceland = 0
9var skip_available = false
10var puzzle_focused = false
11var solve_mode = false
12var puzzle_to_skip = ""
9 13
10var orig_env 14var orig_env
11var orig_walk 15var orig_walk
@@ -90,13 +94,66 @@ func deactivate_atbash_trap():
90 apclient.evaluateSolvability() 94 apclient.evaluateSolvability()
91 95
92 96
97func show_puzzle_skip_message(node_path):
98 var panel_input = get_tree().get_root().get_node(node_path)
99 if not panel_input.visible:
100 return
101
102 var ap_panel = panel_input.get_parent().get_parent().get_parent().get_parent().get_node(
103 "AP_Panel"
104 )
105 if not ap_panel.solvable:
106 return
107
108 puzzle_focused = true
109 puzzle_to_skip = node_path
110 _evaluate_puzzle_skip()
111
112
113func hide_puzzle_skip_message():
114 puzzle_focused = false
115 _evaluate_puzzle_skip()
116
117
118func enter_solve_mode():
119 solve_mode = true
120 _evaluate_puzzle_skip()
121
122
123func exit_solve_mode():
124 solve_mode = false
125 _evaluate_puzzle_skip()
126
127
128func skip_puzzle():
129 if not solve_mode and puzzle_focused:
130 var apclient = global.get_node("Archipelago")
131 if apclient.getAvailablePuzzleSkips() > 0:
132 apclient.usePuzzleSkip()
133 get_tree().get_root().get_node(puzzle_to_skip).complete()
134
135
136func _evaluate_puzzle_skip():
137 if puzzle_focused and not solve_mode:
138 skip_available = true
139
140 if not effect_running:
141 _process_effects()
142 else:
143 skip_available = false
144
145
93func _process_effects(): 146func _process_effects():
94 effect_running = true 147 effect_running = true
95 148
96 while slowness_remaining > 0 or iceland_remaining > 0 or atbash_activated: 149 while slowness_remaining > 0 or iceland_remaining > 0 or atbash_activated or skip_available:
97 var text = "" 150 var text = ""
98 if atbash_activated: 151 if atbash_activated:
99 text += "Atbash Trap lasts until you solve a puzzle" 152 text += "Atbash Trap lasts until you solve a puzzle"
153 if skip_available:
154 var apclient = global.get_node("Archipelago")
155 if apclient.getAvailablePuzzleSkips() > 0:
156 text += "Press P to skip puzzle (%d available)" % apclient.getAvailablePuzzleSkips()
100 if slowness_remaining > 0: 157 if slowness_remaining > 0:
101 if not text.empty(): 158 if not text.empty():
102 text += "\n" 159 text += "\n"