def calculate(self):
        if not self.initializing:
            gear_stats = self.gear_page.get_stats()
            my_stats = stats.Stats(**gear_stats)
            my_talents = rogue_talents.RogueTalents(*self.talents_page.get_talents())
            my_glyphs = rogue_glyphs.RogueGlyphs(*self.talents_page.get_glyphs())
            my_buffs = buffs.Buffs(*self.buffs_page.current_buffs)
            my_race = race.Race(self.settings_page.get_race())
            test_settings = settings.Settings(self.settings_page.get_cycle(), response_time = self.settings_page.get_response_time())

            self.error_area.SetLabel("")
            try:
                calculator = AldrianasRogueDamageCalculator(my_stats, my_talents, my_glyphs, my_buffs, my_race, test_settings)
                dps = calculator.get_dps()
                ep_values = calculator.get_ep()
                dps_breakdown = calculator.get_dps_breakdown()

            except exceptions.InvalidInputException as e:
                self.error_area.SetLabel(str(e))
            
            self.dps.SetValue(str(dps))
            self.ep_box.SetValue(self.pretty_print(ep_values))
            self.dps_breakdown.SetValue(self.pretty_print(dps_breakdown))
            for stat in GearPage.stats:
                tc = getattr(self, stat)
                tc.SetValue(str(gear_stats[stat]))
Example #2
0
 def test_get_ep(self):
     test_buffs = buffs.Buffs()
     test_mh = stats.Weapon(939.5, 1.8, 'dagger', 'landslide')
     test_oh = stats.Weapon(730.5, 1.4, 'dagger', 'landslide')
     test_ranged = stats.Weapon(1371.5, 2.2, 'thrown')
     test_procs = procs.ProcsList('heroic_prestors_talisman_of_machination', 'fluid_death', 'rogue_t11_4pc')
     test_gear_buffs = stats.GearBuffs('rogue_t11_2pc', 'leather_specialization', 'potion_of_the_tolvir', 'chaotic_metagem')
     test_stats = stats.Stats(20, 4756, 190, 1022, 1329, 597, 1189, 1377, test_mh, test_oh, test_ranged, test_procs, test_gear_buffs)
     test_talents = rogue_talents.RogueTalents('0333230113022110321', '0020000000000000000', '2030030000000000000')
     glyph_list = ['backstab', 'mutilate', 'rupture']
     test_glyphs = rogue_glyphs.RogueGlyphs(*glyph_list)
     test_race = race.Race('night_elf')
     test_cycle = settings.AssassinationCycle()
     test_settings = settings.Settings(test_cycle, response_time=1)
     test_level = 85
     calculator = AldrianasRogueDamageCalculator(test_stats, test_talents, test_glyphs, test_buffs, test_race, test_settings, test_level)
     ep_values = calculator.get_ep()
     self.assertTrue(ep_values['agi'] < 4.0)
     self.assertTrue(ep_values['agi'] > 2.0)
     self.assertTrue(ep_values['yellow_hit'] < 4.0)
     self.assertTrue(ep_values['yellow_hit'] > 1.0)
     self.assertTrue(ep_values['crit'] < 2.0)
     self.assertTrue(ep_values['crit'] > 0.0)
Example #3
0
# Set up glyphs.
glyph_list = ['sinister_strike', 'adrenaline_rush', 'rupture']
test_glyphs = rogue_glyphs.RogueGlyphs(*glyph_list)

# Set up race.
test_race = race.Race('night_elf')

# Set up settings.
test_cycle = settings.CombatCycle()
test_settings = settings.Settings(test_cycle, response_time=1)

# Set up level 
test_level = 85

# Build a DPS object.
calculator = AldrianasRogueDamageCalculator(test_stats, test_talents, test_glyphs, test_buffs, test_race, test_settings, test_level)

print 'WARNING: This module contains bugs.  Probably a lot of them. Don\'t even *think* about trying to draw meaningful decisions from the results at this stage.'

# Compute EP values.
ep_values = calculator.get_ep().items()
ep_values.sort(key=lambda entry: entry[1], reverse=True)
max_len = max(len(entry[0]) for entry in ep_values)
for value in ep_values:
    print value[0] + ':' + ' ' * (max_len - len(value[0])), value[1]

print '---------'

# Compute DPS Breakdown.
dps_breakdown = calculator.combat_dps_breakdown().items()
dps_breakdown.sort(key=lambda entry: entry[1], reverse=True)
Example #4
0
# Set up glyphs.
glyph_list = ['backstab', 'slice_and_dice', 'shadow_dance', 'tricks_of_the_trade']
test_glyphs = rogue_glyphs.RogueGlyphs(*glyph_list)

# Set up race.
test_race = race.Race('night_elf')

# Set up settings.
test_cycle = settings.SubtletyCycle(5)
test_settings = settings.Settings(test_cycle, response_time=1)

# Set up level 
test_level = 85

# 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 talents ranking
main_tree_talents_ranking, off_tree_talents_ranking = calculator.get_talents_ranking()

# Compute DPS Breakdown.
dps_breakdown = calculator.get_dps_breakdown()
total_dps = sum(entry[1] for entry in dps_breakdown.items())

def pretty_print(dict_list):
    max_len = 0
    for i in dict_list:
        dict_values = i.items()
Example #5
0
assert test_stats.mastery == 528


# Initialize talents and test.

test_talents = rogue_talents.RogueTalents('0333230113022110321', '0020000000000000000', '33')

assert test_talents.assassination.master_poisoner == 1
assert test_talents.combat.killing_spree == 0
assert test_talents.subtlety.opportunity == 3


# Set up glyphs and test.
glyph_list = ['backstab', 'mutilate', 'rupture']
test_glyphs = rogue_glyphs.RogueGlyphs(*glyph_list)

assert test_glyphs.backstab
assert not test_glyphs.vendetta


# Build a DPS object, and test some functions.
calculator = AldrianasRogueDamageCalculator(test_stats, test_talents, test_glyphs, test_buffs)
assert calculator.stat_multiplier() == 1.05
assert calculator.physical_damage_multiplier() == 1

assert calculator.oh_penalty() == .5
assert calculator.assassins_resolve()

print calculator.backstab_damage(9001)
print calculator.mutilate_damage(9001)
Example #6
0

# Set up race and test
test_race = race.Race('night_elf')
assert test_race.racial_agi == 210
assert not test_race.get_racial_expertise('1h_sword')

# Set up settings.
test_cycle = settings.AssassinationCycle()
test_settings = settings.Settings(test_cycle, response_time=1)

# Set up level 
test_level = 85

# Build a DPS object, and test some functions.
calculator = AldrianasRogueDamageCalculator(test_stats, test_talents, test_glyphs, test_buffs, test_race, test_settings, test_level)

assert calculator.stats.level == calculator.race.level == calculator.buffs.level == calculator.level == 85
assert test_buffs.buff_agi() == 549 + 90 + 300
calculator.level = 80
assert calculator.stats.level == calculator.race.level == calculator.buffs.level == calculator.level == 80
assert calculator.buffs.buff_agi() == 155 + 90 + 300
calculator.level = 85

assert calculator.oh_penalty() == .5

ep_values = calculator.get_ep().items()
ep_values.sort(key=lambda entry: entry[1], reverse=True)
for value in ep_values:
    print value[0] + ':\t', value[1]
# Set up glyphs.
glyph_list = ['backstab', 'mutilate', 'rupture', 'tricks_of_the_trade']
test_glyphs = rogue_glyphs.RogueGlyphs(*glyph_list)

# Set up race.
test_race = race.Race('night_elf')

# Set up settings.
test_cycle = settings.AssassinationCycle()
test_settings = settings.Settings(test_cycle, response_time=1)

# Set up level 
test_level = 85

# 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 talents ranking
main_tree_talents_ranking, off_tree_talents_ranking = calculator.get_talents_ranking()

# Compute glyphs ranking
glyps_ranking = calculator.get_glyphs_ranking(['vendetta', 'backstab'])

# Compute EP values for procs and gear buffs
tier_ep_values = calculator.get_other_ep(['rogue_t11_4pc', 'rogue_t11_2pc'])
metagem_ep_value = calculator.get_other_ep(['chaotic_metagem'])
trinkets_list = [
    'heroic_key_to_the_endless_chamber',