Adds more abilities

This commit is contained in:
2025-06-07 10:58:58 +02:00
parent 232b94b04c
commit b2ba3d96ba
25 changed files with 429 additions and 16 deletions

View 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));
}
}