namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
///
/// Delta Stream is an ability that creates strong winds when the Pokémon enters battle.
/// These winds weaken the power of super-effective Flying-type moves and prevent other weather conditions.
/// This ability is exclusive to Mega Rayquaza.
///
/// Bulbapedia - Delta Stream
///
[Script(ScriptCategory.Ability, "delta_stream")]
public class DeltaStreamAbility : Script, IScriptOnSwitchIn
{
///
public void OnSwitchIn(IPokemon pokemon, byte position)
{
var battle = pokemon.BattleData?.Battle;
if (battle == null)
return;
battle.SetWeather(ScriptUtils.ResolveName(), -1);
if (battle.WeatherName == ScriptUtils.ResolveName())
{
((Weather.StrongWinds)battle.WeatherScript.Script!).MarkAsPlaced(pokemon);
battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon));
}
}
}