namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Dazzling is an ability that prevents opposing Pokémon from using moves with increased priority.
/// This includes moves like Quick Attack, Aqua Jet, and Extreme Speed.
/// 
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Dazzling_(Ability)">Bulbapedia - Dazzling</see>
/// </summary>
[Script(ScriptCategory.Ability, "dazzling")]
public class Dazzling : Script, IScriptFailIncomingMove
{
    /// <inheritdoc />
    public void FailIncomingMove(IExecutingMove move, IPokemon target, ref bool fail)
    {
        if (move.UseMove.Priority > 0)
        {
            fail = true;
        }
    }
}