feat: Round 52 narrative systems improvements
P1-A: QuestManager.OnLoad Enum.TryParse failure warning (dev builds)
P1-B: SaveData.QuestState ObjectiveCompleted dict; BuildObjectiveCompleted
helper; OnSave/OnLoad wiring (DataVersion 2→3)
P2-A: Quest start/complete timestamps (_startedAtUtc/_completedAtUtc dicts;
StartedAtUtc/CompletedAtUtc in SaveData; AcceptQuest/CompleteQuest/
OnSave/OnLoad wiring)
P2-B: DialogueManager pending queue Queue→List + priority-eviction on full
(lowest-priority item evicted when higher-priority request arrives)
P2-C: NpcSO.localizationTable field; NpcSOEditor uses npc.localizationTable
in TryResolveNameKey, PingLocalizationFile, and button label
P3-A: QuestSO.failConditions[] multi-fail array; Obsolete failCondition;
DispatchEvent updates fail check to any-of-array logic with fallback
P3-B: QuestObjectiveSO.prerequisiteObjectiveId; DispatchEvent gates objective
event routing behind prerequisite completed check
P3-C: IQuestEventPayload interface + StringQuestPayload struct; QuestObjectiveSO
typed TryHandleEvent(IQuestEventPayload) overload; DispatchEvent string
overload delegates to typed IQuestEventPayload overload
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -46,6 +46,10 @@ namespace BaseGames.Quest
|
||||
public string displayTextKey;
|
||||
[Tooltip("勾选后此目标为可选项:完成可获奖励,但不阻塞任务交接。")]
|
||||
public bool IsOptional;
|
||||
[Tooltip("前置目标 objectiveId(留空 = 无依赖,目标与其他目标并行激活)。\n" +
|
||||
"设置后,在指定目标的 completed 标志置为 true 之前,本目标不接收任何事件路由,即便事件满足匹配条件。\n" +
|
||||
"用于实现顺序解锁的目标链(如先对话再交物品)。")]
|
||||
public string prerequisiteObjectiveId;
|
||||
|
||||
/// <summary>
|
||||
/// 目标所需完成数量。用于 UI 显示进度条分母(如 "3/5 击败")。
|
||||
@@ -75,6 +79,14 @@ namespace BaseGames.Quest
|
||||
public virtual bool TryHandleEvent(QuestEventType eventType, string payload, QuestObjectiveState state)
|
||||
=> false;
|
||||
|
||||
/// <summary>
|
||||
/// 强类型载荷重载(<see cref="IQuestEventPayload"/>)。
|
||||
/// 默认实现委托给 string 版本(向后兼容),子类可 override 以直接消费结构化载荷,避免字符串解析。
|
||||
/// QuestManager 优先调用此重载。
|
||||
/// </summary>
|
||||
public virtual bool TryHandleEvent(QuestEventType eventType, IQuestEventPayload payload, QuestObjectiveState state)
|
||||
=> TryHandleEvent(eventType, payload?.AsString(), state);
|
||||
|
||||
/// <summary>
|
||||
/// 在 DataHub / 编辑器工具中显示的类型徽章文字。
|
||||
/// 子类应 override 返回简洁中文标签(如 "[对话]")。
|
||||
|
||||
Reference in New Issue
Block a user