コード例 #1
0
 def _set_constants_for_level(self):
     self.buffs.level = self.level
     self.stats.level = self.level
     self.race.level = self.level
     self.stats.gear_buffs.level = self.level
     # calculate and cache the level-dependent armor mitigation parameter
     self.armor_mitigation_parameter = armor_mitigation.parameter(self.level)
     # target level dependent constants
     try:
         self.target_base_armor = self.TARGET_BASE_ARMOR_VALUES[self.target_level]
     except KeyError as e:
         raise exceptions.InvalidInputException(_('There\'s no armor value for a target level {level}').format(level=str(e)))
     self.crit_reduction = .01 * self.level_difference
コード例 #2
0
 def _set_constants_for_level(self):
     self.buffs.level = self.level
     self.stats.level = self.level
     self.race.level = self.level
     self.stats.gear_buffs.level = self.level
     # calculate and cache the level-dependent armor mitigation parameter
     self.armor_mitigation_parameter = armor_mitigation.parameter(
         self.level)
     # target level dependent constants
     try:
         self.target_base_armor = self.TARGET_BASE_ARMOR_VALUES[
             self.target_level]
     except KeyError as e:
         raise exceptions.InvalidInputException(
             _('There\'s no armor value for a target level {level}').format(
                 level=str(e)))
     self.crit_reduction = .01 * self.level_difference
コード例 #3
0
ファイル: __init__.py プロジェクト: Kaowa/ShadowCraft-Engine
 def _set_constants_for_level(self):
     self.buffs.level = self.level
     self.stats.level = self.level
     self.race.level = self.level
     # calculate and cache the level-dependent armor mitigation parameter
     self.armor_mitigation_parameter = armor_mitigation.parameter(self.level)
コード例 #4
0
ファイル: __init__.py プロジェクト: Pathal/ShadowCraft-Engine
    def __init__(self, stats, talents, glyphs, buffs, race, settings=None, level=100, target_level=103, char_class='rogue'):
        #load stats, class, procs, etc to main content
        self.tools = class_data.Util()
        self.stats = stats
        self.talents = talents
        self.glyphs = glyphs
        self.buffs = buffs
        self.race = race
        self.char_class = char_class
        self.settings = settings
        self.target_level = target_level
        self.level = level
        
        self.buffs.level = self.level
        self.stats.level = self.level
        self.race.level = self.level
        self.stats.gear_buffs.level = self.level
        # calculate and cache the level-dependent armor mitigation parameter
        self.armor_mitigation_parameter = armor_mitigation.parameter(self.level)
        
        #setup global variables, these get deep-copy and passed to new objects
        self.state_values = {}
        self.state_values['last_event'] = 0
        self.state_values['damage_multiplier'] = 1.0
        self.state_values['gcd_size'] = 1.0
        self.state_values['range'] = 4.0
        self.state_values['stance'] = 0
        self.state_values['player_state'] = 'normal' #normal, casting, 
        self.state_values['cooldown'] = {}
        self.state_values['stat_multipliers'] = {
            'primary':self.stats.gear_buffs.gear_specialization_multiplier(), #armor specialization
            'ap':self.buffs.attack_power_multiplier(),
            'haste':1.0,
            'crit':1.0,
            'mastery':1.0,
            'versatility':1.0,
            'readiness':1.0,
            'multistrike':1.0,
        }
        self.state_values['current_stats'] = {
            'str': (self.stats.str), #useless for rogues now
            'agi': (self.stats.agi + self.race.racial_agi), #+ self.buffs.buff_agi()
            'int': (self.stats.int), #useless for rogues now
            'ap': (self.stats.ap),
            'crit': (self.stats.crit),
            'haste': (self.stats.haste),
            'mastery': (self.stats.mastery), # + self.buffs.buff_mast()
            'readiness': (self.stats.readiness),
            'multistrike': (self.stats.multistrike),
            'versatility': (self.stats.versatility),
        }
        self.state_values['attack_speed'] = 1.0 #decimal value
        self.state_values['haste'] = 1.0 #decimal value
        self.calculate_effective_ap()

        self.state_values['auras'] = [] #handles permanent and temporary
        for e in self.buffs.buffs_debuffs:
            self.state_values['auras'].append(e)
            
        #change stats to match buffs
        
        #combat tables
        self.base_one_hand_miss_rate = 0
        self.base_parry_chance = .03
        self.base_dodge_chance = 0
        self.base_spell_miss_rate = 0
        self.base_dw_miss_rate = .17
        self.base_block_chance = .075
        self.crit_reduction = .01 * (self.target_level - self.level)
        
        #load class module data
        class_variables = self._get_values_for_class()
        for key in class_variables:
            self.state_values[key] = class_variables[key]
            
        #trash objects, for reusing memory
        self.trash_queue = None
コード例 #5
0
 def test_parameter_spot_checks(self):
     self.assertAlmostEqual(5882.5, armor_mitigation.parameter(60))
     self.assertAlmostEqual(10557.5, armor_mitigation.parameter(70))
     self.assertAlmostEqual(15232.5, armor_mitigation.parameter(80))
     self.assertAlmostEqual(26070.0, armor_mitigation.parameter(85))
コード例 #6
0
 def test_parameter_spot_checks(self):
     self.assertAlmostEqual( 5882.5, armor_mitigation.parameter(60))
     self.assertAlmostEqual(10557.5, armor_mitigation.parameter(70))
     self.assertAlmostEqual(15232.5, armor_mitigation.parameter(80))
     self.assertAlmostEqual(26070.0, armor_mitigation.parameter(85))
コード例 #7
0
    def __init__(self, stats, talents, glyphs, buffs, race, settings=None, level=100, target_level=103, char_class='rogue'):
        #load stats, class, procs, etc to main content
        self.tools = class_data.Util()
        self.stats = stats
        self.talents = talents
        self.glyphs = glyphs
        self.buffs = buffs
        self.race = race
        self.char_class = char_class
        self.settings = settings
        self.target_level = target_level
        self.level = level
        
        self.buffs.level = self.level
        self.stats.level = self.level
        self.race.level = self.level
        self.stats.gear_buffs.level = self.level
        # calculate and cache the level-dependent armor mitigation parameter
        self.armor_mitigation_parameter = armor_mitigation.parameter(self.level)
        
        #setup global variables, these get deep-copy and passed to new objects
        self.state_values = {}
        self.state_values['damage_multiplier'] = 1.0
        self.state_values['gcd_size'] = 1.0
        self.state_values['trinket_1'] = {'name':'null', 'last_proc_time': -600}
        self.state_values['trinket_2'] = {'name':'null', 'last_proc_time': -600}
        self.state_values['weapon_proc_1'] = {'name':'null', 'last_proc_time': -600}
        self.state_values['weapon_proc_2'] = {'name':'null', 'last_proc_time': -600}
        self.state_values['cooldown'] = {}
        self.state_values['stat_multipliers'] = {
            'primary':self.stats.gear_buffs.gear_specialization_multiplier(), #armor specialization
            'ap':self.buffs.attack_power_multiplier(),
            'haste':1.0,
            'crit':1.0,
            'mastery':1.0,
            'versatility':1.0,
            'readiness':1.0,
            'multistrike':1.0,
        }
        self.state_values['current_stats'] = {
            'str': (self.stats.str), #useless for rogues now
            'agi': (self.stats.agi + self.race.racial_agi), #+ self.buffs.buff_agi()
            'int': (self.stats.int), #useless for rogues now
            'ap': (self.stats.ap),
            'crit': (self.stats.crit),
            'haste': (self.stats.haste),
            'mastery': (self.stats.mastery), # + self.buffs.buff_mast()
            'readiness': (self.stats.readiness),
            'multistrike': (self.stats.multistrike),
            'versatility': (self.stats.versatility),
        }
        self.calculate_effective_ap()

        self.state_values['auras'] = [] #handles permanent and temporary
        for e in self.buffs.buffs_debuffs:
            self.state_values['auras'].append((e, 'inf')) # ('name', time), time = 'inf' or number
            
        #change stats to match buffs
        
        #combat tables
        self.base_one_hand_miss_rate = 0
        self.base_parry_chance = .03
        self.base_dodge_chance = 0
        self.base_spell_miss_rate = 0
        self.base_dw_miss_rate = .17
        self.base_block_chance = .075
        self.crit_reduction = .01 * (self.target_level - self.level)
        
        #load class module data
        class_variables = self._get_values_for_class()
        for key in class_variables:
            self.state_values[key] = class_variables[key]