Skip to content

Commit

Permalink
#179 零号空洞 - 修复周期奖励满的判断
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorReid committed Sep 15, 2024
1 parent c79c107 commit 5a5f939
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/zzz_od/application/hollow_zero/hollow_zero_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def check_first_screen(self) -> OperationRoundResult:
else:
return self.round_retry(result.status, wait=1)


@node_from(from_name='初始画面识别', success=False)
@node_from(from_name='初始画面识别', status='信息')
@operation_node(name='传送')
def tp(self) -> OperationRoundResult:
Expand Down
11 changes: 11 additions & 0 deletions src/zzz_od/hollow_zero/hollow_battle.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ def after_battle(self) -> OperationRoundResult:
time.sleep(2) # 第一次稍等等一段时间 避免按键还不能响应
screen = self.screenshot()

result = self.round_by_find_area(screen, '零号空洞-战斗', '关键进展-丁尼奖励')
if not result.is_success:
# 领满奖励了
self.ctx.hollow_zero_record.period_reward_complete = True

# 有时候可能会识别到背景上的挑战结果 这时候也尝试点
result = self.round_by_find_and_click_area(screen, '零号空洞-战斗', '结算周期上限-确认')
if result.is_success:
Expand All @@ -220,6 +225,12 @@ def after_battle(self) -> OperationRoundResult:
@node_from(from_name='自动战斗', status='普通战斗-完成')
@operation_node(name='普通战斗-完成')
def mission_complete(self) -> OperationRoundResult:
screen = self.screenshot()

result = self.round_by_find_area(screen, '零号空洞-战斗', '通关-丁尼奖励')
if not result.is_success:
# 领满奖励了
self.ctx.hollow_zero_record.period_reward_complete = True
# 在battle_context里会判断这个的出现
# 找到后稍微等待 按钮刚出来的时候按没有用
return self.round_success(status='普通战斗-完成', wait=2)
Expand Down
5 changes: 5 additions & 0 deletions src/zzz_od/hollow_zero/hollow_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ def _check_extra_task_finished(self, screen: MatLike, current_map: HollowZeroMap
:return:
"""
level_info = self.ctx.hollow.level_info

if self.ctx.hollow_zero_record.is_finished_by_day():
# 已经完成了
return True

# 完成指定次数后才会触发刷业绩的选项
if not self.ctx.hollow_zero_record.is_finished_by_weekly_times():
return False
Expand Down

0 comments on commit 5a5f939

Please sign in to comment.