From 0123c1d1d687bc2b9343683f6f52f7fa9b61dce1 Mon Sep 17 00:00:00 2001 From: H-K-Y <33424676+H-K-Y@users.noreply.github.com> Date: Wed, 24 Nov 2021 21:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=AD=A6=E5=99=A8=E6=B1=A0?= =?UTF-8?q?=E6=A6=82=E7=8E=87=E5=92=8C=E4=BF=9D=E5=BA=95=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复武器池概率和保底错误的问题 --- gacha/gacha.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/gacha/gacha.py b/gacha/gacha.py index 6e513da..a9acb7c 100644 --- a/gacha/gacha.py +++ b/gacha/gacha.py @@ -79,7 +79,7 @@ def is_up(self,name): # 如果name是一个空字符串表示是第一次抽到4星或5星 if name == "": return True - if self.pool == "常驻池": + if self.pool == "常驻": return False if (name in POOL[self.pool]['5_star_UP']) or (name in POOL[self.pool]['4_star_UP']): @@ -148,11 +148,11 @@ def update_last(self,name): self.last_5_up = self.current_times + 1 if not self.last_4: - if name in POOL[self.pool]['4_star_not_UP']: + if (name in POOL[self.pool]['4_star_not_UP']) or (name in POOL[self.pool]['4_star_UP']): self.last_4 = self.current_times + 1 if not self.last_5: - if name in POOL[self.pool]['5_star_not_UP']: + if (name in POOL[self.pool]['5_star_not_UP']) or (name in POOL[self.pool]['5_star_UP']): self.last_5 = self.current_times + 1 def is_guaranteed(self,frequency): @@ -178,32 +178,28 @@ def get_most_arms(self): def get_up_probability(self): # 获取上一次抽卡抽到5星 UP 时,再次获取5星概率是多少 - if self.pool == '武器': + if self.pool.count("武器"): return 0.75 - return 0.5 def get_5_star_basic_probability(self): # 获取5星的基础概率 - if self.pool == '武器': + if self.pool.count("武器"): return 0.007 - return 0.006 def get_4_star_basic_probability(self): # 获取4星的基础概率 - if self.pool == '武器': + if self.pool.count("武器"): return 0.060 - return 0.051 def get_distance_frequency(self): # 获取当前卡池的保底抽卡次数 - if self.pool == '武器': + if self.pool.count("武器"): return 80 - return 90 @@ -251,7 +247,7 @@ def get_4_star(self): def get_5_star_probability(self): # 获取本次抽5星的概率是多少 - if self.pool == '武器': + if self.pool.count("武器"): # 这是武器up池5星概率 if self.distance_5_star <= 62: return self._5_star_basic_probability