Skip to content

fix(tactical): 技能满级后保住同舰娘的下一个技能 - #950

Merged
wess09 merged 1 commit into
wess09:dev_frontendfrom
LianTian2222:fix/tactical-skill-autoswitch
Sep 15, 2026
Merged

wess09 merged 1 commit into
wess09:dev_frontendfrom
LianTian2222:fix/tactical-skill-autoswitch

Conversation

@LianTian2222

@LianTian2222 LianTian2222 commented Sep 15, 2026

Copy link
Copy Markdown

现象

战术学院里某位舰娘第一个技能学满后,脚本不会让同一位舰娘接着学第二个技能,而是重新进船坞、按等级顺序挑了另一艘船占掉这个槽位。

原因(两条独立缺陷)

  1. _handle_tactical_dock 把游戏递过来的确认学员步骤丢掉了:船坞里已有预选舰船时一律当成“从 page_main 带过来的陈旧预选”,点 BACK_ARROW 退出。游戏在技能界面确认技能后还会再弹一次船坞让确认学员(DOCK_SELECTED 1/1),这一步被当成陈旧状态退出,随后走「添加新学员」,于是槽位换成了别人。
    • 日志证据(2026-09-15 01:51):[战术-技能] 选择技能 为刚学满的舰娘选中第二个技能(['MAX','0/100','0/100'])并确认 → [DOCK_SELECTED] 1/1[战术-船坞] 船坞中有预选舰船,重新进入 → 船坞按等级选中另一位 120 级舰娘(['MAX','1700/5800','MAX'])→ 教材界面读到的经验是 1700/5800,空出的槽位被这艘船占掉,原舰娘的第二个技能再没开课。
  2. Tactical_SkillAutoSwitch(自动切换技能)从未真正生效:它的判定挂在 _tactical_books_choose() 的「没有教材命中」分支上,而 BOOK_FILTERfirst 预置(module/tactical/tactical_class.pyBOOK_FILTER 的 preset),该分支恒不成立;aeb54fccf 又把它收窄成必须 AddNewStudent_Enable,于是关掉「自动添加学员」时这个开关完全不做事。

改动

  • 技能自动切换改由 SKILL_CONFIRM 界面门控:Tactical_SkillAutoSwitch or AddNewStudent_Enable
  • 新增一次性 pending_ship_confirm 标记:刚确认过技能时,船坞里的预选舰船就是要确认的学员,点 SHIP_CONFIRM 继续;没有这个标记时(真正的陈旧预选)保持原有退出行为。
  • 删除从未执行的满级检测/切技能代码(_is_current_skill_max_wait_until_appear_return_to_tactical_page_try_switch_to_next_skill)与被架空的 pending_skill_auto_switch 管道;_handle_tactical_popups() 不再返回无用的第二个值;_tactical_books_choose() 恢复单次判定(Returns: bool)。

验证

  • 桩测试 12 条断言全绿:确认技能后 dock(1/1) → 点 SHIP_CONFIRM;无标记的陈旧预选 → 仍点 BACK_ARROW;dock(0/1) 正常选船流程不受影响;两个开关都关 → 仍关闭技能界面;该舰娘没有可学技能 → 仍退出;教材 first 兜底开课 / 未命中则走取消而不是越界。
  • python -m py_compile;CI 的 tests.test_ci_import 6/6 OK;git diff --check 干净。
  • 尚未实机验证:合并后需要跟一次完整的「技能学满 → 下一个技能」流程。

实机确认点

日志应为 [战术-技能] 选择技能[战术-船坞] 确认继续学习的舰船选择战术教材,且该槽位里仍是同一位舰娘在学第二个技能;若又出现 [战术-船坞] 船坞中有预选舰船,重新进入,说明那次的船坞不是紧跟技能确认出现的。

Sourcery 摘要

确保战术学生在进入下一项技能时仍分配到同一艘飞船,并恢复可靠的自动技能切换。

错误修复:

  • 在确认技能后保留战术坞中之前选定的飞船,以便同一艘飞船继续学习下一项技能。
  • 使战术技能自动切换在确认技能时生效,并独立于自动添加学生设置。

增强功能:

  • 移除过时的技能等级检测、重试和延迟自动切换处理;简化战术书籍选择和弹窗处理。
Original summary in English

Sourcery 摘要

修复战术学院技能衔接流程,确保舰娘满级后能可靠地继续学习下一项技能。

错误修复:

  • 保留技能确认后同一舰娘的预选状态,使其能够继续学习下一个技能而不会被其他舰娘替换。
  • 修复战术技能自动切换未生效的问题,使其在技能确认阶段独立于自动添加学员设置生效。

功能增强:

  • 移除无效的技能满级检测、重试切换流程及相关状态传递,简化战术教材选择和弹窗处理。
Original summary in English

Sourcery 摘要

修复战术技能学习的连续流程,并增强战略地图和剧情自动化功能,以应对无法到达的事件、错误识别的选项以及误判的点击循环。

新功能:

  • 改进战略地图事件恢复机制:通过雷达标记定位被遮挡的事件,并将无法到达的事件升级为保守的舰队移动。

Bug 修复:

  • 技能确认后保持选中同一名战术学生,以便其继续学习下一个技能。
  • 使战术技能自动切换在技能确认期间独立于自动添加学生的功能生效。
  • 修正三选一剧情选项,使其遵循明确的 STORY_OPTION 设置。
  • 防止重复的剧情交互触发误判的点击次数过多错误,同时继续检测真正卡住的剧情界面。
  • 避免在同一次重新扫描过程中反复重试无法到达的地图事件。

改进:

  • 简化战术技能和书籍选择流程,移除过时的等级检查、重试机制和延迟状态处理。

测试:

  • 增加对战术地图恢复升级、无法到达事件跟踪、基于雷达的事件回退、剧情选项选择以及剧情点击保护的覆盖测试。

杂项:

  • 移除过时的 GUI 依赖同步和 WebUI 概览面板切换测试。
Original summary in English

Sourcery 摘要

修复战术学院连续技能学习流程,并恢复可靠的自动技能切换。

错误修复:

  • 确保技能确认后继续使用同一名舰娘学习后续技能,避免预选状态被误清除并替换为其他舰娘。
  • 修复战术技能自动切换未生效的问题,使其在技能确认阶段独立于自动添加学员设置生效。

改进:

  • 简化战术技能与教材选择流程,移除无效的技能满级检测、重试切换及相关状态传递。
Original summary in English

Summary by Sourcery

修复战术学院连续技能学习流程,并恢复可靠的自动技能切换。

Bug Fixes:

  • 确保技能确认后继续使用同一名舰娘学习后续技能,避免预选状态被误清除并替换为其他舰娘。
  • 修复战术技能自动切换未生效的问题,使其在技能确认阶段独立于自动添加学员设置生效。

Enhancements:

  • 简化战术技能与教材选择流程,移除无效的技能满级检测、重试切换及相关状态传递。

@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown

CI 检查报告

检查结果

检查 结果 耗时
Post PR report ➖ unknown -

导入冒烟测试

  • 结果:❌
  • 扫描模块:506(通过 450,已知失败 3,意外失败 53,过期白名单 0)

意外失败:

  • module.auto_equip.auto_equip:ModuleNotFoundError: No module named 'pkg_resources'
  • module.awaken.awaken:ModuleNotFoundError: No module named 'pkg_resources'
  • module.base.debug_clip:ModuleNotFoundError: No module named 'pkg_resources'
  • module.device.app_control:ModuleNotFoundError: No module named 'pkg_resources'
  • module.device.connection:ModuleNotFoundError: No module named 'pkg_resources'
  • module.device.connection_attr:ModuleNotFoundError: No module named 'pkg_resources'
  • module.device.control:ModuleNotFoundError: No module named 'pkg_resources'
  • module.device.input:ModuleNotFoundError: No module named 'pkg_resources'
  • module.device.method.adb:ModuleNotFoundError: No module named 'pkg_resources'
  • module.device.method.ascreencap:ModuleNotFoundError: No module named 'pkg_resources'

@sourcery-ai

sourcery-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown

审查者指南

该 PR 通过区分技能选择后紧接着出现的停靠确认与过时的预选状态,修复了同一艘船继续进行后续战术技能时的流程;同时将技能切换门控移至 SKILL_CONFIRM,并移除了无法到达的重试/状态处理逻辑。

继续让同一艘船进行下一个战术技能的时序图

sequenceDiagram
    participant Tactical as TacticalClass
    participant Skill as SKILL_CONFIRM
    participant Dock as TacticalDock
    participant Books as TACTICAL_CLASS_START

    Tactical->>Skill: _handle_tactical_skill_confirm()
    Skill-->>Tactical: _tactical_skill_choose()
    Tactical->>Tactical: pending_ship_confirm = True
    Tactical->>Dock: _handle_tactical_dock()
    Dock-->>Tactical: dock_selected()
    Tactical->>Dock: SHIP_CONFIRM
    Tactical->>Books: _tactical_books_choose()
Loading

区分战术停靠预选状态的流程图

flowchart TD
    A["_handle_tactical_dock()"] --> B{"dock_selected()?"}
    B -- "no" --> C["选择一名新学生"]
    B -- "yes" --> D{"pending_ship_confirm?"}
    D -- "yes" --> E["点击 SHIP_CONFIRM"]
    D -- "no" --> F["点击 BACK_ARROW"]
    E --> G["继续使用同一艘船"]
    F --> H["清除过时的预选状态"]
Loading

文件级变更

变更 详细信息 文件
在技能确认后保留选中的学员,使同一艘船继续进行下一个技能。
  • 在选择技能时添加一次性待确认标志。
  • 技能确认后使用 SHIP_CONFIRM 确认预选的船。
  • 保留对过时停靠选择的 BACK_ARROW 行为,并在处理后清除该标志。
module/tactical/tactical_class.py
将自动技能切换移至技能确认流程,并简化其控制路径。
  • 在 Tactical_SkillAutoSwitch 或 AddNewStudent_Enable 任一启用时允许选择技能。
  • 移除无法到达的完整等级检测、重试和下一个技能切换辅助函数。
  • 恢复使用布尔结果进行单次教材选择,并保留第一本教材的回退行为。
module/tactical/tactical_class.py
在移除延迟自动切换信号后,简化弹窗和战术接收状态的处理。
  • 使弹窗处理仅返回弹窗是否已被处理。
  • 从接收循环和技能确认处理程序中移除 pending_skill_auto_switch 的传递。
module/tactical/tactical_class.py

提示和命令

与 Sourcery 交互

  • 触发新的审查: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 根据审查评论生成 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以回复审查评论并使用 @sourcery-ai issue,根据该评论创建 issue。
  • 生成 pull request 标题: 在 pull request 标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在 pull request 中评论 @sourcery-ai title,随时(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文中任意位置写入 @sourcery-ai summary,即可在指定位置随时生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary,随时(重新)生成摘要。
  • 生成审查者指南: 在 pull request 中评论 @sourcery-ai guide,即可随时(重新)生成审查者指南。
  • 解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,此功能会很有用。
  • 忽略所有 Sourcery 审查: 在 pull request 中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从新的审查开始,这尤其有用——别忘了评论 @sourcery-ai review 以触发新的审查!

自定义你的使用体验

访问你的控制面板

  • 启用或禁用审查功能,例如 Sourcery 生成的 pull request 摘要、审查者指南等。
  • 更改审查语言。
  • 添加、移除或编辑自定义审查指令。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

The PR fixes same-ship progression to a subsequent tactical skill by distinguishing the dock confirmation immediately following skill selection from stale preselection, while moving skill-switch gating to SKILL_CONFIRM and removing unreachable retry/state plumbing.

Sequence diagram for continuing the same ship to its next tactical skill

sequenceDiagram
    participant Tactical as TacticalClass
    participant Skill as SKILL_CONFIRM
    participant Dock as TacticalDock
    participant Books as TACTICAL_CLASS_START

    Tactical->>Skill: _handle_tactical_skill_confirm()
    Skill-->>Tactical: _tactical_skill_choose()
    Tactical->>Tactical: pending_ship_confirm = True
    Tactical->>Dock: _handle_tactical_dock()
    Dock-->>Tactical: dock_selected()
    Tactical->>Dock: SHIP_CONFIRM
    Tactical->>Books: _tactical_books_choose()
Loading

Flow diagram for distinguishing tactical dock preselection

flowchart TD
    A["_handle_tactical_dock()"] --> B{"dock_selected()?"}
    B -- "no" --> C["Select a new student"]
    B -- "yes" --> D{"pending_ship_confirm?"}
    D -- "yes" --> E["Click SHIP_CONFIRM"]
    D -- "no" --> F["Click BACK_ARROW"]
    E --> G["Continue with the same ship"]
    F --> H["Clear stale preselection"]
Loading

File-Level Changes

Change Details Files
Preserve the selected trainee after skill confirmation so the same ship continues into the next skill.
  • Added a one-shot pending confirmation flag when a skill is selected.
  • Confirm the preselected ship with SHIP_CONFIRM after skill confirmation.
  • Retain BACK_ARROW behavior for stale dock selections and clear the flag after handling.
module/tactical/tactical_class.py
Move automatic skill switching to the skill-confirmation flow and simplify its control path.
  • Allow skill selection when either Tactical_SkillAutoSwitch or AddNewStudent_Enable is enabled.
  • Remove unreachable full-level detection, retry, and next-skill switching helpers.
  • Restore single-pass textbook selection with a boolean result and preserve first-book fallback behavior.
module/tactical/tactical_class.py
Simplify popup and tactical receive state handling after removing deferred auto-switch signaling.
  • Make popup handling return only whether a popup was handled.
  • Remove pending_skill_auto_switch propagation from the receive loop and skill-confirm handler.
module/tactical/tactical_class.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot 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.

你好——我已经审阅了你的更改,看起来很棒!


Sourcery 对开源项目免费——如果你喜欢我们的审阅,请考虑分享它们 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@LianTian2222
LianTian2222 force-pushed the fix/tactical-skill-autoswitch branch from 5d1de50 to 9d3c68e Compare September 15, 2026 05:34
@wess09
wess09 changed the base branch from dev to dev_frontend September 15, 2026 09:44
@wess09

wess09 commented Sep 15, 2026

Copy link
Copy Markdown
Owner

tests/test_gui_dependency_sync.py 请解决冲突

@wess09

wess09 commented Sep 15, 2026

Copy link
Copy Markdown
Owner

@LianTian2222 解决冲突

- 技能自动切换改由 SKILL_CONFIRM 界面门控:原来挂在 if not books 分支上,而 BOOK_FILTER 的 first 预置让该分支恒不成立,开关实际无效
- 船坞已有预选舰船且刚确认过技能时,确认这位学员而不是退出重进(退出会改派船坞里按等级选出的另一艘船,满级舰娘的下一技能因此学不到)
- 删除从未执行的满级检测/切技能代码与被架空的 pending_ship_auto_switch 管道
@LianTian2222
LianTian2222 force-pushed the fix/tactical-skill-autoswitch branch from 9d3c68e to 7528497 Compare September 15, 2026 16:32
@wess09
wess09 merged commit e8bfc54 into wess09:dev_frontend Sep 15, 2026
4 of 6 checks passed
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.

2 participants