Sfoglia il codice sorgente

fix(MetaDemon): Ensure team unlock state before boss battle

blylana 6 giorni fa
parent
commit
09571eb4ee

+ 7 - 0
tasks/Component/GeneralBattle/assets.py

@@ -270,3 +270,10 @@ class GeneralBattleAssets:
 	I_END_FIX_3 = RuleImage(roi_front=(871,278,150,49), roi_back=(119,66,1136,620), threshold=0.85, method="Template matching", file="./tasks/Component/GeneralBattle/gw/gw_end_fix_3.png")
 
 
+	# Image Rule Assets
+	# 显示是锁队伍的图标 
+	I_TEAM_LOCK = RuleImage(roi_front=(1135,379,26,31), roi_back=(728,354,470,341), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/lock/lock_team_lock.png")
+	# 显示是没有锁队伍的图标 
+	I_TEAM_UNLOCK = RuleImage(roi_front=(1136,379,25,27), roi_back=(724,346,472,342), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/lock/lock_team_unlock.png")
+
+

+ 20 - 0
tasks/Component/GeneralBattle/lock/image.json

@@ -0,0 +1,20 @@
+[
+  {
+    "itemName": "team_lock",
+    "imageName": "lock_team_lock.png",
+    "roiFront": "1135,379,26,31",
+    "roiBack": "728,354,470,341",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "显示是锁队伍的图标"
+  },
+  {
+    "itemName": "team_unlock",
+    "imageName": "lock_team_unlock.png",
+    "roiFront": "1136,379,25,27",
+    "roiBack": "724,346,472,342",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "显示是没有锁队伍的图标"
+  }
+]

BIN
tasks/Component/GeneralBattle/lock/lock_team_lock.png


BIN
tasks/Component/GeneralBattle/lock/lock_team_unlock.png


+ 1 - 0
tasks/MetaDemon/script_task.py

@@ -264,6 +264,7 @@ class ScriptTask(RightActivity, Battle, GeneralBattle, SwitchSoul, Star56):
         @return: True 战斗胜利,False 战斗失败
         """
         logger.info('Battle boss')
+        self.ui_click(self.I_TEAM_LOCK, self.I_TEAM_UNLOCK, interval=1.5, timeout=5)
         self.ui_click_until_disappear(self.I_BATTLE_DEMON, interval=1.8)
         # 任务级战斗计数:本场是第几场(和旧日志 Current count 对齐)
         count = runtime.pub_ctx.per_task.count if runtime.pub_ctx else 0