namespace PkmnLib.Plugin.Gen7.Scripts.Side;

[Script(ScriptCategory.Side, "quick_guard")]
public class QuickGuardEffect : Script, IScriptIsInvulnerableToMove, IScriptOnEndTurn
{
    /// <inheritdoc />
    /// <inheritdoc />
    public void IsInvulnerableToMove(IExecutingMove move, IPokemon target, ref bool invulnerable)
    {
        if (move.UseMove.Priority > 0)
            invulnerable = true;
    }

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