namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
///
/// Aroma Veil is an ability that prevents allies from being affected by moves that prevent the use of moves, such as Taunt, Torment, and Disable.
/// This effect applies to all Pokémon on the same side of the field.
///
/// Bulbapedia - Aroma Veil
///
[Script(ScriptCategory.Ability, "aroma_veil")]
public class AromaVeil : Script, IScriptOnSwitchIn, IScriptOnSwitchOut
{
///
public void OnSwitchIn(IPokemon pokemon, byte position)
{
var side = pokemon.BattleData?.BattleSide;
var effect = side?.VolatileScripts.Add(new Side.AromaVeilEffect())?.Script as Side.AromaVeilEffect;
effect?.PlacerActivated(pokemon);
}
///
public void OnSwitchOut(IPokemon oldPokemon, byte position)
{
var side = oldPokemon.BattleData?.BattleSide;
var effect = side?.VolatileScripts.Get();
effect?.PlacerDeactivated(oldPokemon);
}
}