Skip to content

Commit

Permalink
🎨 调整斗技自动上阵单局结束后同时触发周奖励和段位上升时的顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
AquamarineCyan committed Jan 21, 2025
1 parent 3a80000 commit 29f2c87
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- 修改软件图标的加载方式
- 调整素材导入方式
- `assets.json`文件支持(0,0,0,0)格式,表示整个游戏窗口
- 调整`斗技自动上阵`单局结束后同时触发周奖励和段位上升时的顺序

### 修复

Expand Down
17 changes: 14 additions & 3 deletions src/package/douji.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from src.utils.image import RuleImage
from ..utils.adapter import Mouse
from ..utils.event import event_thread
from ..utils.exception import GUIStopException
Expand Down Expand Up @@ -45,6 +46,12 @@ def fighting_once(self):

result = ocr_match_once(self.current_asset_list)
if result is None:
ruleimage = RuleImage(self.global_assets.IMAGE_FAIL)
if ruleimage.match():
logger.ui_warn("失败")
Mouse.click(ruleimage.center_point())
self.done()
return
continue

logger.info(f"current result name: {result.name}")
Expand All @@ -71,6 +78,7 @@ def fighting_once(self):
case self.OCR_INTENTIONAL.name:
logger.ui("手动技能")
Mouse.click(result.match_result.center)
sleep(4)

# 万一对面直接退了呢
case self.global_assets.OCR_CLICK_AND_CONTINUE.name:
Expand All @@ -97,18 +105,21 @@ def fighting_once(self):
msg_title = False

def run(self):
weekly_rewards: int = 0
while self.n < self.max:
if bool(event_thread):
raise GUIStopException

self.fighting_once()
sleep(4)

# 周奖励
if weekly_rewards < 3 and self.check_click(self.global_assets.IMAGE_FINISH, timeout=5):
logger.ui("周奖励")
weekly_rewards += 1

_ocr = RuleOcr(self.OCR_LEVEL_UP)
if result := _ocr.match():
logger.ui("段位上升")
point = RelativePoint(result.center.x, result.center.y + 200)
Mouse.click(point)

# 每周3胜/5胜奖励
self.check_click(self.global_assets.IMAGE_FINISH, timeout=5)
1 change: 0 additions & 1 deletion tests/package/test_rilun.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
class RiLun(Package):
resource_path = "rilun"
resource_list = [
"fighting",
]


Expand Down

0 comments on commit 29f2c87

Please sign in to comment.