using PkmnLib.Static.Moves;

namespace PkmnLib.Plugin.Gen7.Scripts.Side;

[Script(ScriptCategory.Side, "mat_block")]
public class MatBlockEffect : Script, IScriptOnEndTurn, IScriptBlockIncomingHit
{
    /// <inheritdoc />
    public void BlockIncomingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
    {
        if (executingMove.UseMove.Category != MoveCategory.Status)
            block = true;
    }

    /// <inheritdoc />
    public void OnEndTurn(IScriptSource owner, IBattle battle)
    {
        RemoveSelf();
    }
}