### ### Finally the main interactive app can happen ### # Little banner banner_str = 'Starting gen_arbitrary_partlocks.py v{}'.format(_version) print('') print(color_header + '='*len(banner_str)) print('{}{}'.format(color_header, banner_str)) print(color_header + '='*len(banner_str)) print('') # Grab the balance data = BL3Data() balance = Balance.from_data(data, balance_name) # Flatten out the anointments found in the balance (for ease of display) anointments_flattened = [] for anoint_path, anoints in balance.generics: for (part, weight) in anoints: anointments_flattened.append(AnointPart(part, anoint_path, weight)) # I'd like to display '(no part)' rather than None for the short name if anointments_flattened[-1].short_name == 'None': anointments_flattened[-1].short_name = '(no part)' # Set up the struct we'll use to keep track of actions (with an initial spot for anointment actions) actions = [{}] # Load our part categories into our wrapper CategoryInfo classes categories = []
('Operative', 'OPE', 'OPE'), ('Siren', 'SRN', 'SIR'), ]: for rarity in [ '01_Common', '02_Uncommon', '03_Rare', '04_VeryRare', ]: print('Processing {} {}'.format(base_char, rarity)) base_com_name = f'/Game/Gear/ClassMods/_Design/BalanceDefs/InvBalD_ClassMod_{base_char}_{rarity}' dlc5_com_name = f'/Game/PatchDLC/Ixora/Gear/ClassMods/_Design/{dlc5_dir}/PartSets/InvBalD_CM_Ixora_{dlc5_char}_{rarity}' base_com = Balance.from_data(data, base_com_name) dlc5_com = Balance.from_data(data, dlc5_com_name) # Grab the relevant "new" parts from the DLC5 COMs. Namely, the main COM part, # and all the skill parts. Obviously we're just hardcoding the indicies for # the various categories here. modtype_part = None skill_parts = [] for idx, cat in enumerate(dlc5_com.categories): if idx == 1: assert (len(cat.partlist) == 1) modtype_part = cat.partlist[0].part_name elif idx == 5: for part in cat.partlist: skill_parts.append(part.part_name) assert (modtype_part)
"Maliwan weapon.", ], lic=Mod.CC_BY_SA_40, ) # Some assumptions we can make, since we're just dealing with the one balance: # 1) The "secondary element" part group is the only empty group in the list. # 2) The weights of the elements should all just be 1 (since that's what the Primary element uses) p2p_bal_name = '/Game/PatchDLC/Raid1/Gear/Weapons/Link/Balance/Balance_SM_MAL_Link' extra_elements = [ '/Game/Gear/Weapons/SMGs/Maliwan/_Shared/_Design/Parts/Elemental_Secondary/Part_SM_Mal_ElemSecondary_01_Fire', '/Game/Gear/Weapons/SMGs/Maliwan/_Shared/_Design/Parts/Elemental_Secondary/Part_SM_Mal_ElemSecondary_02_Cryo', '/Game/Gear/Weapons/SMGs/Maliwan/_Shared/_Design/Parts/Elemental_Secondary/Part_SM_Mal_ElemSecondary_03_Shock', '/Game/Gear/Weapons/SMGs/Maliwan/_Shared/_Design/Parts/Elemental_Secondary/Part_SM_Mal_ElemSecondary_04_Radiation', '/Game/Gear/Weapons/SMGs/Maliwan/_Shared/_Design/Parts/Elemental_Secondary/Part_SM_Mal_ElemSecondary_05_Corrosive', ] # Add the parts data = BL3Data() p2p_bal = Balance.from_data(data, p2p_bal_name) for cat in p2p_bal.categories: if len(cat) == 0: cat.enabled = True for element in extra_elements: cat.add_part_name(element, 1) break p2p_bal.hotfix_full(mod) mod.close()
"was apparently cut sometime before release. This sets it as a valid", "legendary Artifact drop. It also increases the health regen rate from", "the 'default' (which is *extremely* weak, presumably before any balancing", "attempts had been made) to something which feels somewhat reasonable.", ], lic=Mod.CC_BY_SA_40, ) art_bal_name = '/Game/Gear/Artifacts/_Design/BalanceDefs/InvBalD_Artifact_05_Legendary' cat_idx = 1 terra_part = '/Game/Gear/Artifacts/_Design/PartSets/Abilities/_Legendary/Misc/PendantOfTerramorphous/Artifact_Part_Ability_PendantOfTerramorphous' # Add the part mod.comment('Set as a valid drop') data = BL3Data() art_bal = Balance.from_data(data, art_bal_name) cat = art_bal.categories[cat_idx] if len(cat) != 14: raise Exception('Expected to find a category with fourteen parts!') cat.add_part_name(terra_part, 1) art_bal.hotfix_balance_full(mod) mod.newline() # Now buff up its health regen rate -- the default is really anemic (presumably it # was scrapped before they got around to looking at balancing it). Default value # is `0.001`. mod.comment('Buff health regen') mod.table_hotfix(Mod.PATCH, '', '/Game/Gear/Artifacts/_Design/Balance/Table_Artifact_Abilities2', 'LEGENDARY_BloodOfTerramorphous_HealthRegen', 'Multiplier',
'/Game/PatchDLC/EventVDay/Gear/Weapon/_Unique/PolyAim/Balance/Balance_SM_MAL_PolyAim', '/Game/PatchDLC/Geranium/Gear/Weapon/_Unique/Antler/Balance/Balance_SG_MAL_ETech_Antler', '/Game/PatchDLC/Geranium/Gear/Weapon/_Unique/Decoupler/Balance/Balance_PS_MAL_Decoupler', '/Game/PatchDLC/Geranium/Gear/Weapon/_Unique/Flipper/Balance/Balance_SM_MAL_Flipper', '/Game/PatchDLC/Geranium/Gear/Weapon/_Unique/Frequency/Balance/Balance_SG_MAL_Frequency', '/Game/PatchDLC/Geranium/Gear/Weapon/_Unique/ImaginaryNumber/Balance/Balance_MAL_SR_ImaginaryNumber', '/Game/PatchDLC/Hibiscus/Gear/Weapon/_Unique/Insider/Balance/Balance_SG_MAL_ETech_Insider', '/Game/PatchDLC/Hibiscus/Gear/Weapon/_Unique/TheNothing/Balance/Balance_SG_MAL_TheNothing', '/Game/PatchDLC/Raid1/Gear/Weapons/KybsWorth/Balance/Balance_SM_MAL_KybsWorth', '/Game/PatchDLC/Alisma/Gear/Weapon/_Unique/BlindBandit/Balance/Balance_SG_MAL_BlindBandit', '/Game/PatchDLC/Alisma/Gear/Weapon/_Unique/BlindBandit/Balance/Balance_SG_MAL_BlindBandit_Epic', '/Game/PatchDLC/Ixora/Gear/Weapons/_Unique/PlasmaCoil/Balance/Balance_SM_MAL_PlasmaCoil', ]: short_bal_name = bal_name.split('/')[-1] bal = Balance.from_data(data, bal_name) weap_type = None primary_cat = None primary_elements = set() secondary_cat = None secondary_elements = set() for cat in bal.categories: for part in cat.partlist: if 'Elemental_Primary' in part.part_name: weap_type = part_type[part.part_name] primary_elements.add(known_parts[part.part_name]) primary_cat = cat elif 'Elemental_Secondary' in part.part_name: secondary_elements.add(known_parts[part.part_name])
# <https://www.gnu.org/licenses/>. import collections from bl3data.bl3data import BL3Data from bl3hotfixmod.bl3hotfixmod import Mod, Balance mod = Mod( 'hellwalker_to_purple_parts.txt', 'Hellwalker -> "Stock" Purple-part Jakbobs Shotgun', 'Apocalyptech', [ "Replaces the Hellwalker balance/partset with the balance/partset from", "a regular purple-part Jakobs Shotgun. Just a test to see if the", "NamingStrategy objects would still do their thing, really.", ], lic=Mod.CC_BY_SA_40, ) # Add the parts data = BL3Data() bal = Balance.from_data( data, '/Game/Gear/Weapons/Shotguns/Jakobs/_Shared/_Design/BalanceState/Balance_SG_JAK_04_VeryRare' ) bal.set_balance_to( '/Game/Gear/Weapons/Shotguns/Jakobs/_Shared/_Design/_Unique/_Legendary/Hellwalker/Balance/Balance_SG_JAK_Hellwalker', data) bal.hotfix_full(mod) mod.close()