using Godot;
using System;
using System.Collections.Generic;

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

    public override void Fire()
    {
        if (_target != null)
        {
            if (_target is Worker)
            {
                Worker target = (Worker)_target;
                if (_owner is Worker)
                {
                    Worker owner = (Worker)_owner;
                    if (target._manager != owner._manager)
                    {
                        int damage = -owner._aptitude / 2;
                        target.ChangeHealth(damage, owner);
                    }
                }

            }
            _target = null;
        }
        
    }
    
}
