Explorar o código

领取战后奖励宝箱

yEs1do %!s(int64=2) %!d(string=hai) anos
pai
achega
2e212b5a13

+ 2 - 0
tasks/Exploration/assets.py

@@ -58,6 +58,8 @@ class ExplorationAssets:
 	I_BOSS_BATTLE_BUTTON = RuleImage(roi_front=(683,256,38,34), roi_back=(0,0,1276,719), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_boss_battle_button.png")
 	I_BOSS_BATTLE_BUTTON = RuleImage(roi_front=(683,256,38,34), roi_back=(0,0,1276,719), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_boss_battle_button.png")
 	# 战后奖励 
 	# 战后奖励 
 	I_BATTLE_REWARD = RuleImage(roi_front=(647,395,31,21), roi_back=(1,1,1278,718), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_battle_reward.png")
 	I_BATTLE_REWARD = RuleImage(roi_front=(647,395,31,21), roi_back=(1,1,1278,718), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_battle_reward.png")
+	# 战后奖励宝箱 
+	I_BATTLE_REWARD_BOX = RuleImage(roi_front=(705,225,55,45), roi_back=(141,68,901,547), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_battle_reward_box.png")
 	# 妖 
 	# 妖 
 	I_EXPLORATION_TITLE = RuleImage(roi_front=(1133,124,47,43), roi_back=(1133,124,47,43), threshold=0.7, method="Template matching", file="./tasks/Exploration/res/res_exploration_title.png")
 	I_EXPLORATION_TITLE = RuleImage(roi_front=(1133,124,47,43), roi_back=(1133,124,47,43), threshold=0.7, method="Template matching", file="./tasks/Exploration/res/res_exploration_title.png")
 	# description 
 	# description 

+ 9 - 0
tasks/Exploration/res/image.json

@@ -125,6 +125,15 @@
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "战后奖励"
     "description": "战后奖励"
   },
   },
+  {
+    "itemName": "battle_reward_box",
+    "imageName": "res_battle_reward_box.png",
+    "roiFront": "705,225,55,45",
+    "roiBack": "141,68,901,547",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "战后奖励宝箱"
+  },
   {
   {
     "itemName": "exploration_title",
     "itemName": "exploration_title",
     "imageName": "res_exploration_title.png",
     "imageName": "res_exploration_title.png",

BIN=BIN
tasks/Exploration/res/res_battle_reward_box.png


+ 4 - 1
tasks/Exploration/script_task.py

@@ -202,6 +202,9 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, ExplorationAssets):
             # 战后奖励
             # 战后奖励
             if self.appear(self.I_BATTLE_REWARD) and not self.appear(self.I_GET_REWARD):
             if self.appear(self.I_BATTLE_REWARD) and not self.appear(self.I_GET_REWARD):
                 self.click(self.I_BATTLE_REWARD)
                 self.click(self.I_BATTLE_REWARD)
+            # 宝箱
+            if self.appear(self.I_BATTLE_REWARD_BOX) and not self.appear(self.I_REWARD):
+                self.click(self.I_BATTLE_REWARD_BOX)
             # boss 战
             # boss 战
             if self.appear_then_click(self.I_BOSS_BATTLE_BUTTON):
             if self.appear_then_click(self.I_BOSS_BATTLE_BUTTON):
                 if self.wait_until_appear(self.I_BATTLE_START, wait_time=5):
                 if self.wait_until_appear(self.I_BATTLE_START, wait_time=5):
@@ -215,7 +218,7 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, ExplorationAssets):
                 else:
                 else:
                     continue
                     continue
             # 滑动
             # 滑动
-            elif self.appear(self.I_E_AUTO_ROTATE_ON) or self.appear(self.I_GET_REWARD):
+            elif self.appear(self.I_E_AUTO_ROTATE_ON) or self.appear(self.I_GET_REWARD) or self.appear(self.I_REWARD):
                 self.swipe(self.S_SWIPE_BACKGROUND_RIGHT)
                 self.swipe(self.S_SWIPE_BACKGROUND_RIGHT)
             # 结束流程
             # 结束流程
             if self.appear(self.I_E_EXPLORATION_CLICK) or self.appear(self.I_EXPLORATION_TITLE):
             if self.appear(self.I_E_EXPLORATION_CLICK) or self.appear(self.I_EXPLORATION_TITLE):