2025-06-09 14:23:51 +02:00

27 lines
992 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Electric Surge is an ability that creates Electric Terrain when the Pokémon enters battle.
/// This terrain prevents grounded Pokémon from falling asleep and boosts Electric-type moves.
/// This ability is exclusive to Tapu Koko.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Electric_Surge_(Ability)">Bulbapedia - Electric Surge</see>
/// </summary>
[Script(ScriptCategory.Ability, "electric_surge")]
public class ElectricSurge : Script
{
/// <inheritdoc />
public override void OnSwitchIn(IPokemon pokemon, byte position)
{
var battleData = pokemon.BattleData;
if (battleData == null)
return;
EventBatchId batchId = new();
battleData.Battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon)
{
BatchId = batchId,
});
battleData.Battle.SetTerrain(ScriptUtils.ResolveName<Terrain.ElectricTerrain>(), batchId);
}
}