Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -51,8 +51,11 @@ func _activate(_world, activator, position):
|
|||||||
assert(false, "who are you, activator?")
|
assert(false, "who are you, activator?")
|
||||||
# world.add_child(katana)
|
# world.add_child(katana)
|
||||||
|
|
||||||
func discard(world, activator, do_ability):
|
|
||||||
|
func discard(_world, activator, do_ability):
|
||||||
ammo = max_ammo
|
ammo = max_ammo
|
||||||
|
if do_ability:
|
||||||
|
activator.dash(_activate);
|
||||||
|
|
||||||
func get_ammo():
|
func get_ammo():
|
||||||
return ammo
|
return ammo
|
||||||
|
|||||||
@@ -47,8 +47,10 @@ func _activate(world, activator, position):
|
|||||||
assert(false, "who are you, activator?")
|
assert(false, "who are you, activator?")
|
||||||
world.add_child(mine)
|
world.add_child(mine)
|
||||||
|
|
||||||
func discard(world, activator, do_ability):
|
func discard(_world, activator, do_ability):
|
||||||
ammo = max_ammo
|
ammo = max_ammo
|
||||||
|
if do_ability:
|
||||||
|
activator.dash(null);
|
||||||
|
|
||||||
func get_ammo():
|
func get_ammo():
|
||||||
return ammo
|
return ammo
|
||||||
|
|||||||
@@ -68,10 +68,11 @@ func charge():
|
|||||||
# Gradual charge dropoff
|
# Gradual charge dropoff
|
||||||
charge_level = max(charge_level - charge_rate * 2, 0);
|
charge_level = max(charge_level - charge_rate * 2, 0);
|
||||||
|
|
||||||
func dash(on_end: Callable):
|
func dash(on_end):
|
||||||
dash_cooldown_timer.start(dash_cooldown);
|
dash_cooldown_timer.start(dash_cooldown);
|
||||||
var target_dir = position.direction_to(target)
|
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;
|
velocity = move_direction * speed * 5;
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
|||||||
Reference in New Issue
Block a user