diff --git a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll index 2cf5bdb..2e93a0d 100644 Binary files a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll and b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll differ diff --git a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll index 262cee0..f973998 100644 Binary files a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll and b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll differ diff --git a/ProjectFish/Content/DataAssets/Quest/Quest1_AutoAccept_CompleteByReward.uasset b/ProjectFish/Content/DataAssets/Quest/Quest1_AutoAccept_CompleteByReward.uasset index d0b9974..ebf903a 100644 Binary files a/ProjectFish/Content/DataAssets/Quest/Quest1_AutoAccept_CompleteByReward.uasset and b/ProjectFish/Content/DataAssets/Quest/Quest1_AutoAccept_CompleteByReward.uasset differ diff --git a/ProjectFish/Content/DataAssets/Quest/Quest2_TriggerByQuest1.uasset b/ProjectFish/Content/DataAssets/Quest/Quest2_TriggerByQuest1.uasset index 00f5d72..223988c 100644 Binary files a/ProjectFish/Content/DataAssets/Quest/Quest2_TriggerByQuest1.uasset and b/ProjectFish/Content/DataAssets/Quest/Quest2_TriggerByQuest1.uasset differ diff --git a/ProjectFish/Content/DataAssets/Quest/Quest3_CompleteByTargetPos.uasset b/ProjectFish/Content/DataAssets/Quest/Quest3_CompleteByTargetPos.uasset index 63d2dc9..3b36f43 100644 Binary files a/ProjectFish/Content/DataAssets/Quest/Quest3_CompleteByTargetPos.uasset and b/ProjectFish/Content/DataAssets/Quest/Quest3_CompleteByTargetPos.uasset differ diff --git a/ProjectFish/Content/DataAssets/Quest/Quest4_CompleteByEnemy.uasset b/ProjectFish/Content/DataAssets/Quest/Quest4_CompleteByEnemy.uasset index 79da99c..1365e90 100644 Binary files a/ProjectFish/Content/DataAssets/Quest/Quest4_CompleteByEnemy.uasset and b/ProjectFish/Content/DataAssets/Quest/Quest4_CompleteByEnemy.uasset differ diff --git a/ProjectFish/Content/UI/HomeUI/Widgets/HomeFuncList/UMG_Home_FuncList.uasset b/ProjectFish/Content/UI/HomeUI/Widgets/HomeFuncList/UMG_Home_FuncList.uasset index 25c8f1f..afd4deb 100644 Binary files a/ProjectFish/Content/UI/HomeUI/Widgets/HomeFuncList/UMG_Home_FuncList.uasset and b/ProjectFish/Content/UI/HomeUI/Widgets/HomeFuncList/UMG_Home_FuncList.uasset differ diff --git a/ProjectFish/Content/UI/Quest/Widget/UMG_QuestInfo_Item_Title_Widget.uasset b/ProjectFish/Content/UI/Quest/Widget/UMG_QuestInfo_Item_Title_Widget.uasset new file mode 100644 index 0000000..8705e03 Binary files /dev/null and b/ProjectFish/Content/UI/Quest/Widget/UMG_QuestInfo_Item_Title_Widget.uasset differ diff --git a/ProjectFish/Content/UI/Quest/Widget/UMG_QuestInfo_Widget.uasset b/ProjectFish/Content/UI/Quest/Widget/UMG_QuestInfo_Widget.uasset new file mode 100644 index 0000000..3c9a48a Binary files /dev/null and b/ProjectFish/Content/UI/Quest/Widget/UMG_QuestInfo_Widget.uasset differ diff --git a/ProjectFish/Content/UI/Quest/Widget/UMG_Quest_SwitcherBtns.uasset b/ProjectFish/Content/UI/Quest/Widget/UMG_Quest_SwitcherBtns.uasset new file mode 100644 index 0000000..e7e990e Binary files /dev/null and b/ProjectFish/Content/UI/Quest/Widget/UMG_Quest_SwitcherBtns.uasset differ diff --git a/ProjectFish/Content/UI/Quest/Window/UMG_QuestWindow.uasset b/ProjectFish/Content/UI/Quest/Window/UMG_QuestWindow.uasset new file mode 100644 index 0000000..372b233 Binary files /dev/null and b/ProjectFish/Content/UI/Quest/Window/UMG_QuestWindow.uasset differ diff --git a/ProjectFish/Source/ProjectFish/DataAsset/QuestAsset.h b/ProjectFish/Source/ProjectFish/DataAsset/QuestAsset.h index 9aab783..c352c5d 100644 --- a/ProjectFish/Source/ProjectFish/DataAsset/QuestAsset.h +++ b/ProjectFish/Source/ProjectFish/DataAsset/QuestAsset.h @@ -33,8 +33,8 @@ public: UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest|Basic", meta = (MultiLine = true)) FText QuestDescription; - /** 前置任务ID列表(完成这些任务后才能触发当前任务) */ - UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest|Trigger") + /** 前置任务ID列表() */ + UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest|Trigger", meta = (ToolTip = "完成这些任务后才能触发当前任务, 不填写默认激活接受")) TArray PrerequisiteQuestIDs; /** 任务触发条件(预留,可在蓝图中实现) */ @@ -52,8 +52,5 @@ public: /** 任务完成条件描述(预留,可在蓝图中实现) */ UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest|Completion") FString CompletionCondition; - - /** 是否自动触发(游戏开始时自动接取) */ - UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest|Trigger") - bool bAutoTrigger = false; + }; diff --git a/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/QuestManager.cpp b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/QuestManager.cpp index 897ccc7..eb5781a 100644 --- a/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/QuestManager.cpp +++ b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/QuestManager.cpp @@ -44,6 +44,18 @@ void UQuestManager::LoadAllQuests() } +void UQuestManager::CheckAcceptableQuests() +{ + for (auto QuestAsset : QuestAssets) + { + if (!ActiveQuestsMap.Find(QuestAsset->QuestID) && CompletedQuestIDs.Contains(QuestAsset->QuestID)) + { + //任务不在当前已激活的任务 和 已完成的任务列表中 + AcceptQuest(QuestAsset); + } + } +} + bool UQuestManager::AcceptQuest(UQuestAsset* QuestAsset) { if (!QuestAsset) @@ -70,7 +82,7 @@ bool UQuestManager::AcceptQuest(UQuestAsset* QuestAsset) // 触发事件 OnQuestStateChanged.Broadcast(QuestAsset->QuestID); - + UE_LOG(LogTemp, Warning, TEXT("Quest %s Accepted"), *QuestAsset->QuestName.ToString()); return true; } @@ -97,10 +109,12 @@ bool UQuestManager::CompleteQuest(int32 QuestID) // 触发事件 OnQuestStateChanged.Broadcast(QuestID); - + UE_LOG(LogTemp, Warning, TEXT("Quest id = %d Complete"), QuestID); // 从活动任务中移除 ActiveQuestsMap.Remove(QuestID); + //检测是否有其他可接受的任务 + CheckAcceptableQuests(); return true; } @@ -307,6 +321,8 @@ void UQuestManager::LoadFromSaveData(const TArray& SaveData) } } + + CheckAcceptableQuests(); } void UQuestManager::CheckQuestCompletion(int32 QuestID) diff --git a/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/QuestManager.h b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/QuestManager.h index 5e98b78..28e0da6 100644 --- a/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/QuestManager.h +++ b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/QuestManager.h @@ -51,6 +51,10 @@ public: /** 加载本地所有任务 */ void LoadAllQuests(); + /** 检测所有可接收的任务 */ + UFUNCTION(BlueprintCallable, Category = "Quest") + void CheckAcceptableQuests(); + /** 接受任务 */ UFUNCTION(BlueprintCallable, Category = "Quest") bool AcceptQuest(UQuestAsset* QuestAsset);