Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增FES配置 #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions hoshino/modules/priconne/gacha/config.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"MIX": {
"up_prob": 14,
"up_prob": 7,
"fes_prob": 7,
"s3_prob": 50,
"s2_prob": 180,
"up": [ "凯留(新年)", "空花(大江户)", "妮诺(大江户)" ],
"up": [ "可可罗(公主)"],
"_comment": "star3 仅填3星常驻角色。不要填UP角,否则出率会偏高",
"fes": [ "贪吃佩可(公主)", "克莉丝提娜", "矛依未", "似似花" ],
"star3": [
"杏奈","真步","璃乃","初音","霞","伊绪",
"咲恋","望","妮诺","秋乃","镜华","智","真琴",
"伊莉亚","纯","静流","莫妮卡","流夏","吉塔",
"亚里莎","安","古蕾娅",
"克萝依", "碧(插班生)", "美美(万圣节)", "露娜",
"伊莉亚(圣诞节)", "霞(魔法少女)", "优妮", "琪爱儿",
"リン(レンジャー)"
"铃(游骑兵)", "真阳(游骑兵)"
],
"other_normal_star3": [ "空花(大江户)", "妮诺(大江户)" ],
"star2": [
"茉莉","茜里","宫子","雪","七七香","美里",
"铃奈","香织","美美","绫音","铃","惠理子",
Expand Down Expand Up @@ -106,4 +107,4 @@
"优花梨","碧","美咲","莉玛"
]
}
}
}
58 changes: 33 additions & 25 deletions hoshino/modules/priconne/gacha/gacha.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ def __init__(self, pool_name:str="MIX"):
def load_pool(self, pool_name:str):
config = util.load_config(__file__)
pool = config[pool_name]
self.up_prob = pool["up_prob"]
self.up_prob = pool["up_prob"] # 当期up
self.fes_prob = pool["fes_prob"] # 当期FES
self.s3_prob = pool["s3_prob"]
self.s2_prob = pool["s2_prob"]
self.s1_prob = 1000 - self.s2_prob - self.s3_prob
self.up = pool["up"]
self.fes = pool["fes"] # 当期Fes
self.star3 = pool["star3"]
self.star2 = pool["star2"]
self.star1 = pool["star1"]


def gacha_one(self, up_prob:int, s3_prob:int, s2_prob:int, s1_prob:int=None):
def gacha_one(self, ten_flag:bool = False):
'''
sx_prob: x星概率,要求和为1000
up_prob: UP角色概率(从3星划出)
Expand All @@ -36,15 +38,18 @@ def gacha_one(self, up_prob:int, s3_prob:int, s2_prob:int, s1_prob:int=None):
| *** | ** | * |
---------------------------
'''
if s1_prob is None:
s1_prob = 1000 - s3_prob - s2_prob
total_ = s3_prob + s2_prob + s1_prob
if self.s1_prob is None:
self.s1_prob = 1000 - self.s3_prob - self.s2_prob
total_ = self.s3_prob + self.s2_prob + self.s1_prob
pick = random.randint(1, total_)
if pick <= up_prob:

if pick <= self.up_prob:
return Chara.fromname(random.choice(self.up), 3), 100
elif pick <= s3_prob:
elif pick <= self.up_prob + self.fes_prob: # fes
return Chara.fromname(random.choice(self.fes), 3), 50
elif pick <= self.s3_prob:
return Chara.fromname(random.choice(self.star3), 3), 50
elif pick <= s2_prob + s3_prob:
elif (pick <= self.s2_prob + self.s3_prob) or (ten_flag == True):
return Chara.fromname(random.choice(self.star2), 2), 10
else:
return Chara.fromname(random.choice(self.star1), 1), 1
Expand All @@ -58,10 +63,10 @@ def gacha_ten(self):
s2 = self.s2_prob
s1 = 1000 - s3 - s2
for _ in range(9): # 前9连
c, y = self.gacha_one(up, s3, s2, s1)
c, y = self.gacha_one(False)
result.append(c)
hiishi += y
c, y = self.gacha_one(up, s3, s2 + s1, 0) # 保底第10抽
c, y = self.gacha_one(True) # 保底第10抽
result.append(c)
hiishi += y

Expand All @@ -75,24 +80,27 @@ def gacha_tenjou(self):
s3 = self.s3_prob
s2 = self.s2_prob
s1 = 1000 - s3 - s2
for i in range(9 * 30):
c, y = self.gacha_one(up, s3, s2, s1)
if 100 == y:
result['up'].append(c)
first_up_pos = min(first_up_pos, 10 * ((i+1) // 9) + ((i+1) % 9))
elif 50 == y:
result['s3'].append(c)
elif 10 == y:
result['s2'].append(c)
elif 1 == y:
result['s1'].append(c)
else:
pass # should never reach here
for i in range(30):
c, y = self.gacha_one(up, s3, s2 + s1, 0)
# 前9抽
# print("\n", i * 10, "-", i * 10 + 10)
for k in range(9):
c, y = self.gacha_one(False)
if 100 == y:
result['up'].append(c)
first_up_pos = min(first_up_pos, i * 10 + k)
elif 50 == y:
result['s3'].append(c)
elif 10 == y:
result['s2'].append(c)
elif 1 == y:
result['s1'].append(c)
else:
pass # should never reach here
# 第10抽保底
c, y = self.gacha_one(True)
if 100 == y:
result['up'].append(c)
first_up_pos = min(first_up_pos, 10 * (i+1))
first_up_pos = min(first_up_pos, 10 * (i + 1))
elif 50 == y:
result['s3'].append(c)
elif 10 == y:
Expand Down
2 changes: 2 additions & 0 deletions hoshino/modules/priconne/priconne_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,15 @@ class _PriconneData:
1125: ["凛(偶像大师)", "リン(デレマス)", "Rin(DEREM@S)", "凛", "Rin(DEREMAS)", "涩谷凛"],
1126: ["未央(偶像大师)", "ミオ(デレマス)", "Mio(DEREM@S)", "未央", "Mio(DEREMAS)", "本田未央"],
1127: ["铃(游骑兵)", "リン(レンジャー)", "Rin(Ranger)", "骑兵松鼠", "游侠松鼠", "游骑兵松鼠", "护林员松鼠", "护林松鼠", "游侠🐿️"],
1128: ["真阳(游骑兵)", "マヒル(レンジャー)", "Mahiru(Ranger)", "骑兵奶牛", "游侠奶牛", "游骑兵奶牛", "护林员奶牛", "护林奶牛"],

# =================================== #




1804: ["贪吃佩可(公主)", "ペコリーヌ(プリンセス)", "Pekoriinu(Princess)", "公主吃", "公主饭", "公主吃货", "公主佩可", "公主饭团", "公主🍙", "命运高达", "高达", "命运公主", "高达公主", "春哥高达", "🤖🍙", "🤖"],
1805: ["可可罗(公主)", "コッコロ(プリンセス)", "Kokkoro(Princess)", "公主妈"],



Expand Down