mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-10 15:17:57 -05:00
Juggernog: no longer sets health to max upon purchase
This commit is contained in:
@ -46,6 +46,7 @@ main()
|
||||
replaceFunc(maps/mp/zombies/_zm_perks::destroy_weapon_in_blackout, scripts/zm/replaced/_zm_perks::destroy_weapon_in_blackout);
|
||||
replaceFunc(maps/mp/zombies/_zm_perks::give_perk, scripts/zm/replaced/_zm_perks::give_perk);
|
||||
replaceFunc(maps/mp/zombies/_zm_perks::perk_think, scripts/zm/replaced/_zm_perks::perk_think);
|
||||
replaceFunc(maps/mp/zombies/_zm_perks::perk_set_max_health_if_jugg, scripts/zm/replaced/_zm_perks::perk_set_max_health_if_jugg);
|
||||
replaceFunc(maps/mp/zombies/_zm_perks::initialize_custom_perk_arrays, scripts/zm/replaced/_zm_perks::initialize_custom_perk_arrays);
|
||||
replaceFunc(maps/mp/zombies/_zm_power::standard_powered_items, scripts/zm/replaced/_zm_power::standard_powered_items);
|
||||
replaceFunc(maps/mp/zombies/_zm_powerups::full_ammo_powerup, scripts/zm/replaced/_zm_powerups::full_ammo_powerup);
|
||||
|
@ -187,6 +187,66 @@ perk_think( perk )
|
||||
self notify( "perk_lost" );
|
||||
}
|
||||
|
||||
perk_set_max_health_if_jugg( perk, set_premaxhealth, clamp_health_to_max_health )
|
||||
{
|
||||
max_total_health = undefined;
|
||||
if ( perk == "specialty_armorvest" )
|
||||
{
|
||||
if ( set_premaxhealth )
|
||||
{
|
||||
self.premaxhealth = self.maxhealth;
|
||||
}
|
||||
max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
|
||||
}
|
||||
else if ( perk == "specialty_armorvest_upgrade" )
|
||||
{
|
||||
if ( set_premaxhealth )
|
||||
{
|
||||
self.premaxhealth = self.maxhealth;
|
||||
}
|
||||
max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health_upgrade" ];
|
||||
}
|
||||
else if ( perk == "jugg_upgrade" )
|
||||
{
|
||||
if ( set_premaxhealth )
|
||||
{
|
||||
self.premaxhealth = self.maxhealth;
|
||||
}
|
||||
if ( self hasperk( "specialty_armorvest" ) )
|
||||
{
|
||||
max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
|
||||
}
|
||||
else
|
||||
{
|
||||
max_total_health = 100;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( perk == "health_reboot" )
|
||||
{
|
||||
max_total_health = 100;
|
||||
}
|
||||
}
|
||||
if ( isDefined( max_total_health ) )
|
||||
{
|
||||
if ( self maps/mp/zombies/_zm_pers_upgrades_functions::pers_jugg_active() )
|
||||
{
|
||||
max_total_health += level.pers_jugg_upgrade_health_bonus;
|
||||
}
|
||||
missinghealth = self.maxhealth - self.health;
|
||||
self setmaxhealth( max_total_health );
|
||||
self.health -= missinghealth;
|
||||
if ( isDefined( clamp_health_to_max_health ) && clamp_health_to_max_health == 1 )
|
||||
{
|
||||
if ( self.health > self.maxhealth )
|
||||
{
|
||||
self.health = self.maxhealth;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// modifying this function because it is right before perk_machine_spawn_init and has a lot less code
|
||||
initialize_custom_perk_arrays()
|
||||
{
|
||||
|
Reference in New Issue
Block a user