using UnityEngine;

public abstract class PrayerRitual : Ritual
{
    public int maxExtraDelay; // frames

    private int framesBeforePrayer;

    // Update is called once per frame
    void Update()
    {
        if (framesBeforePrayer >= 0)
        {
            if (framesBeforePrayer == 0)
            {
                monk.Pray(GetPrayerId());
            }
            framesBeforePrayer--;
        }
    }

    protected abstract int GetPrayerId();

    void OnEnable()
    {
        framesBeforePrayer = Random.Range(0, maxExtraDelay + 1);
    }
}