2023-03-29 16:36:24 +00:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
2023-05-02 06:16:40 +00:00
|
|
|
#include "WorldState.h"
|
2023-03-29 16:36:24 +00:00
|
|
|
#include "Quest.generated.h"
|
|
|
|
|
2023-05-02 04:42:48 +00:00
|
|
|
UENUM(BlueprintType)
|
|
|
|
enum class EQuestLine : uint8
|
|
|
|
{
|
|
|
|
Main UMETA(DisplayName="Main"),
|
|
|
|
Sub UMETA(DisplayName="Sub")
|
|
|
|
};
|
|
|
|
|
|
|
|
UCLASS(Abstract, BlueprintType, Blueprintable, EditInlineNew, DefaultToInstanced)
|
2023-03-29 16:36:24 +00:00
|
|
|
class THE_TWILIGHT_ABYSS_API UQuest : public UObject
|
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
2023-05-02 04:42:48 +00:00
|
|
|
|
2023-03-29 16:36:24 +00:00
|
|
|
public:
|
2023-05-02 06:16:40 +00:00
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
|
|
|
int QuestID;
|
2023-05-02 04:42:48 +00:00
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
2023-03-29 16:36:24 +00:00
|
|
|
FText Title;
|
2023-05-02 04:42:48 +00:00
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
2023-03-29 16:36:24 +00:00
|
|
|
FText Description;
|
2023-05-02 04:42:48 +00:00
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
|
|
|
EQuestLine QuestLine;
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, NoClear, Instanced)
|
|
|
|
UWorldState* Goals;
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Instanced)
|
|
|
|
UWorldState* PreConditions;
|
2023-05-04 04:04:37 +00:00
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Instanced)
|
2023-05-02 04:42:48 +00:00
|
|
|
TArray<UBaseItem*> Rewards;
|
2023-05-04 04:04:37 +00:00
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
2023-05-04 05:31:59 +00:00
|
|
|
TMap<FString, bool> QuestFlagsOnAdd;
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
|
|
|
TMap<FString, bool> QuestFlagsOnComplete;
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
2023-05-04 04:04:37 +00:00
|
|
|
bool bShowQuestCompletedNotification = true;
|
2023-03-29 16:36:24 +00:00
|
|
|
|
2023-05-02 04:42:48 +00:00
|
|
|
bool CheckConditions(UWorldState* WorldState) const;
|
|
|
|
bool CheckPreConditions(UWorldState* WorldState) const;
|
|
|
|
void ApplyRewards(UInventoryComponent* Inventory);
|
|
|
|
static bool WorldStateMatch(UWorldState* A, UWorldState* B);
|
2023-05-04 04:04:37 +00:00
|
|
|
static bool FlagTrueMatch(const UWorldState* WorldState, const FString& FlagName);
|
|
|
|
FString GetItemCountAndGoalAmount(const UWorldState* WorldState, UBaseItem* Item) const;
|
2023-03-29 16:36:24 +00:00
|
|
|
};
|