using UnityEngine;
using System.Collections;

public class FrozenDebuff : MonoBehaviour
{

    public float fLifetime;
    private BaseEnemy myVictim;

	// Use this for initialization
	void Start () 
    {
	
	}

    public void AssignVictim(BaseEnemy victim)
    {
        myVictim = victim;
        fLifetime = 3.0f;
    }

	// Update is called once per frame
	void Update () 
    {
	    if (myVictim == null || myVictim.currentAiEnemyBehaviorState == AIEnemyBehaviorState.dying_lol)
	    {
	        Destroy(gameObject);
	        return;
	    }

	    fLifetime -= Time.smoothDeltaTime;
	    if (fLifetime < 0.0f)
	    {
	        myVictim.currentAiEnemyBehaviorState = myVictim.DefaultAI;
            Destroy(gameObject);
            return;
	    }
    }
}
