diff options
Diffstat (limited to 'Archipelago/effects.gd')
-rw-r--r-- | Archipelago/effects.gd | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Archipelago/effects.gd b/Archipelago/effects.gd index e830fbc..7d9df35 100644 --- a/Archipelago/effects.gd +++ b/Archipelago/effects.gd | |||
@@ -113,6 +113,9 @@ func deactivate_atbash_trap(): | |||
113 | 113 | ||
114 | 114 | ||
115 | func show_puzzle_skip_message(node_path): | 115 | func show_puzzle_skip_message(node_path): |
116 | if puzzle_focused and node_path != puzzle_to_skip: | ||
117 | hide_puzzle_skip_message() | ||
118 | |||
116 | var panel_input = get_tree().get_root().get_node(node_path) | 119 | var panel_input = get_tree().get_root().get_node(node_path) |
117 | if not panel_input.visible: | 120 | if not panel_input.visible: |
118 | return | 121 | return |
@@ -126,6 +129,7 @@ func show_puzzle_skip_message(node_path): | |||
126 | puzzle_focused = true | 129 | puzzle_focused = true |
127 | wallcast.enabled = true | 130 | wallcast.enabled = true |
128 | not_behind_wall = false | 131 | not_behind_wall = false |
132 | text_dirty = true | ||
129 | puzzle_to_skip = node_path | 133 | puzzle_to_skip = node_path |
130 | _evaluate_puzzle_skip() | 134 | _evaluate_puzzle_skip() |
131 | 135 | ||
@@ -133,6 +137,8 @@ func show_puzzle_skip_message(node_path): | |||
133 | func hide_puzzle_skip_message(): | 137 | func hide_puzzle_skip_message(): |
134 | puzzle_focused = false | 138 | puzzle_focused = false |
135 | wallcast.enabled = false | 139 | wallcast.enabled = false |
140 | not_behind_wall = false | ||
141 | text_dirty = true | ||
136 | _evaluate_puzzle_skip() | 142 | _evaluate_puzzle_skip() |
137 | 143 | ||
138 | 144 | ||
@@ -188,11 +194,16 @@ func _tick_iceland(): | |||
188 | 194 | ||
189 | func _process(_delta): | 195 | func _process(_delta): |
190 | if puzzle_focused: | 196 | if puzzle_focused: |
197 | var should_nbw = false | ||
191 | if wallcast.is_colliding(): | 198 | if wallcast.is_colliding(): |
192 | var should_nbw = (get_tree().get_root().get_node("Spatial/player")._get_panel_from_ray(wallcast) != null) | 199 | var player = get_tree().get_root().get_node("Spatial/player") |
193 | if should_nbw != not_behind_wall: | 200 | var puzzlecast = player.get_node("pivot/camera/RayCast_sight") |
194 | not_behind_wall = true | 201 | var distance = puzzlecast.get_collision_point().distance_to(wallcast.get_collision_point()) |
195 | text_dirty = true | 202 | should_nbw = (distance < 0.05) |
203 | |||
204 | if should_nbw != not_behind_wall: | ||
205 | not_behind_wall = should_nbw | ||
206 | text_dirty = true | ||
196 | 207 | ||
197 | if text_dirty: | 208 | if text_dirty: |
198 | text_dirty = false | 209 | text_dirty = false |