diff options
Diffstat (limited to 'Archipelago/effects.gd')
-rw-r--r-- | Archipelago/effects.gd | 59 |
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 | |||
6 | var iceland_remaining = 0 | 6 | var iceland_remaining = 0 |
7 | var atbash_activated = false | 7 | var atbash_activated = false |
8 | var queued_iceland = 0 | 8 | var queued_iceland = 0 |
9 | var skip_available = false | ||
10 | var puzzle_focused = false | ||
11 | var solve_mode = false | ||
12 | var puzzle_to_skip = "" | ||
9 | 13 | ||
10 | var orig_env | 14 | var orig_env |
11 | var orig_walk | 15 | var orig_walk |
@@ -90,13 +94,66 @@ func deactivate_atbash_trap(): | |||
90 | apclient.evaluateSolvability() | 94 | apclient.evaluateSolvability() |
91 | 95 | ||
92 | 96 | ||
97 | func 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 | |||
113 | func hide_puzzle_skip_message(): | ||
114 | puzzle_focused = false | ||
115 | _evaluate_puzzle_skip() | ||
116 | |||
117 | |||
118 | func enter_solve_mode(): | ||
119 | solve_mode = true | ||
120 | _evaluate_puzzle_skip() | ||
121 | |||
122 | |||
123 | func exit_solve_mode(): | ||
124 | solve_mode = false | ||
125 | _evaluate_puzzle_skip() | ||
126 | |||
127 | |||
128 | func 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 | |||
136 | func _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 | |||
93 | func _process_effects(): | 146 | func _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" |