Explorar el Código

feat(task) save bondling fairy land

runhey hace 3 años
padre
commit
2df76189e6

+ 19 - 0
tasks/BondlingFairyland/assets.py

@@ -21,6 +21,8 @@ class BondlingFairylandAssets:
 	C_STONE_4 = RuleClick(roi_front=(911,487,27,24), roi_back=(0,0,100,100), name="stone_4")
 	C_STONE_4 = RuleClick(roi_front=(911,487,27,24), roi_back=(0,0,100,100), name="stone_4")
 	# description 
 	# description 
 	C_STONE_5 = RuleClick(roi_front=(1041,494,25,25), roi_back=(0,0,100,100), name="stone_5")
 	C_STONE_5 = RuleClick(roi_front=(1041,494,25,25), roi_back=(0,0,100,100), name="stone_5")
+	# description 
+	C_CAP_SUCCESS = RuleClick(roi_front=(317,102,378,363), roi_back=(0,0,100,100), name="cap_success")
 
 
 
 
 	# Ocr Rule Assets
 	# Ocr Rule Assets
@@ -81,6 +83,10 @@ class BondlingFairylandAssets:
 	I_LITTLE_KURO = RuleImage(roi_front=(478,334,77,70), roi_back=(462,318,108,102), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_little_kuro.png")
 	I_LITTLE_KURO = RuleImage(roi_front=(478,334,77,70), roi_back=(462,318,108,102), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_little_kuro.png")
 	# 火灵 
 	# 火灵 
 	I_AZURE_BASAN = RuleImage(roi_front=(654,260,48,46), roi_back=(631,235,91,92), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_azure_basan.png")
 	I_AZURE_BASAN = RuleImage(roi_front=(654,260,48,46), roi_back=(631,235,91,92), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_azure_basan.png")
+	# description 
+	I_CAP_SUCCESS = RuleImage(roi_front=(210,445,22,21), roi_back=(210,445,22,21), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_cap_success.png")
+	# description 
+	I_CAP_FAILURE = RuleImage(roi_front=(1192,608,30,39), roi_back=(1192,608,30,39), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_cap_failure.png")
 
 
 
 
 	# Image Rule Assets
 	# Image Rule Assets
@@ -110,8 +116,21 @@ class BondlingFairylandAssets:
 	I_CLICK_CAPTION = RuleImage(roi_front=(177,625,59,51), roi_back=(177,625,59,51), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_click_caption.png")
 	I_CLICK_CAPTION = RuleImage(roi_front=(177,625,59,51), roi_back=(177,625,59,51), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_click_caption.png")
 
 
 
 
+	# Click Rule Assets
+	# description 
+	C_LEFT_1 = RuleClick(roi_front=(167,198,128,265), roi_back=(167,198,128,265), name="left_1")
+	# description 
+	C_LEFT_2 = RuleClick(roi_front=(423,190,139,277), roi_back=(423,190,139,277), name="left_2")
+	# description 
+	C_LEFT_3 = RuleClick(roi_front=(676,176,159,307), roi_back=(676,176,159,307), name="left_3")
+	# description 
+	C_LEFT_4 = RuleClick(roi_front=(923,198,155,279), roi_back=(923,198,155,279), name="left_4")
+
+
 	# Image Rule Assets
 	# Image Rule Assets
 	# description 
 	# description 
 	I_STONE_ENTER = RuleImage(roi_front=(1167,472,38,41), roi_back=(1167,472,38,41), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/stone/stone_stone_enter.png")
 	I_STONE_ENTER = RuleImage(roi_front=(1167,472,38,41), roi_back=(1167,472,38,41), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/stone/stone_stone_enter.png")
+	# description 
+	I_STONE_SURE = RuleImage(roi_front=(1152,601,75,70), roi_back=(1152,601,75,70), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/stone/stone_stone_sure.png")
 
 
 
 

+ 86 - 0
tasks/BondlingFairyland/battle.py

@@ -0,0 +1,86 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+import random
+
+from tasks.Component.GeneralBattle.general_battle import GeneralBattle
+from tasks.BondlingFairyland.assets import BondlingFairylandAssets
+from tasks.BondlingFairyland.config_battle import BattleConfig
+
+from module.logger import logger
+
+
+
+
+class BondlingBattle(GeneralBattle, BondlingFairylandAssets):
+
+    def run_battle(self, battle_config: BattleConfig) -> bool:
+        """
+        :return: 如果结契成功返回True,否则返回False
+        """
+        logger.hr("General battle start", 2)
+        self.current_count += 1
+        logger.info(f"Current count: {self.current_count}")
+
+        if self.check_load():
+            # 首先要判断进入战斗的界面
+            self.green_mark(battle_config.green_enable, battle_config.green_mark)
+
+        # 进入战斗过程
+        return self.catch_battle_wait(battle_config.random_click_swipt_enable)
+
+
+    def check_load(self) -> bool:
+        """
+        检查战斗时候的加载动画
+        如何是还在加载种,有那个要准备的按钮,就返回True
+        如果已经进入战斗了,就返回False
+        :return:
+        """
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_BUFF):
+                return True
+            if self.appear(self.I_EXIT):
+                return False
+
+    def catch_battle_wait(self, random_click_swipt_enable: bool) -> bool:
+        """
+        重写一个 战斗等待
+        :return: 如果捕获成功返回True,否则返回False
+        """
+        self.device.stuck_record_add('BATTLE_STATUS_S')
+        # 战斗过程 随机点击和滑动 防封
+        logger.info("Start battle process")
+        win: bool = False
+        while 1:
+            self.screenshot()
+            # 如果捕获成功
+            if self.appear_then_click(self.I_CAP_SUCCESS, action=self.C_CAP_SUCCESS,  interval=1):
+                win = True
+            # 如果捕获失败
+            if self.appear_then_click(self.I_CAP_FAILURE, action=self.C_CAP_SUCCESS, interval=1):
+                win = False
+
+            # 如果领奖励
+            if self.appear(self.I_REWARD, threshold=0.6):
+                break
+            # 如果开启战斗过程随机滑动
+            if random_click_swipt_enable:
+                self.random_click_swipt()
+
+        # 确定获得奖励 无论是胜利还是失败
+        if win:
+            logger.info("Catch success")
+        else:
+            logger.info("Catch failure")
+        while 1:
+            self.screenshot()
+            # 如果出现领奖励
+            action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
+            if self.appear_then_click(self.I_REWARD, action=action_click, interval=1.5):
+                continue
+            if not self.appear(self.I_REWARD):
+                break
+        logger.info("Get reward")
+        return win

+ 18 - 0
tasks/BondlingFairyland/capture/capture.json

@@ -34,5 +34,23 @@
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "火灵"
     "description": "火灵"
+  },
+  {
+    "itemName": "cap_success",
+    "imageName": "capture_cap_success.png",
+    "roiFront": "210,445,22,21",
+    "roiBack": "210,445,22,21",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "cap_failure",
+    "imageName": "capture_cap_failure.png",
+    "roiFront": "1192,608,30,39",
+    "roiBack": "1192,608,30,39",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
   }
   }
 ]
 ]

+ 6 - 0
tasks/BondlingFairyland/click.json

@@ -28,5 +28,11 @@
     "roiFront": "1041,494,25,25",
     "roiFront": "1041,494,25,25",
     "roiBack": "0,0,100,100",
     "roiBack": "0,0,100,100",
     "description": "description"
     "description": "description"
+  },
+  {
+    "itemName": "cap_success",
+    "roiFront": "317,102,378,363",
+    "roiBack": "0,0,100,100",
+    "description": "description"
   }
   }
 ]
 ]

+ 6 - 4
tasks/BondlingFairyland/config.py

@@ -7,6 +7,7 @@ from datetime import datetime, time
 
 
 from tasks.Component.config_scheduler import Scheduler
 from tasks.Component.config_scheduler import Scheduler
 from tasks.Component.config_base import ConfigBase
 from tasks.Component.config_base import ConfigBase
+from tasks.BondlingFairyland.config_battle import BattleConfig
 
 
 class BondlingMode(str, Enum):
 class BondlingMode(str, Enum):
     MODE1 = 'mode_1'
     MODE1 = 'mode_1'
@@ -37,18 +38,19 @@ class BondlingConfig(ConfigBase):
 class BondlingSwitchSoul(ConfigBase):
 class BondlingSwitchSoul(ConfigBase):
     auto_switch_soul: bool = Field(default=False, description='auto_switch_soul_help')
     auto_switch_soul: bool = Field(default=False, description='auto_switch_soul_help')
     # 镇墓兽 config
     # 镇墓兽 config
-    tomb_guard_switch: str = Field(default='1,1', description='tomb_guard_switch_help')
+    tomb_guard_switch: str = Field(default='-1,-1', description='tomb_guard_switch_help')
     # 茨球 config
     # 茨球 config
-    snowball_switch: str = Field(default='1,1', description='snowball_switch_help')
+    snowball_switch: str = Field(default='-1,-1', description='snowball_switch_help')
     # 小黑 config
     # 小黑 config
-    little_kuro_switch: str = Field(default='1,1', description='little_kuro_switch_help')
+    little_kuro_switch: str = Field(default='-1,-1', description='little_kuro_switch_help')
     # 火灵 config
     # 火灵 config
-    azure_basan_switch: str = Field(default='1,1', description='azure_basan_switch_help')
+    azure_basan_switch: str = Field(default='-1,-1', description='azure_basan_switch_help')
 
 
 class BondlingFairyland(ConfigBase):
 class BondlingFairyland(ConfigBase):
     scheduler: Scheduler = Field(default_factory=Scheduler)
     scheduler: Scheduler = Field(default_factory=Scheduler)
     bondling_config: BondlingConfig = Field(default_factory=BondlingConfig)
     bondling_config: BondlingConfig = Field(default_factory=BondlingConfig)
     bondling_switch_soul: BondlingSwitchSoul = Field(default_factory=BondlingSwitchSoul)
     bondling_switch_soul: BondlingSwitchSoul = Field(default_factory=BondlingSwitchSoul)
+    battle_config: BattleConfig = Field(default_factory=BattleConfig)
 
 
 
 
 
 

+ 14 - 0
tasks/BondlingFairyland/config_battle.py

@@ -0,0 +1,14 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from pydantic import BaseModel, Field
+
+from tasks.Component.GeneralBattle.config_general_battle import GreenMarkType
+
+class BattleConfig(BaseModel):
+    # 是否开启绿标
+    green_enable: bool = Field(default=False, description='green_enable_help')
+    # 选哪一个绿标
+    green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='green_mark_help')
+    # 是否启动战斗时随机点击或者随机滑动
+    random_click_swipt_enable: bool = Field(default=False, description='random_click_swipt_enable_help')

+ 179 - 12
tasks/BondlingFairyland/script_task.py

@@ -1,22 +1,27 @@
 # This Python file uses the following encoding: utf-8
 # This Python file uses the following encoding: utf-8
 # @author runhey
 # @author runhey
 # github https://github.com/runhey
 # github https://github.com/runhey
+
 import numpy as np
 import numpy as np
+from time import sleep
 from cached_property import cached_property
 from cached_property import cached_property
+from datetime import datetime, timedelta
 
 
 from tasks.base_task import BaseTask
 from tasks.base_task import BaseTask
-from tasks.Component.GeneralBattle.general_battle import GeneralBattle
 from tasks.GameUi.game_ui import GameUi
 from tasks.GameUi.game_ui import GameUi
 from tasks.BondlingFairyland.config import (BondlingFairyland, BondlingMode,
 from tasks.BondlingFairyland.config import (BondlingFairyland, BondlingMode,
                                             BondlingClass,
                                             BondlingClass,
                                             BondlingSwitchSoul, BondlingConfig)
                                             BondlingSwitchSoul, BondlingConfig)
 from tasks.BondlingFairyland.assets import BondlingFairylandAssets
 from tasks.BondlingFairyland.assets import BondlingFairylandAssets
+from tasks.BondlingFairyland.battle import BondlingBattle
+from tasks.BondlingFairyland.config_battle import BattleConfig
 from tasks.Component.SwitchSoul.switch_soul import SwitchSoul, switch_parser
 from tasks.Component.SwitchSoul.switch_soul import SwitchSoul, switch_parser
+from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
 
 
 from module.atom.image import RuleImage
 from module.atom.image import RuleImage
 from module.logger import logger
 from module.logger import logger
 
 
-class ScriptTask(GameUi, GeneralBattle, SwitchSoul, BondlingFairylandAssets):
+class ScriptTask(GameUi, BondlingBattle, SwitchSoul, BondlingFairylandAssets):
 
 
     ball_pos_list = [None, None, None, None, None]  # 用于记录每一个位置的球是否出现
     ball_pos_list = [None, None, None, None, None]  # 用于记录每一个位置的球是否出现
     first_catch = True  # 用于记录是否是第一次捕捉
     first_catch = True  # 用于记录是否是第一次捕捉
@@ -24,12 +29,92 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, BondlingFairylandAssets):
     def run(self):
     def run(self):
         pass
         pass
 
 
-    def run_search(self):
+    def run_stone(self, bondling_stone_enable: bool, bondling_stone_class: BondlingClass):
+        """
+        使用结契石 进行召唤 契灵
+        :param bondling_stone_class:
+        :return:
+        (0) 不开启使用结契石,(探查界面)返回False
+        (1) 五个球满了,(探查界面)返回True
+        (2) 没有结契石了,(探查界面)返回False
+        """
+        if not bondling_stone_enable:
+            return False
+
+        while 1:
+            self.screenshot()
+            # 检查是不是在探查界面,
+            if not self.in_search_ui(screenshot=False):
+                continue
+            # 如果没有石头了
+            cu, res, total = self.O_B_STONE_NUMBER.ocr(self.device.image)
+            if cu == 0 and cu + res == total:
+                logger.warning(f'No bondling stone')
+                return False
+            # 如果五个球满了
+            click_count = 0
+            while 1:
+                self.screenshot()
+                if click_count >= 2:
+                    logger.info(f'Ball is full')
+                    return True
+                if not self.appear(self.I_STONE_ENTER):
+                    # 这时进入到了召唤的界面
+                    self.wait_until_appear(self.I_STONE_SURE)
+                    action_click = None
+                    match bondling_stone_class:
+                        case BondlingClass.LITTLE_KURO: action_click = self.C_LEFT_1
+                        case BondlingClass.SNOWBALL: action_click = self.C_LEFT_2
+                        case BondlingClass.AZURE_BASAN: action_click = self.C_LEFT_3
+                        case BondlingClass.TOMB_GUARD: action_click = self.C_LEFT_4
+                    sleep(0.5)
+                    self.click(action_click)
+
+                    # 点击召唤
+                    while 1:
+                        self.screenshot()
+                        if not self.appear(self.I_STONE_SURE):
+                            break
+                        if self.appear_then_click(self.I_STONE_SURE, interval=1):
+                            continue
+                    break
+
+
+
+                if self.appear_then_click(self.I_STONE_ENTER, interval=1):
+                    click_count += 1
+                    continue
+
+    def run_search(self, bondling_config: BondlingConfig):
         """
         """
         运行探查
         运行探查
         :return:
         :return:
+        (1) 超出战斗的次数的了,(探查页面)返回False
+        (2) 超过时间限制了,(探查页面)返回False
+        (3) 打满五只球了,(探查界面)返回True
         """
         """
-    def run_catch(self, bondling_config: BondlingConfig, bondling_switch_soul: BondlingSwitchSoul):
+        while 1:
+            # 检查是不是在探查界面,
+            if not self.in_search_ui(screenshot=True):
+                continue
+            # 检查是否有挑战次数
+            if self.current_count >= bondling_config.limit_count:
+                logger.warning(f'No challenge count, exit')
+                return False
+            # 检查是否到了限制时间
+            if datetime.now() - self.start_time >= self.limit_time:
+                logger.warning(f'No time, exit')
+                return False
+
+            if self.click_search():
+                self.run_general_battle(self.general_battle_config)
+            else:
+                logger.warning(f'Full five ball')
+                return True
+
+    def run_catch(self, bondling_config: BondlingConfig,
+                        bondling_switch_soul: BondlingSwitchSoul,
+                        battle_config: BattleConfig):
         """
         """
         执行捕捉的(确保进入了结契界面)
         执行捕捉的(确保进入了结契界面)
         :return:
         :return:
@@ -81,6 +166,33 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, BondlingFairylandAssets):
             switch_soul(bondling_class)
             switch_soul(bondling_class)
 
 
 
 
+        # 开始执行循环
+        while 1:
+            self.screenshot()
+
+            # 如果不在结契界面,就等待
+            if not self.in_catch_ui():
+                continue
+
+            # 检查是否有盘子
+            if not check_plate_number(target_plate):
+                logger.warning(f'No plate number, exit')
+                return False
+            # 检查是否有挑战次数
+            if self.current_count >= bondling_config.limit_count:
+                logger.warning(f'No challenge count, exit')
+                return False
+            # 检查是否到了限制时间
+            if datetime.now() - self.start_time >= self.limit_time:
+                logger.warning(f'No time, exit')
+                return False
+            # ok 就进行挑战
+            self.click_fire()
+            if self.run_battle(battle_config):
+                return True
+
+
+
 
 
     @cached_property
     @cached_property
     def balls_target(self) -> list[RuleImage]:
     def balls_target(self) -> list[RuleImage]:
@@ -151,13 +263,6 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, BondlingFairylandAssets):
 
 
         return False
         return False
 
 
-    def click_search(self) -> bool:
-        """
-        点击探查
-        :return: 如果进入战斗返回True,如果五个球满了返回False
-        """
-        return False
-
     def ball_click(self, index: int) -> bool:
     def ball_click(self, index: int) -> bool:
         """
         """
         点击球, 进去结契战斗的界面
         点击球, 进去结契战斗的界面
@@ -290,7 +395,67 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, BondlingFairylandAssets):
             return BondlingClass.AZURE_BASAN
             return BondlingClass.AZURE_BASAN
         return None
         return None
 
 
+    @cached_property
+    def limit_time(self) -> timedelta:
+        if not self.config.bondling_fairyland.bondling_config.limit_time:
+            return timedelta(minutes=20)
+        limit_time = self.config.bondling_fairyland.bondling_config.limit_time
+        return timedelta(hours=limit_time.hour, minutes=limit_time.minute, seconds=limit_time.second)
+
+    def click_fire(self):
+        """
+        点击 挑战, 主要是结契时的挑战
+        """
+        while 1:
+            self.screenshot()
+            if not self.appear(self.I_BALL_FIRE):
+                break
+            if self.appear_then_click(self.I_BALL_FIRE, interval=1):
+                continue
+
+    def in_catch_ui(self, screenshot=False) -> bool:
+        """
+        判断是否在结契的总界面
+        :return:
+        """
+        if screenshot:
+            self.screenshot()
+        return self.appear(self.I_BALL_FIRE)
+
+    def in_search_ui(self, screenshot=False) -> bool:
+        """
+        判断是否在探查的总界面
+        :return:
+        """
+        if screenshot:
+            self.screenshot()
+        return self.appear(self.I_BF_STORE)
+
+    def click_search(self) -> bool:
+        """
+        点击探查
+        :return: 如果五个球满了 就返回False。如果进入战斗不出现点击按钮那就是返回True
+        """
+        count = 0
+        while 1:
+            self.screenshot()
+            if count >= 3:
+                return False
+            if not self.appear(self.I_BF_SEARSH):
+                return True
+            if self.appear_then_click(self.I_BF_SEARSH, interval=2):
+                count += 1
+                continue
+        return False
 
 
+    @cached_property
+    def general_battle_config(self):
+        gbc = GeneralBattleConfig()
+        gbc.lock_team_enable = True
+        gbc.preset_enable = False
+        gbc.green_enable = False
+        gbc.random_click_swipt_enable = False
+        return gbc
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':
     from module.config.config import Config
     from module.config.config import Config
@@ -304,5 +469,7 @@ if __name__ == '__main__':
     # print(task.roi_appear_ball(task.I_BF_LOCAL_3_LITTLE_KURO.roi_back, image))
     # print(task.roi_appear_ball(task.I_BF_LOCAL_3_LITTLE_KURO.roi_back, image))
     # print(task.ball_number())
     # print(task.ball_number())
     con = config.bondling_fairyland
     con = config.bondling_fairyland
-    task.run_catch(con.bondling_config, con.bondling_switch_soul)
+    # task.run_catch(con.bondling_config, con.bondling_switch_soul, con.battle_config)
+    # task.run_stone(True, con.bondling_config.bondling_stone_class)
+    task.run_search(con.bondling_config)
 
 

+ 9 - 0
tasks/BondlingFairyland/stone/image.json

@@ -7,5 +7,14 @@
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "description"
     "description": "description"
+  },
+  {
+    "itemName": "stone_sure",
+    "imageName": "stone_stone_sure.png",
+    "roiFront": "1152,601,75,70",
+    "roiBack": "1152,601,75,70",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
   }
   }
 ]
 ]

+ 15 - 12
tasks/Component/GeneralBattle/general_battle.py

@@ -173,18 +173,8 @@ class GeneralBattle(BaseTask, GeneralBattleAssets):
                 break
                 break
             # 如果开启战斗过程随机滑动
             # 如果开启战斗过程随机滑动
             if random_click_swipt_enable:
             if random_click_swipt_enable:
-                time.sleep(0.4)  # 这样的好像不对
-                if 0 <= random.randint(0, 500) <= 3:  # 百分之4的概率
-                    rand_type = random.randint(0, 2)
-                    match rand_type:
-                        case 0:
-                            self.click(self.C_RANDOM_CLICK, interval=20)
-                        case 1:
-                            self.swipe(self.S_BATTLE_RANDOM_LEFT, interval=20)
-                        case 2:
-                            self.swipe(self.S_BATTLE_RANDOM_RIGHT, interval=20)
-                    # 重新设置为长战斗
-                    self.device.stuck_record_add('BATTLE_STATUS_S')
+                self.random_click_swipt()
+
 
 
         # 再次确认战斗结果
         # 再次确认战斗结果
         logger.info("Reconfirm the results of the battle")
         logger.info("Reconfirm the results of the battle")
@@ -328,6 +318,19 @@ class GeneralBattle(BaseTask, GeneralBattleAssets):
                 break
                 break
         logger.info("Click preset ensure")
         logger.info("Click preset ensure")
 
 
+    def random_click_swipt(self):
+        time.sleep(0.4)  # 这样的好像不对
+        if 0 <= random.randint(0, 500) <= 3:  # 百分之4的概率
+            rand_type = random.randint(0, 2)
+            match rand_type:
+                case 0:
+                    self.click(self.C_RANDOM_CLICK, interval=20)
+                case 1:
+                    self.swipe(self.S_BATTLE_RANDOM_LEFT, interval=20)
+                case 2:
+                    self.swipe(self.S_BATTLE_RANDOM_RIGHT, interval=20)
+            # 重新设置为长战斗
+            self.device.stuck_record_add('BATTLE_STATUS_S')