// © 2025 Naked People Team. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "NakedDesire/Commissions/CommissionObjective.h"
#include "ReachEmbarrassmentObjective.generated.h"

// Push embarrassment to ThresholdFraction of max. RequiredHoldSeconds = 0 satisfies on reaching it
// (ReachEmbarrassment); > 0 requires staying at/above it for the duration (SustainEmbarrassment).
UCLASS(EditInlineNew, DisplayName = "Reach Embarrassment")
class NAKEDDESIRE_API UReachEmbarrassmentObjective : public UCommissionObjective
{
	GENERATED_BODY()

public:
	virtual FText GetDescription() const override;

protected:
	virtual void OnActivate() override;
	virtual void OnDeactivate() override;
	virtual bool IsConditionMet() const override;

private:
	UPROPERTY(EditDefaultsOnly, meta = (ClampMin = 0.0, ClampMax = 1.0))
	float ThresholdFraction = 0.8f;

	UFUNCTION()
	void HandleEmbarrassmentUpdate(float CurrentValue, float MaxValue);

	float CachedCurrent = 0.0f;
	float CachedMax = 0.0f;
};