class_name MaskAbility extends Node2D

var from_player : bool = false
var target_position : Vector2
var start_position : Vector2

func mask_ready():
	set_from_player(from_player)

func _get_all_children(node) -> Array:
	var nodes : Array = []
	for N in node.get_children():
		if N.get_child_count() > 0:
			nodes.append(N)
			nodes.append_array(_get_all_children(N))
		else:
			nodes.append(N)
	return nodes

func set_from_player(val):
	from_player = val
	var children = _get_all_children(self)
	for c in children:
		if c is Hitbox:
			c.from_player = from_player
