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

fix(combat-insights): attribute F Minor tempo - #221

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

cauyxy 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

战斗结算 Recap 中,F Minor(F 小调)会显示“本场战斗未造成效果”,即使放在 F Note 上的 Haste 物品实际触发了它。

原始 replay 没有为 F Minor 单独发出 PlayerTempoApply:额外 +2 Tempo 被折叠进触发物品的同帧节奏变化。本次复现中 Turner 的基础节奏获取量为 4,但部分帧净增量为 6;F Minor 自身既没有 combat event,也没有 CardStats,因此需要从稳定模板 ID、槽位、Haste 标签及物品 UseCount 确定性重建来源。

根因与修正

第一次实现只读取运行时 Card.HiddenTags。合成投影测试直接注入了 Haste 标签,因此通过了,但旧 replay 重建的卡牌不会必然把模板隐藏标签复制到运行时集合,导致真实 Recap 在进入归因规则前就丢失 Haste 条件。

本次修正:

  • Combat Impact snapshot 合并运行时、基础模板及当前附魔的 hidden tags;
  • 保留既有的 F Minor 确定性重建:F Minor + F Note + 覆盖该槽位的 Haste 物品 + 正数 UseCount
  • 增加 replay 卡牌运行时标签为空、但模板带 Haste 的回归测试;
  • 不依赖本地化文案,也不从可能受同帧消耗污染的 Tempo 差值猜来源。

验证情况

  • ./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,Combat Impact 显示 Tempo Gain +14;日志记录该技能 tooltip 为 shown,不再是 shown_without_attributed_impact

已知边界

  • 当前修复只覆盖 replay 已证明的 F Minor 折叠归因,不泛化推测其他技能。

Copilot AI lite review requested due to automatic review settings August 6, 2026 07:36

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 missing Combat Impact attribution for F Minor tempo gains in the post-combat Recap by reconstructing tempo events when the native replay data folds the +Tempo into the triggering item’s same-frame tempo change (i.e., no standalone PlayerTempoApply for F Minor).

Changes:

  • Extend CombatImpactEntity snapshots to include socket position and native hidden tags needed for deterministic attribution.
  • Add projector logic to reconstruct F Minor “TempoApplyAmount” events from authoritative CardStats.UseCount for Haste items occupying the F Note socket.
  • Add a regression test ensuring only qualifying items contribute and the projected events are marked as ReconstructedTransition.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/PostCombatImpact.Tests/CombatImpactProjectorTests.cs Adds a regression test covering F Minor tempo reconstruction from Haste item uses on the F Note socket.
src/BazaarPlusPlus/Game/PostCombatImpact/Data/CombatImpactProjector.cs Implements F Minor tempo reconstruction using template IDs, socket overlap, hidden tag checks, and UseCount.
src/BazaarPlusPlus/Game/PostCombatImpact/Data/CombatImpactModels.cs Extends CombatImpactEntity with SocketId and HiddenTags to support attribution rules.
src/BazaarPlusPlus/Game/PostCombatImpact/Data/CombatImpactEntitySnapshotReader.cs Populates SocketId/HiddenTags in entity snapshots from native card state.

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

Comment on lines +214 to +228
foreach (
var item in entities.Values.Where(entity =>
entity.TypeLabel == "Item"
&& entity.CombatantId == combatantId
&& entity.SocketId.HasValue
&& entity.HiddenTags?.Contains(EHiddenTag.Haste) == true
&& OccupiesAnySocket(entity, noteSockets)
&& useCounts.TryGetValue(entity.Id, out var uses)
&& uses > 0
)
)
{
var amount = skill.Attributes![ECardAttributeType.Custom_0];
var uses = useCounts[item.Id];
for (var index = 0; index < uses; index++)
@cauyxy
cauyxy merged commit 250f7f3 into master Aug 6, 2026
1 check passed
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.

3 participants