Files
PkmnLib.NET/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Captivate.cs
Deukhoofd 6a82c20cf2
All checks were successful
Build / Build (push) Successful in 1m57s
More tests, more fixes
2026-07-05 18:26:55 +02:00

24 lines
752 B
C#

using PkmnLib.Static.Species;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "captivate")]
public class Captivate : Script, IScriptOnSecondaryEffect
{
/// <inheritdoc />
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
var user = move.User;
if (target.Gender == Gender.Genderless || target.Gender == user.Gender || user.Gender == Gender.Genderless)
{
move.GetHitData(target, hit).Fail();
return;
}
if (target.ActiveAbility?.Name == "oblivious")
{
move.GetHitData(target, hit).Fail();
return;
}
target.ChangeStatBoost(Statistic.SpecialAttack, -2, false, false);
}
}