namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "grudge")]
public class Grudge : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        move.User.Volatile.StackOrAdd("grudge", () =>
        {
            move.User.Library.ScriptResolver.TryResolve(ScriptCategory.Pokemon, "grudge",
                new Dictionary<StringKey, object?>(), out var script);
            return script;
        });
    }
}