mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-07-02 18:10:26 -05:00
Encounter: fix health resetting on revived
This commit is contained in:
@ -190,12 +190,14 @@ perk_think( perk )
|
|||||||
perk_set_max_health_if_jugg( perk, set_premaxhealth, clamp_health_to_max_health )
|
perk_set_max_health_if_jugg( perk, set_premaxhealth, clamp_health_to_max_health )
|
||||||
{
|
{
|
||||||
max_total_health = undefined;
|
max_total_health = undefined;
|
||||||
|
|
||||||
if ( perk == "specialty_armorvest" )
|
if ( perk == "specialty_armorvest" )
|
||||||
{
|
{
|
||||||
if ( set_premaxhealth )
|
if ( set_premaxhealth )
|
||||||
{
|
{
|
||||||
self.premaxhealth = self.maxhealth;
|
self.premaxhealth = self.maxhealth;
|
||||||
}
|
}
|
||||||
|
|
||||||
max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
|
max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
|
||||||
}
|
}
|
||||||
else if ( perk == "specialty_armorvest_upgrade" )
|
else if ( perk == "specialty_armorvest_upgrade" )
|
||||||
@ -204,6 +206,7 @@ perk_set_max_health_if_jugg( perk, set_premaxhealth, clamp_health_to_max_health
|
|||||||
{
|
{
|
||||||
self.premaxhealth = self.maxhealth;
|
self.premaxhealth = self.maxhealth;
|
||||||
}
|
}
|
||||||
|
|
||||||
max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health_upgrade" ];
|
max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health_upgrade" ];
|
||||||
}
|
}
|
||||||
else if ( perk == "jugg_upgrade" )
|
else if ( perk == "jugg_upgrade" )
|
||||||
@ -212,6 +215,7 @@ perk_set_max_health_if_jugg( perk, set_premaxhealth, clamp_health_to_max_health
|
|||||||
{
|
{
|
||||||
self.premaxhealth = self.maxhealth;
|
self.premaxhealth = self.maxhealth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( self hasperk( "specialty_armorvest" ) )
|
if ( self hasperk( "specialty_armorvest" ) )
|
||||||
{
|
{
|
||||||
max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
|
max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
|
||||||
@ -223,21 +227,32 @@ perk_set_max_health_if_jugg( perk, set_premaxhealth, clamp_health_to_max_health
|
|||||||
}
|
}
|
||||||
else if ( perk == "health_reboot" )
|
else if ( perk == "health_reboot" )
|
||||||
{
|
{
|
||||||
max_total_health = level.player_starting_health;
|
if ( self hasperk( "specialty_armorvest" ) )
|
||||||
|
{
|
||||||
|
max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
max_total_health = level.player_starting_health;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isDefined( max_total_health ) )
|
if ( isDefined( max_total_health ) )
|
||||||
{
|
{
|
||||||
if ( self maps/mp/zombies/_zm_pers_upgrades_functions::pers_jugg_active() )
|
if ( self maps/mp/zombies/_zm_pers_upgrades_functions::pers_jugg_active() )
|
||||||
{
|
{
|
||||||
max_total_health += level.pers_jugg_upgrade_health_bonus;
|
max_total_health += level.pers_jugg_upgrade_health_bonus;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_true( level.sudden_death ) && isDefined( level.sudden_death_health_loss ) )
|
if ( is_true( level.sudden_death ) && isDefined( level.sudden_death_health_loss ) )
|
||||||
{
|
{
|
||||||
max_total_health -= level.sudden_death_health_loss;
|
max_total_health -= level.sudden_death_health_loss;
|
||||||
}
|
}
|
||||||
|
|
||||||
missinghealth = self.maxhealth - self.health;
|
missinghealth = self.maxhealth - self.health;
|
||||||
self setmaxhealth( max_total_health );
|
self setmaxhealth( max_total_health );
|
||||||
self.health -= missinghealth;
|
self.health -= missinghealth;
|
||||||
|
|
||||||
if ( isDefined( clamp_health_to_max_health ) && clamp_health_to_max_health == 1 )
|
if ( isDefined( clamp_health_to_max_health ) && clamp_health_to_max_health == 1 )
|
||||||
{
|
{
|
||||||
if ( self.health > self.maxhealth )
|
if ( self.health > self.maxhealth )
|
||||||
|
@ -1940,6 +1940,18 @@ grief_laststand_weapons_return()
|
|||||||
|
|
||||||
self thread grief_laststand_items_return();
|
self thread grief_laststand_items_return();
|
||||||
|
|
||||||
|
if(is_true(self._retain_perks))
|
||||||
|
{
|
||||||
|
if(isDefined(self.grief_savedperks))
|
||||||
|
{
|
||||||
|
self.perks_active = [];
|
||||||
|
foreach(perk in self.grief_savedperks)
|
||||||
|
{
|
||||||
|
self maps/mp/zombies/_zm_perks::give_perk(perk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self.grief_savedweapon_weapons = undefined;
|
self.grief_savedweapon_weapons = undefined;
|
||||||
|
|
||||||
primaries = self getweaponslistprimaries();
|
primaries = self getweaponslistprimaries();
|
||||||
@ -2045,18 +2057,6 @@ grief_laststand_items_return()
|
|||||||
self [[ self.player_shield_reset_health ]]();
|
self [[ self.player_shield_reset_health ]]();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_true(self._retain_perks))
|
|
||||||
{
|
|
||||||
if(isDefined(self.grief_savedperks))
|
|
||||||
{
|
|
||||||
self.perks_active = [];
|
|
||||||
foreach(perk in self.grief_savedperks)
|
|
||||||
{
|
|
||||||
self maps/mp/zombies/_zm_perks::give_perk(perk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sudden_death()
|
sudden_death()
|
||||||
|
Reference in New Issue
Block a user