bovido/scripts/enemy/behavior_tree/throw_ball_action.gd

18 lines
404 B
GDScript3
Raw Normal View History

class_name ThrowBallAction
extends ActionLeaf
func before_run(actor, _blackboard):
actor.play_throw_animation()
func tick(actor, blackboard):
if !actor.is_throw_animation_finished:
return RUNNING
else:
var target = blackboard.get_value("target")
actor.throw_ball(target)
actor.has_thrown_ball = true
return SUCCESS
func after_run(actor, _blackboard):
actor.animation_player.play("idle")