namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Queenly Majesty is an ability that prevents priority moves from being used against the Pokémon.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Queenly_Majesty_(Ability)">Bulbapedia - Queenly Majesty</see>
/// </summary>
[Script(ScriptCategory.Ability, "queenly_majesty")]
public class QueenlyMajesty : Script, IScriptFailIncomingMove
{
    /// <inheritdoc />
    public void FailIncomingMove(IExecutingMove move, IPokemon target, ref bool fail)
    {
        if (move.Targets.Count != 1)
            return;

        if (move.MoveChoice.Priority > 0)
        {
            fail = true;
        }
    }
}