#pragma once

#include "CoreMinimal.h"
#include "Perk.h"
#include "Templates/SubclassOf.h"
#include "BalancedLanding.generated.h"

class UStatusEffect;

UCLASS(Blueprintable, meta=(BlueprintSpawnableComponent))
class UBalancedLanding : public UPerk
{
	GENERATED_BODY()

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<UStatusEffect> _staggerReductionEffectClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<UStatusEffect> _activatableExhaustedEffectClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	float _sprintDuration;

	UPROPERTY(EditAnywhere)
	float _exhaustionDurationPerLevel;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, Instanced, meta=(AllowPrivateAccess=true))
	UStatusEffect* _exhaustedEffect;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, ReplicatedUsing=OnRep_ShouldApplyStaggerReduction, meta=(AllowPrivateAccess=true))
	bool _shouldApplyStaggerReduction;

private:
	UFUNCTION(BlueprintCallable, Server, Reliable)
	void Server_WarnBalancedLandingPredicted();

	UFUNCTION(BlueprintCallable)
	void OnRep_ShouldApplyStaggerReduction();

public:
	UFUNCTION(BlueprintPure)
	float GetSprintDuration() const;

	UFUNCTION(BlueprintPure)
	float GetExhaustionDurationAtLevel() const;

private:
	UFUNCTION(BlueprintCallable, Client, Reliable)
	void Client_UnvalidateBalanceLanding();

public:
	virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

public:
	UBalancedLanding();
};

FORCEINLINE uint32 GetTypeHash(const UBalancedLanding) { return 0; }
