namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "knock_off")]
public class KnockOff : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        if (!target.TryStealHeldItem(out _))
        {
            move.GetHitData(target, hit).Fail();
        }
    }
}