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