namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// Sand Stream is an ability that creates a sandstorm when the Pokémon enters battle. /// /// Bulbapedia - Sand Stream /// [Script(ScriptCategory.Ability, "sand_stream")] public class SandStream : 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); } }