"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!function ai_calculate_health( round_number )
{
level.zombie_health = 9999;
for ( i=2; i <= round_number; i++ )
{
// After round 10, get exponentially harder
if ( i >= 10 )
{
old_health = level.zombie_health;
level.zombie_health += Int( level.zombie_health * level.zombie_vars["zombie_health_increase_multiplier"] );
if ( level.zombie_health < old_health )
{
// we must have overflowed the signed integer space, just use the last good health, it'll give some headroom to the capped value to account for extra damage applications
level.zombie_health = old_health;
return;
}
}
else
{
level.zombie_health = Int( level.zombie_health + level.zombie_vars["zombie_health_increase"] );
}
}
}
function ai_calculate_health( round_number )
{
level.zombie_health = level.zombie_vars["zombie_health_start"];
for ( i=2; i <= round_number; i++ )
{
// After round 10, get exponentially harder
if ( i >= 10 )
{
old_health = level.zombie_health;
level.zombie_health += Int( level.zombie_health * level.zombie_vars["zombie_health_increase_multiplier"] );
if ( level.zombie_health < old_health )
{
// we must have overflowed the signed integer space, just use the last good health, it'll give some headroom to the capped value to account for extra damage applications
level.zombie_health = old_health;
return;
}
}
else
{
level.zombie_health = Int( level.zombie_health + level.zombie_vars["zombie_health_increase"] );
}
}
}
>mode,zm
>type,common
#include "zm_mod.class"
scriptparsetree,scripts\zm\_zm_perk_quick_revive.gsc
//scriptparsetree,scripts\zm\_zm.gsc
scriptparsetree,scripts\zm\zombie_utility.gsc
///////////////////////////////////////////////////////////////////////////////////////////////////////////
rawfile,dummy.cfg
///////////////////////////////////////////////////////////////////////////////////////////////////////////
//this is a comment and means that all text will be ignored by the compiler and doesn't get read as code.
function ai_calculate_health()
{
level.zombie_health = 9999;
}
>mode,zm
>type,common
#include "zm_mod.class"
scriptparsetree,scripts\zm\_zm_perk_quick_revive.gsc
scriptparsetree,scripts\shared\ai\zombie_utility.gsc
///////////////////////////////////////////////////////////////////////////////////////////////////////////
rawfile,dummy.cfg
///////////////////////////////////////////////////////////////////////////////////////////////////////////