using Godot;
using System;

public partial class Spiky : Condition
{
    public Spiky(Node2D OWNER) : base(OWNER)
    {
        _triggers.Add(Trigger.On.Collision);
    }

    public override void Fire()
    {
        if (_target != null)
        {
            if (_target is Worker)
            {
                Worker target = (Worker)_target;
                target._rotationalForce += 10;
                target.ChangeHealth(-1, _owner);
            }
            _target = null;
        }
    }
}
