// Copyright CodeSpartan, 2022. All rights reserved.

#pragma once

#include "CoreMinimal.h"
#include "Engine/DataAsset.h"
#include "AbilityAssetCpp.generated.h"

class UAnimMontage;
class UTexture2D;
class USoundBase;
class UAbilityLogic;
/**
 * 
 */
UCLASS(Blueprintable, BlueprintType)
class MMOKITCODE_API UAbilityAssetCpp : public UPrimaryDataAsset
{
	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Ability)
	FText AbilityName;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Ability)
	UTexture2D* Icon = nullptr;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Ability)
	float CastTime = 0.f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Ability)
	float Cooldown = 0.f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Ability)
	float ManaCost = 0.f;

	UPROPERTY(Instanced, EditDefaultsOnly, BlueprintReadOnly, Category = Ability)
	UAbilityLogic* AbilityLogic = nullptr;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Cosmetic)
	UAnimMontage* ThirdPersonMontage = nullptr;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Cosmetic)
	UAnimMontage* FirstPersonMontage = nullptr;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Cosmetic)
	USoundBase* CastSound = nullptr;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Cosmetic)
	USoundBase* TargetSound = nullptr;

	/*UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Cosmetic)
	TSubclassOf<class ASpellParticleActor> ParticleOnInstrigator;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Cosmetic)
	TSubclassOf<class ASpellParticleActor> ParticleOnTarget;*/

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Ability)
	bool bChannelingAbility = false;

	/* UPrimaryDataAsset-related boilerplate below */

	/** Must be set correctly, or the asset won't be gathered by the Asset Manager */
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Asset Manager")
	FPrimaryAssetType AssetType = FPrimaryAssetType(FName(TEXT("AbilityAsset")));

	/** Returns the logical name, equivalent to the primary asset id */
	UFUNCTION(BlueprintCallable, Category = Item)
	FString GetIdentifierString() const;

	/** Overridden to use saved type */
	virtual FPrimaryAssetId GetPrimaryAssetId() const override;
};
