Skip to content

Commit

Permalink
Feat: support reward
Browse files Browse the repository at this point in the history
  • Loading branch information
moesnow committed Sep 2, 2024
1 parent 02d9f80 commit 050cc38
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions assets/docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v2.4.0

### 新功能
- 支持 差分宇宙
- 支持 “智识之蕾•匹诺康尼大剧院” 关卡
- 支持 “云璃” 、 “三月七(虚数)” 、 “开拓者(虚数)”
- 飞书 支持发送截图 [#310](https://github.com/moesnow/March7thAssistant/pull/310)
Expand Down
17 changes: 11 additions & 6 deletions tasks/weekly/universe.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def finalize_simulation(save):
screen.wait_for_screen_change('main')
Universe.get_reward()

if cfg.universe_bonus_enable and cfg.break_down_level_four_relicset:
if cfg.universe_category != "divergent" and cfg.universe_bonus_enable and cfg.break_down_level_four_relicset:
Relicset.run()

@staticmethod
Expand Down Expand Up @@ -180,21 +180,26 @@ def start(nums=cfg.universe_count, save=True):

@staticmethod
def get_reward():
if cfg.universe_category == "divergent":
# 差分宇宙暂不领取奖励
return
log.info("开始领取奖励")
if auto.find_element("./assets/images/share/base/F.png", "image", 0.9, crop=(998.0 / 1920, 473.0 / 1080, 392.0 / 1920, 296.0 / 1080)):
auto.press_key("f")
screen.wait_for_screen_change('universe_main')
if cfg.universe_category == "divergent":
screen.wait_for_screen_change('divergent_main')
else:
screen.wait_for_screen_change('universe_main')
else:
screen.change_to('universe_main')
if cfg.universe_category == "divergent":
screen.change_to('divergent_main')
else:
screen.change_to('universe_main')
time.sleep(1)
if auto.click_element("./assets/images/share/base/RedExclamationMark.png", "image", 0.9, crop=(0 / 1920, 877.0 / 1080, 422.0 / 1920, 202.0 / 1080)):
if auto.click_element("./assets/images/zh_CN/universe/one_key_receive.png", "image", 0.9, max_retries=10):
if auto.find_element("./assets/images/zh_CN/base/click_close.png", "image", 0.8, max_retries=10):
Base.send_notification_with_screenshot(cfg.notify_template['SimulatedUniverseRewardClaimed'])
auto.click_element("./assets/images/zh_CN/base/click_close.png", "image", 0.8, max_retries=10)
time.sleep(1)
auto.press_key("esc")
return
Base.send_notification_with_screenshot(cfg.notify_template['SimulatedUniverseCompleted'])

Expand Down

0 comments on commit 050cc38

Please sign in to comment.