更新获得鱼获后 完成任务
This commit is contained in:
parent
111f68fa10
commit
0f942b0b77
Binary file not shown.
Binary file not shown.
@ -10,5 +10,8 @@ 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="")
|
||||
|
||||
|
||||
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,6 +5,7 @@
|
||||
#include "CoreMinimal.h"
|
||||
#include "ShapeAsset.h"
|
||||
#include "Engine/DataAsset.h"
|
||||
#include "ProjectFish/Quest/QuestTypes.h"
|
||||
#include "FishingRewardDataAsset.generated.h"
|
||||
|
||||
UENUM(BlueprintType)
|
||||
@ -36,4 +37,7 @@ public:
|
||||
|
||||
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Fishing Reward Data" , meta = (ToolTip = "鱼获稀有度"))
|
||||
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);
|
||||
}
|
||||
|
||||
void UQuestManager::UpdateObjectiveByTargetID(FName TargetID, int32 ProgressDelta)
|
||||
void UQuestManager::UpdateObjectiveByTargetID(FGameplayTag TargetTag, int32 ProgressDelta)
|
||||
{
|
||||
// 遍历所有活动任务,查找匹配的目标
|
||||
for (TPair<int32, FQuestRuntimeData>& Pair : ActiveQuestsMap)
|
||||
@ -213,7 +213,7 @@ void UQuestManager::UpdateObjectiveByTargetID(FName TargetID, int32 ProgressDelt
|
||||
for (int32 i = 0; i < RuntimeData.QuestAsset->Objectives.Num(); ++i)
|
||||
{
|
||||
const FQuestObjective& Objective = RuntimeData.QuestAsset->Objectives[i];
|
||||
if (Objective.TargetID == TargetID)
|
||||
if (Objective.TargetID.TargetTag == TargetTag)
|
||||
{
|
||||
// 增加进度
|
||||
int32 NewProgress = RuntimeData.ObjectiveProgress[i].CurrentProgress + ProgressDelta;
|
||||
|
||||
@ -79,7 +79,7 @@ public:
|
||||
|
||||
/** 通过目标ID更新进度(自动查找对应目标) */
|
||||
UFUNCTION(BlueprintCallable, Category = "Quest")
|
||||
void UpdateObjectiveByTargetID(FName TargetID, int32 ProgressDelta = 1);
|
||||
void UpdateObjectiveByTargetID(FGameplayTag TargetTag, int32 ProgressDelta = 1);
|
||||
|
||||
// ========== 任务查询 ==========
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameplayTagContainer.h"
|
||||
#include "QuestTypes.generated.h"
|
||||
|
||||
/**
|
||||
@ -49,6 +50,24 @@ 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;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* 任务目标数据
|
||||
*/
|
||||
@ -67,7 +86,7 @@ struct FQuestObjective
|
||||
|
||||
/** 目标ID(物品ID、敌人ID、地点Tag等) */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest")
|
||||
FName TargetID;
|
||||
FQuestTargetInfo TargetID;
|
||||
|
||||
/** 需要完成的数量 */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Quest")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user