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