namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "purify")]
public class Purify : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        if (target.StatusScript.IsEmpty)
        {
            move.GetHitData(target, hit).Fail();
            return;
        }

        target.ClearStatus();
        target.Heal(target.MaxHealth / 2);
    }
}