This commit is contained in:
24
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SpeedBoost.cs
Normal file
24
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SpeedBoost.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user