forked from Aldriana/ShadowCraft-Engine
-
Notifications
You must be signed in to change notification settings - Fork 12
/
__init__.py
1902 lines (1632 loc) · 103 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#import copy
import gettext
import __builtin__
import math
from operator import add
from copy import copy
__builtin__._ = gettext.gettext
from shadowcraft.calcs.rogue import RogueDamageCalculator
from shadowcraft.core import exceptions
from shadowcraft.objects import procs
from shadowcraft.objects import proc_data
class InputNotModeledException(exceptions.InvalidInputException):
# I'll return these when inputs don't make sense to the model.
pass
class AldrianasRogueDamageCalculator(RogueDamageCalculator):
###########################################################################
# Main DPS comparison function. Calls the appropriate sub-function based
# on talent tree.
###########################################################################
def get_dps(self):
super(AldrianasRogueDamageCalculator, self).get_dps()
if self.settings.is_assassination_rogue():
self.init_assassination()
return self.assassination_dps_estimate()
elif self.settings.is_combat_rogue():
return self.combat_dps_estimate()
elif self.settings.is_subtlety_rogue():
return self.subtlety_dps_estimate()
else:
raise InputNotModeledException(_('You must specify a spec.'))
def get_dps_breakdown(self):
if self.settings.is_assassination_rogue():
self.init_assassination()
return self.assassination_dps_breakdown()
elif self.settings.is_combat_rogue():
return self.combat_dps_breakdown()
elif self.settings.is_subtlety_rogue():
return self.subtlety_dps_breakdown()
else:
raise InputNotModeledException(_('You must specify a spec.'))
###########################################################################
# General object manipulation functions that we'll use multiple places.
###########################################################################
PRECISION_REQUIRED = 10 ** -7
def are_close_enough(self, old_dist, new_dist, precision=PRECISION_REQUIRED):
for item in new_dist:
if item not in old_dist:
return False
elif not hasattr(new_dist[item], '__iter__'):
if abs(new_dist[item] - old_dist[item]) > precision:
return False
else:
for index in range(len(new_dist[item])):
if abs(new_dist[item][index] - old_dist[item][index]) > precision:
return False
return True
###########################################################################
# Overrides: these make the ep methods default to glyphs/talents or weapon
# setups that we are really modeling.
###########################################################################
def get_glyphs_ranking(self, list=None):
if list is None:
list = [
'vendetta',
'energy',
'disappearance',
]
return super(AldrianasRogueDamageCalculator, self).get_glyphs_ranking(list)
def get_talents_ranking(self, list=None):
if list is None:
list = [
'nightstalker',
'subterfuge',
'shadow_focus',
#'shuriken_toss',
'marked_for_death',
'anticipation',
'lemon_zest',
'death_from_above',
'shadow_reflection',
]
return super(AldrianasRogueDamageCalculator, self).get_talents_ranking(list)
def get_oh_weapon_modifier(self, setups=None):
if setups is None:
setups = [
(None, {'hand':'oh', 'type':'one-hander', 'speed':2.6}),
(None, {'hand':'oh', 'type':'dagger', 'speed':1.8})
]
return super(AldrianasRogueDamageCalculator, self).get_oh_weapon_modifier(setups)
###########################################################################
# General modeling functions for pulling information useful across all
# models.
###########################################################################
def heroism_uptime_per_fight(self):
if not self.buffs.short_term_haste_buff:
return 0
total_uptime = 0
remaining_duration = self.settings.duration
while remaining_duration > 0:
total_uptime += min(remaining_duration, 40)
remaining_duration -= 600
return total_uptime * 1.0 / self.settings.duration
def get_heroism_haste_multiplier(self):
# Just average-casing for now. Should fix that at some point.
return 1 + .3 * self.heroism_uptime_per_fight()
def get_cp_distribution_for_cycle(self, cp_distribution_per_move, target_cp_quantity):
avg_cp_per_cpg = sum([key * cp_distribution_per_move[key] for key in cp_distribution_per_move])
time_spent_at_cp = [0, 0, 0, 0, 0, 0]
cur_min_cp = 0
cur_dist = {(0, 0): 1}
while cur_min_cp < target_cp_quantity:
cur_min_cp += 1
new_dist = {}
for (cps, moves), prob in cur_dist.items():
if cps >= cur_min_cp:
if (cps, moves) in new_dist:
new_dist[(cps, moves)] += prob
else:
new_dist[(cps, moves)] = prob
else:
for (move_cp, move_prob) in cp_distribution_per_move.items():
total_cps = cps + move_cp
if total_cps > 5:
total_cps = 5
dist_entry = (total_cps, moves + 1)
time_spent_at_cp[total_cps] += move_prob * prob
if dist_entry in new_dist:
new_dist[dist_entry] += move_prob * prob
else:
new_dist[dist_entry] = move_prob * prob
cur_dist = new_dist
for (cps, moves), prob in cur_dist.items():
time_spent_at_cp[cps] += prob
total_weight = sum(time_spent_at_cp)
for i in xrange(6):
time_spent_at_cp[i] /= total_weight
return cur_dist, time_spent_at_cp, avg_cp_per_cpg
def get_cp_per_cpg(self, base_cp_per_cpg=1, *probs):
# Computes the combined probabilites of getting an additional cp from
# each of the items in probs.
cp_per_cpg = {base_cp_per_cpg: 1}
for prob in probs:
if prob == 0:
continue
new_cp_per_cpg = {}
for cp in cp_per_cpg:
new_cp_per_cpg.setdefault(cp, 0)
new_cp_per_cpg.setdefault(cp + 1, 0)
new_cp_per_cpg[cp] += cp_per_cpg[cp] * (1 - prob)
new_cp_per_cpg[cp + 1] += cp_per_cpg[cp] * prob
cp_per_cpg = new_cp_per_cpg
return cp_per_cpg
def get_crit_rates(self, stats):
base_melee_crit_rate = self.crit_rate(crit=stats['crit'])
crit_rates = {
'mh_autoattacks': min(base_melee_crit_rate, self.dw_mh_hit_chance),
'oh_autoattacks': min(base_melee_crit_rate, self.dw_oh_hit_chance),
}
for attack in ('rupture_ticks', 'shuriken_toss'):
crit_rates[attack] = base_melee_crit_rate
if self.settings.is_assassination_rogue():
spec_attacks = ('mutilate', 'dispatch', 'envenom', 'venomous_wounds')
elif self.settings.is_combat_rogue():
spec_attacks = ('main_gauche', 'sinister_strike', 'revealing_strike', 'eviscerate', 'killing_spree', 'oh_killing_spree', 'mh_killing_spree')
elif self.settings.is_subtlety_rogue():
spec_attacks = ('eviscerate', 'backstab', 'ambush', 'hemorrhage')
if self.settings.dmg_poison == 'dp':
poisons = ('deadly_instant_poison', 'deadly_poison')
elif self.settings.dmg_poison == 'wp':
poisons = ('wound_poison', )
elif self.settings.dmg_poison == 'sp':
poisons = ('swift_poison', )
talent_attacks = ()
if self.talents.death_from_above:
talent_attacks = ('death_from_above', 'death_from_above_strike', 'death_from_above_pulse')
openers = tuple([self.settings.opener_name])
for attack in spec_attacks + poisons + openers + talent_attacks:
#for handling odd crit rates
if attack in ('eviscerate', 'envenom') and self.stats.gear_buffs.rogue_t15_4pc:
crit_rates[attack] = base_melee_crit_rate + .2
else:
crit_rates[attack] = base_melee_crit_rate
for attack, crit_rate in crit_rates.items():
if crit_rate > 1:
crit_rates[attack] = 1
return crit_rates
def set_constants(self):
# General setup that we'll use in all 3 cycles.
self.load_from_advanced_parameters()
self.bonus_energy_regen = 0
self.spec_needs_converge = False
#racials
if self.race.arcane_torrent:
self.bonus_energy_regen += 15. / (120 + self.settings.response_time)
#auxiliary rotational effects
if self.settings.shiv_interval != 0:
self.bonus_energy_regen -= self.get_spell_stats('shiv')[0] / self.settings.shiv_interval
if self.settings.feint_interval != 0:
self.bonus_energy_regen -= self.get_spell_stats('feint')[0] / self.settings.feint_interval
self.set_openers()
#only include if general multiplier applies to spec calculations
self.true_haste_mod *= self.get_heroism_haste_multiplier()
self.base_stats = {
'agi': (self.stats.agi + self.buffs.buff_agi(race=self.race.epicurean) + self.race.racial_agi),
'ap': (self.stats.ap),
'crit': (self.stats.crit + self.buffs.buff_crit(race=self.race.epicurean)),
'haste': (self.stats.haste + self.buffs.buff_haste(race=self.race.epicurean)),
'mastery': (self.stats.mastery + self.buffs.buff_mast(race=self.race.epicurean)),
'readiness': (self.stats.readiness + self.buffs.buff_readiness(race=self.race.epicurean)),
'multistrike': (self.stats.multistrike + self.buffs.buff_multistrike(race=self.race.epicurean)),
'versatility': (self.stats.versatility + self.buffs.buff_versatility(race=self.race.epicurean)),
}
self.stat_multipliers = {
'str': 1.,
'agi': self.buffs.stat_multiplier() * self.stats.gear_buffs.gear_specialization_multiplier(),
'ap': self.buffs.attack_power_multiplier(),
'crit': 1.,
'haste': 1.,
'mastery': 1.,
'readiness': 1.,
'multistrike': 1.,
'versatility': 1.,
}
if self.race.human_spirit:
self.base_stats['versatility'] += self.race.versatility_bonuses[self.level]
for boost in self.race.get_racial_stat_boosts():
if boost['stat'] in self.base_stats:
self.base_stats[boost['stat']] += boost['value'] * boost['duration'] * 1.0 / (boost['cooldown'] + self.settings.response_time)
if self.stats.procs.virmens_bite:
getattr(self.stats.procs, 'virmens_bite').icd = self.settings.duration
if self.stats.procs.virmens_bite_prepot:
getattr(self.stats.procs, 'virmens_bite_prepot').icd = self.settings.duration
if self.stats.procs.draenic_agi_pot:
getattr(self.stats.procs, 'draenic_agi_pot').icd = self.settings.duration
if self.stats.procs.draenic_agi_prepot:
getattr(self.stats.procs, 'draenic_agi_prepot').icd = self.settings.duration
self.base_strength = self.stats.str + self.buffs.buff_str() + self.race.racial_str
self.base_strength *= self.buffs.stat_multiplier()
self.base_intellect = self.stats.int + self.race.racial_int
self.base_intellect *= self.buffs.stat_multiplier()
self.relentless_strikes_energy_return_per_cp = 5 #.20 * 25
#should only include bloodlust if the spec can average it in, deal with this later
self.base_speed_multiplier = 1.4
if self.race.berserking:
self.true_haste_mod *= (1 + .15 * 10. / (180 + self.settings.response_time))
self.true_haste_mod *= 1 + self.race.get_racial_haste() #doesn't include Berserking
self.true_haste_mod *= self.buffs.haste_multiplier()
if self.stats.gear_buffs.rogue_t14_4pc:
self.true_haste_mod *= 1.05
#hit chances
self.dw_mh_hit_chance = self.dual_wield_mh_hit_chance()
self.dw_oh_hit_chance = self.dual_wield_oh_hit_chance()
def load_from_advanced_parameters(self):
self.true_haste_mod = self.get_adv_param('haste_buff', 1., min_bound=.1, max_bound=3.)
self.major_cd_delay = self.get_adv_param('major_cd_delay', 0, min_bound=0, max_bound=600)
self.settings.feint_interval = self.get_adv_param('feint_interval', self.settings.feint_interval, min_bound=0, max_bound=600)
self.settings.is_day = self.get_adv_param('is_day', self.settings.is_day, ignore_bounds=True)
self.get_version_number = self.get_adv_param('print_version', False, ignore_bounds=True)
def get_proc_damage_contribution(self, proc, proc_count, current_stats, average_ap, damage_breakdown):
crit_multiplier = self.crit_damage_modifiers()
crit_rate = self.crit_rate(crit=current_stats['crit'])
if proc.stat == 'spell_damage':
multiplier = self.get_modifiers(current_stats, damage_type='spell')
elif proc.stat == 'physical_damage':
multiplier = self.get_modifiers(current_stats, damage_type='physical')
elif proc.stat == 'physical_dot':
multiplier = self.get_modifiers(current_stats, damage_type='bleed')
elif proc.stat == 'bleed_damage':
multiplier = self.get_modifiers(current_stats, damage_type='bleed')
else:
return 0
if proc.can_crit == False:
crit_rate = 0
proc_value = proc.value
#280+75% AP
if proc is getattr(self.stats.procs, 'legendary_capacitive_meta'):
crit_rate = self.crit_rate(crit=current_stats['crit'])
proc_value = average_ap * 1.5 + 50
if proc is getattr(self.stats.procs, 'fury_of_xuen'):
crit_rate = self.crit_rate(crit=current_stats['crit'])
proc_value = (average_ap * .40 + 1) * 10 * (1 + min(4., self.settings.num_boss_adds))
average_hit = proc_value * multiplier
average_damage = average_hit * (1 + crit_rate * (crit_multiplier - 1)) * proc_count
#print proc.proc_name, average_hit, multiplier
if proc.stat == 'physical_dot':
average_damage *= proc.uptime / proc_count
return average_damage
def set_openers(self):
# Sets the swing_reset_spacing and total_openers_per_second variables.
opener_cd = [10, 20][self.settings.opener_name == 'garrote']
if self.settings.is_subtlety_rogue():
opener_cd = 30
if self.settings.use_opener == 'always':
opener_spacing = (self.get_spell_cd('vanish') + self.settings.response_time)
total_openers_per_second = (1. + math.floor((self.settings.duration - opener_cd) / opener_spacing)) / self.settings.duration
elif self.settings.use_opener == 'opener':
total_openers_per_second = 1. / self.settings.duration
opener_spacing = None
else:
total_openers_per_second = 0
opener_spacing = None
self.total_openers_per_second = total_openers_per_second
self.swing_reset_spacing = opener_spacing
def get_bonus_energy_from_openers(self, *cycle_abilities):
if self.settings.opener_name not in cycle_abilities:
# if not a normal rotational ability, it should cost the player energy
return -1 * self.get_net_energy_cost(self.settings.opener_name) * self.get_shadow_focus_multiplier() * self.total_openers_per_second
elif not self.talents.shadow_focus:
# or a rotational ability and without SF then
return 0
else:
# else, it's a rotational ability and we have SF, so we should add energy
# this lets us save computational time in the aps methods
return self.get_net_energy_cost(self.settings.opener_name) * (1 - self.get_shadow_focus_multiplier()) * self.total_openers_per_second
def get_net_energy_cost(self, ability):
return self.get_spell_stats(ability)[0]
def get_mh_procs_per_second(self, proc, attacks_per_second, crit_rates):
triggers_per_second = 0
if proc.procs_off_auto_attacks():
if proc.procs_off_crit_only():
if 'mh_autoattacks' in attacks_per_second:
triggers_per_second += attacks_per_second['mh_autoattacks'] * crit_rates['mh_autoattacks']
else:
if 'mh_autoattack_hits' in attacks_per_second:
triggers_per_second += attacks_per_second['mh_autoattack_hits']
if proc.procs_off_strikes():
for ability in ('mutilate', 'dispatch', 'backstab', 'revealing_strike', 'sinister_strike', 'ambush', 'hemorrhage', 'mh_killing_spree', 'shuriken_toss'):
if ability in attacks_per_second:
if proc.procs_off_crit_only():
triggers_per_second += attacks_per_second[ability] * crit_rates[ability]
else:
triggers_per_second += attacks_per_second[ability]
for ability in ('envenom', 'eviscerate'):
if ability in attacks_per_second:
if proc.procs_off_crit_only():
triggers_per_second += sum(attacks_per_second[ability]) * crit_rates[ability]
else:
triggers_per_second += sum(attacks_per_second[ability])
if proc.procs_off_apply_debuff() and not proc.procs_off_crit_only():
if 'rupture' in attacks_per_second:
triggers_per_second += attacks_per_second['rupture']
if 'garrote' in attacks_per_second:
triggers_per_second += attacks_per_second['garrote']
if 'hemorrhage_ticks' in attacks_per_second:
triggers_per_second += attacks_per_second['hemorrhage']
return triggers_per_second * proc.get_proc_rate(self.stats.mh.speed)
def get_oh_procs_per_second(self, proc, attacks_per_second, crit_rates):
triggers_per_second = 0
if proc.procs_off_auto_attacks():
if proc.procs_off_crit_only():
if 'oh_autoattacks' in attacks_per_second:
triggers_per_second += attacks_per_second['oh_autoattacks'] * crit_rates['oh_autoattacks']
else:
if 'oh_autoattack_hits' in attacks_per_second:
triggers_per_second += attacks_per_second['oh_autoattack_hits']
if proc.procs_off_strikes():
for ability in ('mutilate', 'oh_killing_spree'):
if ability in attacks_per_second:
if proc.procs_off_crit_only():
triggers_per_second += attacks_per_second[ability] * crit_rates[ability]
else:
triggers_per_second += attacks_per_second[ability]
return triggers_per_second * proc.get_proc_rate(self.stats.oh.speed)
def get_other_procs_per_second(self, proc, attacks_per_second, crit_rates):
triggers_per_second = 0
if proc.procs_off_harmful_spells():
for ability in ('deadly_instant_poison', 'wound_poison', 'venomous_wounds'):
if ability in attacks_per_second:
if proc.procs_off_crit_only():
triggers_per_second += attacks_per_second[ability] * crit_rates[ability]
else:
triggers_per_second += attacks_per_second[ability]
if proc.procs_off_periodic_spell_damage():
if 'deadly_poison' in attacks_per_second:
if proc.procs_off_crit_only():
triggers_per_second += attacks_per_second['deadly_poison'] * crit_rates['deadly_poison']
else:
triggers_per_second += attacks_per_second['deadly_poison']
if proc.procs_off_bleeds():
if 'rupture_ticks' in attacks_per_second:
if proc.procs_off_crit_only():
triggers_per_second += sum(attacks_per_second['rupture_ticks']) * crit_rates['rupture']
else:
triggers_per_second += sum(attacks_per_second['rupture_ticks'])
if 'garrote_ticks' in attacks_per_second:
if proc.procs_off_crit_only():
triggers_per_second += attacks_per_second['garrote_ticks'] * crit_rates['garrote']
else:
triggers_per_second += attacks_per_second['garrote_ticks']
if 'hemorrhage_ticks' in attacks_per_second and not proc.procs_off_crit_only():
triggers_per_second += attacks_per_second['hemorrhage_ticks']
if proc.is_ppm():
if triggers_per_second == 0:
return 0
else:
raise InputNotModeledException(_('PPMs that also proc off spells are not yet modeled.'))
else:
return triggers_per_second * proc.get_proc_rate()
def get_procs_per_second(self, proc, attacks_per_second, crit_rates):
# TODO: Include damaging proc hits in figuring out how often everything else procs.
if getattr(proc, 'mh_only', False):
procs_per_second = self.get_mh_procs_per_second(proc, attacks_per_second, crit_rates)
elif getattr(proc, 'oh_only', False):
procs_per_second = self.get_oh_procs_per_second(proc, attacks_per_second, crit_rates)
else:
procs_per_second = self.get_mh_procs_per_second(proc, attacks_per_second, crit_rates)
procs_per_second += self.get_oh_procs_per_second(proc, attacks_per_second, crit_rates)
procs_per_second += self.get_other_procs_per_second(proc, attacks_per_second, crit_rates)
return procs_per_second
def lost_swings_from_swing_delay(self, delay, swing_timer):
# delay = swing delay = s (see: graphs)
# swing timer = x (see: graphs)
delay_remainder = delay % .5 #m
num_sum = min(swing_timer, delay) #n
#TODO: Wiki Documentation explaining swing delay calculations
#OLD SWING DELAY METHODS: delay//swing_timer + (delay%swing_timer)/swing_timer
# : delay/swing_timer
# : OH is the same value but 1 lower
t0 = max(min( delay_remainder/swing_timer*1.5, 1.5 ), 0)
t1 = max(min( num_sum - delay_remainder, .5 )/swing_timer, 0)
t2 = max(min( num_sum - delay_remainder - .5, .5 )/swing_timer * .5, 0)
#print "total delay: ", t0, t1, t2, (t0+t1+t2)
return (t0+t1+t2)/swing_timer
def set_uptime_for_ramping_proc(self, proc, procs_per_second):
time_for_one_stack = 1 / procs_per_second
if time_for_one_stack * proc.max_stacks > self.settings.duration:
max_stacks_reached = self.settings.duration * procs_per_second
proc.uptime = max_stacks_reached / 2
else:
missing_stacks = proc.max_stacks * (proc.max_stacks + 1) / 2
stack_time_lost = missing_stacks * time_for_one_stack
proc.uptime = proc.max_stacks - stack_time_lost / self.settings.duration
def update_with_damaging_proc(self, proc, attacks_per_second, crit_rates):
if proc.is_real_ppm():
#http://us.battle.net/wow/en/forum/topic/8197741003?page=4#79
haste = 1.
if proc.haste_scales:
haste *= self.true_haste_mod * self.stats.get_haste_multiplier_from_rating(self.base_stats['haste'])
if proc.att_spd_scales:
haste *= 1.4
#The 1.1307 is a value that increases the proc rate due to bad luck prevention. It /should/ be constant among all rppm proc styles
if not proc.icd:
frequency = haste * 1.1307 * proc.get_rppm_proc_rate() / 60
else:
mean_proc_time = 60. / (haste * proc.get_rppm_proc_rate()) + proc.icd - min(proc.icd, 10)
if proc.max_stacks > 1: # just correct if you only do damage on max_stacks, e.g. legendary_capacitive_meta
mean_proc_time *= proc.max_stacks
frequency = 1.1307 / mean_proc_time
else:
if proc.icd:
frequency = 1. / (proc.icd + 0.5 / self.get_procs_per_second(proc, attacks_per_second, crit_rates))
else:
frequency = self.get_procs_per_second(proc, attacks_per_second, crit_rates)
if proc.proc_name in attacks_per_second:
attacks_per_second[proc.proc_name] += frequency
else:
attacks_per_second[proc.proc_name] = frequency
def get_shadow_focus_multiplier(self):
if self.talents.shadow_focus:
return (1 - .75)
return 1.
def setup_unique_procs(self, current_stats, average_ap):
if self.stats.procs.rocket_barrage:
getattr(self.stats.procs, 'rocket_barrage').value = 0.42900 * self.base_intellect + .5 * average_ap + 1 + self.level * 2 #need to update
if self.stats.procs.touch_of_the_grave:
getattr(self.stats.procs, 'touch_of_the_grave').value = 8 * self.tools.get_constant_scaling_point(self.level) # +/- 15% spread
def get_poison_counts(self, attacks_per_second, current_stats):
# Builds a phony 'poison' proc object to count triggers through the proc
# methods.
poison = procs.Proc(**proc_data.allowed_procs['rogue_poison'])
mh_hits_per_second = self.get_mh_procs_per_second(poison, attacks_per_second, None)
oh_hits_per_second = self.get_oh_procs_per_second(poison, attacks_per_second, None)
total_hits_per_second = mh_hits_per_second + oh_hits_per_second
if poison:
poison_base_proc_rate = .3
else:
return
proc_multiplier = 1
if self.settings.is_combat_rogue():
if self.settings.cycle.blade_flurry:
ms_value = 1 + min(2 * (self.stats.get_multistrike_chance_from_rating(rating=current_stats['multistrike']) + self.buffs.multistrike_bonus()), 2)
proc_multiplier += min(self.settings.num_boss_adds, [4, 999][self.level==100]) * ms_value
if self.settings.is_assassination_rogue():
poison_base_proc_rate += .2
poison_envenom_proc_rate = poison_base_proc_rate + .3
aps_envenom = attacks_per_second['envenom']
if self.talents.death_from_above:
aps_envenom = map(add, attacks_per_second['death_from_above_strike'], attacks_per_second['envenom'])
envenom_uptime = min(sum([(1 + cps + self.stats.gear_buffs.rogue_t15_2pc_bonus_cp()) * aps_envenom[cps] for cps in xrange(1, 6)]), 1)
avg_poison_proc_rate = poison_base_proc_rate * (1 - envenom_uptime) + poison_envenom_proc_rate * envenom_uptime
else:
avg_poison_proc_rate = poison_base_proc_rate
if self.settings.dmg_poison == 'sp':
poison_procs = avg_poison_proc_rate * total_hits_per_second * proc_multiplier - 1 / self.settings.duration
attacks_per_second['swift_poison'] = poison_procs
elif self.settings.dmg_poison == 'dp':
poison_procs = avg_poison_proc_rate * total_hits_per_second * proc_multiplier - 1 / self.settings.duration
attacks_per_second['deadly_instant_poison'] = poison_procs
attacks_per_second['deadly_poison'] = 1. / 3 * proc_multiplier
elif self.settings.dmg_poison == 'wp':
attacks_per_second['wound_poison'] = total_hits_per_second * avg_poison_proc_rate
def determine_stats(self, attack_counts_function):
current_stats = {
'str': self.base_strength,
'agi': self.base_stats['agi'] * self.stat_multipliers['agi'],
'ap': self.base_stats['ap'] * self.stat_multipliers['ap'],
'crit': self.base_stats['crit'] * self.stat_multipliers['crit'],
'haste': self.base_stats['haste'] * self.stat_multipliers['haste'],
'mastery': self.base_stats['mastery'] * self.stat_multipliers['mastery'],
'readiness': self.base_stats['readiness'] * self.stat_multipliers['readiness'],
'multistrike': self.base_stats['multistrike'] * self.stat_multipliers['multistrike'],
'versatility': self.base_stats['versatility'] * self.stat_multipliers['versatility'],
}
self.current_variables = {}
#arrys to store different types of procs
active_procs_rppm_stat_mods = []
active_procs_rppm = []
active_procs_icd = []
active_procs_no_icd = []
damage_procs = []
weapon_damage_procs = []
shatt_hand = 0
for hand in ('mh', 'oh'):
if getattr(getattr(self.stats, hand), 'mark_of_the_shattered_hand'):
self.stats.procs.set_proc('mark_of_the_shattered_hand_dot') #this enables the proc if it's not active, doesn't duplicate
shatt_hand += 1
if shatt_hand > 0:
if shatt_hand > 1:
getattr(self.stats.procs, 'mark_of_the_shattered_hand_dot').proc_rate = 5
else:
getattr(self.stats.procs, 'mark_of_the_shattered_hand_dot').proc_rate = 2.5
self.set_rppm_uptime(getattr(self.stats.procs, 'mark_of_the_shattered_hand_dot'))
if not shatt_hand:
self.stats.procs.del_proc('mark_of_the_shattered_hand_dot')
#sort the procs into groups
for proc in self.stats.procs.get_all_procs_for_stat():
if (proc.stat == 'stats'):
if proc.is_real_ppm():
active_procs_rppm.append(proc)
else:
if proc.icd:
active_procs_icd.append(proc)
else:
active_procs_no_icd.append(proc)
elif proc.stat == 'stats_modifier':
active_procs_rppm_stat_mods.append(proc)
elif proc.stat in ('spell_damage', 'physical_damage', 'physical_dot'):
damage_procs.append(proc)
elif proc.stat == 'extra_weapon_damage':
weapon_damage_procs.append(proc)
#calculate weapon procs
weapon_enchants = set([])
for hand, enchant in [(x, y) for x in ('mh', 'oh') for y in ('dancing_steel', 'mark_of_the_frostwolf',
'mark_of_the_shattered_hand', 'mark_of_the_thunderlord',
'mark_of_the_bleeding_hollow', 'mark_of_warsong')]:
proc = getattr(getattr(self.stats, hand), enchant)
if proc:
setattr(proc, '_'.join((hand, 'only')), True)
if (proc.stat in current_stats or proc.stat == 'stats'):
if proc.is_real_ppm():
active_procs_rppm.append(proc)
else:
if proc.icd:
active_procs_icd.append(proc)
else:
active_procs_no_icd.append(proc)
elif enchant in ('mark_of_the_shattered_hand', ):
damage_procs.append(proc)
static_proc_stats = {
'str': 0,
'agi': 0,
'ap': 0,
'crit': 0,
'haste': 0,
'mastery': 0,
'readiness': 0,
'multistrike': 0,
'versatility': 0,
}
for proc in active_procs_rppm_stat_mods:
self.set_rppm_uptime(proc)
for e in proc.value:
self.stat_multipliers[e] *= 1 + proc.uptime * proc.value[e]
current_stats[e] *= 1 + proc.uptime * proc.value[e]
for proc in active_procs_rppm:
if proc.stat == 'stats':
self.set_rppm_uptime(proc)
for e in proc.value:
static_proc_stats[ e ] += proc.uptime * proc.value[e] * self.stat_multipliers[e]
for k in static_proc_stats:
current_stats[k] += static_proc_stats[ k ]
attacks_per_second, crit_rates, additional_info = attack_counts_function(current_stats)
recalculate_crit = False
#check need to converge
need_converge = False
convergence_stats = False
if len(active_procs_no_icd) > 0:
need_converge = True
while (need_converge or self.spec_needs_converge):
current_stats = {
'str': self.base_strength,
'agi': self.base_stats['agi'] * self.stat_multipliers['agi'],
'ap': self.base_stats['ap'] * self.stat_multipliers['ap'],
'crit': self.base_stats['crit'] * self.stat_multipliers['crit'],
'haste': self.base_stats['haste'] * self.stat_multipliers['haste'],
'mastery': self.base_stats['mastery'] * self.stat_multipliers['mastery'],
'readiness': self.base_stats['readiness'] * self.stat_multipliers['readiness'],
'multistrike': self.base_stats['multistrike'] * self.stat_multipliers['multistrike'],
'versatility': self.base_stats['versatility'] * self.stat_multipliers['versatility'],
}
for k in static_proc_stats:
current_stats[k] += static_proc_stats[k]
for proc in active_procs_no_icd:
self.set_uptime(proc, attacks_per_second, crit_rates)
for e in proc.value:
if e in self.spec_convergence_stats:
convergence_stats = True
if e == 'crit':
recalculate_crit = True
current_stats[ e ] += proc.uptime * proc.value[e] * self.stat_multipliers[e]
#only have to converge with specific procs
#check if... assassination:crit/haste, combat:mastery/haste, sub:haste/mastery
if not convergence_stats and not self.spec_needs_converge:
break
old_attacks_per_second = attacks_per_second
if recalculate_crit:
crit_rates = None
recalculate_crit = False
attacks_per_second, crit_rates, additional_info = attack_counts_function(current_stats, crit_rates=crit_rates)
if self.are_close_enough(old_attacks_per_second, attacks_per_second):
break
for proc in active_procs_icd:
self.set_uptime(proc, attacks_per_second, crit_rates)
for e in proc.value:
if e == 'crit':
recalculate_crit = True
current_stats[ e ] += proc.uptime * proc.value[e] * self.stat_multipliers[e]
#if no new stats are added, skip this step
if len(active_procs_icd) > 0 or self.spec_needs_converge:
if recalculate_crit:
crit_rates = None
attacks_per_second, crit_rates, additional_info = attack_counts_function(current_stats, crit_rates=crit_rates)
# the t16 4pc do not need to be in the main loop because mastery for assa is just increased damage
# and has no impact on the cycle
if self.stats.gear_buffs.rogue_t16_4pc_bonus() and self.settings.is_assassination_rogue():
#20 stacks of 250 mastery, lasts 5 seconds
mas_per_stack = 38.
max_stacks = 20.
buff_duration = 5.
extra_duration = buff_duration - self.settings.response_time
ability_aps = 0
mutilate_aps = 0
for key in ('mutilate', 'dispatch', 'envenom'):
if key in attacks_per_second:
if key in ('envenom'):
ability_aps += sum(attacks_per_second[key])
elif key == 'mutilate':
ability_aps += attacks_per_second[key]
mutilate_aps += attacks_per_second[key]
else:
ability_aps += attacks_per_second[key]
attack_spacing = 1 / ability_aps
# mutilate gives 2 stacks, so it needs to be included
avg_stacks_per_attack = 1 + mutilate_aps / ability_aps
res = 0.
if attack_spacing < 5:
time_to_max = max_stacks * attack_spacing / avg_stacks_per_attack
time_at_max = max(0., self.vendetta_duration - time_to_max)
max_stacks_able_to_reach = min(self.vendetta_duration / attack_spacing, max_stacks)
avg_stacks = max_stacks_able_to_reach / 2
avg = time_to_max * avg_stacks + time_at_max * max_stacks + extra_duration * max_stacks_able_to_reach
res = avg * mas_per_stack / self.get_spell_cd('vendetta')
else:
uptime = buff_duration / attack_spacing
res = self.vendetta_duration * uptime * mas_per_stack * avg_stacks_per_attack / self.get_spell_cd('vendetta')
current_stats['mastery'] += res
#some procs need specific prep, think RoRO/VoS
self.setup_unique_procs(current_stats, current_stats['agi']+current_stats['ap'])
for proc in damage_procs:
self.update_with_damaging_proc(proc, attacks_per_second, crit_rates)
for proc in weapon_damage_procs:
self.set_uptime(proc, attacks_per_second, crit_rates)
return current_stats, attacks_per_second, crit_rates, damage_procs, additional_info
def compute_damage_from_aps(self, current_stats, attacks_per_second, crit_rates, damage_procs, additional_info):
# this method exists solely to let us use cached values you would get from determine stats
# really only useful for combat calculations (restless blades calculations)
damage_breakdown, additional_info = self.get_damage_breakdown(current_stats, attacks_per_second, crit_rates, damage_procs, additional_info)
return damage_breakdown, additional_info
def compute_damage(self, attack_counts_function):
current_stats, attacks_per_second, crit_rates, damage_procs, additional_info = self.determine_stats(attack_counts_function)
damage_breakdown, additional_info = self.get_damage_breakdown(current_stats, attacks_per_second, crit_rates, damage_procs, additional_info)
#damage_breakdown, additional_info = self.get_damage_breakdown(self.determine_stats(attack_counts_function))
return damage_breakdown, additional_info
###########################################################################
# Assassination DPS functions
###########################################################################
def init_assassination(self):
# Call this before calling any of the assassination_dps functions
# directly. If you're just calling get_dps, you can ignore this as it
# happens automatically; however, if you're going to pull a damage
# breakdown or other sub-result, make sure to call this, as it
# initializes many values that are needed to perform the calculations.
if not self.settings.is_assassination_rogue():
raise InputNotModeledException(_('You must specify an assassination cycle to match your assassination spec.'))
if self.stats.mh.type != 'dagger' or self.stats.oh.type != 'dagger':
raise InputNotModeledException(_('Assassination modeling requires daggers in both hands'))
#set readiness coefficient
self.readiness_spec_conversion = self.assassination_readiness_conversion
self.spec_convergence_stats = ['haste', 'crit', 'readiness']
# Assassasins's Resolve
self.damage_modifier_cache = 1.17
#update spec specific proc rates
if getattr(self.stats.procs, 'legendary_capacitive_meta'):
getattr(self.stats.procs, 'legendary_capacitive_meta').proc_rate_modifier = 1.789
if getattr(self.stats.procs, 'fury_of_xuen'):
getattr(self.stats.procs, 'fury_of_xuen').proc_rate_modifier = 1.55
#spec specific glyph behaviour
if self.glyphs.disappearance:
self.ability_cds['vanish'] = 60
else:
self.ability_cds['vanish'] = 120
self.base_energy_regen = 10
self.max_energy = 120.
if self.stats.gear_buffs.rogue_pvp_4pc_extra_energy():
self.max_energy += 30
if self.talents.lemon_zest:
self.base_energy_regen *= 1 + .05 * (1 + min(self.settings.num_boss_adds, 2))
self.max_energy += 15
if self.glyphs.energy:
self.max_energy += 20
if self.race.expansive_mind:
self.max_energy = round(self.max_energy * 1.05, 0)
self.set_constants()
self.stat_multipliers['mastery'] *= 1.05
self.vendetta_duration = 20 + 10 * self.glyphs.vendetta
self.vendetta_uptime = self.vendetta_duration / (self.get_spell_cd('vendetta') + self.settings.response_time + self.major_cd_delay)
self.vendetta_multiplier = .3 - .05 * self.glyphs.vendetta
self.vendetta_mult = 1 + self.vendetta_multiplier * self.vendetta_uptime
def assassination_dps_estimate(self):
non_execute_dps = self.assassination_dps_estimate_non_execute() * (1 - self.settings.time_in_execute_range)
execute_dps = self.assassination_dps_estimate_execute() * self.settings.time_in_execute_range
return non_execute_dps + execute_dps
def assassination_dps_estimate_execute(self):
return sum(self.assassination_dps_breakdown_execute().values())
def assassination_dps_estimate_non_execute(self):
return sum(self.assassination_dps_breakdown_non_execute().values())
def assassination_dps_breakdown(self):
non_execute_dps_breakdown = self.assassination_dps_breakdown_non_execute()
execute_dps_breakdown = self.assassination_dps_breakdown_execute()
non_execute_weight = 1 - self.settings.time_in_execute_range
execute_weight = self.settings.time_in_execute_range
dps_breakdown = {}
for source, quantity in non_execute_dps_breakdown.items():
dps_breakdown[source] = quantity * non_execute_weight
for source, quantity in execute_dps_breakdown.items():
if source in dps_breakdown:
dps_breakdown[source] += quantity * execute_weight
else:
dps_breakdown[source] = quantity * execute_weight
return dps_breakdown
def update_assassination_breakdown_with_modifiers(self, damage_breakdown, current_stats):
#calculate multistrike here for Sub and Assassination, really cheap to calculate
#turns out the 2 chance system yields a very basic linear pattern, the damage modifier is 30% of the multistrike %!
multistrike_multiplier = .3 * 2 * (self.stats.get_multistrike_chance_from_rating(rating=current_stats['multistrike']) + self.buffs.multistrike_bonus())
multistrike_multiplier = min(.6, multistrike_multiplier)
for key in damage_breakdown:
damage_breakdown[key] *= 1 + multistrike_multiplier
if ('sr_' not in key):
damage_breakdown[key] *= self.vendetta_mult
elif 'sr_' in key:
damage_breakdown[key] *= 1 + self.vendetta_multiplier
if self.level == 100 and key in ('mutilate', 'dispatch', 'sr_mutilate', 'sr_mh_mutilate', 'sr_oh_mutilate', 'sr_dispatch'):
damage_breakdown[key] *= self.emp_envenom_percentage
def assassination_dps_breakdown_non_execute(self):
#damage_breakdown, additional_info = self.compute_damage(self.assassination_attack_counts_non_execute)
current_stats, attacks_per_second, crit_rates, damage_procs, additional_info = self.determine_stats(self.assassination_attack_counts_non_execute)
damage_breakdown, additional_info = self.get_damage_breakdown(current_stats, attacks_per_second, crit_rates, damage_procs, additional_info)
self.update_assassination_breakdown_with_modifiers(damage_breakdown, current_stats)
return damage_breakdown
def assassination_dps_breakdown_execute(self):
#damage_breakdown, additional_info = self.compute_damage(self.assassination_attack_counts_execute)
current_stats, attacks_per_second, crit_rates, damage_procs, additional_info = self.determine_stats(self.assassination_attack_counts_execute)
damage_breakdown, additional_info = self.get_damage_breakdown(current_stats, attacks_per_second, crit_rates, damage_procs, additional_info)
self.update_assassination_breakdown_with_modifiers(damage_breakdown, current_stats)
return damage_breakdown
def assassination_cp_distribution_for_finisher(self, current_cp, crit_rates, ability_count, size_breakdown, cp_limit=4, blindside_proc=0, execute=False):
current_sizes = copy(size_breakdown)
if (current_cp >= cp_limit and not blindside_proc and not execute) or current_cp >= 5:
final_cp = min(current_cp, 5)
current_sizes[final_cp] += 1
return final_cp, blindside_proc, ability_count, current_sizes
avg_count = {'mutilate':0, 'dispatch':0}
avg_breakdown = [0,0,0,0,0,0]
new_count = copy(ability_count)
if blindside_proc or execute:
new_count['dispatch'] += 1
n_chance = 1 - crit_rates['dispatch']
n_value, n_proc, n_count, n_breakdown = self.assassination_cp_distribution_for_finisher(current_cp+1, crit_rates, new_count, current_sizes, cp_limit=cp_limit, execute=execute)
c_chance = crit_rates['dispatch']
c_value, c_proc, c_count, c_breakdown = self.assassination_cp_distribution_for_finisher(current_cp+2, crit_rates, new_count, current_sizes, cp_limit=cp_limit, execute=execute)
avg_cp = n_chance*n_value + c_chance*c_value
avg_bs_afterwards = n_chance*n_proc + c_chance*c_proc
for key in new_count:
avg_count[key] = n_chance*n_count[key] + c_chance*c_count[key]
for i in xrange(1, 6):
avg_breakdown[i] = n_chance*n_breakdown[i] + c_chance*c_breakdown[i]
return avg_cp, avg_bs_afterwards, avg_count, avg_breakdown
else:
bs_proc_rate = .3
new_count['mutilate'] += 1
n_chance = ((1 - crit_rates['mutilate']) ** 2) * (1-bs_proc_rate)
n_value, n_proc, n_count, n_breakdown = self.assassination_cp_distribution_for_finisher(current_cp+2, crit_rates, new_count, current_sizes, cp_limit=cp_limit)
n_bs_chance = ((1 - crit_rates['mutilate']) ** 2) * bs_proc_rate
n_bs_value, n_bs_proc, n_bs_count, n_bs_breakdown = self.assassination_cp_distribution_for_finisher(current_cp+2, crit_rates, new_count, current_sizes, cp_limit=cp_limit, blindside_proc=1.)
c_chance = (1 - (1 - crit_rates['mutilate']) ** 2) * (1-bs_proc_rate)
c_value, c_proc, c_count, c_breakdown = self.assassination_cp_distribution_for_finisher(current_cp+3, crit_rates, new_count, current_sizes, cp_limit=cp_limit)
c_bs_chance = (1 - (1 - crit_rates['mutilate']) ** 2) * bs_proc_rate
c_bs_value, c_bs_proc, c_bs_count, c_bs_breakdown = self.assassination_cp_distribution_for_finisher(current_cp+3, crit_rates, new_count, current_sizes, cp_limit=cp_limit, blindside_proc=1.)
avg_cp = n_chance*n_value + n_bs_chance*n_bs_value + c_chance*c_value + c_bs_chance*c_bs_value
avg_bs_afterwards = n_chance*n_proc + n_bs_chance*n_bs_proc + c_chance*c_proc + c_bs_chance*c_bs_proc
for key in new_count:
avg_count[key] = n_chance*n_count[key] + n_bs_chance*n_bs_count[key] + c_chance*c_count[key] + c_bs_chance*c_bs_count[key]
for i in xrange(1, 6):
avg_breakdown[i] = n_chance*n_breakdown[i] + n_bs_chance*n_bs_breakdown[i] + c_chance*c_breakdown[i] + c_bs_chance*c_bs_breakdown[i]
return avg_cp, avg_bs_afterwards, avg_count, avg_breakdown
def assassination_attack_counts(self, current_stats, cpg, finisher_size, crit_rates=None):
attacks_per_second = {}
additional_info = {}
#can't rely on a cache, due to the Cold Blood perk
crit_rates = self.get_crit_rates(current_stats)
haste_multiplier = self.stats.get_haste_multiplier_from_rating(current_stats['haste']) * self.true_haste_mod
ability_cost_modifier = self.stats.gear_buffs.rogue_t15_4pc_reduced_cost()
energy_regen = self.base_energy_regen * haste_multiplier
if self.stats.gear_buffs.rogue_t17_4pc_lfr:
#http://www.wolframalpha.com/input/?i=1.1307+*+%281+-+e+**+%28-1+*+1.1+*+6%2F+60%29%29
#https://twitter.com/Celestalon/status/525350819856535552
energy_regen *= 1 + (.11778034322021550695 * .3) #11% uptime on 30% boost)
energy_regen += self.bonus_energy_regen
if cpg == 'dispatch':
#this is for the effects of pooling going into execute phase
energy_regen += (self.max_energy - 10) / (self.settings.duration * self.settings.time_in_execute_range)
vw_energy_return = 10
vw_energy_per_bleed_tick = vw_energy_return
blindside_proc_rate = [0, .3][cpg == 'mutilate']
attacks_per_second['envenom'] = [0,0,0,0,0,0]
attacks_per_second['dispatch'] = 0
if self.talents.marked_for_death:
energy_regen -= 10. / self.get_spell_cd('marked_for_death') # 35-25
attack_speed_multiplier = self.base_speed_multiplier * haste_multiplier
self.attack_speed_increase = attack_speed_multiplier
seal_fate_proc_rate = crit_rates['dispatch']
if cpg == 'mutilate':
seal_fate_proc_rate *= blindside_proc_rate
seal_fate_proc_rate += 1 - (1 - crit_rates['mutilate']) ** 2
mutilate_cps = 3 - (1 - crit_rates['mutilate']) ** 2 # 1 - (1 - crit_rates['mutilate']) ** 2 is the Seal Fate CP
dispatch_cps = 1 + crit_rates['dispatch']
if self.talents.anticipation:
avg_finisher_size = 5
avg_size_breakdown = [0,0,0,0,0,1.] #this is for determining the % likelyhood of sizes, not frequency of the sizes
cp_needed_per_finisher = 5
if self.stats.gear_buffs.rogue_t17_4pc: