using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Singleton;
public class Nessie : Singleton<Nessie> {

    public int Health = 3;

    [SerializeField] private GameObject nessieGameObject;
    [SerializeField] private Animator nessAnimator;
    public bool rotating = false;
    public bool headlost = false;

    public void Activate() {
        nessieGameObject.SetActive(true);
    }

    public void SelfDestruct() {
        GameManager.Instance.minigameOne = false;
        Destroy(gameObject);
    }

    public void Hurt() {
        Health--;
        print("HURT");

        if (Health <= 0) {
            nessAnimator.SetTrigger("Die");
        }
    }

    public void LoseHead() {
        if (headlost) return; 
        headlost = true;
        nessAnimator.SetTrigger("LoseHead");
    }

    public void GetHead() {
        if (!headlost) return;
        headlost = false;
        nessAnimator.SetTrigger("UnloseHead");
        Debug.Log("unlose head");
    }

    public void SetRotate() {
        if (rotating) return;
        rotating = true;
        nessAnimator.SetTrigger("Rotate");
    }

    public void UndoRotate() {
        if (!rotating) return;
        rotating = false;
        nessAnimator.SetTrigger("Unrotate");
    }
}
