Deukhoofd 00005aa4bf
All checks were successful
Build / Build (push) Successful in 47s
Implements more abilities
2025-06-09 12:10:25 +02:00

27 lines
1.0 KiB
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// 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.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Delta_Stream_(Ability)">Bulbapedia - Delta Stream</see>
/// </summary>
[Script(ScriptCategory.Ability, "delta_stream")]
public class DeltaStreamAbility : Script
{
/// <inheritdoc />
public override void OnSwitchIn(IPokemon pokemon, byte position)
{
var battle = pokemon.BattleData?.Battle;
if (battle == null)
return;
battle.SetWeather(ScriptUtils.ResolveName<Weather.StrongWinds>(), -1);
if (battle.WeatherName == ScriptUtils.ResolveName<Weather.StrongWinds>())
{
((Weather.StrongWinds)battle.WeatherScript.Script!).MarkAsPlaced(pokemon);
battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon));
}
}
}