diff --git a/Content/Blueprints/Quests/Quest_SistersPendant.uasset b/Content/Blueprints/Quests/Quest_SistersPendant.uasset index 4e4e76c..f39c34c 100644 --- a/Content/Blueprints/Quests/Quest_SistersPendant.uasset +++ b/Content/Blueprints/Quests/Quest_SistersPendant.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3beb11e9f1d958aa30d7f660b5ab50181189487f21515d03411ec02ec05873c2 -size 6849 +oid sha256:eb980aa84d4b9f9c87f2890562fa709d94ba526ce73d2c7a49de2698c952ddd8 +size 7028 diff --git a/Content/Dialogue/SM_Merchant_Blueprint.uasset b/Content/Dialogue/SM_Merchant_Blueprint.uasset index c27808c..d207bf9 100644 --- a/Content/Dialogue/SM_Merchant_Blueprint.uasset +++ b/Content/Dialogue/SM_Merchant_Blueprint.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bee8f1aea1e8cbb574f4cbf9eec05ddf145d5c4150504e2cd34d35f03008e06d -size 86863 +oid sha256:ba046fa456f61a573d8f993c9d545969daa02500446de3db07f962a95e57e364 +size 138895 diff --git a/Content/Levels/Build.umap b/Content/Levels/Build.umap index 3dc70ab..2ef1b29 100644 --- a/Content/Levels/Build.umap +++ b/Content/Levels/Build.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d023215811d29d965431f0be11eea712a031a6cbb04c1fccd182ae191e151b7 -size 3555472 +oid sha256:f1c45e7da5d507d70f97dee6dbaf88d4e33d90d9efee98c37b57b9a00fb983ec +size 3555553 diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp index b2f5d5f..c0f2bdb 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.cpp @@ -6,6 +6,7 @@ #include "Components/TextBlock.h" #include "GameFramework/Character.h" #include "Kismet/KismetStringLibrary.h" +#include "Misc/OutputDeviceNull.h" #include "the_twilight_abyss/Quest/QuestSystem.h" // Sets default values for this component's properties @@ -115,6 +116,9 @@ void UDialogueNPC::TickComponent(float DeltaTime, ELevelTick TickType, FActorCom void UDialogueNPC::StartDialogue() { + FOutputDeviceNull AR; + const FString Command = FString::Printf(TEXT("SetRootDialoguePath")); + GetOwner()->CallFunctionByNameWithArguments(*Command, AR, nullptr, true); if (IsValid(RootDialoguePath)) CurrentDialogueStringPath = RootDialoguePath->Dialogue; if (CurrentDialogueStringPath.IsEmpty()) { @@ -162,8 +166,8 @@ void UDialogueNPC::EndDialogue() UDialoguePath* UDialogueNPC::CreateRootDialoguePath() { - RootDialoguePath = NewObject(); - return RootDialoguePath; + //RootDialoguePath = NewObject(); + return NewObject(); } UDialoguePath* UDialogueNPC::AddDialogue(UDialoguePath* DialoguePath, FText TextInput) diff --git a/Source/the_twilight_abyss/Dialogue/DialogueNPC.h b/Source/the_twilight_abyss/Dialogue/DialogueNPC.h index 880c3b3..f50251d 100644 --- a/Source/the_twilight_abyss/Dialogue/DialogueNPC.h +++ b/Source/the_twilight_abyss/Dialogue/DialogueNPC.h @@ -35,7 +35,7 @@ public: UPROPERTY(EditAnywhere) FString NPCName; - UPROPERTY() + UPROPERTY(BlueprintReadWrite) UDialoguePath* RootDialoguePath; UPROPERTY() UDialoguePath* CurrentDialoguePath; diff --git a/Source/the_twilight_abyss/Quest/Quest.h b/Source/the_twilight_abyss/Quest/Quest.h index b9e27c5..d70530d 100644 --- a/Source/the_twilight_abyss/Quest/Quest.h +++ b/Source/the_twilight_abyss/Quest/Quest.h @@ -34,6 +34,10 @@ public: 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; diff --git a/Source/the_twilight_abyss/Quest/QuestSystem.cpp b/Source/the_twilight_abyss/Quest/QuestSystem.cpp index c334b9b..54dcbf0 100644 --- a/Source/the_twilight_abyss/Quest/QuestSystem.cpp +++ b/Source/the_twilight_abyss/Quest/QuestSystem.cpp @@ -60,6 +60,10 @@ void UQuestSystem::CheckActiveQuestConditions() { CompletedQuests.Add(Quest); Quest->ApplyRewards(PlayerInventory); + for (TTuple QuestFlag : Quest->QuestFlagsOnComplete) + { + QuestFlags.Add(QuestFlag.Key, QuestFlag.Value); + } QuestCompletionTitle->SetText(Quest->Title); if (Quest->QuestLine == EQuestLine::Sub) { @@ -90,6 +94,10 @@ bool UQuestSystem::AddQuest(UQuest* Quest) if (HasActiveQuest(Quest)) return false; if (!Quest->CheckPreConditions(GetWorldState())) return false; ActiveQuests.Add(Quest); + for (TTuple QuestFlag : Quest->QuestFlagsOnAdd) + { + QuestFlags.Add(QuestFlag.Key, QuestFlag.Value); + } if (Quest->QuestLine == EQuestLine::Sub) { bHasSubQuest = true; @@ -123,6 +131,12 @@ bool UQuestSystem::HasActiveQuest(UQuest* Quest) const return false; } +bool UQuestSystem::HasQuestFlag(FString FlagName) const +{ + if (QuestFlags.Contains(FlagName)) return true; + return false; +} + void UQuestSystem::UpdateQuestGoalsUI(const UQuest* Quest) const { FString GoalsText; diff --git a/Source/the_twilight_abyss/Quest/QuestSystem.h b/Source/the_twilight_abyss/Quest/QuestSystem.h index 9dd8407..149d519 100644 --- a/Source/the_twilight_abyss/Quest/QuestSystem.h +++ b/Source/the_twilight_abyss/Quest/QuestSystem.h @@ -61,6 +61,8 @@ public: bool CheckPreConditions(UQuest* Quest) const; UFUNCTION(BlueprintCallable) bool HasActiveQuest(UQuest* Quest) const; + UFUNCTION(BlueprintCallable) + bool HasQuestFlag(FString FlagName) const; private: UInventoryComponent* PlayerInventory;