/
mop_assassination.py
101 lines (80 loc) · 3.24 KB
/
mop_assassination.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
# Simple test program to debug + play with assassination models.
from os import path
import sys
sys.path.append(path.abspath(path.join(path.dirname(__file__), '..')))
from shadowcraft.calcs.rogue.Aldriana import AldrianasRogueDamageCalculator
from shadowcraft.calcs.rogue.Aldriana import settings
from shadowcraft.objects import buffs
from shadowcraft.objects import race
from shadowcraft.objects import stats
from shadowcraft.objects import procs
from shadowcraft.objects import talents
from shadowcraft.objects import glyphs
from shadowcraft.core import i18n
# Set up language. Use 'en_US', 'es_ES', 'fr' for specific languages.
test_language = 'local'
i18n.set_language(test_language)
# Set up level/class/race
test_level = 90
test_race = race.Race('night_elf')
test_class = 'rogue'
# Set up buffs.
test_buffs = buffs.Buffs(
'short_term_haste_buff',
'stat_multiplier_buff',
'crit_chance_buff',
'mastery_buff',
'melee_haste_buff',
'attack_power_buff',
'armor_debuff',
'physical_vulnerability_debuff',
'spell_damage_debuff',
'agi_flask',
'guild_feast'
)
# Set up weapons.
test_mh = stats.Weapon(6733, 1.8, 'dagger', 'landslide')
test_oh = stats.Weapon(6733, 1.8, 'dagger', 'landslide')
# Set up procs.
test_procs = procs.ProcsList('heroic_the_hungerer', 'heroic_matrix_restabilizer')
# Set up gear buffs.
test_gear_buffs = stats.GearBuffs('rogue_t14_2pc', 'rogue_t14_4pc', 'leather_specialization', 'potion_of_the_tolvir', 'chaotic_metagem')
# Set up a calcs object..
# str, agi, ap, crit, hit, exp, haste, mast, mh, oh, procs, gear_buffs, level
test_stats = stats.Stats(80, 12000, 0, 2500, 2200, 2200, 2300, 3000, test_mh, test_oh, test_procs, test_gear_buffs, test_level)
# Initialize talents..
test_talents = talents.Talents('322213', test_class, test_level)
# Set up glyphs.
glyph_list = ['recuperate', 'sprint'] #just to have something
test_glyphs = glyphs.Glyphs(test_class, *glyph_list)
# Set up settings.
test_cycle = settings.AssassinationCycle()
test_settings = settings.Settings(test_cycle, response_time=1, duration=360)
# Build a DPS object.
calculator = AldrianasRogueDamageCalculator(test_stats, test_talents, test_glyphs, test_buffs, test_race, test_settings, test_level)
# Compute EP values.
ep_values = calculator.get_ep()
# Compute DPS Breakdown.
dps_breakdown = calculator.get_dps_breakdown()
total_dps = sum(entry[1] for entry in dps_breakdown.items())
def max_length(dict_list):
max_len = 0
for i in dict_list:
dict_values = i.items()
if max_len < max(len(entry[0]) for entry in dict_values):
max_len = max(len(entry[0]) for entry in dict_values)
return max_len
def pretty_print(dict_list):
max_len = max_length(dict_list)
for i in dict_list:
dict_values = i.items()
dict_values.sort(key=lambda entry: entry[1], reverse=True)
for value in dict_values:
print value[0] + ':' + ' ' * (max_len - len(value[0])), value[1]
print '-' * (max_len + 15)
dicts_for_pretty_print = [
ep_values,
dps_breakdown
]
pretty_print(dicts_for_pretty_print)
print ' ' * (max_length(dicts_for_pretty_print) + 1), total_dps, _("total damage per second.")