Deukhoofd 1feb27e826
All checks were successful
Build / Build (push) Successful in 50s
More work on refactor to interfaces
2025-06-29 12:03:51 +02:00

24 lines
775 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, IScriptOnEndTurn
{
/// <inheritdoc />
public 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);
}
}