-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pathal
authored and
Pathal
committed
Oct 15, 2012
1 parent
e60c6c5
commit 4c25cd8
Showing
9 changed files
with
209 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
# Simple test program to debug + play with subtlety models. | ||
from os import path | ||
import sys | ||
from import_character import CharacterData | ||
|
||
#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 proc_data | ||
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) | ||
|
||
charInfo = {'region':'us', 'realm':'Doomhammer', 'name':'Pins', 'talents':None} | ||
key = 1 | ||
while key < len(sys.argv): | ||
terms = sys.argv[key].split(':') | ||
charInfo[ terms[0] ] = terms[1] | ||
key += 1 | ||
|
||
print "Loading " + charInfo['name'] + " of " + charInfo['region'] + "-" + charInfo['realm'] + "\n" | ||
character_data = CharacterData(charInfo['region'], charInfo['realm'], charInfo['name']) | ||
character_data.do_import() | ||
|
||
|
||
# Set up level/class/race | ||
test_level = 90 | ||
test_race = race.Race(character_data.get_race()) | ||
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_mop', | ||
'food_300_agi' | ||
) | ||
|
||
# Set up weapons. | ||
|
||
test_mh = stats.Weapon(*character_data.get_mh()) | ||
test_oh = stats.Weapon(*character_data.get_oh()) | ||
|
||
# Set up procs. | ||
character_procs = character_data.get_procs() | ||
character_procs_allowed = filter(lambda p: p in proc_data.allowed_procs, character_procs) | ||
|
||
#not_allowed_procs = set(character_procs) - set(character_procs_allowed) | ||
#print not_allowed_procs | ||
|
||
test_procs = procs.ProcsList(*character_procs_allowed) | ||
|
||
# Set up gear buffs. | ||
character_gear_buffs = character_data.get_gear_buffs() + ['leather_specialization', 'virmens_bite', 'virmens_bite_prepot', 'chaotic_metagem'] | ||
test_gear_buffs = stats.GearBuffs(*character_gear_buffs) | ||
|
||
# Set up a calcs object.. | ||
# str, agi, ap, crit, hit, exp, haste, mast, mh, oh, procs, gear_buffs | ||
#test_stats = stats.Stats(80, 19000, 250, 4800, 2550, 2550, 3000, 5000, test_mh, test_oh, test_procs, test_gear_buffs, pvp_power=0, pvp_resil=0, pvp_target_armor=None) | ||
#[215, 12136, 365, 2486, 2584, 1582, 2423, 4039] | ||
#character_stats = character_data.get_stats() | ||
character_stats = character_data.get_gear_stats() | ||
test_stats = stats.Stats(*(character_stats + [test_mh, test_oh, test_procs, test_gear_buffs]), pvp_power=0, pvp_resil=0, pvp_target_armor=None) | ||
|
||
# Initialize talents.. | ||
if charInfo['talents'] == None: | ||
charInfo['talents'] = character_data.get_talents() | ||
test_talents = talents.Talents(charInfo['talents'], test_class, test_level) | ||
|
||
# Set up glyphs. | ||
glyph_list = character_data.get_glyphs() | ||
test_glyphs = glyphs.Glyphs(test_class, *glyph_list) | ||
|
||
# Set up settings. | ||
raid_crits_per_second = 5 | ||
hemo_interval = 24 #'always', 'never', 24, 25, 26... | ||
if not character_data.get_mh_type() == 'dagger': | ||
if not hemo_interval == 'always': | ||
print "\nALERT: Dagger not found, forced rotation to strictly Hemo \n" | ||
hemo_interval = 'always' | ||
test_cycle = settings.SubtletyCycle(raid_crits_per_second, use_hemorrhage=hemo_interval) | ||
test_settings = settings.Settings(test_cycle, response_time=.5, duration=360, dmg_poison='dp', utl_poison='lp', is_pvp=False) | ||
|
||
# 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()) | ||
talent_ranks = calculator.get_talents_ranking() | ||
|
||
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: | ||
if ("{0:.2f}".format(float(value[1])/total_dps)) != '0.00': | ||
print value[0] + ':' + ' ' * (max_len - len(value[0])), str(value[1]) + ' ('+str( "{0:.2f}".format(100*float(value[1])/total_dps) )+'%)' | ||
else: | ||
print value[0] + ':' + ' ' * (max_len - len(value[0])), str(value[1]) | ||
print '-' * (max_len + 15) | ||
|
||
dicts_for_pretty_print = [ | ||
ep_values, | ||
talent_ranks, | ||
dps_breakdown | ||
] | ||
pretty_print(dicts_for_pretty_print) | ||
print ' ' * (max_length(dicts_for_pretty_print) + 1), total_dps, _("total damage per second.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.