Skip to content

Commit

Permalink
修复模拟抽卡武器UP池保底次数错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
H-K-Y committed Nov 26, 2020
1 parent 55c98b6 commit 2abd006
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ XXX哪里有|查询XXX的位置图,XXX是资源的名字

# 更新记录

### 2020-11-26
* 修复模拟抽卡武器UP池保底次数错误的问题

### 2020-11-20
* 加入圣遗物收集功能

Expand Down
9 changes: 7 additions & 2 deletions gacha/gacha.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@
}
}


DISTANCE_FREQUENCY = {
# 3个池子的5星是多少发才保底
'角色up池':90,
'武器up池':80,
'常驻池':90
}



Expand Down Expand Up @@ -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() # 抽一次卡,把结果赋值留给下一次抽卡判断
Expand Down

0 comments on commit 2abd006

Please sign in to comment.