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

public class ZombieRecoveryState : BaseZombieAIState {

    private float startTime;
    private float recoveryTime = 10;

    public override void InitState()
    {
        base.InitState();

        this.startTime = Time.time;
        this.controller.Zombie.Movement.MoveTo(this.controller.transform.position);
    }

    public override void UpdateState()
    {
        base.UpdateState();

        if (Time.time - this.startTime > recoveryTime) {
            this.controller.Zombie.Health.Heal();
            this.controller.ChangeState(new ZombiePatrolState());
        }
    }
}
