namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// SuppressWeatherAbility is a generic ability that suppresses the effects of weather conditions. /// This ability prevents weather effects from being applied while the Pokémon is on the field. /// This ability is used by abilities like Cloud Nine and Air Lock. /// /// Bulbapedia - Cloud Nine /// Bulbapedia - Air Lock /// [Script(ScriptCategory.Ability, "suppress_weather")] public class SuppressWeatherAbility : Script, IScriptOnBeforeAnyHookInvoked, IScriptOnSwitchIn { /// public void OnBeforeAnyHookInvoked(ref List? suppressedCategories) { suppressedCategories ??= []; suppressedCategories.Add(ScriptCategory.Weather); } /// public void OnSwitchIn(IPokemon pokemon, byte position) { pokemon.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon)); } }