using PkmnLib.Plugin.Gen7.Scripts.Pokemon;

namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "feint")]
public class Feint : Script, IScriptOnBeforeHit
{
    /// <inheritdoc />
    public void OnBeforeHit(IExecutingMove move, IPokemon target, byte hitIndex)
    {
        if (target.Volatile.Contains<ProtectionEffectScript>())
        {
            target.Volatile.Remove<ProtectionEffectScript>();
        }
    }
}