Skip to content
This repository was archived by the owner on Sep 20, 2026. It is now read-only.

fix(combat-insights): restore replay hidden tags - #222

Merged
pengx17 merged 1 commit into
masterfrom
codex/fix-f-minor-combat-impact
Aug 6, 2026
Merged

pengx17 merged 1 commit into
masterfrom
codex/fix-f-minor-combat-impact

Conversation

@pengx17

@pengx17 pengx17 commented Aug 6, 2026

Copy link
Copy Markdown
Member

Context

这是 #221 的后续修正。第一次实现能在合成投影测试中计算 F Minor 的 Tempo,但用户重启游戏并重放同一场战斗后,真实 Recap 仍显示无效果。

根因

旧 replay 重建的卡牌不会必然把模板隐藏标签复制到运行时 Card.HiddenTags#221 的测试直接注入了 EHiddenTag.Haste,因此没有覆盖生产边界;真实 Recap 的 Turner 在进入 F Minor 归因规则前丢失了 Haste 条件。

修正

  • Combat Impact snapshot 合并运行时、基础模板及当前附魔的 hidden tags;
  • 保留运行时标签,同时为旧 replay 使用模板权威数据兜底;
  • 增加运行时标签为空、模板带 Haste 的回归测试。

验证

  • ./run.sh format-check
  • dotnet test tests/PostCombatImpact.Tests/PostCombatImpact.Tests.csproj ...:151/151 通过
  • ./run.sh test:全量测试通过;PTR compatibility 因本地无 decompiled-vptr/ 按既有逻辑跳过
  • dotnet build src/BazaarPlusPlus/BazaarPlusPlus.csproj -t:BuildAll ...:Debug + Release 成功,0 warning / 0 error
  • 通过 Steam 重启游戏,重放同一场战斗 4f189f64ed294b0188d0c0a8b5e1a663 并进入真实 Recap:F Minor 显示 Tempo Gain +14;日志为 shown,不再是 shown_without_attributed_impact

边界

  • 只修复 Combat Impact 读取 replay 卡牌 hidden tags 的缺口,不修改全局 replay rehydration 行为。

Copilot AI lite review requested due to automatic review settings August 6, 2026 08:01
@pengx17
pengx17 merged commit a541728 into master Aug 6, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a production gap in PostCombatImpact replay processing by restoring “hidden tags” (notably Haste) for rehydrated replay cards, ensuring Combat Impact attribution rules (e.g., F Minor tempo gain) behave the same after game restart + replay.

Changes:

  • Add CombatImpactHiddenTags.Merge(...) helper to combine runtime, template, and enchantment hidden tags.
  • Update CombatImpactEntitySnapshotReader to resolve hidden tags via the merged sources instead of only runtime Card.HiddenTags.
  • Add a regression test covering the “runtime tags empty, template has Haste” replay scenario.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/PostCombatImpact.Tests/CombatImpactEntitySnapshotReaderTests.cs Adds regression coverage for template hidden-tag fallback.
src/BazaarPlusPlus/Game/PostCombatImpact/Data/CombatImpactModels.cs Introduces hidden-tag merge helper used by snapshotting.
src/BazaarPlusPlus/Game/PostCombatImpact/Data/CombatImpactEntitySnapshotReader.cs Switches entity snapshot hidden-tag capture to merged resolution (runtime + template + enchantment).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +115 to +122
var hiddenTags = new HashSet<EHiddenTag>();
if (runtime != null)
hiddenTags.UnionWith(runtime);
if (template != null)
hiddenTags.UnionWith(template);
if (enchantment != null)
hiddenTags.UnionWith(enchantment);
return hiddenTags.Count == 0 ? null : hiddenTags.ToArray();
return entities;
}

internal static IReadOnlyCollection<EHiddenTag>? ResolveHiddenTags(Card card)
enchantment: null
);

Assert.Contains(EHiddenTag.Haste, hiddenTags!);
@cauyxy
cauyxy deleted the codex/fix-f-minor-combat-impact branch August 6, 2026 11:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants