namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Gale Wings is an ability that gives priority to Flying-type moves when the Pokémon's HP is full.
/// This ability is commonly associated with Fletchling, Fletchinder, and Talonflame.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Gale_Wings_(Ability)">Bulbapedia - Gale Wings</see>
/// </summary>
[Script(ScriptCategory.Ability, "gale_wings")]
public class GaleWings : Script, IScriptChangePriority
{
    /// <inheritdoc />
    public void ChangePriority(IMoveChoice choice, ref sbyte priority)
    {
        if (choice.User.CurrentHealth != choice.User.MaxHealth)
            return;
        // Defensive programming, should never happen
        if (priority == sbyte.MaxValue)
            return;

        priority++;
    }
}