Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- class Warrior(object):
- '''Parameters of the star, and of the integration algorithm'''
- def __init__(self, AD=400, crit=40.0, hit=8.0, glancing=0.85, dodge=10.0, impale=False, DW=True, armorDR = 0.9, enrage = 1.00):
- self.AD = AD #average main hand attack damage, 400 = Mactank unbuffed
- self.impale = impale
- self.glancing = glancing
- self.armorDR = armorDR
- self.dodge = dodge #lump parry in with dodge for face-tanking purposes
- self.crit = crit
- self.hit = hit
- self.enrage = enrage#subject to uptime
- if DW == True: #glancing, base miss, DW penalty, dodge + parry
- self.hitNcrit = 100.0 - 40 - 8 - 19 - self.dodge + min(8+19,self.hit)
- elif DW == False: #colloquially know as the crit cap
- self.hitNcrit = 100.0 - 40 - 8 - self.dodge + min(8,self.hit)
- if self.impale == True:
- self.cMod = 1.2
- elif self.impale == False:
- self.cMod = 1.0
- def expectedWhiteHit(self): #glancing, crits, hits
- return self.enrage*self.armorDR*self.AD*(40.0*self.glancing +
- min(self.crit, self.hitNcrit)*2 +
- max(self.hitNcrit - self.crit,0))/100.0
- def expectedWHrage(self): #On kronos, dodges and parries give rage as if though it was a hit
- return self.enrage*self.armorDR*(1.0/30.0)*self.AD*(40.0*self.glancing +
- min(self.crit, self.hitNcrit)*2 +
- max(self.hitNcrit - self.crit,0))/100.0
- def expectedHST(self):
- return self.enrage*self.armorDR*(self.AD+157.0)*(100.0 - self.dodge + self.crit*self.cMod)/100.0 + 175.0
- def TPRHS(self): #damage per rage for HS - keep in mind the opportunity cost
- return 1.3*1.15*(self.expectedHST() - self.expectedWhiteHit())/((12 + self.expectedWHrage())*(100.0-self.dodge) + (3 + self.expectedWHrage())*(self.dodge))*100
- def TPRSA(self):
- return 1.3*1.15*260.0*(100.0-self.dodge)/100/(12.0*(100.0-self.dodge) + 3.0*(self.dodge))*100
- Baseline = Warrior()
- AD_max = 500
- AD_min = 100
- i = AD_max - AD_min + 1
- MH_range = np.linspace(AD_min,AD_max,i)
- Charles = Warrior(AD=AD_min)
- SA_TPR = np.empty(i)
- HS_TPR = np.empty(i)
- j = 0
- for j in range(i):
- SA_TPR[j] = Charles.TPRSA()
- HS_TPR[j] = Charles.TPRHS()
- Charles.AD = Charles.AD + 1
- '''
- print Charles.expectedHST()
- print Charles.expectedWhiteHit()
- print Charles.expectedWHrage()
- print "next"
- '''
- import matplotlib.pyplot as plt
- fig, ax1 = plt.subplots()
- ax1.set_xlabel('Average Weapon Damage')
- ax1.set_ylabel('Threat Per Rage',rotation=0)
- ax1.yaxis.set_label_coords(0.005, 1.03)
- ax1.plot(MH_range,SA_TPR,linestyle='dashed',linewidth=1.5,color='k',
- label="Sunder Armor")
- ax1.plot(MH_range,HS_TPR,linestyle='solid',linewidth=1.5,color='k',
- label="Heroic Strike")
- ax1.legend(loc=1,frameon=False,prop={'size':30})
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement