#怎么说,我感觉我这里有很多错误,不过最后还是有点达成了目的,请各位大佬帮我改善一下,最后就是我的代码大部分参考了另一位大佬的博客,我这只是做一个纪念和笔记,不要太在意。
ps.该代码只能抽90发以内,且十连似乎不保底(好吧,我其实写进去了的好像,它没反应)
代码:
def A(m):
import random
star_get=0
star5_get_amount=0
star5_amount = 0
result=' '
j=1
k=1
up = '胡桃'
star5 = ['刻晴', '莫娜', '七七', '迪卢克', '琴']
star5plus=[up, up, up, up, up, '刻晴', '莫娜', '七七', '迪卢克', '琴']
star4_role = ['安柏', '丽莎', '凯亚', '芭芭拉', '雷泽', '菲谢尔', '班尼特', '诺艾尔', '菲谢尔', '砂糖',
'迪奥娜', '北斗', '凝光', '香菱', '行秋', '重云', '辛焱']
star4_weapon = ['弓藏', '祭礼弓', '绝弦', '西风猎弓', '昭心', '祭礼残章', '流浪乐章', '西风秘典', '西风长枪','雨裁', '匣里灭辰', '祭礼大剑', '钟剑', '西风大剑', '匣里龙吟', '祭礼剑', '笛剑', '西风剑']
star4=star4_role+star4_role
star3=['弹弓','神射手之誓','鸦羽弓','翡玉法球','讨龙英杰谭','魔导绪论','黑缨枪','以理服人','沐浴龙血的剑','铁影阔剑','飞天御剑','黎明神剑','冷刃']
while j<=m:
i=random.randint(1,10001)
if i in range(1,31):
a=random.randint(0,4)
result=result+' '+star5[a]
star5_amount=star5_amount+1
star5_get_amount = 0
star_get=star_get + 1
elif i in range(61,316):
b=random.randint(0,16)
result=result+' '+star4_role[b]
star5_get_amount = star5_get_amount + 1
star_get=star_get + 1
elif i in range(316,571):
c=random.randint(0,17)
result=result+' '+star4_weapon[c]
star5_get_amount = star5_get_amount + 1
star_get=star_get + 1
elif i in range(571,10001):
d=random.randint(0,12)
result=result+' '+star3[d]
star5_get_amount = star5_get_amount + 1
star_get=star_get + 1
else:
result=result+' '+up
star_get = star_get + 1
star5_get_amount=0
j=j+1
if star_get==90:
e=random.randint(0,10)
result = result + ' ' +star5plus[e]
if star5_amount==1 and star_get==90:
result=result +' '+ 'up'
if star_get==90:
star_get=0
if star_get%10==0 :
while i<=star_get//10:
n = random.randint(0,35)
result=result +' '+ star4[n]
i=i+1
return result