about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-02-04 13:15:35 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-02-04 13:15:35 -0500
commitf1fdf947e95761136b8abafe630fb1ba61ae3129 (patch)
tree1eef6c3916e5baac39f01bd17bd29fb72e9cf71f
parentf696286fdab96ccfc2bb4bddd8cc0ceda87309db (diff)
downloadlingo-archipelago-f1fdf947e95761136b8abafe630fb1ba61ae3129.tar.gz
lingo-archipelago-f1fdf947e95761136b8abafe630fb1ba61ae3129.tar.bz2
lingo-archipelago-f1fdf947e95761136b8abafe630fb1ba61ae3129.zip
More accurate wall snipe detection
-rw-r--r--Archipelago/effects.gd19
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
115func show_puzzle_skip_message(node_path): 115func 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):
133func hide_puzzle_skip_message(): 137func 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
189func _process(_delta): 195func _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