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
Merged
Conversation
There was a problem hiding this comment.
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
CombatImpactEntitySnapshotReaderto resolve hidden tags via the merged sources instead of only runtimeCard.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!); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
这是 #221 的后续修正。第一次实现能在合成投影测试中计算 F Minor 的 Tempo,但用户重启游戏并重放同一场战斗后,真实 Recap 仍显示无效果。
根因
旧 replay 重建的卡牌不会必然把模板隐藏标签复制到运行时
Card.HiddenTags。#221 的测试直接注入了EHiddenTag.Haste,因此没有覆盖生产边界;真实 Recap 的 Turner 在进入 F Minor 归因规则前丢失了 Haste 条件。修正
验证
./run.sh format-checkdotnet 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 error4f189f64ed294b0188d0c0a8b5e1a663并进入真实 Recap:F Minor 显示Tempo Gain +14;日志为shown,不再是shown_without_attributed_impact边界