20 lines
378 B
C#
20 lines
378 B
C#
using Godot;
|
|
using Newlon.Components.Zombies;
|
|
using Newlon.Systems.Effects;
|
|
|
|
namespace Newlon.Components.Plants;
|
|
|
|
public partial class ReturnEffect : Node
|
|
{
|
|
[Export]
|
|
private Effect _effectToReturn;
|
|
|
|
public void OnDamageRecieved(int delta,Node origin)
|
|
{
|
|
if (delta >= 0) return;
|
|
if (origin is RuntimeZombieData zombie)
|
|
{
|
|
zombie.GiveEffect(_effectToReturn);
|
|
}
|
|
}
|
|
}
|