namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "refresh")]
public class Refresh : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        var userStatus = move.User.StatusScript;
        switch (userStatus.Script?.Name)
        {
            case "paralyzed":
            case "burned":
            case "poisoned":
            case "badly_poisoned":
                move.User.ClearStatus();
                break;
            default:
                move.GetHitData(target, hit).Fail();
                break;
        }
    }
}