Преглед изворни кода

fix(Duel): detect MVP share page via share-button image rule

is_battle_win misses the victory MVP share page (no I_WIN/I_D_VICTORY
there): it now also checks I_D_VICTORY_SHARE, a masked template of the
share-button glyphs (mask drops the fogged left edge). Verified on 100
share screenshots (7/10 incidents fire at 0.8, 3 heavy-fog ones don't)
with 0/15 false positives on battle/records/hall screens.
Enough1122 пре 1 месец
родитељ
комит
d638c11ffe

+ 2 - 0
tasks/Duel/assets.py

@@ -60,6 +60,8 @@ class DuelAssets:
 	I_DUEL_HONOR = RuleImage(roi_front=(211,636,20,20), roi_back=(200,601,130,100), threshold=0.8, method="Template matching", file="./tasks/Duel/duel/duel_duel_honor.png")
 	# 队伍试用 
 	I_D_TRY = RuleImage(roi_front=(667,356,111,30), roi_back=(667,356,111,30), threshold=0.8, method="Template matching", file="./tasks/Duel/duel/duel_d_try.png")
+	# 斗技胜利MVP分享页右下分享按钮 
+	I_D_VICTORY_SHARE = RuleImage(roi_front=(1100,580,90,120), roi_back=(1080,560,130,160), threshold=0.8, method="Masked template matching", file="./tasks/Duel/duel/duel_d_victory_share.png")
 
 
 	# Ocr Rule Assets

BIN
tasks/Duel/duel/duel_d_victory_share.png


BIN
tasks/Duel/duel/duel_d_victory_share_mask.png


+ 9 - 0
tasks/Duel/duel/image.json

@@ -187,5 +187,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "队伍试用"
+  },
+  {
+    "itemName": "d_victory_share",
+    "imageName": "duel_d_victory_share.png",
+    "roiFront": "1100,580,90,120",
+    "roiBack": "1080,560,130,160",
+    "method": "Masked template matching",
+    "threshold": 0.8,
+    "description": "斗技胜利MVP分享页右下分享按钮"
   }
 ]

+ 2 - 1
tasks/Duel/script_task.py

@@ -303,7 +303,8 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, DuelAssets, SwitchOnmyoji):
             self.appear(self.I_D_CHECK_BAN)
 
     def is_battle_win(self) -> bool:
-        return self.appear(self.I_WIN) or self.appear(self.I_D_VICTORY)
+        return self.appear(self.I_WIN) or self.appear(self.I_D_VICTORY) or \
+            self.appear(self.I_D_VICTORY_SHARE)
 
     def is_battle_lose(self) -> bool:
         return self.appear(self.I_FALSE) or self.appear(self.I_D_FAIL)