From 2abd006d546626634250f7764fee476c4d999644 Mon Sep 17 00:00:00 2001 From: CaiJi Date: Thu, 26 Nov 2020 14:27:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=A1=E6=8B=9F=E6=8A=BD?= =?UTF-8?q?=E5=8D=A1=E6=AD=A6=E5=99=A8UP=E6=B1=A0=E4=BF=9D=E5=BA=95?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ gacha/gacha.py | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 01a1fa1..f75b87e 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,9 @@ XXX哪里有|查询XXX的位置图,XXX是资源的名字 # 更新记录 +### 2020-11-26 +* 修复模拟抽卡武器UP池保底次数错误的问题 + ### 2020-11-20 * 加入圣遗物收集功能 diff --git a/gacha/gacha.py b/gacha/gacha.py index 56a06ce..b5d5b29 100644 --- a/gacha/gacha.py +++ b/gacha/gacha.py @@ -98,7 +98,12 @@ } } - +DISTANCE_FREQUENCY = { + # 3个池子的5星是多少发才保底 + '角色up池':90, + '武器up池':80, + '常驻池':90 +} @@ -350,7 +355,7 @@ def gacha_one(self): r = random.random() # 先检查是不是保底5星 - if self.distance_5_star % 90 == 0: + if self.distance_5_star % DISTANCE_FREQUENCY[self.pool] == 0: self.gacha_rarity_statistics["5星"] += 1 self.distance_5_star = 0 # 重置保底计数 self.last_time_5 = self.get_5_star() # 抽一次卡,把结果赋值留给下一次抽卡判断