namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Triage is an ability that gives priority to healing moves.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Triage_(Ability)">Bulbapedia - Triage</see>
/// </summary>
[Script(ScriptCategory.Ability, "triage")]
public class Triage : Script, IScriptChangePriority
{
    /// <inheritdoc />
    public void ChangePriority(IMoveChoice choice, ref sbyte priority)
    {
        if (!choice.ChosenMove.MoveData.HasFlag(MoveFlags.Heal))
            return;
        if (priority == sbyte.MaxValue)
            return;
        priority++;
    }
}