浏览代码

feat(tasks) add buff open component

runhey 3 年之前
父节点
当前提交
7fc8699ca6

+ 8 - 0
module/atom/image.py

@@ -141,6 +141,14 @@ class RuleImage:
         x, y, w, h = self.roi_back
         return x + np.random.randint(0, w), y + np.random.randint(0, h)
 
+    def front_center(self) -> tuple:
+        """
+        获取roi_front的中心坐标
+        :return:
+        """
+        x, y, w, h = self.roi_front
+        return int(x + w//2), int(y + h//2)
+
 
 if __name__ == "__main__":
     image = cv2.imread("D:/4713.jpg")

二进制
module/config/i18n/zh_CN.qm


+ 25 - 1
module/config/i18n/zh_CN.ts

@@ -344,7 +344,7 @@
 	<message><source>Random Click Swipt Enable</source><translation>战斗时随机点击或者随机滑动</translation></message>
 	
 	<message><source>lock_team_enable_help</source><translation>如果锁定阵容将无法启用预设队伍、加成功能</translation></message>
-	<message><source>preset_enable_help</source><translation> </translation></message>
+	<message><source>preset_enable_help</source><translation>将会在第一次战斗的时候切换队伍预设</translation></message>
 	<message><source>preset_group_help</source><translation>可选[1~7]</translation></message>
 	<message><source>preset_team_help</source><translation>可选[1~5]</translation></message>
 	<message><source>buff_enable_help</source><translation>在准备阶段开启加成不太符合直觉,暂时还未实现,而且挺多的战斗是不允许准备阶段开启加成的</translation></message>
@@ -393,4 +393,28 @@
 	<message><source>buy_ap_activity_help</source><translation>该设置只有是设定为活动次数时有效</translation></message>
 	<message><source>activity_toggle_help</source><translation>该设置只有是设定为活动次数时有效</translation></message>
 </context>
+<context>
+    <name>Args</name>
+	<message><source>InviteConfig</source><translation>邀请</translation></message>
+	<message><source>InviteNumber</source><translation>邀请人数</translation></message>
+	<message><source>Friend 1</source><translation>第一个队友名字</translation></message>
+	<message><source>Friend 2</source><translation>第二个队友名字</translation></message>
+	<message><source>Auto Find</source><translation>自动切换好友列表选中队友</translation></message>
+	<message><source>Wait Time</source><translation>等待时间</translation></message>
+	<message><source>invite_number_help</source><translation>可选1或者2,为1时只会邀请第一个队友</translation></message>
+	<message><source>friend_name_help</source><translation>输入队友的名字必须是全称,这一项是基于OCR来识别,如果名字过于离谱建议画200勾玉改一个正常点的名字</translation></message>
+	<message><source>friend_2_name_help</source><translation>同上</translation></message>
+	<message><source>auto_find_help</source><translation>首先会在第一个好友列表寻找,如果没有找到则跳转到"最近" -> "寮友" -> "跨区"</translation></message>
+	<message><source>wait_time_help</source><translation>保持默认一分钟就好,期间每隔15s邀请一次</translation></message>
+</context>
+<context>
+    <name>Args</name>
+	<message><source>OrochiConfig</source><translation>副本</translation></message>
+	<message><source>UserStatus</source><translation>身份</translation></message>
+	<message><source>Layer</source><translation>挑战层数</translation></message>
+	<message><source>Soul Buff Enable</source><translation>开启御魂加成</translation></message>
+	<message><source>user_status_help</source><translation>可选队长、队员、单独刷(野队还不打算实现)</translation></message>
+	<message><source>layer_help</source><translation> </translation></message>
+	<message><source>soul_buff_enable_help</source><translation>会在庭院开始的时候设置加成</translation></message>
+</context>	
 </TS>

+ 1 - 1
module/ocr/base_ocr.py

@@ -195,7 +195,7 @@ class BaseCor:
         if keyword is None:
             keyword = self.keyword
         if keyword in concatenated_string:
-            result = [index for index, _ in enumerate(strings)]
+            result = [index for index, word in enumerate(strings) if keyword in word]
         else:
             result = None
 

+ 4 - 3
module/ocr/sub_ocr.py

@@ -37,6 +37,7 @@ class Full(BaseCor):
             return 0, 0, 0, 0
 
         index_list = self.filter(boxed_results, keyword)
+        logger.info(f"OCR [{self.name}] detected in {index_list}")
         # 如果一个都没有匹配到
         if not index_list:
             return 0, 0, 0, 0
@@ -49,13 +50,13 @@ class Full(BaseCor):
                 boxed_results[index].box[1, 0] - boxed_results[index].box[0, 0],     # width
                 boxed_results[index].box[2, 1] - boxed_results[index].box[0, 1],     # height
             ) for index in index_list]
-            box = merge_area(area_list)
-            self.area = box[0]+self.roi[0], box[1]+self.roi[1], box[2], box[3]
+            area = merge_area(area_list)
+            self.area = area[0]+self.roi[0], area[1]+self.roi[1], area[2], area[3]
         else:
             box = boxed_results[index_list[0]].box
             self.area = box[0, 0]+self.roi[0], box[0, 1]+self.roi[1], box[1, 0] - box[0, 0], box[2, 1] - box[0, 1]
 
-        logger.info(f"OCR [{self.name}: {keyword}] detected in {self.area}")
+        logger.info(f"OCR [{self.name}] detected in {self.area}")
         return self.area
 
 class Single(BaseCor):

+ 46 - 0
tasks/Component/GeneralBuff/assets.py

@@ -0,0 +1,46 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by module/dev_tools/assets_extract.py.
+# Don't modify it manually.
+class GeneralBuffAssets: 
+
+
+	# Image Rule Assets
+	# 庭院左上角的加成 
+	I_BUFF_1 = RuleImage(roi_front=(357,42,45,50), roi_back=(357,42,45,50), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_buff_1.png")
+	# description 
+	I_AWAKE = RuleImage(roi_front=(381,130,35,45), roi_back=(360,107,80,447), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_awake.png")
+	# 御魂加成 
+	I_SOUL = RuleImage(roi_front=(377,203,39,40), roi_back=(361,121,71,388), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_soul.png")
+	# description 
+	I_GOLD_50 = RuleImage(roi_front=(373,269,52,36), roi_back=(367,120,64,391), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_gold_50.png")
+	# description 
+	I_GOLD_100 = RuleImage(roi_front=(378,338,43,39), roi_back=(365,121,74,407), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_gold_100.png")
+	# description 
+	I_EXP_50 = RuleImage(roi_front=(379,406,44,43), roi_back=(365,127,70,393), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_exp_50.png")
+	# description 
+	I_EXP_100 = RuleImage(roi_front=(383,406,30,40), roi_back=(368,126,58,386), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_exp_100.png")
+	# description 
+	I_OPEN_YELLOW = RuleImage(roi_front=(773,143,24,25), roi_back=(766,133,35,366), threshold=0.7, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_open_yellow.png")
+	# description 
+	I_CLOSE_RED = RuleImage(roi_front=(772,273,25,29), roi_back=(761,134,41,369), threshold=0.7, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_close_red.png")
+	# 用来判定是否点击的那个 
+	I_CLOUD = RuleImage(roi_front=(356,505,65,38), roi_back=(356,505,65,38), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_cloud.png")
+
+
+	# Ocr Rule Assets
+	# Ocr-description 
+	O_GOLD_50 = RuleOcr(roi=(428,120,338,389), area=(0,0,100,100), mode="Full", method="Default", keyword="战斗胜利获得的金币增加50%", name="gold_50")
+	# Ocr-description 
+	O_GOLD_100 = RuleOcr(roi=(425,118,342,397), area=(0,0,100,100), mode="Full", method="Default", keyword="战斗胜利获得的金币增加100%", name="gold_100")
+	# Ocr-description 
+	O_EXP_50 = RuleOcr(roi=(426,119,335,394), area=(0,0,100,100), mode="Full", method="Default", keyword="战斗胜利获得的经验增加50%", name="exp_50")
+	# Ocr-description 
+	O_EXP_100 = RuleOcr(roi=(421,127,342,388), area=(0,0,100,100), mode="Full", method="Default", keyword="战斗胜利获得的经验增加100%", name="exp_100")
+
+

+ 27 - 0
tasks/Component/GeneralBuff/config_buff.py

@@ -0,0 +1,27 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from enum import Enum
+from datetime import datetime, time
+from pydantic import BaseModel, ValidationError, validator, Field
+
+
+# 这个类是用来 演示的
+
+class BuffConfig(BaseModel):
+    # 是否启动buff
+    buff_enable: bool = Field(default=False, description='buff_enable_help')
+    # 是否点击觉醒Buff
+    buff_awake_click: bool = Field(default=False, description='')
+    # 是否点击御魂buff
+    buff_soul_click: bool = Field(default=False, description='')
+    # 是否点击金币50buff
+    buff_gold_50_click: bool = Field(default=False, description='')
+    # 是否点击金币100buff
+    buff_gold_100_click: bool = Field(default=False, description='')
+    # 是否点击经验50buff
+    buff_exp_50_click: bool = Field(default=False, description='')
+    # 是否点击经验100buff
+    buff_exp_100_click: bool = Field(default=False, description='')
+
+

二进制
tasks/Component/GeneralBuff/gb/gb_awake.png


二进制
tasks/Component/GeneralBuff/gb/gb_buff_1.png


二进制
tasks/Component/GeneralBuff/gb/gb_close_red.png


二进制
tasks/Component/GeneralBuff/gb/gb_cloud.png


二进制
tasks/Component/GeneralBuff/gb/gb_exp_100.png


二进制
tasks/Component/GeneralBuff/gb/gb_exp_50.png


二进制
tasks/Component/GeneralBuff/gb/gb_gold_100.png


二进制
tasks/Component/GeneralBuff/gb/gb_gold_50.png


二进制
tasks/Component/GeneralBuff/gb/gb_open_yellow.png


二进制
tasks/Component/GeneralBuff/gb/gb_soul.png


+ 92 - 0
tasks/Component/GeneralBuff/gb/image.json

@@ -0,0 +1,92 @@
+[
+  {
+    "itemName": "buff_1",
+    "imageName": "gb_buff_1.png",
+    "roiFront": "357,42,45,50",
+    "roiBack": "357,42,45,50",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "庭院左上角的加成"
+  },
+  {
+    "itemName": "awake",
+    "imageName": "gb_awake.png",
+    "roiFront": "381,130,35,45",
+    "roiBack": "360,107,80,447",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "soul",
+    "imageName": "gb_soul.png",
+    "roiFront": "377,203,39,40",
+    "roiBack": "361,121,71,388",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "御魂加成"
+  },
+  {
+    "itemName": "gold_50",
+    "imageName": "gb_gold_50.png",
+    "roiFront": "373,269,52,36",
+    "roiBack": "367,120,64,391",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "gold_100",
+    "imageName": "gb_gold_100.png",
+    "roiFront": "378,338,43,39",
+    "roiBack": "365,121,74,407",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "exp_50",
+    "imageName": "gb_exp_50.png",
+    "roiFront": "379,406,44,43",
+    "roiBack": "365,127,70,393",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "exp_100",
+    "imageName": "gb_exp_100.png",
+    "roiFront": "383,406,30,40",
+    "roiBack": "368,126,58,386",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "open_yellow",
+    "imageName": "gb_open_yellow.png",
+    "roiFront": "773,143,24,25",
+    "roiBack": "766,133,35,366",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "description"
+  },
+  {
+    "itemName": "close_red",
+    "imageName": "gb_close_red.png",
+    "roiFront": "772,273,25,29",
+    "roiBack": "761,134,41,369",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "description"
+  },
+  {
+    "itemName": "cloud",
+    "imageName": "gb_cloud.png",
+    "roiFront": "356,505,65,38",
+    "roiBack": "356,505,65,38",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "用来判定是否点击的那个"
+  }
+]

+ 38 - 0
tasks/Component/GeneralBuff/gb/ocr.json

@@ -0,0 +1,38 @@
+[
+  {
+    "itemName": "gold_50",
+    "roiFront": "428,120,338,389",
+    "roiBack": "0,0,100,100",
+    "mode": "Full",
+    "method": "Default",
+    "keyword": "战斗胜利获得的金币增加50%",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "gold_100",
+    "roiFront": "425,118,342,397",
+    "roiBack": "0,0,100,100",
+    "mode": "Full",
+    "method": "Default",
+    "keyword": "战斗胜利获得的金币增加100%",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "exp_50",
+    "roiFront": "426,119,335,394",
+    "roiBack": "0,0,100,100",
+    "mode": "Full",
+    "method": "Default",
+    "keyword": "战斗胜利获得的经验增加50%",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "exp_100",
+    "roiFront": "421,127,342,388",
+    "roiBack": "0,0,100,100",
+    "mode": "Full",
+    "method": "Default",
+    "keyword": "战斗胜利获得的经验增加100%",
+    "description": "Ocr-description"
+  }
+]

+ 278 - 0
tasks/Component/GeneralBuff/general_buff.py

@@ -0,0 +1,278 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+import time
+
+import cv2
+import numpy as np
+
+from tasks.Component.GeneralBuff.assets import GeneralBuffAssets
+from module.atom.ocr import RuleOcr
+from module.atom.image import RuleImage
+from tasks.base_task import BaseTask
+from module.logger import logger
+
+
+class GeneralBuff(BaseTask, GeneralBuffAssets):
+
+    def open_buff(self):
+        """
+        打开buff的总界面
+        :return:
+        """
+        logger.info('Open buff')
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_CLOUD):
+                break
+            if self.appear_then_click(self.I_BUFF_1, interval=2):
+                continue
+
+    @staticmethod
+    def get_area(image: np.array, buff: RuleOcr) -> tuple:
+        """
+        获取要点击的开关buff的区域
+        :param cls:
+        :param image:
+        :param buff:
+        :return:
+        """
+        area = buff.ocr(image)
+        if area == tuple([0, 0, 0, 0]):
+            logger.info('No gold 50 buff')
+            return None
+
+        # 开始的x坐标就是文字的右边
+        start_x = area[0] + area[2] + 10  # 10是文字和开关之间的间隔
+        start_y = area[1] - 10
+        width = 80  # 开关的宽度 80够了
+        height = area[3] + 20
+        return int(start_x), int(start_y), int(width), int(height)
+
+    def set_switch_area(self, area):
+        """
+        设置开关的区域
+        :param area:
+        :return:
+        """
+        self.I_OPEN_YELLOW.roi_back = list(area)  # 动态设置roi
+        self.I_CLOSE_RED.roi_back = list(area)
+
+
+    def gold_50(self, is_open: bool = True):
+        """
+        金币50buff
+        :param is_open: 是否打开
+        :return:
+        """
+        logger.info('Gold 50 buff')
+        self.screenshot()
+        area = self.get_area(self.device.image, self.O_GOLD_50)
+        if not area:
+            logger.warning('No gold 100 buff')
+            return None
+        self.I_OPEN_YELLOW.roi_back = list(area)  # 动态设置roi
+        self.I_CLOSE_RED.roi_back = list(area)
+        if is_open:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_OPEN_YELLOW):
+                    break
+                if self.appear_then_click(self.I_CLOSE_RED, interval=1):
+                    continue
+        else:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_CLOSE_RED):
+                    break
+                if self.appear_then_click(self.I_OPEN_YELLOW, interval=1):
+                    continue
+
+    def gold_100(self, is_open: bool = True):
+        """
+        金币100buff
+        :param is_open: 是否打开
+        :return:
+        """
+        logger.info('Gold 100 buff')
+        self.screenshot()
+        area = self.get_area(self.device.image, self.O_GOLD_100)
+        if not area:
+            logger.warning('No gold 100 buff')
+            return None
+        self.I_OPEN_YELLOW.roi_back = list(area)
+        self.I_CLOSE_RED.roi_back = list(area)
+        if is_open:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_OPEN_YELLOW):
+                    break
+                if self.appear_then_click(self.I_CLOSE_RED, interval=1):
+                    continue
+        else:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_CLOSE_RED):
+                    break
+                if self.appear_then_click(self.I_OPEN_YELLOW, interval=1):
+                    continue
+
+    def exp_50(self, is_open: bool = True):
+        """
+        经验50buff
+        :param is_open: 是否打开
+        :return:
+        """
+        logger.info('Exp 50 buff')
+        self.screenshot()
+        area = self.get_area(self.device.image, self.O_EXP_50)
+        if not area:
+            logger.warning('No gold 100 buff')
+            return None
+        self.I_OPEN_YELLOW.roi_back = list(area)
+        self.I_CLOSE_RED.roi_back = list(area)
+        if is_open:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_OPEN_YELLOW):
+                    break
+                if self.appear_then_click(self.I_CLOSE_RED, interval=1):
+                    continue
+        else:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_CLOSE_RED):
+                    break
+                if self.appear_then_click(self.I_OPEN_YELLOW, interval=1):
+                    continue
+
+    def exp_100(self, is_open: bool = True):
+        """
+        经验100buff
+        :param is_open: 是否打开
+        :return:
+        """
+        logger.info('Exp 100 buff')
+        while 1:
+            self.screenshot()
+            area = self.get_area(self.device.image, self.O_EXP_100)
+            self.set_switch_area(area)
+
+            if not self.appear(self.I_OPEN_YELLOW) and not self.appear(self.I_CLOSE_RED):
+                logger.info('No exp 100 buff')
+                self.device.swipe(p2=(530, 240), p1=(580, 320))
+                time.sleep(1)
+            else:
+                break
+
+        if is_open:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_OPEN_YELLOW):
+                    break
+                if self.appear_then_click(self.I_CLOSE_RED, interval=1):
+                    continue
+        else:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_CLOSE_RED):
+                    break
+                if self.appear_then_click(self.I_OPEN_YELLOW, interval=1):
+                    continue
+
+    @staticmethod
+    def get_area_image(image: np.array, target: RuleImage) -> list:
+        """
+        获取觉醒加成或者是御魂加成所要点击的区域
+        因为实在的图片比ocr快
+        :param image:
+        :param target:
+        :return:
+        """
+        if not target.match(image):
+            logger.warning(f'No {target.name} buff')
+            return None
+            # logger.info(f'front area: {target.roi_front}')
+            # logger.info(f'front center: {target.front_center()}')
+        start_x = int(target.front_center()[0] + 364)
+        start_y = int(target.roi_front[1])
+        width = 80
+        height = int(target.roi_front[3])
+        return [start_x, start_y, width, height]
+
+    def awake(self, is_open: bool = True):
+        """
+        觉醒buff
+        :param is_open: 是否打开
+        :return:
+        """
+        logger.info('Awake buff')
+        self.screenshot()
+        area = self.get_area_image(self.device.image, self.I_AWAKE)
+        self.set_switch_area(area)
+        if not area:
+            logger.warning('No awake buff')
+            return None
+        if is_open:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_OPEN_YELLOW):
+                    break
+                if self.appear_then_click(self.I_CLOSE_RED, interval=1):
+                    continue
+        else:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_CLOSE_RED):
+                    break
+                if self.appear_then_click(self.I_OPEN_YELLOW, interval=1):
+                    continue
+
+    def soul(self, is_open: bool = True):
+        """
+        御魂buff
+        :param is_open: 是否打开
+        :return:
+        """
+        logger.info('Soul buff')
+        self.screenshot()
+        area = self.get_area_image(self.device.image, self.I_SOUL)
+        self.set_switch_area(area)
+        if not area:
+            logger.warning('No soul buff')
+            return None
+        if is_open:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_OPEN_YELLOW):
+                    break
+                if self.appear_then_click(self.I_CLOSE_RED, interval=1):
+                    continue
+        else:
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_CLOSE_RED):
+                    break
+                if self.appear_then_click(self.I_OPEN_YELLOW, interval=1):
+                    continue
+
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+    c = Config('oas1')
+    d = Device(c)
+    t = GeneralBuff(c, d)
+
+    t.open_buff()
+    t.screenshot()
+
+    t.awake(is_open=True)
+    t.soul(is_open=True)
+    # t.gold_50(is_open=False)
+    # t.gold_100(is_open=False)
+    # t.exp_50(is_open=False)
+    # t.exp_100(is_open=True)
+
+
+

+ 21 - 0
tasks/Component/GeneralInvite/config_invite.py

@@ -0,0 +1,21 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from enum import Enum
+from datetime import datetime, time
+from pydantic import BaseModel, ValidationError, validator, Field
+
+class InviteNumber(str, Enum):
+    ONE = 'one'
+    TWO = 'two'
+
+class InviteConfig(BaseModel):
+
+    invite_number: InviteNumber = Field(default=InviteNumber.ONE, description='invite_number_help')
+    friend_1: str = Field(default='', description='friend_name_help')
+    friend_2: str = Field(default='', description='friend_2_name_help')
+    auto_find: bool = Field(default=True, description='auto_find_help')
+    wait_time: time = Field(default=time(minute=1), description='wait_time_help')
+
+    # recent_friend, guild_friend, friend, other_friend
+

+ 12 - 0
tasks/Component/GeneralRoom/assets.py

@@ -0,0 +1,12 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by module/dev_tools/assets_extract.py.
+# Don't modify it manually.
+class GeneralRoomAssets: 
+	pass
+

+ 40 - 2
tasks/Orochi/config.py

@@ -2,10 +2,48 @@
 # @author runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
-
+from enum import Enum
 from tasks.Component.config_scheduler import Scheduler
-from tasks.Component.config_base import ConfigBase
+from tasks.Component.config_base import ConfigBase, TimeDelta
+from tasks.Component.GeneralInvite.config_invite import InviteConfig
+from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
+
+
+class UserStatus(str, Enum):
+    LEADER = 'leader'
+    MEMBER = 'member'
+    ALONE = 'alone'
+    WILD = 'wild'  # 还不打算实现
+
+class Layer(str, Enum):
+    ONE = '壹层'
+    TWO = '贰层'
+    THREE = '叁层'
+    FOUR = '肆层'
+    FIVE = '伍层'
+    SIX = '陆层'
+    SEVEN = '柒层'
+    EIGHT = '捌层'
+    NINE = '玖层'
+    TEN = '拾层'
+    ELEVEN = '悲鸣'
+    TWELVE = '神罚'
+
+class OrochiConfig(ConfigBase):
+    # 身份
+    user_status: UserStatus = Field(default=UserStatus.LEADER, description='user_status_help')
+    # 层数
+    layer: Layer = Field(default=Layer.ELEVEN, description='layer_help')
+    # 限制时间
+    limit_time: TimeDelta = Field(default=TimeDelta(minutes=30), description='limit_time_help')
+    # 限制次数
+    limit_count: int = Field(default=30, description='limit_count_help')
+    # 是否开启御魂加成
+    soul_buff_enable: bool = Field(default=False, description='soul_buff_enable_help')
 
 class Orochi(ConfigBase):
     scheduler: Scheduler = Field(default_factory=Scheduler)
+    orochi_config: OrochiConfig = Field(default_factory=OrochiConfig)
+    invite_config: InviteConfig = Field(default_factory=InviteConfig)
+    general_battle_config: GeneralBattleConfig = Field(default_factory=GeneralBattleConfig)