diff --git a/README.md b/README.md index 9f66542d..f8c3b147 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,9 @@ * No longer deactivated if the perk machine is powered off * Added high qualty perk icons to all maps +### Juggernog +* Increases current health by 100 upon purchase (normally sets current health to max) + ### Quick Revive * No longer automatically powered on in solo * Increased cost in solo from 500 to 1500 diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index 58d6eb7e..90ab1d56 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -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); diff --git a/scripts/zm/replaced/_zm_perks.gsc b/scripts/zm/replaced/_zm_perks.gsc index 67902ea6..6ed275a9 100644 --- a/scripts/zm/replaced/_zm_perks.gsc +++ b/scripts/zm/replaced/_zm_perks.gsc @@ -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() {