Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import choice
- #Colors are R,G,B,W = 0,1,2,3
- chance = [800, 0, 5800, 3400] #f, 5*, 4*, 3*
- defaultrate = list(chance)
- cost = [5,4,4,4,3] #of each summon
- islegendary = True #determines if 5* increases
- desired = 'W'
- orbs = 50
- #rarity pools by color
- poolf = [3,3,3,3]
- pool5 = [0,0,0,0]
- pool4 = [30,27,18,25]
- pool3 = [15,12,9,13]
- cpools = [poolf, pool5, pool4, pool3]
- rdict = {'f':0, '5':1, '4':2, '3':3}
- def summon():
- global orbs
- pool = []
- rpicker = ['f'] * chance[0] + ['5'] * chance[1] + ['4'] * chance[2] + ['3'] * chance[3]
- for i in range(5):
- r = choice(rpicker)
- cpicker = ['R'] * cpools[rdict[r]][0] + ['G'] * cpools[rdict[r]][1] + ['B'] * cpools[rdict[r]][2] + ['W'] * cpools[rdict[r]][3]
- c = choice(cpicker)
- pool.append(r+c)
- #print(pool)
- numpicked = 0
- picked = []
- for hero in pool:
- if hero[1] == desired and orbs >= cost[numpicked]:
- picked.append(hero)
- orbs -= cost[numpicked]
- numpicked += 1
- if numpicked is 0:
- picked.append(choice(pool))
- orbs -= cost[numpicked]
- return picked
- def simulate(i):
- global orbs
- global chance
- goodpulls = 0
- totalpulls = 0
- pitycounter = 0
- #defaultrate = chance
- for val in range (i):
- print val
- orbs = 100
- while orbs >= cost[0]:
- pulls = summon()
- pitybreak = False
- for pull in pulls:
- if pull == 'f'+desired:
- #print(pull)
- goodpulls += 1
- totalpulls += 1
- pitycounter += 1
- if pull[0] == 'f' or pull[0] is '5':
- #pitycounter = 0
- #chance = list(defaultrate)
- pitybreak = True
- #print defaultrate
- if pitycounter >= 5:
- pitycounter -= 5
- chance[0] += 50
- chance[2] -= 25
- chance[3] -= 25
- #print chance
- #print defaultrate
- if pitybreak:
- pitycounter = 0
- chance = list(defaultrate)
- #print("orbs: "+ str(orbs))
- chance = list(defaultrate)
- #print defaultrate
- print(goodpulls)
- print(totalpulls)
- print("rate: " + str(1.0*goodpulls/totalpulls))
- return
- simulate(10000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement