i18n.set_language(test_language) # Set up level/class/race test_level = 90 test_race = race.Race('pandaren') 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(9725.5, 2.6, 'axe', 'dancing_steel') test_oh = stats.Weapon(9725.5, 2.6, 'axe', 'dancing_steel') # Set up procs. test_procs = procs.ProcsList('heroic_vial_of_shadows', 'heroic_wrath_of_unchaining') # Set up gear buffs. test_gear_buffs = stats.GearBuffs('rogue_t14_2pc', 'rogue_t14_4pc', 'leather_specialization', 'vermins_bite', 'chaotic_metagem') # Set up a calcs object.. # str, agi, ap, crit, hit, exp, haste, mast, mh, oh, procs, gear_buffs test_stats = stats.Stats(80, 18000, 250, 2000, 2550, 2550, 4000, 4800, test_mh, test_oh, test_procs, test_gear_buffs)
# 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',
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', 'dancing_steel') test_oh = stats.Weapon(6733, 1.8, 'dagger', 'dancing_steel') # Set up procs. test_procs = procs.ProcsList('heroic_terror_in_the_mists', 'heroic_wrath_of_unchaining') # Set up gear buffs. test_gear_buffs = stats.GearBuffs('rogue_t14_2pc', 'rogue_t14_4pc', 'leather_specialization', 'virmens_bite', 'virmens_bite_prepot', 'chaotic_metagem') # Set up a calcs object.. # str, agi, ap, crit, hit, exp, haste, mast, mh, oh, procs, gear_buffs test_stats = stats.Stats(80, 19000,
# Set up language. Use 'en_US', 'es_ES', 'fr' for specific languages. test_language = 'local' i18n.set_language(test_language) # Set up buffs. test_buffs = buffs.Buffs('short_term_haste_buff', 'stat_multiplier_buff', 'crit_chance_buff', 'all_damage_buff', 'melee_haste_buff', 'attack_power_buff', 'str_and_agi_buff', 'armor_debuff', 'physical_vulnerability_debuff', 'spell_damage_debuff', 'spell_crit_debuff', 'bleed_damage_debuff', 'agi_flask', 'guild_feast') # Set up weapons. test_mh = stats.Weapon(1121, 1.8, 'dagger', 'landslide') test_oh = stats.Weapon(872, 1.4, 'dagger', 'landslide') test_ranged = stats.Weapon(1679.5, 2.0, 'thrown') # Set up procs. test_procs = procs.ProcsList('heroic_the_hungerer', 'heroic_matrix_restabilizer') # Set up gear buffs. test_gear_buffs = stats.GearBuffs('rogue_t12_2pc', 'rogue_t12_4pc', 'leather_specialization', 'potion_of_the_tolvir', 'chaotic_metagem') # Set up a calcs object.. test_stats = stats.Stats(20, 6248, 190, 624, 1331, 297, 1719, 2032, test_mh, test_oh, test_ranged, test_procs, test_gear_buffs)
# Set up level/class/race test_level = 100 test_race = race.Race('troll') test_class = 'rogue' # Set up buffs. test_buffs = buffs.Buffs('short_term_haste_buff', 'stat_multiplier_buff', 'crit_chance_buff', 'mastery_buff', 'haste_buff', 'multistrike_buff', 'versatility_buff', 'attack_power_buff', 'physical_vulnerability_debuff', 'spell_damage_debuff', 'flask_wod_agi', 'food_mop_agi') # Set up weapons: dancing_steel mark_of_the_shattered_hand mark_of_warsong test_mh = stats.Weapon(410., 2.6, 'sword', 'dancing_steel') #test_mh = stats.Weapon(420.5, 1.8, 'dagger', 'mark_of_the_shattered_hand') test_oh = stats.Weapon(410., 2.6, 'sword', 'dancing_steel') # Set up procs. test_procs = procs.ProcsList( ('assurance_of_consequence', 588), ('draenic_philosophers_stone', 620), 'virmens_bite', 'virmens_bite_prepot', 'archmages_incandescence') #trinkets, other things (legendary procs) # Set up gear buffs. test_gear_buffs = stats.GearBuffs('gear_specialization', 'rogue_t17_2pc', 'rogue_t17_4pc') #tier buffs located here # Set up a calcs object.. test_stats = stats.Stats(
def setUp(self): self.mh = stats.Weapon(1000, 2.0, 'dagger', 'hurricane') self.ranged = stats.Weapon(1104, 2.0, 'thrown')
# Set up buffs. test_buffs = buffs.Buffs( 'short_term_haste_buff', 'stat_multiplier_buff', 'crit_chance_buff', 'mastery_buff', 'haste_buff', 'multistrike_buff', 'attack_power_buff', 'armor_debuff', 'physical_vulnerability_debuff', 'spell_damage_debuff', ) # Set up weapons. test_mh = stats.Weapon(571.0, 2.6, 'axe', 'dancing_steel') test_oh = stats.Weapon(571.0, 2.6, 'axe', 'dancing_steel') # Set up procs. test_procs = procs.ProcsList(('assurance_of_consequence', 580), ('haromms_talisman', 580), 'legendary_capacitive_meta', 'fury_of_xuen') # Set up gear buffs. test_gear_buffs = stats.GearBuffs('rogue_t16_2pc', 'rogue_t16_4pc', 'leather_specialization') # Set up a calcs object.. test_stats = stats.Stats( test_mh, test_oh,
#'short_term_haste_buff', 'stat_multiplier_buff', 'crit_chance_buff', 'mastery_buff', 'haste_buff', 'multistrike_buff', 'versatility_buff', 'attack_power_buff', 'physical_vulnerability_debuff', 'spell_damage_debuff', 'agi_flask_mop', 'food_mop_agi' ) # Set up weapons. test_mh = stats.Weapon(812.0, 1.8, 'dagger', 'mark_of_the_shattered_hand') test_oh = stats.Weapon(812.0, 1.8, 'dagger', 'mark_of_the_frostwolf') # Set up procs. test_procs = procs.ProcsList(('scales_of_doom', 691), ('beating_heart_of_the_mountain', 701), 'draenic_agi_pot', 'draenic_agi_prepot', 'archmages_greater_incandescence') # Set up gear buffs. test_gear_buffs = stats.GearBuffs('gear_specialization') # Set up a calcs object.. test_stats = stats.Stats(test_mh, test_oh, test_procs, test_gear_buffs, agi=3650, stam=2426, crit=1539, haste=0,
# Set up language. Use 'en_US', 'es_ES', 'fr' for specific languages. test_language = 'local' i18n.set_language(test_language) # Set up buffs. test_buffs = buffs.Buffs('short_term_haste_buff', 'stat_multiplier_buff', 'crit_chance_buff', 'all_damage_buff', 'melee_haste_buff', 'attack_power_buff', 'str_and_agi_buff', 'armor_debuff', 'physical_vulnerability_debuff', 'spell_damage_debuff', 'spell_crit_debuff', 'bleed_damage_debuff', 'agi_flask', 'guild_feast') # Set up weapons. 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') # Set up procs. test_procs = procs.ProcsList('heroic_prestors_talisman_of_machination', 'fluid_death') # Set up gear buffs. test_gear_buffs = stats.GearBuffs('rogue_t11_2pc', 'leather_specialization', 'potion_of_the_tolvir') # Set up a calcs object.. test_stats = stats.Stats(20, 4788, 190, 1399, 752, 574, 1705, 964, test_mh, test_oh, test_ranged, test_procs, test_gear_buffs)
def get_stats(self): current_stats = { 'str': 0, 'agi': 0, 'ap': 0, 'crit': 0, 'hit': 0, 'exp': 0, 'haste': 0, 'mastery': 0, 'procs': [], 'gear_buffs': [] } current_stats['procs'] = [] current_stats['gear_buffs'] = [ 'leather_specialization' ] #Assuming this rather than give equipment an armor type enchant_slots = self.enchants.keys() tier11_count = 0 tier12_count = 0 tier14_count = 0 for slot in self.gear_slots: for stat in self.stats: current_stats[stat] += getattr(self.current_gear[slot], stat) gear_buff = self.current_gear[slot].gear_buff if 'tier_11' == gear_buff: tier11_count += 1 elif 'tier_12' == gear_buff: tier12_count += 1 elif 'tier_14' == gear_buff: tier14_count += 1 elif len(gear_buff) > 0: current_stats['gear_buffs'].append(gear_buff) if len(self.current_gear[slot].proc) > 0: current_stats['procs'].append(self.current_gear[slot].proc) get_bonus = True for slot_color in self.current_gear[slot].sockets: gem_name = self.gems[slot][slot_color].GetValue() if len(gem_name) > 0: gem = ui_data.gems[gem_name] for stat in gem[1]: if stat == 'proc': current_stats['procs'] += gem[1][stat] elif stat == 'gear_buff': current_stats['gear_buffs'] += gem[1][stat] else: current_stats[stat] += gem[1][stat] if not slot_color in gem[0] and slot_color != 'prismatic': get_bonus = False if get_bonus and len(self.current_gear[slot].bonus_stat) > 0: current_stats[self.current_gear[ slot].bonus_stat] += self.current_gear[slot].bonus_value if slot in enchant_slots and slot not in ('mainhand', 'offhand'): #bugged enchant_name = self.enchants[slot].GetValue() if len(enchant_name) > 0: enchant_data = ui_data.enchants[slot][enchant_name] for stat in enchant_data.keys(): current_stats[stat] += enchant_data[stat] if tier11_count >= 2: current_stats['gear_buffs'].append('rogue_t11_2pc') if tier11_count >= 4: current_stats['procs'].append('rogue_t11_4pc') if tier12_count >= 2: current_stats['gear_buffs'].append('rogue_t12_2pc') if tier12_count >= 4: current_stats['gear_buffs'].append('rogue_t12_4pc') if tier14_count >= 2: current_stats['gear_buffs'].append('rogue_t14_2pc') if tier14_count >= 4: current_stats['gear_buffs'].append('rogue_t14_4pc') mh = self.current_gear['mainhand'] enchant = None #bugged if len(self.enchants['mainhand'].GetValue()) > 0: enchant = ui_data.enchants['melee_weapons'][ self.enchants['mainhand'].GetValue()] mainhand = stats.Weapon(mh.damage, mh.speed, mh.type, enchant) current_stats['mh'] = mainhand oh = self.current_gear['offhand'] enchant = None if len(self.enchants['offhand'].GetValue()) > 0: enchant = ui_data.enchants['melee_weapons'][ self.enchants['offhand'].GetValue()] offhand = stats.Weapon(oh.damage, oh.speed, oh.type, enchant) current_stats['oh'] = offhand current_stats['procs'] = procs.ProcsList(*set(current_stats['procs'])) current_stats['gear_buffs'] = stats.GearBuffs( *set(current_stats['gear_buffs'])) return current_stats
def from_json(json_string, character_class='rogue'): j = json.loads(json_string) try: race_object = race.Race(str(j['race']), character_class=character_class) level = int(j['level']) s = j['settings'] settings_type = s['type'] if settings_type == 'assassination': # AssassinationCycle(self, min_envenom_size_mutilate=4, min_envenom_size_backstab=5, prioritize_rupture_uptime_mutilate=True, prioritize_rupture_uptime_backstab=True) c = s.get('cycle', {}) cycle = settings.AssassinationCycle( c.get('min_envenom_size_mutilate', 4), c.get('min_envenom_size_backstab', 5), c.get('prioritize_rupture_uptime_mutilate', True), c.get('prioritize_rupture_uptime_backstab', True)) elif settings_type == 'combat': # CombatCycle(self, use_rupture=True, use_revealing_strike='sometimes', ksp_immediately=False) c = s.get('cycle', {}) cycle = settings.CombatCycle( c.get('use_rupture', True), c.get('use_revealing_strike', 'sometimes'), c.get('ksp_immediately', False)) elif settings_type == 'subtlety': # SubletySycle(raid_crits_per_second, clip_recuperate=False) c = s['cycle'] cycle = settings.SubtletyCycle(c['raid_crits_per_second'], c.get('clip_recuperate', False)) else: raise InvalidJSONException(_("Missing settings")) # Settings(cycle, time_in_execute_range=.35, tricks_on_cooldown=True, response_time=.5, mh_poison='ip', oh_poison='dp', duration=300): settings_object = settings.Settings( cycle, s.get('time_in_execute_range', .35), s.get('tricks_on_cooldown', True), s.get('response_time', .5), s.get('mh_poison', 'ip'), s.get('oh_poison', 'dp'), s.get('duration', 300)) stats_dict = j['stats'] # Weapon(damage, speed, weapon_type, enchant=None): mh_dict = stats_dict['mh'] mh = stats.Weapon(mh_dict['damage'], mh_dict['speed'], mh_dict['type'], mh_dict.get('enchant')) oh_dict = stats_dict['oh'] oh = stats.Weapon(oh_dict['damage'], oh_dict['speed'], oh_dict['type'], oh_dict.get('enchant')) ranged_dict = stats_dict['ranged'] ranged = stats.Weapon(ranged_dict['damage'], ranged_dict['speed'], ranged_dict['type'], ranged_dict.get('enchant')) procs_list = procs.ProcsList(*stats_dict['procs']) gear_buffs = stats.GearBuffs(*stats_dict['gear_buffs']) # Stats(str, agi, ap, crit, hit, exp, haste, mastery, mh, oh, ranged, procs, gear_buffs, level=85): def s(stat): return int(stats_dict[stat]) stats_object = stats.Stats(s('str'), s('agi'), s('ap'), s('crit'), s('hit'), s('exp'), s('haste'), s('mastery'), mh, oh, ranged, procs_list, gear_buffs, level) glyphs = rogue_glyphs.RogueGlyphs(*j['glyphs']) talents = rogue_talents.RogueTalents(*j['talents']) buffs_object = buffs.Buffs(*j['buffs']) except KeyError as e: raise InvalidJSONException( _("Missing required input {key}").format(key=str(e))) # Calculator(stats, talents, glyphs, buffs, race, settings=None, level=85): return AldrianasRogueDamageCalculator(stats_object, talents, glyphs, buffs_object, race_object, settings=settings_object, level=level)
'crit_chance_buff', 'all_damage_buff', 'melee_haste_buff', 'attack_power_buff', 'str_and_agi_buff', 'armor_debuff', 'physical_vulnerability_debuff', 'spell_damage_debuff', 'spell_crit_debuff', 'bleed_damage_debuff', 'agi_flask', 'guild_feast' ) # Set up weapons. test_mh = stats.Weapon(1356.5, 2.6, '1h_axe', 'landslide') test_oh = stats.Weapon(730.5, 1.4, 'dagger', 'landslide') test_ranged = stats.Weapon(1371.5, 2.2, 'thrown') # Set up procs. test_procs = procs.ProcsList('heroic_prestors_talisman_of_machination', 'fluid_death', 'rogue_t11_4pc') # Set up gear buffs. test_gear_buffs = stats.GearBuffs('rogue_t11_2pc', 'leather_specialization', 'potion_of_the_tolvir', 'chaotic_metagem') # Set up a calcs object.. test_stats = stats.Stats(20, 4746, 190, 1290, 716, 779, 1761, 963, test_mh, test_oh, test_ranged, test_procs, test_gear_buffs) # Initialize talents.. test_talents = rogue_talents.RogueTalents('0232000000000000000', '0332230310032012321', '0030000000000000000')