Explorar o código

Merge pull request #875 from yEs1do/fix(GeneralBattle)

修复卡结算问题
huangrunheng hai 1 ano
pai
achega
5ac53ca8ba

+ 11 - 1
tasks/Component/GeneralBattle/assets.py

@@ -108,7 +108,17 @@ class GeneralBattleAssets:
 	# 结算时左下角统计图标 
 	# 结算时左下角统计图标 
 	I_REWARD_STATISTICS = RuleImage(roi_front=(51,629,54,59), roi_back=(51,629,54,59), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_statistics.png")
 	I_REWARD_STATISTICS = RuleImage(roi_front=(51,629,54,59), roi_back=(51,629,54,59), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_statistics.png")
 	# 结算金币 
 	# 结算金币 
-	I_REWARD_GOLD = RuleImage(roi_front=(943,312,97,69), roi_back=(943,312,97,69), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold.png")
+	I_REWARD_GOLD = RuleImage(roi_front=(268,178,97,69), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold.png")
+	# 结算紫蛇皮 
+	I_REWARD_PURPLE_SNAKE_SKIN = RuleImage(roi_front=(403,177,97,73), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_purple_snake_skin.png")
+	# 结算金蛇皮 
+	I_REWARD_GOLD_SNAKE_SKIN = RuleImage(roi_front=(537,176,97,75), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold_snake_skin.png")
+	# 结算四星青吉鬼 
+	I_REWARD_EXP_SOUL_4 = RuleImage(roi_front=(806,177,97,69), roi_back=(254,163,797,261), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_exp_soul_4.png")
+	# 结算五星御魂 
+	I_REWARD_SOUL_5 = RuleImage(roi_front=(266,533,97,20), roi_back=(254,163,797,396), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_soul_5.png")
+	# 结算六星御魂 
+	I_REWARD_SOUL_6 = RuleImage(roi_front=(942,397,97,20), roi_back=(254,163,797,396), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_soul_6.png")
 	# 针对封魔的特殊 
 	# 针对封魔的特殊 
 	I_DE_WIN = RuleImage(roi_front=(472,49,100,100), roi_back=(239,36,399,133), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_de_win.png")
 	I_DE_WIN = RuleImage(roi_front=(472,49,100,100), roi_back=(239,36,399,133), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_de_win.png")
 	# description 
 	# description 

BIN=BIN
tasks/Component/GeneralBattle/gb/gb_reward_exp_soul_4.png


BIN=BIN
tasks/Component/GeneralBattle/gb/gb_reward_gold.png


BIN=BIN
tasks/Component/GeneralBattle/gb/gb_reward_gold_snake_skin.png


BIN=BIN
tasks/Component/GeneralBattle/gb/gb_reward_purple_snake_skin.png


BIN=BIN
tasks/Component/GeneralBattle/gb/gb_reward_soul_5.png


BIN=BIN
tasks/Component/GeneralBattle/gb/gb_reward_soul_6.png


+ 47 - 2
tasks/Component/GeneralBattle/gb/image.json

@@ -182,12 +182,57 @@
   {
   {
     "itemName": "reward_gold",
     "itemName": "reward_gold",
     "imageName": "gb_reward_gold.png",
     "imageName": "gb_reward_gold.png",
-    "roiFront": "943,312,97,69",
-    "roiBack": "943,312,97,69",
+    "roiFront": "268,178,97,69",
+    "roiBack": "254,163,797,261",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "结算金币"
     "description": "结算金币"
   },
   },
+  {
+    "itemName": "reward_purple_snake_skin",
+    "imageName": "gb_reward_purple_snake_skin.png",
+    "roiFront": "403,177,97,73",
+    "roiBack": "254,163,797,261",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算紫蛇皮"
+  },
+  {
+    "itemName": "reward_gold_snake_skin",
+    "imageName": "gb_reward_gold_snake_skin.png",
+    "roiFront": "537,176,97,75",
+    "roiBack": "254,163,797,261",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算金蛇皮"
+  },
+  {
+    "itemName": "reward_exp_soul_4",
+    "imageName": "gb_reward_exp_soul_4.png",
+    "roiFront": "806,177,97,69",
+    "roiBack": "254,163,797,261",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算四星青吉鬼"
+  },
+  {
+    "itemName": "reward_soul_5",
+    "imageName": "gb_reward_soul_5.png",
+    "roiFront": "266,533,97,20",
+    "roiBack": "254,163,797,396",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算五星御魂"
+  },
+  {
+    "itemName": "reward_soul_6",
+    "imageName": "gb_reward_soul_6.png",
+    "roiFront": "942,397,97,20",
+    "roiBack": "254,163,797,396",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "结算六星御魂"
+  },
   {
   {
     "itemName": "de_win",
     "itemName": "de_win",
     "imageName": "gb_de_win.png",
     "imageName": "gb_de_win.png",

+ 18 - 3
tasks/Component/GeneralBattle/general_battle.py

@@ -223,10 +223,25 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
             self.screenshot()
             self.screenshot()
             # 如果出现领奖励
             # 如果出现领奖励
             action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
             action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
-            if self.appear_then_click(self.I_REWARD, action=action_click, interval=1.5) or \
-                    self.appear_then_click(self.I_REWARD_GOLD, action=action_click, interval=1.5):
+            if (self.appear_then_click(self.I_REWARD, action=action_click, interval=1.5) or
+                self.appear_then_click(self.I_REWARD_GOLD, action=action_click, interval=1.5)#  or
+                # self.appear_then_click(self.I_REWARD_STATISTICS, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_PURPLE_SNAKE_SKIN, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_GOLD_SNAKE_SKIN, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_EXP_SOUL_4, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_SOUL_5, action=action_click, interval=1.5) or
+                # self.appear_then_click(self.I_REWARD_SOUL_6, action=action_click, interval=1.5)
+                ):
                 continue
                 continue
-            if not self.appear(self.I_REWARD) and not self.appear(self.I_REWARD_GOLD):
+            if (not self.appear(self.I_REWARD) and
+                not self.appear(self.I_REWARD_GOLD)#  and
+                # not self.appear(self.I_REWARD_STATISTICS) and
+                # not self.appear(self.I_REWARD_PURPLE_SNAKE_SKIN) and
+                # not self.appear(self.I_REWARD_GOLD_SNAKE_SKIN) and
+                # not self.appear(self.I_REWARD_EXP_SOUL_4) and
+                # not self.appear(self.I_REWARD_SOUL_5) and
+                # not self.appear(self.I_REWARD_SOUL_6)
+                ):
                 break
                 break
 
 
         return win
         return win