Skip to content

feat(tracker): 完善诫厉观看阶段目标通知适配#39

Merged
llsccm merged 3 commits into
devfrom
feat/jieli
Jul 18, 2026
Merged

feat(tracker): 完善诫厉观看阶段目标通知适配#39
llsccm merged 3 commits into
devfrom
feat/jieli

Conversation

@llsccm

@llsccm llsccm commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • 完善族钟繇【诫厉】SpellID=3483 观看阶段 GsCRoleOptTargetNtf 适配:按 [pileCount, handCount, ...pileTop, ...handPartial] 同步牌堆顶与目标手牌片段,并写入 expectedPileCount
  • handCount 恰好等于目标整手数(优先观测手牌数,否则本地手牌实体数)时升级为 fullHand
  • 文档化观看同区展示与后续 MoveType=11 交换序列;明确观看 top-first(如 81 为顶)与交换 CardIDs 可能逆序/重排。
  • decorateJieLi 暂不挂上PILE_SAME_ZONE_SHOW_SPELL_IDS 不因 3483 扩展。

Why

实战协议已给出诫厉观看与交换消息语义;观看阶段可先安全接入目标通知,交换阶段旧装饰假设与实战不一致,避免误挂。

Test plan

  • pnpm exec vitest run tests/tracker/roleOptTargetNtf.test.ts(7/7)
  • eslint on touched handler/test/skill files
  • 浏览器实战核对 3483 观看阶段牌堆顶/部分手牌
  • 后续单独验证交换默认路径(1->10 / 部分 5->10 / 10->1 / 10->5

Summary by CodeRabbit

  • 功能改进

    • 优化诫厉相关牌堆与手牌展示逻辑,支持更准确地同步牌堆顶及目标手牌片段。
    • 当已确认目标持有完整手牌时,将自动按整手牌进行展示。
  • 文档

    • 新增协议文档索引及诫厉协议说明,补充参数解析、牌序和交换流程说明。
    • 更新整手牌交换协议引用,明确不同技能路径的识别与适用边界。
  • 测试

    • 增加诫厉场景覆盖,验证牌堆数量、手牌展示及完整手牌同步行为。

同步 3483 Params 中的牌堆顶与目标手牌片段,handCount 恰好整手时 fullHand;补充交换序列协议文档并暂不挂上 decorateJieLi。
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f650c9d6-1430-4ca0-9a90-df5b84036ce9

📥 Commits

Reviewing files that changed from the base of the PR and between c54ead5 and 9825ea9.

📒 Files selected for processing (7)
  • AGENTS.md
  • docs/agents/card_tracker.md
  • docs/protocols/GsCRoleOptTargetNtf-3483.md
  • docs/protocols/README.md
  • docs/protocols/hand-exchange.md
  • src/tracker/skill/HandExchange.ts
  • tests/tracker/roleOptTargetNtf.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/protocols/GsCRoleOptTargetNtf-3483.md
  • docs/agents/card_tracker.md
  • tests/tracker/roleOptTargetNtf.test.ts

📝 Walkthrough

Walkthrough

Changes

诫厉协议与牌面同步

Layer / File(s) Summary
协议规则与适配文档
docs/protocols/*, docs/agents/card_tracker.md, src/tracker/skill/{JieLi,HandExchange}.ts
新增诫厉协议说明、相关技能索引、交换区排除规则及通用协议引用。
观看参数解析与明牌处理
src/handler/GsCRoleOptTargetNtf.js
pileCounthandCount 切分参数,写入 expectedPileCount,并按观测手牌数量决定 fullHand
回归测试与文档导航
tests/tracker/roleOptTargetNtf.test.ts, docs/protocols/README.md, AGENTS.md
覆盖牌堆和手牌同步、整手牌公开及仅牌堆计数场景,并新增协议文档索引入口。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RoleOptTargetNtf
  participant TrackerRoom
  participant revealTrackerCards
  RoleOptTargetNtf->>TrackerRoom: 写入 expectedPileCount
  RoleOptTargetNtf->>TrackerRoom: 检查 observedHandCount 或手牌快照
  RoleOptTargetNtf->>revealTrackerCards: 公开牌堆顶
  RoleOptTargetNtf->>revealTrackerCards: 公开目标手牌片段或整手牌
Loading

Possibly related PRs

  • llsccm/tracker#21:同样修改 handleRoleOptTargetNtf 中基于 Params 控制整手牌公开的逻辑。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次主要变更:完善诫厉(3483)观看阶段的目标通知适配。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/jieli

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/tracker/roleOptTargetNtf.test.ts`:
- Line 32: TypeScript 无法识别 Vitest mock 方法及 skillState 对象属性。更新
tests/tracker/roleOptTargetNtf.test.ts#L32 的 tracker.getReadyTrackerRoom,使用
vi.mocked 后再调用 mockReset;在 `#L128-L133`、#L164-L169 和 `#L191-L193` 为 skillState 明确声明
Record<string, any> 类型,并使用 vi.mocked 包装相关 mock 返回值,确保 mockReset 与
expectedPileCount 等属性通过 tsc 检查。
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f4abfae-d7f9-4a11-9cb8-f449bdab031f

📥 Commits

Reviewing files that changed from the base of the PR and between 2725bd9 and c54ead5.

📒 Files selected for processing (8)
  • docs/agents/card_tracker.md
  • docs/protocols/GsCRoleOptTargetNtf-3483.md
  • docs/protocols/GsCRoleOptTargetNtf-7011.md
  • docs/protocols/GsCRoleOptTargetNtf-987.md
  • docs/protocols/PubGsCMoveCard-spell-121-hand-exchange.md
  • src/handler/GsCRoleOptTargetNtf.js
  • src/tracker/skill/JieLi.ts
  • tests/tracker/roleOptTargetNtf.test.ts

Comment thread tests/tracker/roleOptTargetNtf.test.ts Outdated
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 1 file(s) based on 1 unresolved review comment.

Files modified:

  • tests/tracker/roleOptTargetNtf.test.ts

Commit: 4a8d8c1ed9bb7ca10979a3d398b0518000d01d9c

The changes have been pushed to the feat/jieli branch.

Time taken: 3m 28s

coderabbitai Bot and others added 2 commits July 18, 2026 11:28
Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
新增 docs/protocols/README.md 作为 className/SpellID 定位入口,并将 PubGsCMoveCard-spell-121-hand-exchange.md 重命名为 hand-exchange.md,同步更新引用。
@llsccm
llsccm merged commit 047ec4c into dev Jul 18, 2026
4 checks passed
@llsccm
llsccm deleted the feat/jieli branch July 18, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant