#pragma once

#include "CoreMinimal.h"
#include "Engine/DataTable.h"
#include "AbilityRow.generated.h"

class UTexture2D;
class UAnimMontage;
class UNiagaraSystem;
class USoundBase;

UENUM(BlueprintType)
enum class EAbilityCategory : uint8
{
	Combat      UMETA(DisplayName = "Combat"),
	Buff        UMETA(DisplayName = "Buff"),
	Heal        UMETA(DisplayName = "Heal"),
	Movement    UMETA(DisplayName = "Movement"),
	Passive     UMETA(DisplayName = "Passive")
};

UENUM(BlueprintType)
enum class EAbilityTarget : uint8
{
	Self        UMETA(DisplayName = "Self"),
	Single      UMETA(DisplayName = "Single Target"),
	Area        UMETA(DisplayName = "Area"),
	Cone        UMETA(DisplayName = "Cone"),
	Line        UMETA(DisplayName = "Line")
};

USTRUCT(BlueprintType)
struct ZMMO_API FAbilityRow : public FTableRowBase
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Ability")
	FText DisplayName;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Ability", meta = (MultiLine = true))
	FText Description;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Ability")
	EAbilityCategory Category = EAbilityCategory::Combat;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Targeting")
	EAbilityTarget TargetMode = EAbilityTarget::Single;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Targeting")
	float Range = 500.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Targeting", meta = (EditCondition = "TargetMode == EAbilityTarget::Area || TargetMode == EAbilityTarget::Cone"))
	float Radius = 200.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Cost")
	int32 ManaCost = 0;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Cost")
	int32 StaminaCost = 0;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Timing")
	float CastTime = 0.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Timing")
	float Cooldown = 1.f;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Effect")
	int32 BaseDamage = 0;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Effect")
	FName StatusEffectRow;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Visuals")
	TSoftObjectPtr<UTexture2D> Icon;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Visuals")
	TSoftObjectPtr<UAnimMontage> CastMontage;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Visuals")
	TSoftObjectPtr<UNiagaraSystem> CastVFX;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Audio")
	TSoftObjectPtr<USoundBase> CastSound;
};
