Kaynağa Gözat

feat: Added two sets of soul switching options to the Eternal Sea.

Chino dentist Ko 2 yıl önce
ebeveyn
işleme
b2f76adeb8
2 değiştirilmiş dosya ile 17 ekleme ve 1 silme
  1. 3 0
      tasks/EternitySea/config.py
  2. 14 1
      tasks/EternitySea/script_task.py

+ 3 - 0
tasks/EternitySea/config.py

@@ -4,6 +4,7 @@
 from pydantic import BaseModel, Field
 from enum import Enum
 from datetime import datetime, time
+from tasks.Component.SwitchSoul.switch_soul_config import SwitchSoulConfig
 
 from tasks.Component.config_scheduler import Scheduler
 from tasks.Component.config_base import ConfigBase, Time
@@ -31,4 +32,6 @@ class EternitySea(ConfigBase):
     scheduler: Scheduler = Field(default_factory=Scheduler)
     eternity_sea_config: EternitySeaConfig = Field(default_factory=EternitySeaConfig)
     general_battle_config: GeneralBattleConfig = Field(default_factory=GeneralBattleConfig)
+    switch_soul_config_1: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig)
+    switch_soul_config_2: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig)
 

+ 14 - 1
tasks/EternitySea/script_task.py

@@ -7,7 +7,7 @@ from module.exception import TaskEnd
 from module.logger import logger
 
 from tasks.GameUi.game_ui import GameUi, Page
-from tasks.GameUi.page import page_soul_zones
+from tasks.GameUi.page import page_soul_zones, page_shikigami_records
 from tasks.Component.GeneralBattle.general_battle import GeneralBattle
 from tasks.Component.GeneralRoom.general_room import GeneralRoom
 from tasks.Component.GeneralInvite.general_invite import GeneralInvite
@@ -25,7 +25,20 @@ class ScriptTask(
     def task_name(self):
         return "EternitySea"
 
+    def _two_teams_switch_sous(self, config):
+        if config.enable:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul(config.switch_group_team)
+
+        if config.enable_switch_by_name:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul_by_name(config.group_name, config.team_name)
+
     def run(self) -> None:
+        self._two_teams_switch_sous(self._task_config.switch_soul_config_1)
+        self._two_teams_switch_sous(self._task_config.switch_soul_config_2)
         match self._task_config.eternity_sea_config.user_status:
             case UserStatus.ALONE:
                 success = self.run_alone()