浏览代码

fix(task): Supports soul switching for all tasks

runhey 3 年之前
父节点
当前提交
328f7906e4
共有 3 个文件被更改,包括 21 次插入 和 3 次删除
  1. 12 2
      tasks/RealmRaid/script_task.py
  2. 4 0
      tasks/Secret/script_task.py
  3. 5 1
      tasks/Sougenbi/script_task.py

+ 12 - 2
tasks/RealmRaid/script_task.py

@@ -8,9 +8,10 @@ from cached_property import cached_property
 from tasks.base_task import BaseTask
 from tasks.Component.GeneralBattle.general_battle import GeneralBattle
 from tasks.GameUi.game_ui import GameUi
-from tasks.GameUi.page import page_realm_raid, page_main
+from tasks.GameUi.page import page_realm_raid, page_main, page_shikigami_records
 from tasks.RealmRaid.assets import RealmRaidAssets
 from tasks.RealmRaid.config import RealmRaid, RaidMode, AttackNumber, WhenAttackFail
+from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
 
 
 from module.logger import logger
@@ -20,7 +21,7 @@ from module.atom.image import RuleImage
 from module.atom.click import RuleClick
 
 
-class ScriptTask(GeneralBattle, GameUi, RealmRaidAssets):
+class ScriptTask(GeneralBattle, GameUi, SwitchSoul, RealmRaidAssets):
     medal_grid: ImageGrid = None
 
     def run(self):
@@ -118,6 +119,15 @@ class ScriptTask(GeneralBattle, GameUi, RealmRaidAssets):
     # ------------------------------------------------------------------------------------------------------------------
     def run_2(self):
         con = self.config.realm_raid
+        if con.switch_soul_config.enable:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul(con.switch_soul_config.switch_group_team)
+        if con.switch_soul_config.enable_switch_by_name:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul_by_name(con.switch_soul_config.group_name, con.switch_soul_config.team_name)
+
         self.ui_get_current_page()
         self.ui_goto(page_realm_raid)
 

+ 4 - 0
tasks/Secret/script_task.py

@@ -42,6 +42,10 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, SecretAssets):
             self.ui_get_current_page()
             self.ui_goto(page_shikigami_records)
             self.run_switch_soul(secret.switch_soul.switch_group_team)
+        if secret.switch_soul.enable_switch_by_name:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul_by_name(secret.switch_soul.group_name, secret.switch_soul.team_name)
         self.ui_get_current_page()
         self.ui_goto(page_secret_zones)
 

+ 5 - 1
tasks/Sougenbi/script_task.py

@@ -24,9 +24,13 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, SougenbiAssets):
             self.ui_get_current_page()
             self.ui_goto(page_shikigami_records)
             self.run_switch_soul(con.switch_soul_config.switch_group_team)
+        if con.switch_soul_config.enable_switch_by_name:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul_by_name(con.switch_soul_config.group_name, con.switch_soul_config.team_name)
+
         self.ui_get_current_page()
         self.ui_goto(page_soul_zones)
-
         while 1:
             self.screenshot()
             if self.appear(self.I_S_CHECK_SOUGENBI):