Deukhoofd 1b9d137bb0
All checks were successful
Build / Build (push) Successful in 50s
Surprisingly, more abilities
2025-06-14 13:37:58 +02:00

24 lines
766 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Speed Boost is an ability that raises the Pokémon's Speed at the end of each turn.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Speed_Boost_(Ability)">Bulbapedia - Speed Boost</see>
/// </summary>
[Script(ScriptCategory.Ability, "speed_boost")]
public class SpeedBoost : Script
{
/// <inheritdoc />
public override void OnEndTurn(IScriptSource owner, IBattle battle)
{
if (owner is not IPokemon pokemon)
return;
EventBatchId batchId = new();
battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon)
{
BatchId = batchId,
});
pokemon.ChangeStatBoost(Statistic.Speed, 1, true, false, batchId);
}
}