Adds more abilities
This commit is contained in:
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Contrary.cs
Normal file
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Contrary.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Contrary is an ability that inverts all stat changes for the Pokémon.
|
||||
/// When a stat would normally be raised, it is lowered instead, and vice versa.
|
||||
/// This applies to both self-inflicted stat changes and those caused by other Pokémon.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Contrary_(Ability)">Bulbapedia - Contrary</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "contrary")]
|
||||
public class Contrary : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeStatBoostChange(IPokemon target, Statistic stat, bool selfInflicted, ref sbyte amount)
|
||||
{
|
||||
// Invert the stat change
|
||||
amount = (sbyte)-amount;
|
||||
target.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user