extends ConditionLeaf

func tick(actor: Node, blackboard: Blackboard) -> int:
	if actor.action_points < 2:
		return FAILURE
		
	# Look for items that match goals
	for i in range(actor.playerboard.size()):
		if actor.playerboard[i] in actor.goals:
			var neighbors = actor.get_adjacent_playerboard_slots(i)
			for adj_slot in neighbors:
				if actor.playerboard[adj_slot] == -1:
					blackboard.set_value("source_slot", i)
					blackboard.set_value("target_slot", adj_slot)
					return SUCCESS
	return FAILURE
