Ver código fonte

feat(task): update EemonEncounter for small boss

runhey 3 anos atrás
pai
commit
4bdfb6090c

+ 7 - 0
tasks/DemonEncounter/assets.py

@@ -10,6 +10,11 @@ from module.atom.list import RuleList
 class DemonEncounterAssets: 
 
 
+	# Click Rule Assets
+	# description 
+	C_DM_BOSS_CLICK = RuleClick(roi_front=(593,274,100,100), roi_back=(593,274,100,100), name="dm_boss_click")
+
+
 	# Image Rule Assets
 	# 地震鲇 
 	I_BOSS_NAMAZU = RuleImage(roi_front=(589,294,100,100), roi_back=(589,294,100,100), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/boss/boss_boss_namazu.png")
@@ -84,6 +89,8 @@ class DemonEncounterAssets:
 	I_DE_LETTER = RuleImage(roi_front=(1236,358,33,35), roi_back=(1177,261,100,294), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_de_letter.png")
 	# 关闭封魔密信 
 	I_LETTER_CLOSE = RuleImage(roi_front=(851,43,45,45), roi_back=(851,43,45,45), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_letter_close.png")
+	# 小鬼王的挑战 
+	I_DE_SMALL_FIRE = RuleImage(roi_front=(1064,549,100,100), roi_back=(1064,549,100,100), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_de_small_fire.png")
 
 
 	# Ocr Rule Assets

+ 8 - 0
tasks/DemonEncounter/boss/click.json

@@ -0,0 +1,8 @@
+[
+  {
+    "itemName": "dm_boss_click",
+    "roiFront": "593,274,100,100",
+    "roiBack": "593,274,100,100",
+    "description": "description"
+  }
+]

BIN
tasks/DemonEncounter/demon/demon_de_defeat_4.png


BIN
tasks/DemonEncounter/demon/demon_de_small_fire.png


+ 9 - 0
tasks/DemonEncounter/demon/image_side.json

@@ -79,5 +79,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "关闭封魔密信"
+  },
+  {
+    "itemName": "de_small_fire",
+    "imageName": "demon_de_small_fire.png",
+    "roiFront": "1064,549,100,100",
+    "roiBack": "1064,549,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "小鬼王的挑战"
   }
 ]

+ 14 - 1
tasks/DemonEncounter/script_task.py

@@ -62,6 +62,8 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets):
                 continue
             if self.appear_then_click(self.I_DE_BOSS, interval=4):
                 continue
+            if self.click(self.C_DM_BOSS_CLICK, interval=1.7):
+                continue
         logger.info('Boss battle start')
         # 点击集结挑战
         while 1:
@@ -239,6 +241,17 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets):
             if not self.appear(self.I_DE_LOCATION):
                 logger.info('Battle Start')
                 break
+            if self.appear(self.I_DE_SMALL_FIRE):
+                # 小鬼王
+                logger.info('Small Boss')
+                while 1:
+                    self.screenshot()
+                    if not self.appear(self.I_DE_SMALL_FIRE):
+                        break
+                    if self.appear_then_click(self.I_DE_SMALL_FIRE, interval=1):
+                        continue
+                break
+
             if self.click(target_click, interval=1):
                 continue
         if self.run_general_battle(config):
@@ -258,4 +271,4 @@ if __name__ == '__main__':
     d = Device(c)
     t = ScriptTask(c, d)
 
-    t.execute_lantern()
+    t.run()