Skip to content

Instantly share code, notes, and snippets.

@LeftoverAtoms
Last active October 21, 2025 07:14
Show Gist options
  • Save LeftoverAtoms/835a0e5aca5402f8fa24fe2812a6c5c9 to your computer and use it in GitHub Desktop.
Save LeftoverAtoms/835a0e5aca5402f8fa24fe2812a6c5c9 to your computer and use it in GitHub Desktop.
T8 Zombie Health for T5/T6 Zombies
/*
┌─────────────────────────────────────────────────────────┐
│ Black Ops 4 Health Cap for Black Ops 1/2 Zombies │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ INSTALLATION INSTRUCTIONS │
├─────────────────────────────────────────────────────────┤
│ https://plutonium.pw/docs/modding/loading-mods/ │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ WHAT DOES THIS SCRIPT DO? │
├─────────────────────────────────────────────────────────┤
│ Replaces the classic zombie health calculation with │
│ the one from Black Ops 4. │
│ │
│ Max health for standard zombies is 11,272 at round 35. │
│ │
│ Hellhounds, Pentagon Thief, George Romero, Avogadro, │
│ Jumping Jacks, Warden, Witches, and Panzer Soldat │
│ remain unchanged. │
│ │
│ Maximum health for special zombies by player count: │
│ Astronaut: 180,352 \ 135,264 \ 90,176 \ 45,088 │
│ Napalm: 180,352 \ 135,264 \ 90,176 \ 45,088 │
│ Sonic: 112,720 \ 84,540 \ 56,360 \ 28,180 │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ CHANGE NOTES │
├─────────────────────────────────────────────────────────┤
│ [v1.1.3] │
│ - Improved comment clarity. │
│ - Hide logs behind developer mode. │
│ - Removed dependencies for easier installation. │
│ [v1.1.2] │
│ - Fixed BO1 error due to BO2 include. │
│ [v1.1.1] │
│ - Incorrect value fix. │
│ [v1.1.0] │
│ - Added BO2 support. │
│ - Discovered a possible decompilation error.. but it │
│ has no effect on the result. │
│ - Removed campaign difficulty health modifiers. │
│ - Improved script clarity and comments. │
│ [v1.0.0] │
│ - Initial release. │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ CREDITS │
├─────────────────────────────────────────────────────────┤
│ - [LeftoverAtoms] creator. │
│ - [All0utWar] motivation / just a chill guy. │
│ - [ate47] atian-cod-tools were used to extract scripts. │
└─────────────────────────────────────────────────────────┘
*/
main()
{
level thread zombie_health_monitor();
}
zombie_health_monitor()
{
// Variables are undefined until around this point.
level waittill( "start_of_round" );
while ( true )
{
// level waittill( "zombie_health_changed ");
while ( IsDefined( level.zombie_health_old ) && level.zombie_health == level.zombie_health_old )
{
wait_network_frame();
}
zombie_health_changed();
level.zombie_health_old = level.zombie_health;
}
}
zombie_health_changed()
{
// Let round number be overridden, but keep as a fallback.
round_number = level.round_number;
// We're in No Man's Land.. so use the timer.
if ( IsDefined( level.nml_timer ) && IsDefined( level.on_the_moon ) && !level.on_the_moon )
{
round_number = level.nml_timer;
}
ai_calculate_health( round_number );
update_zombie_health();
/# IPrintLn( "[RR] Set Zombie Health to ", level.zombie_health ); #/
}
// BO4 zombie health calculation.
// FACT: The majority of this code snippet is from the BO2 era.
ai_calculate_health( round_number )
{
if ( round_number > 35 )
{
round_number = 35;
}
level.zombie_health = level.zombie_vars["zombie_health_start"];
for ( i = 2; i <= round_number; i++ )
{
if ( i >= 10 )
{
old_health = level.zombie_health;
level.zombie_health = level.zombie_health + int( level.zombie_health * level.zombie_vars["zombie_health_increase_multiplier"] );
if ( level.zombie_health < old_health )
{
level.zombie_health = old_health;
return;
}
}
else
level.zombie_health = int( level.zombie_health + level.zombie_vars["zombie_health_increase"] );
}
}
// No Man's Land modifies the health of active zombies using the old health calculation.
update_zombie_health()
{
zombies = GetAISpeciesArray( "axis", "zombie" );
for ( i = 0; i < zombies.size; i++ )
{
// Received damage.
if ( zombies[i].health != level.zombie_health )
{
continue;
}
if( zombies[i].gibbed )
{
continue;
}
if ( zombies[i].head_gibbed )
{
continue;
}
zombies[i].health = level.zombie_health;
}
}
// Copied utility function to eliminate dependencies.
// Black Ops 1/2 has different locations for this function.
wait_network_frame()
{
if ( NumRemoteClients() )
{
snapshot_ids = getsnapshotindexarray();
acked = undefined;
while ( !IsDefined( acked ) )
{
level waittill( "snapacknowledged" );
acked = snapshotacknowledged( snapshot_ids );
}
}
else
{
wait(0.1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment