Compare commits

..

No commits in common. "0f942b0b7734f7f78755138ef493f171048f74dd" and "1ccc1d8796778f4dd3bd0b8a38b0c09148fd4a64" have entirely different histories.

17 changed files with 6 additions and 64 deletions

View File

@ -10,8 +10,5 @@ InvalidTagCharacters="\"\',"
+GameplayTagRedirects=(OldTagName="Skill.PoserPull",NewTagName="Skill.PowerPull")
NumBitsForContainerSize=6
NetIndexFirstBitSegment=16
+GameplayTagList=(Tag="FishReward",DevComment="鱼获")
+GameplayTagList=(Tag="FishReward.Fish1",DevComment="")
+GameplayTagList=(Tag="FishReward.Fish2",DevComment="")
+GameplayTagList=(Tag="Skill.PowerPull",DevComment="")

View File

@ -5,7 +5,6 @@
#include "CoreMinimal.h"
#include "ShapeAsset.h"
#include "Engine/DataAsset.h"
#include "ProjectFish/Quest/QuestTypes.h"
#include "FishingRewardDataAsset.generated.h"
UENUM(BlueprintType)
@ -37,7 +36,4 @@ public:
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Fishing Reward Data" , meta = (ToolTip = "鱼获稀有度"))
ERewardRarityType RewardRarityType;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Fishing Reward Data" , meta = (ToolTip = "鱼获对应的任务信息"))
FQuestTargetInfo QuestTargetInfo;
};

View File

@ -198,7 +198,7 @@ void UQuestManager::UpdateObjectiveProgress(int32 QuestID, int32 ObjectiveIndex,
CheckQuestCompletion(QuestID);
}
void UQuestManager::UpdateObjectiveByTargetID(FGameplayTag TargetTag, int32 ProgressDelta)
void UQuestManager::UpdateObjectiveByTargetID(FName TargetID, int32 ProgressDelta)
{
// 遍历所有活动任务,查找匹配的目标
for (TPair<int32, FQuestRuntimeData>& Pair : ActiveQuestsMap)
@ -213,7 +213,7 @@ void UQuestManager::UpdateObjectiveByTargetID(FGameplayTag TargetTag, int32 Prog
for (int32 i = 0; i < RuntimeData.QuestAsset->Objectives.Num(); ++i)
{
const FQuestObjective& Objective = RuntimeData.QuestAsset->Objectives[i];
if (Objective.TargetID.TargetTag == TargetTag)
if (Objective.TargetID == TargetID)
{
// 增加进度
int32 NewProgress = RuntimeData.ObjectiveProgress[i].CurrentProgress + ProgressDelta;
@ -257,19 +257,6 @@ TArray<UQuestAsset*> UQuestManager::GetActiveQuests() const
return Result;
}
TArray<UQuestAsset*> UQuestManager::GetFollowingQuests() const
{
TArray<UQuestAsset*> Result;
for (const TPair<int32, FQuestRuntimeData>& Pair : ActiveQuestsMap)
{
if (FollowingQuestIDs.Contains(Pair.Key))
{
Result.Add(Pair.Value.QuestAsset);
}
}
return Result;
}
TArray<UQuestAsset*> UQuestManager::GetCompletedQuests() const
{
TArray<UQuestAsset*> Result;
@ -294,17 +281,6 @@ bool UQuestManager::GetQuestProgress(int32 QuestID, TArray<FQuestProgress>& OutP
return false;
}
bool UQuestManager::GetQuestRuntimeData(int32 QuestID, FQuestRuntimeData& OutData) const
{
const FQuestRuntimeData* RuntimeData = ActiveQuestsMap.Find(QuestID);
if (RuntimeData)
{
OutData = *RuntimeData;
return true;
}
return false;
}
bool UQuestManager::CanAcceptQuest(UQuestAsset* QuestAsset) const
{
if (!QuestAsset)
@ -377,7 +353,7 @@ void UQuestManager::LoadFromSaveData(const TArray<FQuestSaveData>& SaveData)
if (questAsset->QuestID == Data.QuestID)
{
FQuestRuntimeData RuntimeData = CreateRuntimeData(questAsset);
for (int i =0; i < Data.ObjectiveProgress.Num(); i++)
for (int i =0; i < RuntimeData.ObjectiveProgress.Num(); i++)
{
RuntimeData.ObjectiveProgress[i].CurrentProgress = Data.ObjectiveProgress[i];
RuntimeData.ObjectiveProgress[i].bCompleted = Data.ObjectiveCompleted[i];

View File

@ -79,7 +79,7 @@ public:
/** 通过目标ID更新进度自动查找对应目标 */
UFUNCTION(BlueprintCallable, Category = "Quest")
void UpdateObjectiveByTargetID(FGameplayTag TargetTag, int32 ProgressDelta = 1);
void UpdateObjectiveByTargetID(FName TargetID, int32 ProgressDelta = 1);
// ========== 任务查询 ==========
@ -95,10 +95,6 @@ public:
UFUNCTION(BlueprintPure, Category = "Quest")
TArray<UQuestAsset*> GetActiveQuests() const;
/** 获取所有追踪的任务 */
UFUNCTION(BlueprintPure, Category = "Quest")
TArray<UQuestAsset*> GetFollowingQuests() const;
/** 获取所有已完成的任务 */
UFUNCTION(BlueprintPure, Category = "Quest")
TArray<UQuestAsset*> GetCompletedQuests() const;
@ -107,10 +103,6 @@ public:
UFUNCTION(BlueprintPure, Category = "Quest")
bool GetQuestProgress(int32 QuestID, TArray<FQuestProgress>& OutProgress) const;
/** 获取任务进度 */
UFUNCTION(BlueprintPure, Category = "Quest")
bool GetQuestRuntimeData(int32 QuestID, FQuestRuntimeData& OutData) const;
/** 检查是否可以接受任务(前置任务检查) */
UFUNCTION(BlueprintPure, Category = "Quest")
bool CanAcceptQuest(UQuestAsset* QuestAsset) const;
@ -148,7 +140,7 @@ private:
TMap<int32, FQuestRuntimeData> ActiveQuestsMap;
/** 正在追踪的任务列表 */
UPROPERTY(BlueprintReadOnly, meta = (AllowPrivateAccess = true))
UPROPERTY()
TSet<int32> FollowingQuestIDs;
/** 已完成的任务ID列表 */

View File

@ -3,7 +3,6 @@
#pragma once
#include "CoreMinimal.h"
#include "GameplayTagContainer.h"
#include "QuestTypes.generated.h"
/**
@ -50,24 +49,6 @@ struct FQuestReward
int32 GoldAmount = 0;
};
/**
*
*/
USTRUCT(BlueprintType)
struct FQuestTargetInfo
{
GENERATED_BODY()
/** 目标名称*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest")
FText QuestTargetName;
/** 目标ID */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest")
FGameplayTag TargetTag;
};
/**
*
*/
@ -86,7 +67,7 @@ struct FQuestObjective
/** 目标ID物品ID、敌人ID、地点Tag等 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest")
FQuestTargetInfo TargetID;
FName TargetID;
/** 需要完成的数量 */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest")