This commit is contained in:
SondreElg
2025-10-05 15:12:07 +02:00
parent 7582b91926
commit 0b0a5963e4
2 changed files with 3 additions and 2 deletions

View File

@@ -50,7 +50,7 @@ func _activate(world, activator, position):
func discard(_world, activator, do_ability):
ammo = max_ammo
if do_ability:
activator.dash(_activate);
activator.dash(null);
func get_ammo():
return ammo

View File

@@ -71,7 +71,8 @@ func charge():
func dash(on_end: Callable):
dash_cooldown_timer.start(dash_cooldown);
var target_dir = position.direction_to(target)
dash_cooldown_timer.timeout.connect(func(): on_end.call(null, self, target_dir), CONNECT_ONE_SHOT);
if (on_end):
dash_cooldown_timer.timeout.connect(func(): on_end.call(null, self, target_dir), CONNECT_ONE_SHOT);
velocity = move_direction * speed * 5;
func _ready():