Files
zeling_v2/Assets/_Game/Scripts/Quest/NpcAffinityEvent.cs
Joywayer 6eaa83dc71 feat: Round 48 narrative systems improvements
- QuestSO: Add ValidateBranchCycles() DFS detection for branches[].nextQuest loop
- QuestSO: Mark three legacy prerequisite fields with v2.0 removal warning in Tooltip
- IQuestManager: Add QuestLockReason enum + QuestLockInfo struct (strongly-typed lock info)
- IQuestManager: Add GetQuestLockInfo() method to interface; GetQuestLockReason() now delegates to it
- IQuestEventSource: Add OnQuestStateChanged(questId, oldState, newState) unified event
- QuestManager: Implement GetQuestLockInfo(); fire OnQuestStateChanged on all state transitions
- DialogueManager: Add one-frame yield in HandleChoices before ShowChoices (skip-debounce fix)
- DialogueManager: Increment _playbackId in ForceEnd() to invalidate residual choice callbacks
- DialogueSequenceSO: Add UNITY_EDITOR debug log in TryGetActiveVariant on variant match
- WorldStateRegistry: Add OnBatchStateChanged event + BatchMark() batch-write API
- DialogueModule: List badge shows warning indicator for unconditional-shadowing variants
- DialogueModule: BuildVariantsCard shows logic mode (AND/OR) alongside flag conditions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-25 00:05:15 +08:00

28 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
using BaseGames.Core.Events;
namespace BaseGames.Quest
{
/// <summary>
/// NPC 好感度变化事件的强类型负载。
/// 替代原 "npcId|delta" 字符串分割方案,杜绝接收方 Split 解析脆弱性。
/// </summary>
[System.Serializable]
public struct NpcAffinityEvent
{
/// <summary>发生好感度变化的 NPC ID与 QuestSO.giverNpcId 保持一致)。</summary>
public string npcId;
/// <summary>好感度变化量(正值=增加,负值=减少)。</summary>
public int delta;
/// <summary>变化后的当前总好感度数值。</summary>
public int newTotal;
}
/// <summary>
/// EVT_NpcAffinityChanged 专用事件频道 SO强类型负载 <see cref="NpcAffinityEvent"/>)。
/// 放置路径: Assets/ScriptableObjects/Events/EVT_NpcAffinityChanged.asset
/// </summary>
[CreateAssetMenu(menuName = "BaseGames/Events/NpcAffinity")]
public class NpcAffinityEventChannelSO : BaseEventChannelSO<NpcAffinityEvent> { }
}