namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// Snow Warning is an ability that creates hail when the Pokémon enters battle. /// /// Bulbapedia - Snow Warning /// [Script(ScriptCategory.Ability, "snow_warning")] public class SnowWarning : Script, IScriptOnSwitchIn { /// public void OnSwitchIn(IBattlePokemon pokemon, byte position) { var battleData = pokemon; if (battleData == null) return; if (battleData.Battle.WeatherName == ScriptUtils.ResolveName()) return; EventBatchId batchId = new(); battleData.Battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon)); battleData.Battle.SetWeather(ScriptUtils.ResolveName(), 5, batchId); } }