fix(KekkaiActivation):修改结界挂卡逻辑,可使用智能放入#1655
Conversation
-默认挂卡逻辑经常卡住,现在使用智能放入即可 -移除结界蹭卡中的更换育成式神(蹭卡不需要判断育成式神) Co-authored-by: huiyuhang1 <huiyuhang1@users.noreply.github.com>
There was a problem hiding this comment.
Hey - 我发现了 1 个问题,并留下了一些整体反馈:
check_max_lv函数已经不再使用shikigami_class参数,但函数签名中仍然声明了它。建议删除该参数,以简化 API 并避免造成混淆。- 新增的资源名
i_AUTO_PUT打破了KekkaiActivationAssets中资产常量全部使用大写命名的既有约定;建议为了保持一致性,对其进行重命名。 - 在使用
appear_then_click(self.i_AUTO_PUT, interval=2)时,建议显式处理自动放入按钮不存在的情况,以避免在不支持该功能的 UI 中出现不必要的重试或卡死。
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `check_max_lv` function no longer uses the `shikigami_class` parameter but still declares it, which can be removed to simplify the API and avoid confusion.
- The new `i_AUTO_PUT` asset name breaks the existing naming convention of uppercase asset constants in `KekkaiActivationAssets`; consider renaming it for consistency.
- When using `appear_then_click(self.i_AUTO_PUT, interval=2)`, consider handling the case where the auto-put button is not present to avoid unnecessary retries or hanging in UIs that don’t support this feature.
## Individual Comments
### Comment 1
<location path="tasks/KekkaiActivation/script_task.py" line_range="366" />
<code_context>
def check_max_lv(self, shikigami_class: ShikigamiClass = ShikigamiClass.N):
"""
- 在结界界面,进入式神育成,检查是否有满级的,如果有就换下一个
</code_context>
<issue_to_address>
**suggestion:** The `shikigami_class` parameter of `check_max_lv` is now unused and could be removed.
Since `check_max_lv` no longer uses `shikigami_class` and callers no longer pass it, keeping the parameter in the signature is misleading. Please either remove it or introduce a meaningful use (e.g., as a fallback when auto-put is unavailable) to keep the API clear and accurate.
Suggested implementation:
```python
if con.exchange_auto:
self.check_max_lv()
# self.back_guild()
self.ui_get_current_page()
self.ui_goto(page_main)
def check_max_lv(self):
"""
在结界界面,进入式神育成,如果显示了智能放入按钮,则使用
:return:
"""
self.realm_goto_grown()
```
1. Search for all other usages of `check_max_lv` in the codebase. If any calls still pass `shikigami_class` (e.g., `self.check_max_lv(ShikigamiClass.N)`), remove the argument so they call `self.check_max_lv()` instead.
2. If the parameter was referenced in any external documentation or comments, update those to reflect the new signature without `shikigami_class`.
</issue_to_address>Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- The
check_max_lvfunction no longer uses theshikigami_classparameter but still declares it, which can be removed to simplify the API and avoid confusion. - The new
i_AUTO_PUTasset name breaks the existing naming convention of uppercase asset constants inKekkaiActivationAssets; consider renaming it for consistency. - When using
appear_then_click(self.i_AUTO_PUT, interval=2), consider handling the case where the auto-put button is not present to avoid unnecessary retries or hanging in UIs that don’t support this feature.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `check_max_lv` function no longer uses the `shikigami_class` parameter but still declares it, which can be removed to simplify the API and avoid confusion.
- The new `i_AUTO_PUT` asset name breaks the existing naming convention of uppercase asset constants in `KekkaiActivationAssets`; consider renaming it for consistency.
- When using `appear_then_click(self.i_AUTO_PUT, interval=2)`, consider handling the case where the auto-put button is not present to avoid unnecessary retries or hanging in UIs that don’t support this feature.
## Individual Comments
### Comment 1
<location path="tasks/KekkaiActivation/script_task.py" line_range="366" />
<code_context>
def check_max_lv(self, shikigami_class: ShikigamiClass = ShikigamiClass.N):
"""
- 在结界界面,进入式神育成,检查是否有满级的,如果有就换下一个
</code_context>
<issue_to_address>
**suggestion:** The `shikigami_class` parameter of `check_max_lv` is now unused and could be removed.
Since `check_max_lv` no longer uses `shikigami_class` and callers no longer pass it, keeping the parameter in the signature is misleading. Please either remove it or introduce a meaningful use (e.g., as a fallback when auto-put is unavailable) to keep the API clear and accurate.
Suggested implementation:
```python
if con.exchange_auto:
self.check_max_lv()
# self.back_guild()
self.ui_get_current_page()
self.ui_goto(page_main)
def check_max_lv(self):
"""
在结界界面,进入式神育成,如果显示了智能放入按钮,则使用
:return:
"""
self.realm_goto_grown()
```
1. Search for all other usages of `check_max_lv` in the codebase. If any calls still pass `shikigami_class` (e.g., `self.check_max_lv(ShikigamiClass.N)`), remove the argument so they call `self.check_max_lv()` instead.
2. If the parameter was referenced in any external documentation or comments, update those to reflect the new signature without `shikigami_class`.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| def check_max_lv(self, shikigami_class: ShikigamiClass = ShikigamiClass.N): | ||
| """ | ||
| 在结界界面,进入式神育成,检查是否有满级的,如果有就换下一个 |
There was a problem hiding this comment.
suggestion: check_max_lv 的 shikigami_class 参数现在已经未被使用,可以考虑移除。
由于 check_max_lv 已经不再使用 shikigami_class,并且调用方也不再传入该参数,继续在函数签名中保留它会具有误导性。请考虑移除该参数,或者为其引入一个有意义的用途(例如在智能放入不可用时作为回退方案),以保持 API 的清晰和准确。
建议的实现方式:
if con.exchange_auto:
self.check_max_lv()
# self.back_guild()
self.ui_get_current_page()
self.ui_goto(page_main)
def check_max_lv(self):
"""
在结界界面,进入式神育成,如果显示了智能放入按钮,则使用
:return:
"""
self.realm_goto_grown()- 在代码库中搜索所有
check_max_lv的调用。如果仍有调用传入shikigami_class(例如self.check_max_lv(ShikigamiClass.N)),请移除该实参,使其改为调用self.check_max_lv()。 - 如果该参数在任何外部文档或注释中被提及,请更新相关内容以反映移除
shikigami_class后的新函数签名。
Original comment in English
suggestion: The shikigami_class parameter of check_max_lv is now unused and could be removed.
Since check_max_lv no longer uses shikigami_class and callers no longer pass it, keeping the parameter in the signature is misleading. Please either remove it or introduce a meaningful use (e.g., as a fallback when auto-put is unavailable) to keep the API clear and accurate.
Suggested implementation:
if con.exchange_auto:
self.check_max_lv()
# self.back_guild()
self.ui_get_current_page()
self.ui_goto(page_main)
def check_max_lv(self):
"""
在结界界面,进入式神育成,如果显示了智能放入按钮,则使用
:return:
"""
self.realm_goto_grown()- Search for all other usages of
check_max_lvin the codebase. If any calls still passshikigami_class(e.g.,self.check_max_lv(ShikigamiClass.N)), remove the argument so they callself.check_max_lv()instead. - If the parameter was referenced in any external documentation or comments, update those to reflect the new signature without
shikigami_class.
|
霍才发现有这个智能放入 |
|
我以为是怕不能选择挂卡类型,特意没加的。 QAQ |
|
sourcery-ai 提到了一些问题,不过我觉得最好是直接在ShikigamiClass这里加一个枚举,可以继承这个类然后加上 |
|
好嘞,明天改一下 |
之前我加了,后来有人重写任务全删掉了。 |
-默认挂卡逻辑经常卡住,现在添加智能放入功能
-移除结界蹭卡中的更换育成式神(蹭卡不需要判断育成式神)
Summary by Sourcery
在结界激活期间启用自动智能式神放置,并简化蹭卡逻辑以依赖该行为。
新功能:
错误修复:
改进:
Original summary in English
Summary by Sourcery
Enable automatic intelligent shikigami placement during Kekkai activation and simplify card hanging logic to rely on this behavior.
New Features:
Bug Fixes:
Enhancements: