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
{
///
public override void OnSwitchIn(IPokemon pokemon, byte position)
{
var battleData = pokemon.BattleData;
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);
}
}