Skip to content

feat: 支持饰品提取连续挑战#1014

Draft
CL4R3T wants to merge 8 commits intomoesnow:mainfrom
CL4R3T:main
Draft

feat: 支持饰品提取连续挑战#1014
CL4R3T wants to merge 8 commits intomoesnow:mainfrom
CL4R3T:main

Conversation

@CL4R3T
Copy link
Copy Markdown
Contributor

@CL4R3T CL4R3T commented Apr 27, 2026

允许饰品提取像其他副本一样连续挑战。
同时精简power.py中的重复代码,将原有的四个函数合并为一个函数。

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

该 PR 旨在让「饰品提取」像其他副本一样支持连续挑战,并通过合并体力处理逻辑来减少 power.py 中的重复代码,从而统一不同副本的执行入口。

Changes:

  • 将清体力与体力计划执行逻辑统一收敛到 Power.process(...),以“挑战次数”为统一计数口径。
  • 调整 Instance.run/start_instance 的入参语义为“每轮挑战次数”,并在「饰品提取」流程中支持通过“+”设置连续挑战次数。

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
tasks/power/power.py 合并原先标准/饰品提取两套执行逻辑为 Power.process,并用于清体力与体力计划执行。
tasks/power/instance.py 将副本启动参数改为“每轮挑战次数”,并为「饰品提取」补齐连续挑战次数的 UI 设置流程。

Comment thread tasks/power/power.py Outdated
Comment thread tasks/power/power.py
Comment thread tasks/power/instance.py
Comment thread tasks/power/power.py
@CL4R3T CL4R3T requested a review from Copilot April 27, 2026 16:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 10 comments.

Comments suppressed due to low confidence (1)

tasks/activity/doubleactivity.py:42

  • _run_instances() 在调用 Power.process(...) 后没有返回值,导致 run() 返回 None。在 ActivityManager 里对部分活动使用 while not func(): pass 的逻辑时,None 会被当作 False,从而可能造成死循环。请确保 _run_instances() 返回明确的 bool(例如根据 Power.process 的返回值判断是否执行成功)。
        Power.process(instance_type, instance_name, planned_attempts = reward_count)

    def run(self):
        reward_count = self._get_reward_count()
        if reward_count == 0:
            return True

        log.info(f"{self.name}剩余次数:{reward_count}")
        return self._run_instances(reward_count)

Comment thread tasks/power/power.py Outdated
Comment thread tasks/power/power.py
Comment thread tasks/activity/doubleactivity.py Outdated
Comment thread tasks/activity/__init__.py Outdated
Comment thread tasks/activity/__init__.py Outdated
Comment thread tasks/weekly/echoofwar.py
Comment thread tasks/activity/__init__.py Outdated
Comment thread tasks/activity/__init__.py Outdated
Comment thread tasks/weekly/universe.py Outdated
Comment thread tasks/weekly/divergent_universe.py Outdated
@CL4R3T
Copy link
Copy Markdown
Contributor Author

CL4R3T commented Apr 27, 2026

wow怎么这么多bug,哈哈

@CL4R3T CL4R3T requested a review from Copilot April 27, 2026 17:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Comment thread tasks/activity/doubleactivity.py Outdated
Comment thread tasks/power/power.py Outdated
@CL4R3T
Copy link
Copy Markdown
Contributor Author

CL4R3T commented Apr 27, 2026

应该没有更多的问题了

@CL4R3T CL4R3T requested a review from Copilot April 27, 2026 17:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

tasks/power/instance.py:289

  • 同上:在通用副本(含“历战余响”)的连续挑战次数选择中,如果未找到“+”按钮也会继续执行,可能导致实际挑战次数仍为 1,但外部按 attempts_per_run 计算,产生次数/计划统计偏差。建议在 attempts_per_run > 1 时要求必须找到“+”按钮(否则返回 False 或降级为 1),并对“历战余响”单独做一次 UI 适配校验。
                count = attempts_per_run - 1
                # if not 0 <= count <= challenge_count_max - 1:
                #     Base.send_notification_with_screenshot(cfg.notify_template['InstanceNotCompleted'].format(error="连续挑战次数错误"))
                #     return False
                result = auto.find_element("./assets/images/screen/guide/plus.png", "image", 0.8, max_retries=10, crop=(1174.0 / 1920, 775.0 / 1080, 738.0 / 1920, 174.0 / 1080))

Comment thread tasks/activity/doubleactivity.py Outdated
Comment thread tasks/power/power.py Outdated
Comment thread tasks/power/instance.py Outdated
Comment thread tasks/activity/doubleactivity.py
@CL4R3T
Copy link
Copy Markdown
Contributor Author

CL4R3T commented Apr 27, 2026

@copilot apply changes based on the comments in this thread

@CL4R3T
Copy link
Copy Markdown
Contributor Author

CL4R3T commented Apr 27, 2026

吔,copilot不能自动更改吗,那我手动push一下

@CL4R3T CL4R3T marked this pull request as draft April 27, 2026 18:27
@CL4R3T CL4R3T requested a review from Copilot April 27, 2026 18:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

log.error(f"获取培养目标副本失败: {e}")

Instance.run("饰品提取", instance_name, 40, immersifier_count)
Power.process("饰品提取", instance_name, immersifier_only = True)
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

同 tasks/weekly/universe.py:此处在 Power.process(..., immersifier_only=True) 前已经 OCR 读取沉浸器数量并判断 >0,但 Power.process 内部会再次识别沉浸器数量,造成重复 OCR 与潜在不一致。建议复用一次识别结果(例如直接依赖 Power.process 的返回值,或把 immersifier_count 传入 Power.process)。

Copilot uses AI. Check for mistakes.
Comment thread tasks/power/power.py

@staticmethod
def process_standard(instance_type, instance_name, challenge_count):
def process(instance_type: str, instance_name: str, planned_attempts: int = 0, immersifier_only: bool = False):
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

建议在 Power.process() 一开始就用 Instance.validate_instance(instance_type, instance_name) 做快速校验(instance_name 为“无”时直接返回 0)。否则像活动/计划传入未配置副本时,会进入多次重试与界面操作,既耗时也会把“未配置”误报成“体力不足/运行失败”。

Suggested change
def process(instance_type: str, instance_name: str, planned_attempts: int = 0, immersifier_only: bool = False):
def process(instance_type: str, instance_name: str, planned_attempts: int = 0, immersifier_only: bool = False):
if instance_name == "无":
return 0
if not Instance.validate_instance(instance_type, instance_name):
return 0

Copilot uses AI. Check for mistakes.
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