Deukhoofd 5961bb746e
All checks were successful
Build / Build (push) Successful in 51s
Even more abilities
2025-06-14 13:24:38 +02:00

21 lines
779 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Sap Sipper is an ability that grants immunity to Grass-type moves and raises Attack when hit by one.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sap_Sipper_(Ability)">Bulbapedia - Sap Sipper</see>
/// </summary>
[Script(ScriptCategory.Ability, "sap_sipper")]
public class SapSipper : Script
{
/// <inheritdoc />
public override void IsInvulnerableToMove(IExecutingMove move, IPokemon target, ref bool invulnerable)
{
if (move.GetHitData(target, 0).Type?.Name == "grass")
{
invulnerable = true;
move.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
target.ChangeStatBoost(Statistic.Attack, 1, true, false);
}
}
}