Compare commits
No commits in common. "0f942b0b7734f7f78755138ef493f171048f74dd" and "1ccc1d8796778f4dd3bd0b8a38b0c09148fd4a64" have entirely different histories.
0f942b0b77
...
1ccc1d8796
Binary file not shown.
Binary file not shown.
@ -10,8 +10,5 @@ InvalidTagCharacters="\"\',"
|
|||||||
+GameplayTagRedirects=(OldTagName="Skill.PoserPull",NewTagName="Skill.PowerPull")
|
+GameplayTagRedirects=(OldTagName="Skill.PoserPull",NewTagName="Skill.PowerPull")
|
||||||
NumBitsForContainerSize=6
|
NumBitsForContainerSize=6
|
||||||
NetIndexFirstBitSegment=16
|
NetIndexFirstBitSegment=16
|
||||||
+GameplayTagList=(Tag="FishReward",DevComment="鱼获")
|
|
||||||
+GameplayTagList=(Tag="FishReward.Fish1",DevComment="")
|
|
||||||
+GameplayTagList=(Tag="FishReward.Fish2",DevComment="")
|
|
||||||
+GameplayTagList=(Tag="Skill.PowerPull",DevComment="")
|
+GameplayTagList=(Tag="Skill.PowerPull",DevComment="")
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -5,7 +5,6 @@
|
|||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "ShapeAsset.h"
|
#include "ShapeAsset.h"
|
||||||
#include "Engine/DataAsset.h"
|
#include "Engine/DataAsset.h"
|
||||||
#include "ProjectFish/Quest/QuestTypes.h"
|
|
||||||
#include "FishingRewardDataAsset.generated.h"
|
#include "FishingRewardDataAsset.generated.h"
|
||||||
|
|
||||||
UENUM(BlueprintType)
|
UENUM(BlueprintType)
|
||||||
@ -37,7 +36,4 @@ public:
|
|||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Fishing Reward Data" , meta = (ToolTip = "鱼获稀有度"))
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Fishing Reward Data" , meta = (ToolTip = "鱼获稀有度"))
|
||||||
ERewardRarityType RewardRarityType;
|
ERewardRarityType RewardRarityType;
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Fishing Reward Data" , meta = (ToolTip = "鱼获对应的任务信息"))
|
|
||||||
FQuestTargetInfo QuestTargetInfo;
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -198,7 +198,7 @@ void UQuestManager::UpdateObjectiveProgress(int32 QuestID, int32 ObjectiveIndex,
|
|||||||
CheckQuestCompletion(QuestID);
|
CheckQuestCompletion(QuestID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UQuestManager::UpdateObjectiveByTargetID(FGameplayTag TargetTag, int32 ProgressDelta)
|
void UQuestManager::UpdateObjectiveByTargetID(FName TargetID, int32 ProgressDelta)
|
||||||
{
|
{
|
||||||
// 遍历所有活动任务,查找匹配的目标
|
// 遍历所有活动任务,查找匹配的目标
|
||||||
for (TPair<int32, FQuestRuntimeData>& Pair : ActiveQuestsMap)
|
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)
|
for (int32 i = 0; i < RuntimeData.QuestAsset->Objectives.Num(); ++i)
|
||||||
{
|
{
|
||||||
const FQuestObjective& Objective = RuntimeData.QuestAsset->Objectives[i];
|
const FQuestObjective& Objective = RuntimeData.QuestAsset->Objectives[i];
|
||||||
if (Objective.TargetID.TargetTag == TargetTag)
|
if (Objective.TargetID == TargetID)
|
||||||
{
|
{
|
||||||
// 增加进度
|
// 增加进度
|
||||||
int32 NewProgress = RuntimeData.ObjectiveProgress[i].CurrentProgress + ProgressDelta;
|
int32 NewProgress = RuntimeData.ObjectiveProgress[i].CurrentProgress + ProgressDelta;
|
||||||
@ -257,19 +257,6 @@ TArray<UQuestAsset*> UQuestManager::GetActiveQuests() const
|
|||||||
return Result;
|
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*> UQuestManager::GetCompletedQuests() const
|
||||||
{
|
{
|
||||||
TArray<UQuestAsset*> Result;
|
TArray<UQuestAsset*> Result;
|
||||||
@ -294,17 +281,6 @@ bool UQuestManager::GetQuestProgress(int32 QuestID, TArray<FQuestProgress>& OutP
|
|||||||
return false;
|
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
|
bool UQuestManager::CanAcceptQuest(UQuestAsset* QuestAsset) const
|
||||||
{
|
{
|
||||||
if (!QuestAsset)
|
if (!QuestAsset)
|
||||||
@ -377,7 +353,7 @@ void UQuestManager::LoadFromSaveData(const TArray<FQuestSaveData>& SaveData)
|
|||||||
if (questAsset->QuestID == Data.QuestID)
|
if (questAsset->QuestID == Data.QuestID)
|
||||||
{
|
{
|
||||||
FQuestRuntimeData RuntimeData = CreateRuntimeData(questAsset);
|
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].CurrentProgress = Data.ObjectiveProgress[i];
|
||||||
RuntimeData.ObjectiveProgress[i].bCompleted = Data.ObjectiveCompleted[i];
|
RuntimeData.ObjectiveProgress[i].bCompleted = Data.ObjectiveCompleted[i];
|
||||||
|
|||||||
@ -79,7 +79,7 @@ public:
|
|||||||
|
|
||||||
/** 通过目标ID更新进度(自动查找对应目标) */
|
/** 通过目标ID更新进度(自动查找对应目标) */
|
||||||
UFUNCTION(BlueprintCallable, Category = "Quest")
|
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")
|
UFUNCTION(BlueprintPure, Category = "Quest")
|
||||||
TArray<UQuestAsset*> GetActiveQuests() const;
|
TArray<UQuestAsset*> GetActiveQuests() const;
|
||||||
|
|
||||||
/** 获取所有追踪的任务 */
|
|
||||||
UFUNCTION(BlueprintPure, Category = "Quest")
|
|
||||||
TArray<UQuestAsset*> GetFollowingQuests() const;
|
|
||||||
|
|
||||||
/** 获取所有已完成的任务 */
|
/** 获取所有已完成的任务 */
|
||||||
UFUNCTION(BlueprintPure, Category = "Quest")
|
UFUNCTION(BlueprintPure, Category = "Quest")
|
||||||
TArray<UQuestAsset*> GetCompletedQuests() const;
|
TArray<UQuestAsset*> GetCompletedQuests() const;
|
||||||
@ -107,10 +103,6 @@ public:
|
|||||||
UFUNCTION(BlueprintPure, Category = "Quest")
|
UFUNCTION(BlueprintPure, Category = "Quest")
|
||||||
bool GetQuestProgress(int32 QuestID, TArray<FQuestProgress>& OutProgress) const;
|
bool GetQuestProgress(int32 QuestID, TArray<FQuestProgress>& OutProgress) const;
|
||||||
|
|
||||||
/** 获取任务进度 */
|
|
||||||
UFUNCTION(BlueprintPure, Category = "Quest")
|
|
||||||
bool GetQuestRuntimeData(int32 QuestID, FQuestRuntimeData& OutData) const;
|
|
||||||
|
|
||||||
/** 检查是否可以接受任务(前置任务检查) */
|
/** 检查是否可以接受任务(前置任务检查) */
|
||||||
UFUNCTION(BlueprintPure, Category = "Quest")
|
UFUNCTION(BlueprintPure, Category = "Quest")
|
||||||
bool CanAcceptQuest(UQuestAsset* QuestAsset) const;
|
bool CanAcceptQuest(UQuestAsset* QuestAsset) const;
|
||||||
@ -148,7 +140,7 @@ private:
|
|||||||
TMap<int32, FQuestRuntimeData> ActiveQuestsMap;
|
TMap<int32, FQuestRuntimeData> ActiveQuestsMap;
|
||||||
|
|
||||||
/** 正在追踪的任务列表 */
|
/** 正在追踪的任务列表 */
|
||||||
UPROPERTY(BlueprintReadOnly, meta = (AllowPrivateAccess = true))
|
UPROPERTY()
|
||||||
TSet<int32> FollowingQuestIDs;
|
TSet<int32> FollowingQuestIDs;
|
||||||
|
|
||||||
/** 已完成的任务ID列表 */
|
/** 已完成的任务ID列表 */
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "GameplayTagContainer.h"
|
|
||||||
#include "QuestTypes.generated.h"
|
#include "QuestTypes.generated.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,24 +49,6 @@ struct FQuestReward
|
|||||||
int32 GoldAmount = 0;
|
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等) */
|
/** 目标ID(物品ID、敌人ID、地点Tag等) */
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest")
|
||||||
FQuestTargetInfo TargetID;
|
FName TargetID;
|
||||||
|
|
||||||
/** 需要完成的数量 */
|
/** 需要完成的数量 */
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest")
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user