def multishot_damage_mod_calc(loadout: mods.loadout) -> None: pass # Imports from math import floor num_bullets_fired = (loadout.loadout_array[20] + loadout.loadout_array[20] * loadout.loadout_array[21]) loadout.loadout_array[21] = num_bullets_fired - floor(num_bullets_fired) loadout.loadout_array[20] = floor(num_bullets_fired)
def get_relevant_mod_list(loadout: mods.loadout, priority: int) -> list: ''' A function to create a list of mods meeting a certain priority from a loadout.''' loadout.update_mod_list() # Get rid of this. relevant_mod_list = [ mod for mod in loadout.mod_list if priority in mod.priority ] return relevant_mod_list
def critical_damage_mod_calc(loadout: mods.loadout) -> None: '''Calculates the critical damage and effective critical chance of the loadout.''' # Imports from math import floor real_critical_chance = (loadout.loadout_array[15] - floor(loadout.loadout_array[15])) loadout.loadout_array[15] = real_critical_chance loadout.loadout_array[:13] = ( loadout.loadout_array[:13] * loadout.loadout_array[16]**floor(real_critical_chance))
def faction_damage_mod_calc(loadout: mods.loadout, target: enemies.Enemy) -> None: # noqa '''Calculates the enhancements of faction damage mods. ''' relevant_mod_list = get_relevant_mod_list(loadout, 7) loadout_array = loadout.loadout_array loadout_crit_array = loadout.loadout_crit_array for mod in relevant_mod_list: mod_array = mod.get_modarray(characteristic=target) loadout_array[:13] = numpy.multiply(loadout_array[:13], mod_array[:13]) loadout_crit_array[:13] = numpy.multiply(loadout_crit_array[:13], mod_array[:13]) loadout.loadout_array = loadout_array loadout.loadout_crit_array = loadout_crit_array
def critical_damage_mod_calc(loadout: mods.loadout) -> None: '''Calculates the critical damage and effective critical chance of the loadout.''' # Imports import math import copy real_critical_chance = (loadout.loadout_array[15] - math.floor(loadout.loadout_array[15])) loadout.loadout_array[15] = real_critical_chance loadout.loadout_crit_array = copy.deepcopy(loadout.loadout_array) loadout.loadout_array[:13] = ( loadout.loadout_array[:13] * loadout.loadout_array[16]**math.floor(real_critical_chance)) loadout.loadout_crit_array[:13] = ( loadout.loadout_array[:13] * loadout.loadout_array[16]**math.ceil(real_critical_chance))
def physical_damage_mod_calc(loadout: mods.loadout) -> None: ''' Calculates the enhancements of physical damage bonus mods. ''' relevant_mod_list = get_relevant_mod_list(loadout, 4) loadout_array = loadout.loadout_array for mod in relevant_mod_list: mod_array = mod.get_modarray() loadout_array[:3] = numpy.multiply(loadout_array[:3], mod_array[:3]) loadout.loadout_array = loadout_array
def base_damage_mod_calc(loadout: mods.loadout) -> None: ''' Calculates the enhancements of base damage mods that equally effects puncture, impact, and slash damages. ''' relevant_mod_list = get_relevant_mod_list(loadout, 1) loadout_array = loadout.loadout_array mod_array = numpy.zeros(20) for mod in relevant_mod_list: mod_array = numpy.add(mod_array, mod.get_modarray() - 1) loadout_array[:3] = (numpy.multiply(loadout_array[:3], mod_array[:3])) loadout.loadout_array = loadout_array
def non_damage_mod_calc(loadout: mods.loadout) -> None: ''' Calculates the enhancements of non-damage type mods such as fire rate, accuracy, critical chance, ... , etc. ''' import copy relevant_mod_list = get_relevant_mod_list(loadout, 0) loadout_array = copy.deepcopy(loadout.weapon.weapon_array) mod_array = numpy.zeros(20) for mod in relevant_mod_list: mod_array = numpy.add(mod_array, mod.get_modarray() - 1) loadout_array[13:] = numpy.multiply(loadout_array[13:], mod_array[13:]) loadout.loadout_array = loadout_array
def first_elemental_mod_calc(loadout: mods.loadout) -> None: ''' Calculates the enhancements of first level elemental damage mods. ''' relevant_mod_list = get_relevant_mod_list(loadout, 2) loadout_array = loadout.loadout_array for mod in relevant_mod_list: mod_array = mod.get_modarray() non_secondary_damage_sum = sum(loadout_array[:7]) non_zero_element = numpy.nonzero(mod_array[:13])[0] loadout_array[non_zero_element] = ( mod_array[non_zero_element] * non_secondary_damage_sum + loadout_array[non_zero_element]) loadout.loadout_array = loadout_array
def first_elemental_mod_calc(loadout: mods.loadout) -> None: ''' Calculates the enhancements of first level elemental damage mods. ''' relevant_mod_list = get_relevant_mod_list(loadout, 2) loadout_array = loadout.loadout_array for mod in relevant_mod_list: mod_array = mod.get_modarray() sum_of_physical_damage = (loadout_array[0] + loadout_array[1] + loadout_array[2]) non_zero_element = numpy.nonzero(mod_array[:13] - 1)[0] loadout_array[non_zero_element] = ( mod_array[non_zero_element] * sum_of_physical_damage + loadout_array[non_zero_element]) loadout.loadout_array = loadout_array