Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Author: Nozdrum
- avgExoticValue = 30000 #3g
- avgRareValue = 5000 #50s
- precursorProbablity = 0.005 #not really important, since it does not impact the choice, just how much you have to pay in the end
- class Item:
- minCost = 0 # Minimal cost of an item to be put in the mystic forge
- exoticProbablity = 0 # Probablity that this will yield in an exotic
- n = 0.0 # Average Number of attempts
- # compute average number of attempts at the mystic forge
- def attempts(self):
- self.n = 1 / (self.exoticProbablity * precursorProbablity )
- def avgCostPerPrecursor(self):
- costToProduce = (4*self.minCost * self.n)
- rakeBackExotic = ( avgExoticValue * ( self.n * self.exoticProbablity )) # average Value of exotics you get
- rakeBackRare = ( avgRareValue * ( self.n * ( 1- self.exoticProbablity ))) # average Value of rares you get
- return costToProduce - rakeBackRare - rakeBackExotic
- class Rare(Item):
- def __init__(self):
- self.exoticProbablity = 0.2 # Every fifth attempt yields an exotic
- self.minCost = 4000 #40 Silver
- self.attempts()
- class Exotic(Item):
- def __init__(self):
- self.exoticProbablity = 1 #Exotics always yield exotics
- self.minCost = 24000 #2g40s
- self.attempts()
- def pretty(number):
- copper = format((number % 100),".0f") + "c"
- number = number / 100
- silver = format(number % 100,".0f") + "s"
- number = number / 100
- return format(number,".0f") + "g"+silver +copper
- rare = Rare()
- exotic = Exotic()
- print("Rare: Average Number of attempts: " + str(rare.n) + " avgCostPerPrecursor: " + pretty(rare.avgCostPerPrecursor()))
- print("Exotic: Average Number of attempts: " + str(exotic.n) + " avgCostPerPrecursor: " + pretty(exotic.avgCostPerPrecursor()))
Advertisement
Add Comment
Please, Sign In to add comment