feat: 支持战斗中切换后援队伍&诺姆战斗模板 - #2364
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough本 PR 新增"切换后援"按键(默认 Changes切换后援 & 诺姆角色自动战斗
Sequence Diagram(s)sequenceDiagram
participant 战斗状态检测
participant 切换后援检测
participant 屏幕区域截取
participant 状态记录
participant 原子操作
participant 控制器
rect rgba(135, 206, 235, 0.5)
Note over 战斗状态检测,状态记录: 周期性检测切换后援按键可用性
战斗状态检测->>切换后援检测: check_battle_state 并行提交
切换后援检测->>切换后援检测: 非阻塞锁 + 节流判断
切换后援检测->>屏幕区域截取: 截取 area_btn_switch_backup
屏幕区域截取-->>切换后援检测: 模板匹配结果
切换后援检测->>状态记录: 写入 STATUS_SWITCH_BACKUP_READY
end
rect rgba(144, 238, 144, 0.5)
Note over 原子操作,控制器: 原子操作执行切换后援动作
原子操作->>战斗状态检测: ctx.switch_backup(press/release)
战斗状态检测->>控制器: controller.switch_backup
战斗状态检测->>状态记录: 写入 BTN_SWITCH_BACKUP
战斗状态检测->>战斗状态检测: 发送 overlay 动作事件
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/zzz_od/auto_battle/auto_battle_context.py (1)
302-302: ⚡ Quick win为新增方法补充返回类型注解
switch_backup是新增方法,建议补上-> None以满足当前类型标注规则。As per coding guidelines, `**/*.py`: “All functions and methods must include type hints (Type Hints)”.💡 建议修复
- def switch_backup(self, press: bool = False, press_time: float | None = None, release: bool = False): + def switch_backup(self, press: bool = False, press_time: float | None = None, release: bool = False) -> None:🤖 Prompt for 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. In `@src/zzz_od/auto_battle/auto_battle_context.py` at line 302, The switch_backup method is missing a return type annotation, which violates the coding guidelines requiring all functions and methods to include type hints. Add the return type annotation -> None to the method signature of switch_backup to indicate that this method does not return a value.Source: Coding guidelines
🤖 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 `@src/zzz_od/auto_battle/auto_battle_agent_context.py`:
- Around line 398-412: Update the type annotations in the
_should_force_check_all_agents method signature to use modern Python 3.11+
built-in generic types. Replace the capital-letter versions List and Tuple with
their lowercase equivalents list and tuple respectively. The parameter
screen_agent_list should be annotated with list[tuple[Agent | None, str | None]]
instead of List[Tuple[Agent | None, str | None]].
In `@src/zzz_od/auto_battle/auto_battle_context.py`:
- Around line 302-314: The switch_backup method now supports press and release
operations, but the shutdown or stop procedure is missing a corresponding call
to release the backup key. When the backup key is pressed during long-press
operation and the system stops, the key remains in a pressed state causing input
stability issues. Locate the stop or shutdown process (around line 1008 area in
the file) and add a call to switch_backup(release=True) to ensure the backup key
is properly released during system shutdown, completing the full lifecycle of
the key press operation.
---
Nitpick comments:
In `@src/zzz_od/auto_battle/auto_battle_context.py`:
- Line 302: The switch_backup method is missing a return type annotation, which
violates the coding guidelines requiring all functions and methods to include
type hints. Add the return type annotation -> None to the method signature of
switch_backup to indicate that this method does not return a value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 775ca990-ab48-4ae3-9533-71efe661cee9
⛔ Files ignored due to path filters (18)
assets/template/agent_state/norma_3_1/mask.pngis excluded by!**/*.pngassets/template/agent_state/norma_3_1/raw.pngis excluded by!**/*.pngassets/template/battle/avatar_1_norma/mask.pngis excluded by!**/*.pngassets/template/battle/avatar_1_norma/raw.pngis excluded by!**/*.pngassets/template/battle/avatar_2_norma/mask.pngis excluded by!**/*.pngassets/template/battle/avatar_2_norma/raw.pngis excluded by!**/*.pngassets/template/battle/avatar_chain_norma/mask.pngis excluded by!**/*.pngassets/template/battle/avatar_chain_norma/raw.pngis excluded by!**/*.pngassets/template/battle/avatar_quick_norma/mask.pngis excluded by!**/*.pngassets/template/battle/avatar_quick_norma/raw.pngis excluded by!**/*.pngassets/template/battle/btn_switch_backup_1/mask.pngis excluded by!**/*.pngassets/template/battle/btn_switch_backup_1/raw.pngis excluded by!**/*.pngassets/template/battle/btn_switch_backup_2/mask.pngis excluded by!**/*.pngassets/template/battle/btn_switch_backup_2/raw.pngis excluded by!**/*.pngassets/template/hollow/avatar_norma/mask.pngis excluded by!**/*.pngassets/template/hollow/avatar_norma/raw.pngis excluded by!**/*.pngassets/template/predefined_team/avatar_norma/mask.pngis excluded by!**/*.pngassets/template/predefined_team/avatar_norma/raw.pngis excluded by!**/*.png
📒 Files selected for processing (23)
assets/game_data/screen_info/_od_merged.ymlassets/game_data/screen_info/battle.ymlassets/template/agent_state/norma_3_1/config.ymlconfig/auto_battle/全配队通用.merged.ymlconfig/auto_battle/全配队通用.sample.ymlconfig/auto_battle_operation/诺姆-强化特殊攻击.sample.ymlconfig/auto_battle_operation/诺姆-支援攻击.sample.ymlconfig/auto_battle_operation/诺姆-普通攻击合轴.sample.ymlconfig/auto_battle_operation/诺姆-终结技.sample.ymlconfig/auto_battle_operation/诺姆-连携攻击.sample.ymlconfig/auto_battle_operation/诺姆-长按普攻.sample.ymlconfig/auto_battle_state_handler/轮换-合轴-全角色.sample.ymlconfig/auto_battle_state_handler/速切模板-全角色.sample.ymlconfig/auto_battle_state_handler/速切模板-耀嘉音.sample.ymlconfig/auto_battle_state_handler/速切模板-诺姆.sample.ymldocs/develop/zzz/auto_battle.mdsrc/zzz_od/auto_battle/atomic_op/btn_common.pysrc/zzz_od/auto_battle/auto_battle_agent_context.pysrc/zzz_od/auto_battle/auto_battle_context.pysrc/zzz_od/auto_battle/auto_battle_state.pysrc/zzz_od/config/game_config.pysrc/zzz_od/controller/zzz_pc_controller.pysrc/zzz_od/game_data/agent.py
| def _should_force_check_all_agents(self, screen_agent_list: List[Tuple[Agent | None, str | None]]) -> bool: | ||
| """ | ||
| 当前处于战斗画面,但一个角色都识别不到时,下一次强制重新全量识别。 | ||
| 这样可以兼容战斗内队伍循环切换的新模式,同时避免常驻全量识别带来的性能压力。 | ||
| """ | ||
| if self.team_info.should_check_all_agents: | ||
| return False | ||
|
|
||
| for agent, _ in screen_agent_list: | ||
| if agent is not None: | ||
| return False | ||
|
|
||
| log.debug('当前识别不到任何角色,下一次截图强制重新识别所有角色') | ||
| return True | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
使用现代类型注解语法
根据代码规范,src/**/*.py 文件应使用 Python 3.11+ 的内置泛型类型注解。第 398 行的函数签名使用了 List[Tuple[...]],应改为 list[tuple[...]]。
♻️ 建议的修改
- def _should_force_check_all_agents(self, screen_agent_list: List[Tuple[Agent | None, str | None]]) -> bool:
+ def _should_force_check_all_agents(self, screen_agent_list: list[tuple[Agent | None, str | None]]) -> bool:📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| def _should_force_check_all_agents(self, screen_agent_list: List[Tuple[Agent | None, str | None]]) -> bool: | |
| """ | |
| 当前处于战斗画面,但一个角色都识别不到时,下一次强制重新全量识别。 | |
| 这样可以兼容战斗内队伍循环切换的新模式,同时避免常驻全量识别带来的性能压力。 | |
| """ | |
| if self.team_info.should_check_all_agents: | |
| return False | |
| for agent, _ in screen_agent_list: | |
| if agent is not None: | |
| return False | |
| log.debug('当前识别不到任何角色,下一次截图强制重新识别所有角色') | |
| return True | |
| def _should_force_check_all_agents(self, screen_agent_list: list[tuple[Agent | None, str | None]]) -> bool: | |
| """ | |
| 当前处于战斗画面,但一个角色都识别不到时,下一次强制重新全量识别。 | |
| 这样可以兼容战斗内队伍循环切换的新模式,同时避免常驻全量识别带来的性能压力。 | |
| """ | |
| if self.team_info.should_check_all_agents: | |
| return False | |
| for agent, _ in screen_agent_list: | |
| if agent is not None: | |
| return False | |
| log.debug('当前识别不到任何角色,下一次截图强制重新识别所有角色') | |
| return True |
🧰 Tools
🪛 Ruff (0.15.17)
[warning] 400-400: Docstring contains ambiguous , (FULLWIDTH COMMA). Did you mean , (COMMA)?
(RUF002)
[warning] 400-400: Docstring contains ambiguous , (FULLWIDTH COMMA). Did you mean , (COMMA)?
(RUF002)
[warning] 401-401: Docstring contains ambiguous , (FULLWIDTH COMMA). Did you mean , (COMMA)?
(RUF002)
[warning] 410-410: String contains ambiguous , (FULLWIDTH COMMA). Did you mean , (COMMA)?
(RUF001)
🤖 Prompt for 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.
In `@src/zzz_od/auto_battle/auto_battle_agent_context.py` around lines 398 - 412,
Update the type annotations in the _should_force_check_all_agents method
signature to use modern Python 3.11+ built-in generic types. Replace the
capital-letter versions List and Tuple with their lowercase equivalents list and
tuple respectively. The parameter screen_agent_list should be annotated with
list[tuple[Agent | None, str | None]] instead of List[Tuple[Agent | None, str |
None]].
Source: Coding guidelines
| def _should_force_check_all_agents(self, screen_agent_list: List[Tuple[Agent | None, str | None]]) -> bool: | ||
| """ | ||
| 当前处于战斗画面,但一个角色都识别不到时,下一次强制重新全量识别。 | ||
| 这样可以兼容战斗内队伍循环切换的新模式,同时避免常驻全量识别带来的性能压力。 | ||
| """ |
There was a problem hiding this comment.
终结技、连携期间也识别不到吧,会不会加大性能压力
There was a problem hiding this comment.
这部分识别压力几乎就跟没有差不多,动画期间一直识别不会有影响
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
config/auto_battle/击破站场-强攻速切.merged.yml (1)
5131-5135:⚠️ Potential issue | 🟠 Major | ⚡ Quick win切人前先松开前进键。
Line 5131 按下了
按键-移动-前-按下,Line 5135 直接切到下一个角色;如果不先松开,后续角色会继承前进输入,影响后续自动战斗节奏。建议修复
- "op_name": "按键-特殊攻击" "post_delay": 0.1 "repeat": 3 + - "op_name": "按键-移动-前-松开" - "op_name": "按键-切换角色-下一个"🤖 Prompt for 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. In `@config/auto_battle/击破站场-强攻速切.merged.yml` around lines 5131 - 5135, The forward movement key (按键-移动-前-按下) is pressed down but never released before switching to the next character (按键-切换角色-下一个). This causes the next character to inherit the ongoing forward input, disrupting the battle sequence. Add a key release operation for the forward movement (按键-移动-前-按起) between the special attack repeat operations and the character switch operation to ensure the input is properly released before the character transition occurs.config/auto_battle/强攻站场-击破支援速切.merged.yml (1)
4200-4204:⚠️ Potential issue | 🟠 Major | ⚡ Quick win切人前先释放前进键。
Line 4204 和 Line 13681 新增切人时,前面仍保持
按键-移动-前-按下,没有对应按键-移动-前-松开;切到下一名角色后可能继续带着前进输入。建议修复
- "op_name": "按键-特殊攻击" "post_delay": 0.1 "repeat": 3 + - "op_name": "按键-移动-前-松开" - "op_name": "按键-切换角色-下一个"请在两处耀嘉音分支中同步添加释放操作。
Also applies to: 13677-13681
🤖 Prompt for 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. In `@config/auto_battle/强攻站场-击破支援速切.merged.yml` around lines 4200 - 4204, The forward movement key press (按键-移动-前-按下) is not being released before switching to the next character (按键-切换角色-下一个) at lines around 4204 and 13681, which causes the forward movement input to persist after the character switch. Add the corresponding release action (按键-移动-前-松开) immediately before the character switch operation in both locations to ensure the movement input is properly cleared when switching characters.config/auto_battle/自动守护.merged.yml (1)
4160-4164:⚠️ Potential issue | 🟠 Major | ⚡ Quick win切人前先释放前进键。
这里先执行了
按键-移动-前-按下,新增的按键-切换角色-下一个会在没有对应按键-移动-前-松开的情况下切走,容易让下一个角色继承前进按住状态。建议修复
- "op_name": "按键-特殊攻击" "post_delay": 0.1 "repeat": 3 + - "op_name": "按键-移动-前-松开" - "op_name": "按键-切换角色-下一个"🤖 Prompt for 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. In `@config/auto_battle/自动守护.merged.yml` around lines 4160 - 4164, The current sequence presses the forward movement key with "按键-移动-前-按下" but never releases it before switching characters with "按键-切换角色-下一个". This causes the next character to inherit the held forward key state. Add a "按键-移动-前-松开" operation between the "按键-特殊攻击" operation (with its post_delay and repeat settings) and the "按键-切换角色-下一个" operation to properly release the forward movement key before switching characters.
🤖 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 `@config/auto_battle/全配队通用.merged.yml`:
- Around line 2047-2056: The interval value of 0.1 seconds for the "切换后援可用"
action is too frequent compared to the upstream state throttling of the
"按键可用-切换后援" trigger which operates at second-level intervals, causing the
"按键-切换后援" operation to potentially execute multiple times within the same state
window. Fix this by increasing the interval value on line 2053 from 0.1 to at
least 1.0 seconds to align with the upstream state update frequency, or
alternatively add an additional debounce condition (such as checking if a recent
switch action was already performed) in the states condition to prevent repeated
rapid triggers.
In `@config/auto_battle/击破站场-强攻速切.merged.yml`:
- Line 10575: The states field on line 10575 uses square bracket syntax [诺姆-预热,
80, 100] which attempts to match by time window, but when matching 诺姆-预热 as a
character resource value, it should use curly brace syntax for numeric ranges
instead. Change the states field from the square bracket syntax to use curly
braces with the numeric interval {80, 100} to properly trigger the heating
branch logic as intended.
- Around line 10541-10575: The operations sequences are missing corresponding
release actions for their press operations. In the special attack sequence
starting around line 10544, after the last "等待秒数" operation with 0.5 seconds,
add a "按键-特殊攻击-松开" operation to release the key. In the normal attack sequence
starting around line 10561, after the last "等待秒数" operation with 0.5 seconds and
before the final "设置状态" operation for "自定义-合轴时间", add a "按键-普通攻击-松开" operation
to release the key. This ensures that each press operation has a corresponding
release operation before the branch ends, preventing the pressed state from
carrying over to subsequent handlers.
In `@config/auto_battle/强攻站场-击破支援速切.merged.yml`:
- Around line 9609-9644: The special skill available condition `[诺姆-特殊技可用]` is
currently ordered before the warm-up exit condition `[诺姆-预热, 80, 100]`, causing
the special skill branch to execute and prevent the `自定义-合轴时间` state from being
set. Reorder the two operations blocks so that the condition with `[诺姆-预热, 80,
100]` appears before the condition with `[诺姆-特殊技可用]` to ensure the warm-up exit
branch takes priority when the warm-up is full. Make this reordering change in
both locations: around line 9625 and around line 19102.
- Around line 9610-9644: The special attack and normal attack branches are using
press-type key operations (`按键-特殊攻击-按下` and `按键-普通攻击-按下`) without corresponding
release operations (`松开`). This causes the key state to persist into the next
handler, affecting subsequent actions. Add a release operation (`按键-特殊攻击-松开` or
`按键-普通攻击-松开`) after each corresponding press operation in both the special
attack sequence and the normal attack sequence. Apply the same fix to the
duplicate branch mentioned at lines 19087-19121. Alternatively, if the intent is
to tap repeatedly rather than hold, replace the press operations with the
non-press versions that do not include the `-按下` suffix.
In `@config/auto_battle/自动守护.merged.yml`:
- Around line 9602-9604: Replace the string reference "诺姆-预热" in the states
configuration value with appropriate numerical values for range judgment instead
of using the constant name. The current configuration is being parsed as a time
window (80~100 seconds) when the constant reference is encountered, causing the
warm-up branch logic to not trigger as expected. Update the states field at
lines 9602-9604 to use direct numerical values that properly represent the
intended range judgment for the "自定义-合轴时间" state.
---
Outside diff comments:
In `@config/auto_battle/击破站场-强攻速切.merged.yml`:
- Around line 5131-5135: The forward movement key (按键-移动-前-按下) is pressed down
but never released before switching to the next character (按键-切换角色-下一个). This
causes the next character to inherit the ongoing forward input, disrupting the
battle sequence. Add a key release operation for the forward movement
(按键-移动-前-按起) between the special attack repeat operations and the character
switch operation to ensure the input is properly released before the character
transition occurs.
In `@config/auto_battle/强攻站场-击破支援速切.merged.yml`:
- Around line 4200-4204: The forward movement key press (按键-移动-前-按下) is not
being released before switching to the next character (按键-切换角色-下一个) at lines
around 4204 and 13681, which causes the forward movement input to persist after
the character switch. Add the corresponding release action (按键-移动-前-松开)
immediately before the character switch operation in both locations to ensure
the movement input is properly cleared when switching characters.
In `@config/auto_battle/自动守护.merged.yml`:
- Around line 4160-4164: The current sequence presses the forward movement key
with "按键-移动-前-按下" but never releases it before switching characters with
"按键-切换角色-下一个". This causes the next character to inherit the held forward key
state. Add a "按键-移动-前-松开" operation between the "按键-特殊攻击" operation (with its
post_delay and repeat settings) and the "按键-切换角色-下一个" operation to properly
release the forward movement key before switching characters.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ffff7d8d-9190-44e1-ae71-2a7a2a50e54d
📒 Files selected for processing (5)
config/auto_battle/全配队通用.merged.ymlconfig/auto_battle/击破站场-强攻速切.merged.ymlconfig/auto_battle/强攻站场-击破支援速切.merged.ymlconfig/auto_battle/自动守护.merged.ymlsrc/zzz_od/auto_battle/auto_battle_context.py
🚧 Files skipped from review as they are similar to previous changes (1)
- src/zzz_od/auto_battle/auto_battle_context.py
| - "debug_name": "切换后援可用" | ||
| "operations": | ||
| - "op_name": "按键-切换后援" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.1 | ||
| "states": "![自定义-终结技被强制释放, 0, 1]" | ||
| "interval": 0.1 | ||
| "priority": 70 | ||
| "triggers": | ||
| - "按键可用-切换后援" |
There was a problem hiding this comment.
切换后援触发频率与状态刷新节流不一致,可能导致连发切换。
Line 2053 将 interval 设为 0.1,但该触发器依赖的 按键可用-切换后援 状态在上游是按秒级节流更新;在同一状态窗口内会重复执行 按键-切换后援,容易出现多次误切。建议把执行节流对齐到 >=1 秒,或增加“最近已切换后援”防抖条件。
建议修改
- "interval": 0.1
+ "interval": 1.0- "states": "![自定义-终结技被强制释放, 0, 1]"
+ "states": "![自定义-终结技被强制释放, 0, 1] & ![按键-切换后援, 0, 0.8]"🤖 Prompt for 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.
In `@config/auto_battle/全配队通用.merged.yml` around lines 2047 - 2056, The interval
value of 0.1 seconds for the "切换后援可用" action is too frequent compared to the
upstream state throttling of the "按键可用-切换后援" trigger which operates at
second-level intervals, causing the "按键-切换后援" operation to potentially execute
multiple times within the same state window. Fix this by increasing the interval
value on line 2053 from 0.1 to at least 1.0 seconds to align with the upstream
state update frequency, or alternatively add an additional debounce condition
(such as checking if a recent switch action was already performed) in the states
condition to prevent repeated rapid triggers.
| - "op_name": "设置状态" | ||
| "seconds": 2.5 | ||
| "state": "自定义-动作不打断" | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| "states": "[诺姆-特殊技可用]" | ||
| - "operations": | ||
| - "op_name": "设置状态" | ||
| "seconds": 2 | ||
| "state": "自定义-动作不打断" | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "设置状态" | ||
| "state": "自定义-合轴时间" | ||
| "states": "[诺姆-预热, 80, 100]" |
There was a problem hiding this comment.
补齐 按下 操作的释放动作。
Line 10544-10555 和 Line 10561-10570 都使用了 *-按下,但分支结束前没有对应 *-松开;后续 handler 可能在特殊攻击/普通攻击仍保持按下状态时执行。
建议修复
- "op_name": "按键-特殊攻击-按下"
- "op_name": "等待秒数"
"seconds": 0.5
+ - "op_name": "按键-特殊攻击-松开"
"states": "[诺姆-特殊技可用]"
@@
- "op_name": "设置状态"
"state": "自定义-合轴时间"
+ - "op_name": "按键-普通攻击-松开"
- "states": "[诺姆-预热, 80, 100]"
+ "states": "[诺姆-预热]{80, 100}"🤖 Prompt for 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.
In `@config/auto_battle/击破站场-强攻速切.merged.yml` around lines 10541 - 10575, The
operations sequences are missing corresponding release actions for their press
operations. In the special attack sequence starting around line 10544, after the
last "等待秒数" operation with 0.5 seconds, add a "按键-特殊攻击-松开" operation to release
the key. In the normal attack sequence starting around line 10561, after the
last "等待秒数" operation with 0.5 seconds and before the final "设置状态" operation for
"自定义-合轴时间", add a "按键-普通攻击-松开" operation to release the key. This ensures that
each press operation has a corresponding release operation before the branch
ends, preventing the pressed state from carrying over to subsequent handlers.
| "seconds": 0.5 | ||
| - "op_name": "设置状态" | ||
| "state": "自定义-合轴时间" | ||
| "states": "[诺姆-预热, 80, 100]" |
There was a problem hiding this comment.
使用数值区间语法匹配 诺姆-预热。
Line 10575 现在写成 [诺姆-预热, 80, 100],这会按状态时间窗口匹配;诺姆-预热 作为角色资源值时应使用 {80, 100},否则预热分支基本不会按预期触发。
建议修复
- "states": "[诺姆-预热, 80, 100]"
+ "states": "[诺姆-预热]{80, 100}"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "states": "[诺姆-预热, 80, 100]" | |
| "states": "[诺姆-预热]{80, 100}" |
🤖 Prompt for 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.
In `@config/auto_battle/击破站场-强攻速切.merged.yml` at line 10575, The states field on
line 10575 uses square bracket syntax [诺姆-预热, 80, 100] which attempts to match
by time window, but when matching 诺姆-预热 as a character resource value, it should
use curly brace syntax for numeric ranges instead. Change the states field from
the square bracket syntax to use curly braces with the numeric interval {80,
100} to properly trigger the heating branch logic as intended.
| - "operations": | ||
| - "op_name": "设置状态" | ||
| "seconds": 2.5 | ||
| "state": "自定义-动作不打断" | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| "states": "[诺姆-特殊技可用]" | ||
| - "operations": | ||
| - "op_name": "设置状态" | ||
| "seconds": 2 | ||
| "state": "自定义-动作不打断" | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "设置状态" | ||
| "state": "自定义-合轴时间" | ||
| "states": "[诺姆-预热, 80, 100]" |
There was a problem hiding this comment.
避免特殊技分支吞掉诺姆预热退出分支。
Line 9625/Line 19102 的 [诺姆-特殊技可用] 排在 [诺姆-预热, 80, 100] 前面;预热已满且特殊技仍可用时,会优先进入特殊技分支,导致后面的 自定义-合轴时间 分支无法触发。
建议修复
- "states": "[诺姆-特殊技可用]"
+ "states": "[诺姆-特殊技可用] & ![诺姆-预热, 80, 100]"请在 Line 9625 和 Line 19102 两处同步修改;或者把 诺姆-预热 分支整体移到特殊技分支之前。
Also applies to: 19086-19121
🤖 Prompt for 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.
In `@config/auto_battle/强攻站场-击破支援速切.merged.yml` around lines 9609 - 9644, The
special skill available condition `[诺姆-特殊技可用]` is currently ordered before the
warm-up exit condition `[诺姆-预热, 80, 100]`, causing the special skill branch to
execute and prevent the `自定义-合轴时间` state from being set. Reorder the two
operations blocks so that the condition with `[诺姆-预热, 80, 100]` appears before
the condition with `[诺姆-特殊技可用]` to ensure the warm-up exit branch takes priority
when the warm-up is full. Make this reordering change in both locations: around
line 9625 and around line 19102.
| - "op_name": "设置状态" | ||
| "seconds": 2.5 | ||
| "state": "自定义-动作不打断" | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-特殊攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| "states": "[诺姆-特殊技可用]" | ||
| - "operations": | ||
| - "op_name": "设置状态" | ||
| "seconds": 2 | ||
| "state": "自定义-动作不打断" | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "按键-普通攻击-按下" | ||
| - "op_name": "等待秒数" | ||
| "seconds": 0.5 | ||
| - "op_name": "设置状态" | ||
| "state": "自定义-合轴时间" | ||
| "states": "[诺姆-预热, 80, 100]" |
There was a problem hiding this comment.
补齐按下类按键的释放操作。
诺姆的特殊攻击和预热普攻分支都使用了 按键-*-按下,但分支结束前没有 按键-*-松开;按键状态可能残留到下一个 handler,影响后续普攻/切人。
建议修复
- "op_name": "按键-特殊攻击-按下"
- "op_name": "等待秒数"
"seconds": 0.5
+ - "op_name": "按键-特殊攻击-松开"
"states": "[诺姆-特殊技可用]" - "op_name": "按键-普通攻击-按下"
- "op_name": "等待秒数"
"seconds": 0.5
+ - "op_name": "按键-普通攻击-松开"
- "op_name": "设置状态"
"state": "自定义-合轴时间"同样需要在 Line 19087-19121 的重复分支中同步补齐;如果这里想表达的是连点而不是长按,也可以改用不带 按下 的 按键-特殊攻击 / 按键-普通攻击。
Also applies to: 19087-19121
🤖 Prompt for 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.
In `@config/auto_battle/强攻站场-击破支援速切.merged.yml` around lines 9610 - 9644, The
special attack and normal attack branches are using press-type key operations
(`按键-特殊攻击-按下` and `按键-普通攻击-按下`) without corresponding release operations (`松开`).
This causes the key state to persist into the next handler, affecting subsequent
actions. Add a release operation (`按键-特殊攻击-松开` or `按键-普通攻击-松开`) after each
corresponding press operation in both the special attack sequence and the normal
attack sequence. Apply the same fix to the duplicate branch mentioned at lines
19087-19121. Alternatively, if the intent is to tap repeatedly rather than hold,
replace the press operations with the non-press versions that do not include the
`-按下` suffix.
| - "op_name": "设置状态" | ||
| "state": "自定义-合轴时间" | ||
| "states": "[诺姆-预热, 80, 100]" |
There was a problem hiding this comment.
把“诺姆-预热”改为数值范围判断。
诺姆-预热 在 src/zzz_od/game_data/agent.py:535-539 是 FOREGROUND_COLOR_RANGE_LENGTH,且 max_length=100;当前 [诺姆-预热, 80, 100] 会被解析成状态存在 80~100 秒的时间窗口,预热分支基本不会按预期触发。
建议修复
- "states": "[诺姆-预热, 80, 100]"
+ "states": "[诺姆-预热]{80, 100}"🤖 Prompt for 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.
In `@config/auto_battle/自动守护.merged.yml` around lines 9602 - 9604, Replace the
string reference "诺姆-预热" in the states configuration value with appropriate
numerical values for range judgment instead of using the constant name. The
current configuration is being parsed as a time window (80~100 seconds) when the
constant reference is encountered, causing the warm-up branch logic to not
trigger as expected. Update the states field at lines 9602-9604 to use direct
numerical values that properly represent the intended range judgment for the
"自定义-合轴时间" state.
| @@ -95,6 +98,7 @@ class GameKeyAction(Enum): | |||
| 'dodge': Ds4ButtonEnum.CROSS.value.value, | |||
| 'switch_next': Ds4ButtonEnum.R1.value.value, | |||
| 'switch_prev': Ds4ButtonEnum.L1.value.value, | |||
| 'switch_backup': Ds4ButtonEnum.TOUCHPAD.value.value, | |||
There was a problem hiding this comment.
这俩按键默认值是不是不对,我记得应该不是back
Summary by CodeRabbit
发布说明