extends ActionLeaf
class_name Action

func get_character(actor:Node) -> Character:
	if not actor is AI:
		print("行为树结构错误")
		return null
	var ai = actor as AI
	return ai.character

func before_run(actor:Node, blackboard: Blackboard) -> void:
	init(get_character(actor))

func tick(actor:Node, blackboard: Blackboard) -> int:
	var character = get_character(actor)
	if character.get_status("is_stagger") or character.get_status("is_stun"):
		return FAILURE
	return run(character)

func init(character: Character): pass
func run(character: Character) -> int: return FAILURE
