// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "BountyClass.h"
#include "SideBountyClass.h"
#include "MainBountyClass.generated.h"

/**
 * 
 */
UCLASS()
class ENDLESSVENDETTA_API AMainBountyClass : public ABountyClass
{
	GENERATED_BODY()

	void IncrementBountyCheckpoint() override;

protected:
	UPROPERTY(EditDefaultsOnly, Category = "Bounty")
	TArray<TSubclassOf<ASideBountyClass>> SideBountiesToSpawn;
	
	// ---------------- Bounty Alterations ----------------
	UPROPERTY(EditDefaultsOnly, Category = "Bounty")
	TArray<FString> CustomBountyAlteration_Description;

	UPROPERTY(EditDefaultsOnly, Category = "Bounty")
	TArray<int> CustomBountyAlteration_Cost;
	
	UPROPERTY(EditDefaultsOnly, Category = "Bounty")
	TArray<FTransform> AmmoDropSpawnTransforms;

	UPROPERTY(EditDefaultsOnly, Category = "Bounty")
	TSubclassOf<AActor> AmmoDropClass;

	UPROPERTY(EditDefaultsOnly, Category = "Bounty")
	TArray<FTransform> HealthDropSpawnTransforms;

	UPROPERTY(EditDefaultsOnly, Category = "Bounty")
	TSubclassOf<AActor> HealthDropClass;
	
	bool HasEnemyRadio = false;

public:
	TArray<TSubclassOf<ASideBountyClass>> GetSideBountiesToSpawn()
	{
		return SideBountiesToSpawn;
	}
	
	// ------------- Custom Bounty Alterations -------------
	UFUNCTION(BlueprintImplementableEvent, Category = "Bounty")
	void ActivateCustomBountyAlteration_1();

	UFUNCTION(BlueprintImplementableEvent, Category = "Bounty")
	void ActivateCustomBountyAlteration_2();
	
	UFUNCTION(BlueprintImplementableEvent, Category = "Bounty")
	void ActivateCustomBountyAlteration_3();

	bool ActivatedCBA_1 = false;
	bool ActivatedCBA_2 = false;
	bool ActivatedCBA_3 = false;

	UFUNCTION(BlueprintCallable, Category = "Bounty")
	FString GetCustomBountyAlteration_1_Description()
	{
		return CustomBountyAlteration_Description.IsEmpty() ? FString("") : CustomBountyAlteration_Description[0];
	}
	
	UFUNCTION(BlueprintCallable, Category = "Bounty")
	FString GetCustomBountyAlteration_2_Description()
	{
		return CustomBountyAlteration_Description.Num() <= 1 ? FString("") : CustomBountyAlteration_Description[1];
	}
	
	UFUNCTION(BlueprintCallable, Category = "Bounty")
	FString GetCustomBountyAlteration_3_Description()
	{
		return CustomBountyAlteration_Description.Num() <= 2 ? FString("") : CustomBountyAlteration_Description[2];
	}

	UFUNCTION(BlueprintCallable, Category = "Bounty")
	int GetCustomBountyAlteration_1_Cost()
	{
		return CustomBountyAlteration_Cost.IsEmpty() ? 0 : CustomBountyAlteration_Cost[0];
	}

	UFUNCTION(BlueprintCallable, Category = "Bounty")
	int GetCustomBountyAlteration_2_Cost()
	{
		return CustomBountyAlteration_Cost.Num() <= 1 ? 0 : CustomBountyAlteration_Cost[1];
	}

	UFUNCTION(BlueprintCallable, Category = "Bounty")
	int GetCustomBountyAlteration_3_Cost()
	{
		return CustomBountyAlteration_Cost.Num() <= 2 ? 0 : CustomBountyAlteration_Cost[2];
	}
	// ------------- Simple Bounty Alterations	-------------

	void SpawnAmmoDrops();

	bool ActivateAmmoDrops = false;

	void SpawnHealthDrops();

	bool ActivatedHealthDrops = false;

	void ActivateEnemyRadio()
	{
		UE_LOG(LogTemp, Display, TEXT("Bought Radio, but it's not implemented yet"));
		HasEnemyRadio = true;
	}

	bool ActivatedRadio = false;

	// Concerned Enemies will call this function, if true, play funny poop voice line and stop enemies from being concerned
	bool CheckIfHasEnemyRadio()
	{
		return HasEnemyRadio;
	};
	
};
