Advertisement
Guest User

Threat comparison between Heroic Strike and Sunder Armor

a guest
Jul 11th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.13 KB | None | 0 0
  1. import numpy as np
  2.  
  3. class Warrior(object):
  4.     '''Parameters of the star, and of the integration algorithm'''
  5.     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):
  6.         self.AD = AD        #average main hand attack damage, 400 = Mactank unbuffed
  7.         self.impale = impale
  8.         self.glancing = glancing
  9.         self.armorDR = armorDR
  10.         self.dodge = dodge  #lump parry in with dodge for face-tanking purposes
  11.         self.crit = crit    
  12.         self.hit = hit
  13.         self.enrage = enrage#subject to uptime    
  14.  
  15.         if DW == True:      #glancing, base miss, DW penalty, dodge + parry
  16.             self.hitNcrit = 100.0 - 40 - 8 - 19 - self.dodge + min(8+19,self.hit)
  17.         elif DW == False:   #colloquially know as the crit cap
  18.             self.hitNcrit = 100.0 - 40 - 8 - self.dodge + min(8,self.hit)    
  19.          
  20.         if self.impale == True:
  21.             self.cMod = 1.2
  22.         elif self.impale == False:
  23.             self.cMod = 1.0      
  24.      
  25.          
  26.     def expectedWhiteHit(self): #glancing, crits, hits
  27.         return self.enrage*self.armorDR*self.AD*(40.0*self.glancing +
  28.             min(self.crit, self.hitNcrit)*2 +
  29.             max(self.hitNcrit - self.crit,0))/100.0
  30.                  
  31.     def expectedWHrage(self):   #On kronos, dodges and parries give rage as if though it was a hit
  32.         return self.enrage*self.armorDR*(1.0/30.0)*self.AD*(40.0*self.glancing +
  33.             min(self.crit, self.hitNcrit)*2 +
  34.             max(self.hitNcrit - self.crit,0))/100.0              
  35.          
  36.     def expectedHST(self):
  37.         return self.enrage*self.armorDR*(self.AD+157.0)*(100.0 - self.dodge + self.crit*self.cMod)/100.0 + 175.0                    
  38.          
  39.                                  
  40.     def TPRHS(self):     #damage per rage for HS - keep in mind the opportunity cost
  41.         return 1.3*1.15*(self.expectedHST() - self.expectedWhiteHit())/((12 + self.expectedWHrage())*(100.0-self.dodge) + (3 + self.expectedWHrage())*(self.dodge))*100
  42.                      
  43.     def TPRSA(self):
  44.         return 1.3*1.15*260.0*(100.0-self.dodge)/100/(12.0*(100.0-self.dodge) + 3.0*(self.dodge))*100  
  45.          
  46. Baseline = Warrior()
  47.  
  48. AD_max = 500
  49. AD_min = 100
  50. i = AD_max - AD_min + 1
  51.  
  52. MH_range = np.linspace(AD_min,AD_max,i)
  53. Charles = Warrior(AD=AD_min)
  54. SA_TPR   = np.empty(i)
  55. HS_TPR   = np.empty(i)
  56. j = 0
  57. for j in range(i):    
  58.     SA_TPR[j] = Charles.TPRSA()
  59.     HS_TPR[j] = Charles.TPRHS()
  60.     Charles.AD = Charles.AD + 1
  61.     '''
  62.    print Charles.expectedHST()
  63.    print Charles.expectedWhiteHit()
  64.    print Charles.expectedWHrage()
  65.    print "next"
  66.    '''
  67.  
  68. import matplotlib.pyplot as plt
  69. fig, ax1 = plt.subplots()
  70. ax1.set_xlabel('Average Weapon Damage')
  71. ax1.set_ylabel('Threat Per Rage',rotation=0)
  72. ax1.yaxis.set_label_coords(0.005, 1.03)
  73.  
  74. ax1.plot(MH_range,SA_TPR,linestyle='dashed',linewidth=1.5,color='k',
  75.          label="Sunder Armor")
  76.  
  77. ax1.plot(MH_range,HS_TPR,linestyle='solid',linewidth=1.5,color='k',
  78.          label="Heroic Strike")
  79. ax1.legend(loc=1,frameon=False,prop={'size':30})
  80.  
  81. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement