Adds more abilities
This commit is contained in:
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Competitive.cs
Normal file
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Competitive.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Competitive is an ability that raises the Pokémon's Special Attack by two stages whenever any of its stats are lowered.
|
||||
/// This includes stat drops from moves, abilities, or items. The ability will not activate if the stat drop is self-inflicted.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Competitive_(Ability)">Bulbapedia - Competitive</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "competitive")]
|
||||
public class Competitive : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <inheritdoc />
|
||||
public override void OnAfterStatBoostChange(IPokemon pokemon, Statistic stat, bool selfInflicted, sbyte change)
|
||||
{
|
||||
if (change >= 0)
|
||||
return;
|
||||
if (selfInflicted)
|
||||
return;
|
||||
EventBatchId batchId = new();
|
||||
pokemon.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon)
|
||||
{
|
||||
BatchId = batchId,
|
||||
});
|
||||
pokemon.ChangeStatBoost(Statistic.SpecialAttack, 2, true, batchId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user