using PkmnLib.Plugin.Gen7.Scripts.Pokemon;

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Oblivious is an ability that prevents the Pokémon from being infatuated or taunted.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Oblivious_(Ability)">Bulbapedia - Oblivious</see>
/// </summary>
[Script(ScriptCategory.Ability, "oblivious")]
public class Oblivious : Script, IScriptPreventVolatileAdd
{
    /// <inheritdoc />
    public void PreventVolatileAdd(IScriptSource parent, Script script, ref bool preventVolatileAdd)
    {
        preventVolatileAdd = script switch
        {
            Infatuated or TauntEffect => true,
            _ => preventVolatileAdd,
        };
    }
}