using Godot;
using Newlon.Components.Zombies;

namespace Newlon.Components.Plants;

public partial class AreaAttack : Area2D
{
	[Export] private int _damage;
	
	public void Attack()
	{
		foreach (var zombie in GetOverlappingAreas())
		{
			var zombieData = zombie.GetParent<RuntimeZombieData>();
			zombieData?.TakeDamage(_damage,GetParent());
		}
	}
}
