using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TowerController : StructureController
{
    public override LevelObjectFaction ObjectFaction { get { return LevelObjectFaction.Zombie; } }
    public override LevelObjectType ObjectType { get { return LevelObjectType.Tower; } }

    //public float ActionCooldown = 1;
    //bool ActionActivated = false;
    public void Awake()
    {
        Init();
    }


    protected override void HPZero()
    {
        base.HPZero();
    }

    public override bool PlayerAction(Necromancer player)
    {
        Debug.Log($"{this.name}: Player Action");
        if (!player.HasGoo)
        {
            return false;
        }

        if (CurrentLevel > 0)
        {
            player.UseGoo(1);
            EventManager.TriggerSpawnFighterZombie();
            return true;
        }
        else
        {
            return base.PlayerAction(player);
        }

        /*
        if (!ActionActivated)
        {
            var renderer = Halo.GetComponent<SpriteRenderer>();
            renderer.sprite = ActiveHalo;
            ActionActivated = true;
            Invoke("ResetAction", ActionCooldown);
            return true;
        }
        */
    }
    /*
        private void ResetAction()
        {
            Debug.Log($"{this.name}: Reset Action");
            ActionActivated = false;
            var renderer = Halo.GetComponent<SpriteRenderer>();
            renderer.sprite = ReadyHalo;
        }
    */
    void Update()
    {

    }

}
