namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Bulletproof is an ability that grants immunity to ball and bomb moves.
/// The Pokémon is unaffected by all damage and effects from moves flagged as ballistics, such as Shadow Ball and Sludge Bomb.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Bulletproof_(Ability)">Bulbapedia - Bulletproof</see>
/// </summary>
[Script(ScriptCategory.Ability, "bulletproof")]
public class Bulletproof : Script, IScriptFailIncomingMove
{
    /// <inheritdoc />
    public void FailIncomingMove(IExecutingMove move, IPokemon target, ref bool fail)
    {
        if (move.UseMove.HasFlag(MoveFlags.Ballistics))
            fail = true;
    }
}