feat: 支持饰品提取连续挑战#1014
Merged
moesnow merged 8 commits intomoesnow:mainfrom Apr 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 设置流程。 |
Contributor
There was a problem hiding this comment.
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)
Contributor
Author
|
wow怎么这么多bug,哈哈 |
Contributor
Author
|
应该没有更多的问题了 |
Contributor
There was a problem hiding this comment.
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))
Contributor
Author
|
@copilot apply changes based on the comments in this thread |
Contributor
Author
|
吔,copilot不能自动更改吗,那我手动push一下 |
Contributor
Author
|
就这样吧,感觉可以merge了。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
允许饰品提取像其他副本一样连续挑战。
同时精简power.py中的重复代码,将原有的四个函数合并为一个函数。