Procházet zdrojové kódy

feat(costume main): Add '烬夜韶阁' #182

huangrunheng před 2 roky
rodič
revize
b75071cdca

+ 13 - 0
tasks/Component/Costume/assets.py

@@ -36,3 +36,16 @@ class CostumeAssets:
 	I_PET_HOUSE_2 = RuleImage(roi_front=(1243,458,29,40), roi_back=(1198,396,81,147), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main2/main2_pet_house_2.png")
 	I_PET_HOUSE_2 = RuleImage(roi_front=(1243,458,29,40), roi_back=(1198,396,81,147), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main2/main2_pet_house_2.png")
 
 
 
 
+	# Image Rule Assets
+	# description 
+	I_CHECK_MAIN_3 = RuleImage(roi_front=(390,122,48,55), roi_back=(149,108,1002,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main3/main3_check_main_3.png")
+	# description 
+	I_MAIN_GOTO_EXPLORATION_3 = RuleImage(roi_front=(785,127,50,54), roi_back=(413,113,847,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main3/main3_main_goto_exploration_3.png")
+	#  
+	I_MAIN_GOTO_SUMMON_3 = RuleImage(roi_front=(1072,165,50,62), roi_back=(589,146,659,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main3/main3_main_goto_summon_3.png")
+	# description 
+	I_MAIN_GOTO_TOWN_3 = RuleImage(roi_front=(659,263,47,60), roi_back=(512,242,555,86), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main3/main3_main_goto_town_3.png")
+	# description 
+	I_PET_HOUSE_3 = RuleImage(roi_front=(1136,423,29,40), roi_back=(1038,409,241,73), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main3/main3_pet_house_3.png")
+
+

+ 1 - 0
tasks/Component/Costume/config.py

@@ -8,6 +8,7 @@ class MainType(str, Enum):
     COSTUME_MAIN = 'costume_main'  # 初语谧景
     COSTUME_MAIN = 'costume_main'  # 初语谧景
     COSTUME_MAIN_1 = 'costume_main_1'  # 织梦莲庭
     COSTUME_MAIN_1 = 'costume_main_1'  # 织梦莲庭
     COSTUME_MAIN_2 = 'costume_main_2'  # 琼夜淬光
     COSTUME_MAIN_2 = 'costume_main_2'  # 琼夜淬光
+    COSTUME_MAIN_3 = 'costume_main_3'  # 烬夜韶阁
 
 
 
 
 class CostumeConfig(BaseModel):
 class CostumeConfig(BaseModel):

+ 5 - 0
tasks/Component/Costume/costume_base.py

@@ -18,6 +18,11 @@ main_costume_model = {
                               'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_2',
                               'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_2',
                               'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_2',
                               'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_2',
                               'I_PET_HOUSE': 'I_PET_HOUSE_2', },
                               'I_PET_HOUSE': 'I_PET_HOUSE_2', },
+    MainType.COSTUME_MAIN_3: {'I_CHECK_MAIN': 'I_CHECK_MAIN_3',
+                              'I_MAIN_GOTO_EXPLORATION': 'I_MAIN_GOTO_EXPLORATION_3',
+                              'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_3',
+                              'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_3',
+                              'I_PET_HOUSE': 'I_PET_HOUSE_3', },
 }
 }
 
 
 
 

+ 47 - 0
tasks/Component/Costume/main3/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "check_main_3",
+    "imageName": "main3_check_main_3.png",
+    "roiFront": "390,122,48,55",
+    "roiBack": "149,108,1002,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_exploration_3",
+    "imageName": "main3_main_goto_exploration_3.png",
+    "roiFront": "785,127,50,54",
+    "roiBack": "413,113,847,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_summon_3",
+    "imageName": "main3_main_goto_summon_3.png",
+    "roiFront": "1072,165,50,62",
+    "roiBack": "589,146,659,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": ""
+  },
+  {
+    "itemName": "main_goto_town_3",
+    "imageName": "main3_main_goto_town_3.png",
+    "roiFront": "659,263,47,60",
+    "roiBack": "512,242,555,86",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "pet_house_3",
+    "imageName": "main3_pet_house_3.png",
+    "roiFront": "1136,423,29,40",
+    "roiBack": "1038,409,241,73",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

binární
tasks/Component/Costume/main3/main2_check_main_3.png


binární
tasks/Component/Costume/main3/main2_main_goto_exploration_3.png


binární
tasks/Component/Costume/main3/main2_main_goto_summon_3.png


binární
tasks/Component/Costume/main3/main2_main_goto_town_3.png


binární
tasks/Component/Costume/main3/main2_pet_house_3.png


+ 2 - 0
tasks/WantedQuests/assets.py

@@ -13,6 +13,8 @@ class WantedQuestsAssets:
 	# Click Rule Assets
 	# Click Rule Assets
 	# 秘闻的挑战对话 
 	# 秘闻的挑战对话 
 	C_SECRET_CHAT = RuleClick(roi_front=(597,296,59,100), roi_back=(597,296,59,100), name="secret_chat")
 	C_SECRET_CHAT = RuleClick(roi_front=(597,296,59,100), roi_back=(597,296,59,100), name="secret_chat")
+	# 特殊的庭院需要点击,然后才能找到这个悬赏 
+	C_SPECIAL_MAIN = RuleClick(roi_front=(409,572,32,30), roi_back=(404,569,41,35), name="special_main")
 
 
 
 
 	# Ocr Rule Assets
 	# Ocr Rule Assets

+ 6 - 0
tasks/WantedQuests/click.json

@@ -4,5 +4,11 @@
     "roiFront": "597,296,59,100",
     "roiFront": "597,296,59,100",
     "roiBack": "597,296,59,100",
     "roiBack": "597,296,59,100",
     "description": "秘闻的挑战对话"
     "description": "秘闻的挑战对话"
+  },
+  {
+    "itemName": "special_main",
+    "roiFront": "409,572,32,30",
+    "roiBack": "404,569,41,35",
+    "description": "特殊的庭院需要点击,然后才能找到这个悬赏"
   }
   }
 ]
 ]

+ 13 - 0
tasks/WantedQuests/script_task.py

@@ -19,6 +19,7 @@ from tasks.Component.GeneralInvite.general_invite import GeneralInvite
 from tasks.Secret.script_task import ScriptTask as SecretScriptTask
 from tasks.Secret.script_task import ScriptTask as SecretScriptTask
 from tasks.WantedQuests.config import WantedQuestsConfig
 from tasks.WantedQuests.config import WantedQuestsConfig
 from tasks.WantedQuests.assets import WantedQuestsAssets
 from tasks.WantedQuests.assets import WantedQuestsAssets
+from tasks.Component.Costume.config import MainType
 
 
 class ScriptTask(SecretScriptTask, GeneralInvite, WantedQuestsAssets):
 class ScriptTask(SecretScriptTask, GeneralInvite, WantedQuestsAssets):
 
 
@@ -117,6 +118,9 @@ class ScriptTask(SecretScriptTask, GeneralInvite, WantedQuestsAssets):
                 continue
                 continue
             if self.appear_then_click(self.I_TRACE_ENABLE, interval=1):
             if self.appear_then_click(self.I_TRACE_ENABLE, interval=1):
                 continue
                 continue
+            if self.special_main and self.click(self.C_SPECIAL_MAIN, interval=3):
+                logger.info('Click special main left to find wanted quests')
+                continue
             if self.appear(self.I_UI_BACK_RED):
             if self.appear(self.I_UI_BACK_RED):
                 if not done_timer.started():
                 if not done_timer.started():
                     done_timer.start()
                     done_timer.start()
@@ -273,6 +277,15 @@ class ScriptTask(SecretScriptTask, GeneralInvite, WantedQuestsAssets):
         invite(self.I_WQ_INVITE_2)
         invite(self.I_WQ_INVITE_2)
         invite(self.I_WQ_INVITE_3)
         invite(self.I_WQ_INVITE_3)
 
 
+    @cached_property
+    def special_main(self) -> bool:
+        # 特殊的庭院需要点一下,左边然后才能找到图标
+        main_type = self.config.global_game.costume_config.costume_main_type
+        if main_type == MainType.COSTUME_MAIN_3:
+            return True
+        return False
+
+
 if __name__ == '__main__':
 if __name__ == '__main__':
     from module.config.config import Config
     from module.config.config import Config
     from module.device.device import Device
     from module.device.device import Device