], 0, ), ]: # First set up a hotfix for the base pool initialization initial_pool = [] for legendary in legendaries: initial_pool.append((legendary, 1, 'WeaponBalanceDefinition')) for i in range( len(uniques) + len(pearls) + len(seraphs) + num_undesirables): initial_pool.append((None, 0)) mp.register_str( 'weapon_pool_clear_{}'.format(guntype.lower()), 'level None set GD_Itempools.WeaponPools.Pool_Weapons_{}_06_Legendary BalancedItems {}' .format( guntype, mp.get_balanced_items(initial_pool), )) # Hotfixes to add uniques for (idx, unique) in enumerate(uniques): unique_hotfixes.append( """level None set GD_Itempools.WeaponPools.Pool_Weapons_{}_06_Legendary BalancedItems[{}] ( ItmPoolDefinition=None, InvBalanceDefinition=WeaponBalanceDefinition'{}', Probability=( BaseValueConstant=1, BaseValueAttribute=None, InitializationDefinition=None,
generate_balanced_items([ '{}_{}'.format(char[1], individual_weight) for char in characters ])) # Now, a general level hotfix to clear out the InitializationDefinition # values in the main loot pools. This is necessary because something that's # not a hotfix but acts like a hotfix will reset InitializationDefinition on # each level load, regardless of what we've done to it beforehand, so we have # to override that. for (weight, pool, individual_weight) in pools: for idx in range(6): mp.register_str( 'com_id_clear_{}_{}'.format(weight, idx), 'level None set {pool} BalancedItems[{idx}].Probability.InitializationDefinition None' .format( pool=pool, idx=idx, )) # OnDemand hotfixes for each player class for idx, (streaming, pool_reg, pool_chronicler, pool_petunia) in enumerate(characters): short = streaming.split('_')[-2] for (weight, pool, individual_weight) in pools: mp.register_str( 'com_{}_set_{}'.format(short, weight), 'demand {streaming} set {pool} BalancedItems[{idx}].Probability.BaseValueConstant 1' .format(
'GD_Gladiator.Character.CharClass_Gladiator'), ('Aurelia', 'Crocus_Baroness_Streaming.Pawn_Baroness', 'Crocus_Baroness.Character.CharClass_Baroness'), ('Fragtrap', 'GD_Prototype_Streaming.Pawn_Prototype', 'GD_Prototype.Character.CharClass_Prototype'), ('Jack', 'Quince_Doppel_Streaming.Pawn_Doppelganger', 'Quince_Doppel.Character.charclass_doppelganger'), ('Nisha', 'GD_Lawbringer_Streaming.Pawn_Lawbringer', 'GD_Lawbringer.Character.CharClass_Lawbringer'), ('Wilhelm', 'GD_Enforcer_Streaming.Pawn_Enforcer', 'GD_Enforcer.Character.CharClass_Enforcer'), ]: (pkg, shortobj) = streaming_obj.split('.', 1) mp.register_str( 'GroundSpeed', 'demand {} set {} GroundSpeed {}'.format(pkg, streaming_obj, ground_speed)) mp.register_str( 'GroundSpeedBaseValue', 'demand {} set {} GroundSpeedBaseValue {}'.format( pkg, streaming_obj, ground_speed)) mp.register_str( 'AirSpeed', 'demand {} set {} AirSpeed {}'.format(pkg, streaming_obj, air_speed)) mp.register_str( 'AirSpeedBaseValue', 'demand {} set {} AirSpeedBaseValue {}'.format( pkg, streaming_obj, air_speed)) mp.register_str( 'JumpZ',
mp.register_str( 'luneshine_override_{}'.format(idx + 1), """level None set {} Accessory2PartData ( bEnabled=True, WeightedParts=( ( bDisabled=True, Part=WeaponPartDefinition'GD_Weap_Accessories.Moonstone.Moonstone_Attachment_None', Manufacturers=( ( Manufacturer=None, DefaultWeightIndex=1 ) ), MinGameStageIndex=0, MaxGameStageIndex=1, DefaultWeightIndex=1 ), ( bDisabled=False, Part=WeaponPartDefinition'GD_Weap_Accessories.Moonstone.Moonstone_Attachment_FastLearner', Manufacturers=( ( Manufacturer=None, DefaultWeightIndex=1 ) ), MinGameStageIndex=0, MaxGameStageIndex=1, DefaultWeightIndex=1 ), ( bDisabled=False, Part=WeaponPartDefinition'GD_Weap_Accessories.Moonstone.Moonstone_Attachment_HardenUp', Manufacturers=( ( Manufacturer=None, DefaultWeightIndex=1 ) ), MinGameStageIndex=0, MaxGameStageIndex=1, DefaultWeightIndex=1 ), ( bDisabled=False, Part=WeaponPartDefinition'GD_Weap_Accessories.Moonstone.Moonstone_Attachment_Boominator', Manufacturers=( ( Manufacturer=None, DefaultWeightIndex=1 ) ), MinGameStageIndex=0, MaxGameStageIndex=1, DefaultWeightIndex=1 ), ( bDisabled=False, Part=WeaponPartDefinition'GD_Weap_Accessories.Moonstone.Moonstone_Attachment_Safeguard', Manufacturers=( ( Manufacturer=None, DefaultWeightIndex=1 ) ), MinGameStageIndex=0, MaxGameStageIndex=1, DefaultWeightIndex=1 ), ( bDisabled=False, Part=WeaponPartDefinition'GD_Weap_Accessories.Moonstone.Moonstone_Attachment_Oxygenator', Manufacturers=( ( Manufacturer=None, DefaultWeightIndex=1 ) ), MinGameStageIndex=0, MaxGameStageIndex=1, DefaultWeightIndex=1 ), ( bDisabled=False, Part=WeaponPartDefinition'GD_Weap_Accessories.Moonstone.Moonstone_Attachment_PiercingRounds', Manufacturers=( ( Manufacturer=None, DefaultWeightIndex=1 ) ), MinGameStageIndex=0, MaxGameStageIndex=1, DefaultWeightIndex=1 ), ( bDisabled=False, Part=WeaponPartDefinition'GD_Weap_Accessories.Moonstone.Moonstone_Attachment_Punisher', Manufacturers=( ( Manufacturer=None, DefaultWeightIndex=1 ) ), MinGameStageIndex=0, MaxGameStageIndex=1, DefaultWeightIndex=1 ), ( bDisabled=False, Part=WeaponPartDefinition'GD_Weap_Accessories.Moonstone.Moonstone_Attachment_Serenity', Manufacturers=( ( Manufacturer=None, DefaultWeightIndex=1 ) ), MinGameStageIndex=0, MaxGameStageIndex=1, DefaultWeightIndex=1 ) ) )""".format(partlist))
### ### Output variables ### mod_name = 'Guaranteed Varkid Evolution' mod_version = '1.1.0' output_filename = '{}.blcm'.format(mod_name) ### ### Generate hotfixes! ### for morph in range(1, 6): mp.register_str( 'varkid_clear_{}'.format(morph), 'level None set GD_Balance.WeightingPlayerCount.BugmorphCocoon_PerPlayers_Phase{} ConditionalInitialization.ConditionalExpressionList ()' .format(morph)) mp.register_str( 'varkid_default_{}'.format(morph), 'level None set GD_Balance.WeightingPlayerCount.BugmorphCocoon_PerPlayers_Phase{} ConditionalInitialization.DefaultBaseValue.BaseValueConstant 1.0' .format(morph)) ### ### Generate the mod string ### mod_str = """BL2 #<{mod_name}> # {mod_name} v{mod_version} # by Apocalyptech