#pragma once

#include "CoreMinimal.h"
#include "KillerAbilityComponent.h"
#include "DBDTunableRowHandle.h"
#include "Templates/SubclassOf.h"
#include "GameplayTagContainer.h"
#include "EAttackSubstate.h"
#include "K06EvilWithinModeAbility.generated.h"

class UStatusEffect;
class UK06SpecialPounceAttack;
class UTurnLimitationStrategy;
class UCurveFloat;
class UFloatValueStrategy;
class AKiller;

UCLASS(Blueprintable, meta=(BlueprintSpawnableComponent))
class THESHAPE_API UK06EvilWithinModeAbility : public UKillerAbilityComponent
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FDBDTunableRowHandle _shouldSurvivorsGetExposed;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TSubclassOf<UStatusEffect> _survivorExposedEffectClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TSubclassOf<UK06SpecialPounceAttack> _specialPounceAttackClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	UTurnLimitationStrategy* _turnLimitationStrategy;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UCurveFloat* _destroyBreakSpeedCurve;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FDBDTunableRowHandle _destroyBreakHittingDuration;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FDBDTunableRowHandle _destroyBreakPostHitDuration;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FDBDTunableRowHandle _destroyBreakLockCameraDuration;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FDBDTunableRowHandle _evilWithinModeDuration;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	UFloatValueStrategy* _evilWithinModeLingeringTime;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FDBDTunableRowHandle _specialPounceAttackCooldown;

	UPROPERTY(EditAnywhere)
	FGameplayTag _modeToSwitchToWhenEvilWithinModeEnds;

private:
	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, ReplicatedUsing=OnRep_SpecialPounceAttack, Transient, Instanced, meta=(AllowPrivateAccess=true))
	UK06SpecialPounceAttack* _specialPounceAttack;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	AKiller* _killer;

private:
	UFUNCTION(BlueprintCallable)
	void OnRep_SpecialPounceAttack();

	UFUNCTION(BlueprintCallable)
	void OnAttackSubstateChanged(EAttackSubstate substate);

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

public:
	UK06EvilWithinModeAbility();
};

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