From 845e5d863a6a358b3472fe4eb525ac36f76a2c47 Mon Sep 17 00:00:00 2001 From: RenYuan2004 Date: Sun, 14 May 2023 00:47:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=A0=E6=98=8E=E6=97=A5?= =?UTF-8?q?=E6=96=B9=E8=88=9F=E6=96=B0=E5=A2=9E=E2=80=9C=E4=B8=AD=E5=9D=9A?= =?UTF-8?q?=E5=AF=BB=E8=AE=BF=E2=80=9D=E5=AF=BC=E8=87=B4=E6=8A=BD=E5=8D=A1?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E4=B8=8D=E5=8F=AF=E7=94=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复因明日方舟新增“中坚寻访”导致抽卡模拟不可用的问题,优化up池及up概率抓取,将中坚干员排除出干员池 --- plugins/draw_card/handles/prts_handle.py | 29 ++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/plugins/draw_card/handles/prts_handle.py b/plugins/draw_card/handles/prts_handle.py index aac9db135..af0c5be26 100644 --- a/plugins/draw_card/handles/prts_handle.py +++ b/plugins/draw_card/handles/prts_handle.py @@ -27,6 +27,7 @@ class Operator(BaseData): recruit_only: bool # 公招限定 event_only: bool # 活动获得干员 + core_only:bool #中坚干员 # special_only: bool # 升变/异格干员 @@ -54,7 +55,7 @@ def get_card(self, add: float) -> Operator: all_operators = [ x for x in self.ALL_OPERATOR - if x.star == star and not any([x.limited, x.recruit_only, x.event_only]) + if x.star == star and not any([x.limited, x.recruit_only, x.event_only,x.core_only]) ] acquire_operator = None @@ -151,11 +152,16 @@ def _init_data(self): Operator( name=value["名称"], star=int(value["星级"]), - limited="干员寻访" not in value["获取途径"], + limited="标准寻访" not in value["获取途径"] and "中坚寻访" not in value["获取途径"], recruit_only=True - if "干员寻访" not in value["获取途径"] and "公开招募" in value["获取途径"] + if "标准寻访" not in value["获取途径"] and "中坚寻访" not in value["获取途径"] and "公开招募" in value["获取途径"] + else False, + event_only=True + if "活动获取" in value["获取途径"] + else False, + core_only=True + if "标准寻访" not in value["获取途径"] and "中坚寻访" in value["获取途径"] else False, - event_only=True if "活动获取" in value["获取途径"] else False, ) for key, value in self.load_data().items() if "阿米娅" not in key @@ -271,22 +277,27 @@ async def update_up_char(self): for char in chars: star = char.split("(")[0].count("★") name = re.split(r"[:(]", char)[1] if "★(" not in char else re.split("):", char)[1] # 有的括号在前面有的在后面 + dual_up = False if "\\" in name: names = name.split("\\") + dual_up = True elif "/" in name: names = name.split("/") + dual_up = True else: names = [name] # 既有用/分割的,又有用\分割的 names = [name.replace("[限定]", "").strip() for name in names] + zoom = 1 if "权值" in char: - match = re.search(r"(在.*?以.*?(\d+).*?倍权值.*?)", char) + zoom = 0.03 else: match = re.search(r"(占.*?的.*?(\d+).*?%)", char) - zoom = 1 - if match: - zoom = float(match.group(1)) - zoom = zoom / 100 if zoom > 10 else zoom + if dual_up == True: + zoom = float(match.group(1))/2 + else: + zoom = float(match.group(1)) + zoom = zoom / 100 if zoom > 1 else zoom for name in names: up_chars.append( UpChar(name=name, star=star, limited=False, zoom=zoom)