Skip to content

fix(KekkaiActivation):修改结界挂卡逻辑,可使用智能放入#1655

Open
huiyuhang1 wants to merge 1 commit into
runhey:devfrom
huiyuhang1:cursor/fix-kekkaiactivation-smart-put-139b
Open

fix(KekkaiActivation):修改结界挂卡逻辑,可使用智能放入#1655
huiyuhang1 wants to merge 1 commit into
runhey:devfrom
huiyuhang1:cursor/fix-kekkaiactivation-smart-put-139b

Conversation

@huiyuhang1

@huiyuhang1 huiyuhang1 commented Jun 28, 2026

Copy link
Copy Markdown

-默认挂卡逻辑经常卡住,现在添加智能放入功能
-移除结界蹭卡中的更换育成式神(蹭卡不需要判断育成式神)

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:

  • Add support for using the in-game intelligent auto-put feature when managing shikigami in realm training during Kekkai activation.

Bug Fixes:

  • Reduce occurrences of the default card hanging flow getting stuck by delegating shikigami selection to the intelligent auto-put feature instead of manual replacement logic.

Enhancements:

  • Unify pre- and post-activation shikigami exchange options into a single configuration flag controlling use of intelligent auto placement.
  • Remove unnecessary育成式神 class switching logic from蹭卡 scenarios to avoid redundant checks.

-默认挂卡逻辑经常卡住,现在使用智能放入即可
-移除结界蹭卡中的更换育成式神(蹭卡不需要判断育成式神)

Co-authored-by: huiyuhang1 <huiyuhang1@users.noreply.github.com>

@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.

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_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.
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 ✨
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):
"""
在结界界面,进入式神育成,检查是否有满级的,如果有就换下一个

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: check_max_lvshikigami_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()
  1. 在代码库中搜索所有 check_max_lv 的调用。如果仍有调用传入 shikigami_class(例如 self.check_max_lv(ShikigamiClass.N)),请移除该实参,使其改为调用 self.check_max_lv()
  2. 如果该参数在任何外部文档或注释中被提及,请更新相关内容以反映移除 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()
  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.

@runhey

runhey commented Jul 2, 2026

Copy link
Copy Markdown
Owner

霍才发现有这个智能放入

@huiyuhang1

Copy link
Copy Markdown
Author

我以为是怕不能选择挂卡类型,特意没加的。 QAQ

@runhey

runhey commented Jul 2, 2026

Copy link
Copy Markdown
Owner

sourcery-ai 提到了一些问题,不过我觉得最好是直接在ShikigamiClass这里加一个枚举,可以继承这个类然后加上

@huiyuhang1

Copy link
Copy Markdown
Author

好嘞,明天改一下

@yEs1do

yEs1do commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

我以为是怕不能选择挂卡类型,特意没加的。 QAQ

之前我加了,后来有人重写任务全删掉了。
紧接着大家发现智能放入有个问题,五星四星白蛋也会往里放,一点都不智能,所以也没那么必要加,于是我也没再加回来。
所以我建议 exchange_auto 选项默认关闭,有需要的自己去开。

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.

3 participants