#pragma once

#include "CoreMinimal.h"
#include "KillerProjectileAbility.h"
#include "Templates/SubclassOf.h"
#include "K40ProjectileAbility.generated.h"

class UFloatValueStrategy;
class UStatusEffect;
class UInteractionDefinition;
class AK40EnvironmentAttachedProjectile;
class UInteractionAttacherComponent;
class AActor;
class ULocalActorPoolComponent;
class AK40AttachedTerrorRadius;

UCLASS(Blueprintable, meta=(BlueprintSpawnableComponent))
class UK40ProjectileAbility : public UKillerProjectileAbility
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	UFloatValueStrategy* _environmentAttachedProjectileAoEDuration;

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

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<UInteractionDefinition> _removeAttachedProjectileSelfInteractionClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<UInteractionDefinition> _removeAttachedProjectileOtherInteractionClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<UInteractionDefinition> _pickupAttachedProjectileInteractionClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<UInteractionDefinition> _recallProjectileInteractionClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<AK40EnvironmentAttachedProjectile> _environmentAttachedProjectileClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, meta=(AllowPrivateAccess=true))
	UFloatValueStrategy* _attachedTerrorRadiusEmitterRadius;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<AK40EnvironmentAttachedProjectile> _survivorAttachedProjectileClass;

	UPROPERTY(BlueprintReadWrite, ReplicatedUsing=OnRep_SurvivorSelfAttacherComponent, Transient, Instanced, meta=(AllowPrivateAccess=true))
	UInteractionAttacherComponent* _survivorSelfAttacherComponent;

	UPROPERTY(BlueprintReadWrite, ReplicatedUsing=OnRep_SurvivorOtherAttacherComponent, Transient, Instanced, meta=(AllowPrivateAccess=true))
	UInteractionAttacherComponent* _survivorOtherAttacherComponent;

	UPROPERTY(BlueprintReadWrite, ReplicatedUsing=OnRep_AttachedProjectileActor, Transient, meta=(AllowPrivateAccess=true))
	AActor* _actorWithAttachedProjectile;

	UPROPERTY(BlueprintReadWrite, Replicated, Transient, meta=(AllowPrivateAccess=true))
	bool _isAttachedProjectileSurvivorInRange;

	UPROPERTY(BlueprintReadWrite, Transient, Instanced, meta=(AllowPrivateAccess=true))
	ULocalActorPoolComponent* _environmentAttachedProjectilePool;

	UPROPERTY(BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	AK40AttachedTerrorRadius* _attachedTerrorRadius;

private:
	UFUNCTION(BlueprintCallable)
	void OnRep_SurvivorSelfAttacherComponent();

	UFUNCTION(BlueprintCallable)
	void OnRep_SurvivorOtherAttacherComponent();

	UFUNCTION(BlueprintCallable)
	void OnRep_AttachedProjectileActor(AActor* oldActorWithAttachedProjectile);

	UFUNCTION(BlueprintCallable, NetMulticast, Reliable)
	void Multicast_Cheat_UseProjectileTerrorRadius(const bool isUsingProjectileTerrorRadius);

	UFUNCTION(BlueprintCallable, NetMulticast, Reliable)
	void Multicast_Cheat_UseProjectileTeleportThroughDoor(const bool isUsingProjectileTeleportThroughDoor);

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

public:
	UK40ProjectileAbility();
};

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