Fix bugs. Reduce code. Add brutus spawning.

This commit is contained in:
JezuzLizard 2024-03-01 23:15:41 -08:00
parent 619282e252
commit abec123219
18 changed files with 518 additions and 151 deletions

View File

@ -11402,25 +11402,6 @@
"angles" "0 0 0"
}
{
"origin" "0 100 -500"
"script_disable_bleeder" "1"
"script_noteworthy" "screecher_zombie_spawner"
"spawnflags" "3"
"export" "135"
"model" "c_zom_screecher_fb"
"classname" "actor_zm_transit_screecher"
"script_forcespawn" "1"
"count" "9999"
}
{
"script_string" "find_flesh"
"angles" "0 270 0"
"targetname" "culdesac_green_zone_spawners"
"origin" "-239 838 -84"
"script_noteworthy" "riser_location screecher_location"
"classname" "script_struct"
}
{
"classname" "actor_zm_alcatraz_brutus"
"model" "c_zom_cellbreaker_fb"
"export" "2"

View File

@ -100,8 +100,6 @@ main()
level.sndbrutusistalking = 0;
level.brutus_health = 500;
level.brutus_health_increase = 1000;
level.brutus_round_count = 0;
level.brutus_last_spawn_round = 0;
level.brutus_count = 0;
level.brutus_max_count = 1;
level.brutus_damage_percent = 0.1;
@ -174,8 +172,6 @@ init()
level.sndbrutusistalking = 0;
level.brutus_health = 500;
level.brutus_health_increase = 1000;
level.brutus_round_count = 0;
level.brutus_last_spawn_round = 0;
level.brutus_count = 0;
level.brutus_max_count = 1;
level.brutus_damage_percent = 0.1;
@ -584,26 +580,20 @@ sndbrutusloopwatcher( ent )
brutus_health_increases()
{
if ( level.round_number > level.brutus_last_spawn_round )
{
a_players = sys::getplayers();
n_player_modifier = 1;
a_players = sys::getplayers();
n_player_modifier = 1;
if ( a_players.size > 1 )
n_player_modifier = a_players.size * 0.75;
if ( a_players.size > 1 )
n_player_modifier = a_players.size * 0.75;
level.brutus_round_count++;
level.brutus_health = int( level.brutus_health_increase * n_player_modifier * level.brutus_round_count );
level.brutus_expl_dmg_req = int( level.brutus_explosive_damage_increase * n_player_modifier * level.brutus_round_count );
level.brutus_health = int( level.brutus_health_increase * n_player_modifier * level.special_round_count );
level.brutus_expl_dmg_req = int( level.brutus_explosive_damage_increase * n_player_modifier * level.special_round_count );
if ( level.brutus_health >= 5000 * n_player_modifier )
level.brutus_health = int( 5000 * n_player_modifier );
if ( level.brutus_health >= 5000 * n_player_modifier )
level.brutus_health = int( 5000 * n_player_modifier );
if ( level.brutus_expl_dmg_req >= 4500 * n_player_modifier )
level.brutus_expl_dmg_req = int( 4500 * n_player_modifier );
level.brutus_last_spawn_round = level.round_number;
}
if ( level.brutus_expl_dmg_req >= 4500 * n_player_modifier )
level.brutus_expl_dmg_req = int( 4500 * n_player_modifier );
}
get_brutus_spawn_pos_val( brutus_pos )
@ -808,9 +798,8 @@ brutus_death()
}
else
{
multiplier = maps\mp\zombies\_zm_score::get_points_multiplier( self );
team_points = multiplier * round_up_score( level.brutus_team_points_for_death, 5 );
player_points = multiplier * round_up_score( level.brutus_player_points_for_death, 5 );
team_points = round_up_score( level.brutus_team_points_for_death, 5 );
player_points = round_up_score( level.brutus_player_points_for_death, 5 );
a_players = sys::getplayers();
}
@ -2124,8 +2113,7 @@ scale_helmet_damage( attacker, damage, headshot_mod, damage_mod, vdir )
player_points = level.brutus_points_for_helmet;
else
{
multiplier = maps\mp\zombies\_zm_score::get_points_multiplier( self );
player_points = multiplier * round_up_score( level.brutus_points_for_helmet, 5 );
player_points = round_up_score( level.brutus_points_for_helmet, 5 );
}
if ( isdefined( attacker ) && isplayer( attacker ) )
@ -2201,8 +2189,7 @@ brutus_damage_override( inflictor, attacker, damage, flags, meansofdeath, weapon
player_points = level.brutus_points_for_helmet;
else
{
multiplier = maps\mp\zombies\_zm_score::get_points_multiplier( self );
player_points = multiplier * round_up_score( level.brutus_points_for_helmet, 5 );
player_points = round_up_score( level.brutus_points_for_helmet, 5 );
}
if ( isdefined( attacker ) && isplayer( attacker ) )
@ -2256,8 +2243,7 @@ brutus_damage_override( inflictor, attacker, damage, flags, meansofdeath, weapon
player_points = level.brutus_points_for_helmet;
else
{
multiplier = maps\mp\zombies\_zm_score::get_points_multiplier( self );
player_points = multiplier * round_up_score( level.brutus_points_for_helmet, 5 );
player_points = round_up_score( level.brutus_points_for_helmet, 5 );
}
attacker add_to_player_score( player_points );

View File

@ -23,7 +23,6 @@ init()
}
level.dogs_enabled = 1;
level.dog_rounds_enabled = 0;
level.dog_round_count = 1;
level.dog_spawners = [];
level.enemy_dog_spawns = [];
level.enemy_dog_locations = [];
@ -156,13 +155,13 @@ dog_health_increase()
{
players = sys::getplayers();
if ( level.dog_round_count == 1 )
if ( level.special_round_count == 1 )
level.dog_health = 400;
else if ( level.dog_round_count == 2 )
else if ( level.special_round_count == 2 )
level.dog_health = 900;
else if ( level.dog_round_count == 3 )
else if ( level.special_round_count == 3 )
level.dog_health = 1300;
else if ( level.dog_round_count == 4 )
else if ( level.special_round_count == 4 )
level.dog_health = 1600;
if ( level.dog_health > 1600 )

View File

@ -110,7 +110,6 @@ init()
level.mechz_base_health = 5000;
level.mechz_health = level.mechz_base_health;
level.mechz_health_increase = 1000;
level.mechz_round_count = 0;
level.mechz_damage_percent = 0.1;
level.mechz_remove_helmet_head_dmg_base = 500;
level.mechz_remove_helmet_head_dmg = level.mechz_remove_helmet_head_dmg_base;
@ -659,21 +658,18 @@ jump_pos_used_cooldown()
mechz_health_increases()
{
if ( !isdefined( level.mechz_last_spawn_round ) || level.round_number > level.mechz_last_spawn_round )
{
a_players = sys::getplayers();
n_player_modifier = 1;
a_players = sys::getplayers();
n_player_modifier = 1;
if ( a_players.size > 1 )
n_player_modifier = a_players.size * 0.75;
if ( a_players.size > 1 )
n_player_modifier = a_players.size * 0.75;
level.mechz_health = int( n_player_modifier * ( level.mechz_base_health + level.mechz_health_increase * level.mechz_round_count ) );
level.mechz_health = int( n_player_modifier * ( level.mechz_base_health + level.mechz_health_increase * level.special_round_count ) );
if ( level.mechz_health >= 22500 * n_player_modifier )
level.mechz_health = int( 22500 * n_player_modifier );
if ( level.mechz_health >= 22500 * n_player_modifier )
level.mechz_health = int( 22500 * n_player_modifier );
level.mechz_last_spawn_round = level.round_number;
}
level.mechz_last_spawn_round = level.round_number;
}
mechz_death()
@ -722,7 +718,24 @@ mechz_death()
event = "ballistic_knife_death";
self.attacker delay_thread( 4.0, maps\mp\zombies\_zm_audio::create_and_play_dialog, "general", "mech_defeated" );
self.attacker maps\mp\zombies\_zm_score::player_add_points( event, self.damagemod, self.damagelocation, 1 );
team_points = round_up_score( level.mechz_points_for_team, 5 );
player_points = round_up_score( level.mechz_points_for_killer, 5 );
a_players = sys::getplayers();
foreach ( player in a_players )
{
if ( !is_player_valid( player ) )
continue;
player add_to_player_score( team_points );
if ( player == self.attacker )
{
player add_to_player_score( player_points );
}
player.pers["score"] = player.score;
}
self.attacker maps\mp\zombies\_zm_stats::increment_client_stat( "tomb_mechz_killed", 0 );
self.attacker maps\mp\zombies\_zm_stats::increment_player_stat( "tomb_mechz_killed" );
@ -1600,6 +1613,10 @@ mechz_damage_override( inflictor, attacker, damage, flags, meansofdeath, weapon,
}
self thread shoot_mechz_head_vo();
if ( isdefined( attacker ) && isalive( attacker ) && isplayer( attacker ) )
{
attacker add_to_player_score( level.mechz_points_for_helmet );
}
}
if ( isdefined( self.powerplant_covered ) && self.powerplant_covered && self.powerplant_cover_dmg >= self.powerplant_cover_dmg_for_removal )
@ -1621,6 +1638,11 @@ mechz_damage_override( inflictor, attacker, damage, flags, meansofdeath, weapon,
self sys::animscripted( self.origin, self.angles, "zm_pain_powercore" );
self maps\mp\animscripts\zm_shared::donotetracks( "pain_anim_powercore" );
}
if ( isdefined( attacker ) && isalive( attacker ) && isplayer( attacker ) )
{
attacker add_to_player_score( level.mechz_points_for_powerplant );
}
}
else if ( !( isdefined( self.powerplant_covered ) && self.powerplant_covered ) && ( isdefined( self.has_powerplant ) && self.has_powerplant ) && self.powerplant_dmg >= self.powerplant_dmg_for_destroy )
{

View File

@ -8,25 +8,26 @@
main()
{
set_dvar_if_unset( "rm_min_rounds_before_special_round", 3 );
set_dvar_if_unset( "rm_max_rounds_before_special_round", 5 );
set_dvar_if_unset( "rm_min_rounds_before_special_round", 4 );
set_dvar_if_unset( "rm_max_rounds_before_special_round", 6 );
set_dvar_if_unset( "rm_special_round_chance", 33 );
set_dvar_if_unset( "rm_allow_same_round_as_last_round", 1 );
set_dvar_if_unset( "rm_allowed_special_rounds", "normal zombie_dog mechz" );
set_dvar_if_unset( "rm_allowed_special_rounds", "normal zombie_dog mechz brutus" );
set_dvar_if_unset( "rm_allowed_special_round_variants", "default" );
set_dvar_if_unset( "rm_forced_special_round", "" );
set_dvar_if_unset( "rm_forced_special_variant", "" );
set_dvar_if_unset( "rm_allowed_mixed_rounds_presets", "default wave" );
set_dvar_if_unset( "rm_allowed_mixed_round_variants_for_default_preset", "random" );
set_dvar_if_unset( "rm_allowed_mixed_round_variants_for_wave_preset", "normal_wave dog_wave mechz_wave" );
set_dvar_if_unset( "rm_allowed_mixed_round_variants_for_wave_preset", "normal_wave dog_wave mechz_wave brutus_wave" );
set_dvar_if_unset( "rm_forced_mixed_rounds_preset", "" );
set_dvar_if_unset( "rm_forced_mixed_rounds_variant", "" );
set_dvar_if_unset( "rm_mixed_round_chance_base", 20 );
set_dvar_if_unset( "rm_mixed_round_chance_round_scalar", 5 );
set_dvar_if_unset( "rm_mixed_round_min_start_round", 18 );
level.round_manager_vars = [];
level.special_round = sys::spawnstruct();
level.special_round.current_data = sys::spawnstruct();
level.special_round.current_data.round_type = "";
@ -40,10 +41,13 @@ main()
level.normal_round.current_data = sys::spawnstruct();
level.normal_round.current_data.round_type = "";
level.normal_round.current_data.variant = "";
level.special_round_is_active = false;
level.special_round_count = 1;
register_ai_spawning_func( "normal", scripts\zm\zm_ai_pack\rounds\_normal::spawn_single_normal_zombie );
register_ai_spawning_func( "zombie_dog", scripts\zm\zm_ai_pack\rounds\_zombie_dog::spawn_single_zombie_dog );
register_ai_spawning_func( "mechz", scripts\zm\zm_ai_pack\rounds\_mechz::spawn_single_mechz );
register_ai_spawning_func( "brutus", scripts\zm\zm_ai_pack\rounds\_brutus::spawn_single_brutus );
scripts\zm\zm_ai_pack\rounds\_zombie_dog::main();
scripts\zm\zm_ai_pack\rounds\_mechz::main();
@ -84,6 +88,24 @@ main()
scripts\zm\zm_ai_pack\rounds\_mechz::round_chance_rush,
scripts\zm\zm_ai_pack\rounds\_mechz::round_next_rush );
register_special_round( "brutus", "default",
scripts\zm\zm_ai_pack\rounds\_brutus::round_spawning,
scripts\zm\zm_ai_pack\rounds\_brutus::round_wait,
scripts\zm\zm_ai_pack\rounds\_brutus::round_max,
scripts\zm\zm_ai_pack\rounds\_brutus::round_start,
scripts\zm\zm_ai_pack\rounds\_brutus::round_over,
scripts\zm\zm_ai_pack\rounds\_brutus::round_chance,
scripts\zm\zm_ai_pack\rounds\_brutus::round_next );
register_special_round( "brutus", "rush",
scripts\zm\zm_ai_pack\rounds\_brutus::round_spawning_rush,
scripts\zm\zm_ai_pack\rounds\_brutus::round_wait,
scripts\zm\zm_ai_pack\rounds\_brutus::round_max_rush,
scripts\zm\zm_ai_pack\rounds\_brutus::round_start,
scripts\zm\zm_ai_pack\rounds\_brutus::round_over,
scripts\zm\zm_ai_pack\rounds\_brutus::round_chance_rush,
scripts\zm\zm_ai_pack\rounds\_brutus::round_next_rush );
register_special_round( "normal", "default",
scripts\zm\zm_ai_pack\rounds\_normal::round_spawning,
scripts\zm\zm_ai_pack\rounds\_normal::round_wait,
@ -138,9 +160,17 @@ main()
scripts\zm\zm_ai_pack\mixed_variants\_mechz_wave::spawning_cooldown,
scripts\zm\zm_ai_pack\mixed_variants\_mechz_wave::spawning_round_start);
register_mixed_round_preset_variant( "wave", "brutus_wave",
scripts\zm\zm_ai_pack\mixed_variants\_brutus_wave::spawning_wave,
scripts\zm\zm_ai_pack\mixed_variants\_brutus_wave::spawning_chance,
scripts\zm\zm_ai_pack\mixed_variants\_brutus_wave::spawning_limit,
scripts\zm\zm_ai_pack\mixed_variants\_brutus_wave::spawning_cooldown,
scripts\zm\zm_ai_pack\mixed_variants\_brutus_wave::spawning_round_start);
scripts\zm\zm_ai_pack\mixed_presets\_default::main();
scripts\zm\zm_ai_pack\mixed_variants\_random::main();
scripts\zm\zm_ai_pack\mixed_variants\_brutus_wave::main();
scripts\zm\zm_ai_pack\mixed_variants\_dog_wave::main();
scripts\zm\zm_ai_pack\mixed_variants\_mechz_wave::main();
scripts\zm\zm_ai_pack\mixed_variants\_normal_wave::main();
@ -214,7 +244,7 @@ should_do_mixed_round()
if ( level.round_number >= min_round )
{
return randomInt( 100 ) <= ( chance_base + int( level.round_number * getdvarint( "rm_mixed_round_chance_round_scalar" ) ) );
return randomInt( 100 ) <= ( chance_base + int( ( level.round_number - getdvarint( "rm_mixed_round_min_start_round" ) ) * getdvarint( "rm_mixed_round_chance_round_scalar" ) ) );
}
return false;
@ -264,6 +294,8 @@ determine_current_round_type()
return level.normal_round.current_data;
}
level.special_round_is_active = true;
allowed_round_string = getDvar( "rm_allowed_special_rounds" );
variant_string = getdvar( "rm_allowed_special_round_variants" );
@ -416,6 +448,17 @@ round_think_override( restart )
wait 1;
#/
maps\mp\zombies\_zm_ai_dogs::dog_health_increase();
maps\mp\zombies\_zm_ai_mechz::mechz_health_increases();
maps\mp\zombies\_zm_ai_brutus::brutus_health_increases();
if ( current_round_data.round_type != "mixed" )
{
if ( getdvarint( "zm_ai_pack_debug" ) > 0 )
{
print( "Round Manager: Running special round <" + current_round_data.round_type + "> variant <" + current_round_data.variant + ">" );
}
}
level.round_manager_special_rounds[ current_round_data.round_type ][ current_round_data.variant ].active = true;
level [[ round_manager_inst.max_func ]]();
level thread [[ round_manager_inst.spawning_func ]]();
@ -492,6 +535,11 @@ round_think_override( restart )
level notify( "between_round_over" );
level.round_manager_special_rounds[ current_round_data.round_type ][ current_round_data.variant ].active = false;
level [[ round_manager_inst.between_round_over_func ]]();
if ( level.special_round_is_active )
{
level.special_round_count++;
}
level.special_round_is_active = false;
restart = 0;
}
}

View File

@ -100,6 +100,26 @@ get_mechz_count()
return get_mechz_array().size;
}
get_brutus_array()
{
zombies = getaiarray( level.zombie_team );
brutus = [];
for ( i = 0; i < zombies.size; i++ )
{
if ( isdefined( zombies[ i ].animname ) && zombies[ i ].animname == "brutus_zombie" )
{
brutus[ brutus.size ] = zombies[ i ];
}
}
return brutus;
}
get_brutus_count()
{
return get_brutus_array().size;
}
get_all_ai_array()
{
return getaispeciesarray( level.zombie_team, "all" );

View File

@ -19,13 +19,16 @@ round_start()
level.round_manager_spawn_count = 0;
}
spawn_wave( type )
spawn_wave( type, custom_starting_properties, wait_for_room = true )
{
max_in_wave = [[ level.round_manager_spawning_preset_current_variant.limit ]]();
while ( get_all_ai_count() > ( level.zombie_ai_limit - max_in_wave ) && level.zombie_total > 0 )
if ( wait_for_room )
{
wait 0.5;
while ( get_all_ai_count() > ( level.zombie_ai_limit - max_in_wave ) && level.zombie_total > 0 )
{
wait 0.5;
}
}
count = 0;
@ -33,7 +36,7 @@ spawn_wave( type )
while ( ( count < max_in_wave ) && level.zombie_total > 0 )
{
wait_for_free_ai_slot( ::get_all_ai_count );
ai = level [[ level.round_manager_aitype_spawning_funcs[ type ] ]]();
ai = level [[ level.round_manager_aitype_spawning_funcs[ type ] ]]( custom_starting_properties );
if ( isdefined( ai ) )
{
count++;
@ -41,5 +44,24 @@ spawn_wave( type )
}
wait( level.zombie_vars["zombie_spawn_delay"] );
}
wait( level.zombie_vars["zombie_spawn_delay"] );
}
spawning_chance( type )
{
if ( level.round_number < getdvarint( "rm_mixed_preset_wave_" + type + "_wave_variant_min_round" ) )
{
return false;
}
chance_of_wave = 0;
chance_of_wave -= ( level.round_manager_vars[ type + "_wave_count" ] * getdvarint( "rm_mixed_preset_wave_" + type + "_wave_variant_chance_threshold" ) );
min = getdvarint( "rm_mixed_preset_wave_" + type + "_wave_variant_chance_per_spawn_min" );
max = getdvarint( "rm_mixed_preset_wave_" + type + "_wave_variant_chance_per_spawn_max" );
chance_of_wave += ( level.round_manager_vars[ type + "_wave_count" ] * randomintrange( min, max ) );
should_spawn_wave_random = chance_of_wave >= getdvarint( "rm_mixed_preset_wave_" + type + "_wave_variant_chance_threshold" );
time = randomfloatrange( getdvarfloat( "rm_mixed_preset_wave_" + type + "_wave_variant_min_cooldown" ), getdvarfloat( "rm_mixed_preset_wave_" + type + "_wave_variant_max_cooldown" ) );
should_spawn_guaranteed_wave = ( ( level.round_manager_vars[ "guaranteed_" + type + "_wave_time" ] + ( time * 1000 ) ) <= gettime() );
return should_spawn_wave_random || should_spawn_guaranteed_wave;
}

View File

@ -0,0 +1,60 @@
#include maps\mp\zombies\_zm_utility;
#include common_scripts\utility;
#include maps\mp\_utility;
#include scripts\zm\zm_ai_pack\_utility;
main()
{
set_dvar_if_unset( "rm_mixed_preset_wave_brutus_wave_variant_spawn_limit_min", 1 );
set_dvar_if_unset( "rm_mixed_preset_wave_brutus_wave_variant_spawn_limit_max", 8 );
set_dvar_if_unset( "rm_mixed_preset_wave_brutus_wave_variant_min_round", 25 );
set_dvar_if_unset( "rm_mixed_preset_wave_brutus_wave_variant_min_cooldown", 120.0 );
set_dvar_if_unset( "rm_mixed_preset_wave_brutus_wave_variant_max_cooldown", 240.0 );
set_dvar_if_unset( "rm_mixed_preset_wave_brutus_wave_variant_chance_threshold", 2000 );
set_dvar_if_unset( "rm_mixed_preset_wave_brutus_wave_variant_chance_per_spawn_min", 5 );
set_dvar_if_unset( "rm_mixed_preset_wave_brutus_wave_variant_chance_per_spawn_max", 10 );
}
spawning_wave()
{
level.music_round_override = 1;
level thread maps\mp\zombies\_zm_audio::change_zombie_music( "brutus_round_start" );
level thread maps\mp\zombies\_zm_ai_brutus::sndforcewait();
level.round_manager_vars[ "brutus_wave_count" ]++;
scripts\zm\zm_ai_pack\mixed_presets\_wave::spawn_wave( "brutus" );
time = randomfloatrange( getdvarfloat( "rm_mixed_preset_wave_brutus_wave_variant_min_cooldown" ), getdvarfloat( "rm_mixed_preset_wave_brutus_wave_variant_max_cooldown" ) );
level.round_manager_vars[ "guaranteed_brutus_wave_time" ] = int( gettime() + ( time * 1000 ) );
}
spawning_chance()
{
return scripts\zm\zm_ai_pack\mixed_presets\_wave::spawning_chance( "brutus" );
}
spawning_limit()
{
if ( level.players.size <= 1 )
{
return getdvarint( "rm_mixed_preset_wave_brutus_wave_variant_spawn_limit_min" );
}
spawn_amount = int( level.players.size * 0.75 ) + 1;
max = getdvarint( "rm_mixed_preset_wave_brutus_wave_variant_spawn_limit_max" );
if ( spawn_amount > max )
{
spawn_amount = max;
}
return spawn_amount;
}
spawning_cooldown()
{
return true;
}
spawning_round_start()
{
level.round_manager_vars[ "guaranteed_brutus_wave_time" ] = level.round_start_time;
level.round_manager_vars[ "brutus_wave_count" ] = 0;
}

View File

@ -6,53 +6,45 @@
main()
{
set_dvar_if_unset( "rm_mixed_preset_wave_dog_wave_variant_spawn_limit_min", 6 );
set_dvar_if_unset( "rm_mixed_preset_wave_dog_wave_variant_spawn_limit_max", 12 );
set_dvar_if_unset( "rm_mixed_preset_wave_dog_wave_variant_min_round", 15 );
set_dvar_if_unset( "rm_mixed_preset_wave_dog_wave_variant_min_cooldown", 80.0 );
set_dvar_if_unset( "rm_mixed_preset_wave_dog_wave_variant_max_cooldown", 240.0 );
set_dvar_if_unset( "rm_mixed_preset_wave_dog_wave_variant_chance_threshold", 1000 );
set_dvar_if_unset( "rm_mixed_preset_wave_dog_wave_variant_chance_per_spawn_min", 5 );
set_dvar_if_unset( "rm_mixed_preset_wave_dog_wave_variant_chance_per_spawn_max", 10 );
set_dvar_if_unset( "rm_mixed_preset_wave_zombie_dog_wave_variant_spawn_limit_min", 6 );
set_dvar_if_unset( "rm_mixed_preset_wave_zombie_dog_wave_variant_spawn_limit_max", 12 );
set_dvar_if_unset( "rm_mixed_preset_wave_zombie_dog_wave_variant_min_round", 15 );
set_dvar_if_unset( "rm_mixed_preset_wave_zombie_dog_wave_variant_min_cooldown", 80.0 );
set_dvar_if_unset( "rm_mixed_preset_wave_zombie_dog_wave_variant_max_cooldown", 240.0 );
set_dvar_if_unset( "rm_mixed_preset_wave_zombie_dog_wave_variant_chance_threshold", 1000 );
set_dvar_if_unset( "rm_mixed_preset_wave_zombie_dog_wave_variant_chance_per_spawn_min", 5 );
set_dvar_if_unset( "rm_mixed_preset_wave_zombie_dog_wave_variant_chance_per_spawn_max", 10 );
}
spawning_wave()
{
level.round_manager_dog_wave_count++;
scripts\zm\zm_ai_pack\mixed_presets\_wave::spawn_wave( "zombie_dog" );
time = randomfloatrange( getdvarfloat( "rm_mixed_preset_wave_dog_wave_variant_min_cooldown" ), getdvarfloat( "rm_mixed_preset_wave_dog_wave_variant_max_cooldown" ) );
level.round_manager_guaranteed_dog_wave_time = gettime() + ( time * level.round_manager_dog_wave_count );
level.round_manager_vars[ "zombie_dog_wave_count" ]++;
custom_starting_properties = sys::spawnstruct();
health = int( ( level.round_number / 5 ) * 400 );
if ( health > 1600 )
{
health = 1600;
}
custom_starting_properties.health = health;
scripts\zm\zm_ai_pack\mixed_presets\_wave::spawn_wave( "zombie_dog", custom_starting_properties );
time = randomfloatrange( getdvarfloat( "rm_mixed_preset_wave_zombie_dog_wave_variant_min_cooldown" ), getdvarfloat( "rm_mixed_preset_wave_zombie_dog_wave_variant_max_cooldown" ) );
level.round_manager_vars[ "guaranteed_zombie_dog_wave_time" ] = int( gettime() + ( time * 1000 ) );
}
spawning_chance()
{
if ( level.round_number < getdvarint( "rm_mixed_preset_wave_dog_wave_variant_min_round" ) )
{
return false;
}
chance_of_dog_wave = 0;
chance_of_dog_wave -= ( level.round_manager_dog_wave_count * getdvarint( "rm_mixed_preset_wave_dog_wave_variant_chance_threshold" ) );
min = getdvarint( "rm_mixed_preset_wave_dog_wave_variant_chance_per_spawn_min" );
max = getdvarint( "rm_mixed_preset_wave_dog_wave_variant_chance_per_spawn_max" );
chance_of_dog_wave += ( level.round_manager_spawn_count * randomintrange( min, max ) );
should_spawn_dog_wave_random = chance_of_dog_wave >= getdvarint( "rm_mixed_preset_wave_dog_wave_variant_chance_threshold" );
time = randomfloatrange( getdvarfloat( "rm_mixed_preset_wave_dog_wave_variant_min_cooldown" ), getdvarfloat( "rm_mixed_preset_wave_dog_wave_variant_max_cooldown" ) );
should_spawn_guaranteed_dog_wave = ( ( level.round_manager_guaranteed_dog_wave_time + ( time * 1000 ) ) <= getTime() );
return should_spawn_dog_wave_random || should_spawn_guaranteed_dog_wave;
return scripts\zm\zm_ai_pack\mixed_presets\_wave::spawning_chance( "zombie_dog" );
}
spawning_limit()
{
if ( level.players.size <= 1 )
{
return getdvarint( "rm_mixed_preset_wave_dog_wave_variant_spawn_limit_min" );
return getdvarint( "rm_mixed_preset_wave_zombie_dog_wave_variant_spawn_limit_min" );
}
else
{
return getdvarint( "rm_mixed_preset_wave_dog_wave_variant_spawn_limit_max" );
return getdvarint( "rm_mixed_preset_wave_zombie_dog_wave_variant_spawn_limit_max" );
}
}
@ -63,6 +55,6 @@ spawning_cooldown()
spawning_round_start()
{
level.round_manager_guaranteed_dog_wave_time = level.round_start_time;
level.round_manager_dog_wave_count = 0;
level.round_manager_vars[ "guaranteed_zombie_dog_wave_time" ] = level.round_start_time;
level.round_manager_vars[ "zombie_dog_wave_count" ] = 0;
}

View File

@ -18,30 +18,15 @@ main()
spawning_wave()
{
level.round_manager_mechz_wave_count++;
level.round_manager_vars[ "mechz_wave_count" ]++;
scripts\zm\zm_ai_pack\mixed_presets\_wave::spawn_wave( "mechz" );
time = randomfloatrange( getdvarfloat( "rm_mixed_preset_wave_mechz_wave_variant_min_cooldown" ), getdvarfloat( "rm_mixed_preset_wave_mechz_wave_variant_max_cooldown" ) );
level.round_manager_guaranteed_mechz_wave_time = gettime() + ( time * level.round_manager_mechz_wave_count );
level.round_manager_vars[ "guaranteed_mechz_wave_time" ] = gettime() + ( time * 1000 );
}
spawning_chance()
{
if ( level.round_number < getdvarint( "rm_mixed_preset_wave_mechz_wave_variant_min_round" ) )
{
return false;
}
chance_of_wave = 0;
chance_of_wave -= ( level.round_manager_mechz_wave_count * getdvarint( "rm_mixed_preset_wave_mechz_wave_variant_chance_threshold" ) );
min = getdvarint( "rm_mixed_preset_wave_mechz_wave_variant_chance_per_spawn_min" );
max = getdvarint( "rm_mixed_preset_wave_mechz_wave_variant_chance_per_spawn_max" );
chance_of_wave += ( level.round_manager_spawn_count * randomintrange( min , max ) );
should_spawn_wave_random = chance_of_wave >= getdvarint( "rm_mixed_preset_wave_mechz_wave_variant_chance_threshold" );
time = randomfloatrange( getdvarfloat( "rm_mixed_preset_wave_mechz_wave_variant_min_cooldown" ), getdvarfloat( "rm_mixed_preset_wave_mechz_wave_variant_max_cooldown" ) );
should_spawn_guaranteed_wave = ( ( level.round_manager_guaranteed_mechz_wave_time + ( time * 1000 ) ) <= getTime() );
return should_spawn_wave_random || should_spawn_guaranteed_wave;
return scripts\zm\zm_ai_pack\mixed_presets\_wave::spawning_chance( "mechz" );
}
spawning_limit()
@ -67,6 +52,6 @@ spawning_cooldown()
spawning_round_start()
{
level.round_manager_guaranteed_mechz_wave_time = level.round_start_time;
level.round_manager_mechz_wave_count = 0;
level.round_manager_vars[ "guaranteed_mechz_wave_time" ] = level.round_start_time;
level.round_manager_vars[ "mechz_wave_count" ] = 0;
}

View File

@ -10,7 +10,7 @@ main()
spawning_wave()
{
scripts\zm\zm_ai_pack\mixed_presets\_wave::spawn_wave( "normal" );
scripts\zm\zm_ai_pack\mixed_presets\_wave::spawn_wave( "normal", undefined, false );
}
spawning_chance()
@ -20,7 +20,7 @@ spawning_chance()
spawning_limit()
{
return int( level.zombie_total * 0.1 ) + 6;
return 24;
}
spawning_cooldown()

View File

@ -0,0 +1,209 @@
#include maps\mp\zombies\_zm_utility;
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\zombies\_zm_ai_mechz;
#include scripts\zm\zm_ai_pack\_round_manager;
#include scripts\zm\zm_ai_pack\_utility;
main()
{
set_dvar_if_unset( "rm_brutus_round_chance", 10 );
set_dvar_if_unset( "rm_brutus_min_round", 8 );
set_dvar_if_unset( "rm_brutus_initial_round_wait_min", 10.0 );
set_dvar_if_unset( "rm_brutus_initial_round_wait_max", 60.0 );
set_dvar_if_unset( "rm_brutus_max_brutus_alive", 6 );
set_dvar_if_unset( "rm_brutus_rush_round_chance", 6 );
set_dvar_if_unset( "rm_brutus_rush_min_round", 30 );
set_dvar_if_unset( "rm_brutus_rush_min_spawn_wait", 1.5 );
set_dvar_if_unset( "rm_brutus_rush_max_spawn_wait", 2.5 );
set_dvar_if_unset( "rm_brutus_rush_max_brutus_alive", 12 );
set_dvar_if_unset( "rm_brutus_rush_max_brutus_round", 12 );
set_dvar_if_unset( "rm_brutus_rush_max_health_multiplier", 0.5 );
}
round_spawning_common()
{
initial_wait = getdvarint( "rm_brutus_initial_round_wait" );
wait( randomfloatrange( initial_wait, initial_wait + 5.0 ) );
}
round_spawning()
{
level endon( "intermission" );
level endon( "end_of_round" );
level endon( "restart_round" );
/#
level endon( "kill_round" );
#/
if ( level.intermission )
return;
round_spawning_common();
for (;;)
{
while ( get_brutus_count() >= level.zombie_ai_limit || get_brutus_count() >= getdvarint( "rm_brutus_max_brutus_alive" ) || level.zombie_total <= 0 )
wait 0.1;
while ( get_current_actor_count() >= level.zombie_actor_limit )
{
clear_all_corpses();
wait 0.1;
}
flag_wait( "spawn_zombies" );
ai = spawn_single_brutus();
wait( randomfloatrange( 3.0, 6.0 ) );
}
}
round_wait()
{
level endon( "restart_round" );
/#
level endon( "kill_round" );
#/
/#
while ( getdvarint( #"zombie_cheat" ) == 2 || getdvarint( #"zombie_cheat" ) >= 4 )
wait 1;
#/
wait 1;
while ( true )
{
should_wait = get_brutus_count() > 0 || level.zombie_total > 0 || level.intermission;
if ( !should_wait )
return;
wait 1.0;
}
}
round_max()
{
level.zombie_total = getdvarint( "rm_brutus_max_brutus_alive" );
}
round_start()
{
}
round_over()
{
}
round_chance()
{
if ( level.round_number < getdvarint( "rm_brutus_min_round" ) )
{
return false;
}
return randomint( 100 ) <= getdvarint( "rm_brutus_round_chance" );
}
round_next()
{
min = getDvarInt( "rm_min_rounds_before_special_round" );
max = getDvarInt( "rm_max_rounds_before_special_round" );
if ( min >= max )
{
return level.special_round.last_data.round_number + 1;
}
else
{
return level.special_round.last_data.round_number + randomintrange( min, max );
}
}
round_spawning_rush()
{
level endon( "intermission" );
level endon( "end_of_round" );
level endon( "restart_round" );
/#
level endon( "kill_round" );
#/
if ( level.intermission )
return;
/#
if ( getdvarint( #"zombie_cheat" ) == 2 || getdvarint( #"zombie_cheat" ) >= 4 )
return;
#/
round_spawning_common();
for (;;)
{
while ( get_brutus_count() >= level.zombie_ai_limit || get_brutus_count() >= getdvarint( "rm_brutus_rush_max_brutus_alive" ) || level.zombie_total <= 0 )
wait 0.1;
while ( get_current_actor_count() >= level.zombie_actor_limit )
{
clear_all_corpses();
wait 0.1;
}
flag_wait( "spawn_zombies" );
starting_properties = sys::spawnstruct();
starting_properties.health = int( level.brutus_health * getdvarfloat( "rm_brutus_rush_max_health_multiplier" ) );
ai = spawn_single_brutus( starting_properties );
wait( randomfloatrange( getdvarfloat( "rm_brutus_rush_min_spawn_wait" ), getdvarfloat( "rm_brutus_rush_min_spawn_wait" ) + 0.05 ) );
}
}
round_max_rush()
{
level.zombie_total = getdvarint( "rm_brutus_rush_max_brutus_round" );
}
round_chance_rush()
{
if ( level.round_number < getdvarint( "rm_brutus_rush_min_round" ) )
{
return false;
}
return randomint( 100 ) <= getdvarint( "rm_brutus_rush_round_chance" );
}
round_next_rush()
{
min = getDvarInt( "rm_min_rounds_before_special_round" );
max = getDvarInt( "rm_max_rounds_before_special_round" );
if ( min >= max )
{
return level.special_round.last_data.round_number + 1;
}
else
{
return level.special_round.last_data.round_number + randomintrange( min, max );
}
}
spawn_single_brutus( starting_properties )
{
ai = spawn_zombie( level.brutus_spawners[ 0 ] );
if ( isdefined( ai ) )
{
level.zombie_total--;
ai set_starting_properties_for_ai( starting_properties );
ai sys::playsound( "zmb_ai_brutus_spawn_2d" );
ai thread maps\mp\zombies\_zm_ai_brutus::brutus_spawn();
}
return ai;
}

View File

@ -77,6 +77,9 @@ round_spawning()
round_wait()
{
level endon( "restart_round" );
/#
level endon( "kill_round" );
#/
/#
while ( getdvarint( #"zombie_cheat" ) == 2 || getdvarint( #"zombie_cheat" ) >= 4 )
wait 1;
@ -98,9 +101,9 @@ round_max()
{
if ( isdefined( level.is_forever_solo_game ) && level.is_forever_solo_game )
level.mechz_zombie_per_round = 1;
else if ( level.mechz_round_count < 2 )
else if ( level.special_round_count < 2 )
level.mechz_zombie_per_round = 1;
else if ( level.mechz_round_count < 5 )
else if ( level.special_round_count < 5 )
level.mechz_zombie_per_round = 2;
else
level.mechz_zombie_per_round = 3;
@ -116,8 +119,6 @@ round_start()
round_over()
{
maps\mp\zombies\_zm_ai_mechz::mechz_health_increases();
level.mechz_round_count++;
maps\mp\zombies\_zm_ai_mechz::mechz_clear_spawns();
}

View File

@ -41,6 +41,9 @@ round_spawning()
round_wait()
{
level endon( "restart_round" );
/#
level endon( "kill_round" );
#/
/#
if ( getdvarint( #"zombie_rise_test" ) )
level waittill( "forever" );

View File

@ -43,6 +43,9 @@ round_spawning()
round_wait()
{
level endon( "restart_round" );
/#
level endon( "kill_round" );
#/
/#
if ( getdvarint( #"zombie_rise_test" ) )
level waittill( "forever" );

View File

@ -20,6 +20,8 @@ main()
set_dvar_if_unset( "rm_dog_rush_max_dogs_round_number_multiplier", 0.1 );
set_dvar_if_unset( "rm_dog_rush_max_spawn_wait", 0.5 );
set_dvar_if_unset( "rm_dog_rush_min_spawn_wait", 0.1 );
level.round_manager_mixed_round_dog_spawn_count = 0;
}
round_spawning()
@ -48,6 +50,10 @@ round_spawning()
round_wait()
{
level endon( "restart_round" );
/#
level endon( "kill_round" );
#/
wait 7;
while ( get_zombie_dog_count() > 0 || level.zombie_total > 0 || level.intermission )
@ -63,7 +69,7 @@ round_wait()
round_max()
{
players = sys::getplayers();
if ( level.dog_round_count < 3 )
if ( level.special_round_count < 3 )
max = players.size * 6;
else
max = players.size * 8;
@ -100,22 +106,13 @@ round_start()
round_over()
{
if ( !isDefined( level.dog_round_count ) )
{
level.dog_round_count = 1;
}
maps\mp\zombies\_zm_ai_dogs::dog_health_increase();
maps\mp\zombies\_zm_ai_dogs::dog_round_stop();
level.music_round_override = 0;
level.dog_round_count = level.dog_round_count + 1;
flag_clear( "dog_round" );
}
round_chance()
{
chance = getDvarInt( "rm_dog_round_chance" );
return randomInt( 100 ) <= chance;
@ -205,11 +202,11 @@ waiting_for_next_dog_spawn( count, max )
{
default_wait = 1.5;
if ( level.dog_round_count == 1 )
if ( level.special_round_count == 1 )
default_wait = 3;
else if ( level.dog_round_count == 2 )
else if ( level.special_round_count == 2 )
default_wait = 2.5;
else if ( level.dog_round_count == 3 )
else if ( level.special_round_count == 3 )
default_wait = 2;
else
default_wait = 1.5;
@ -260,9 +257,7 @@ spawn_single_zombie_dog( starting_properties_struct )
if ( isdefined( ai ) )
{
ai.favoriteenemy = favorite_enemy;
spawn_loc thread maps\mp\zombies\_zm_ai_dogs::dog_spawn_fx( ai, spawn_loc );
level.zombie_total--;
}
}
else
@ -272,9 +267,7 @@ spawn_single_zombie_dog( starting_properties_struct )
if ( isdefined( ai ) )
{
ai.favoriteenemy = favorite_enemy;
spawn_point thread maps\mp\zombies\_zm_ai_dogs::dog_spawn_fx( ai, spawn_point );
level.zombie_total--;
flag_set( "dog_clips" );
}
}
@ -282,6 +275,8 @@ spawn_single_zombie_dog( starting_properties_struct )
if ( isdefined( ai ) )
{
ai set_starting_properties_for_ai( starting_properties_struct );
ai.favoriteenemy = favorite_enemy;
level.zombie_total--;
}
return ai;

View File

@ -70,6 +70,9 @@ command_thread()
case "printentities":
level thread print_entities();
break;
case "gotoround":
goto_round( int( args[ 2 ] ) );
break;
default:
player iPrintLn( "Invalid command" );
break;
@ -552,3 +555,40 @@ print_entities()
print( "Listed " + ents.size + " entities" );
}
goto_round( target_round )
{
level notify( "end_round_think" );
level.round_number = target_round;
level.zombie_vars["spectators_respawn"] = 1;
level.zombie_total = 0;
if ( level.gamedifficulty == 0 )
level.zombie_move_speed = level.round_number * level.zombie_vars["zombie_move_speed_multiplier_easy"];
else
level.zombie_move_speed = level.round_number * level.zombie_vars["zombie_move_speed_multiplier"];
level.zombie_vars["zombie_spawn_delay"] = 2;
for ( i = 1; i <= level.round_number; i++ )
{
timer = level.zombie_vars["zombie_spawn_delay"];
if ( timer > 0.08 )
{
level.zombie_vars["zombie_spawn_delay"] = timer * 0.95;
continue;
}
if ( timer < 0.08 )
level.zombie_vars["zombie_spawn_delay"] = 0.08;
}
level thread maps\mp\zombies\_zm::round_think( 1 );
if ( getdvar( "rm_allowed_special_rounds" ) == "" )
{
return;
}
old_round_number = level.round_number;
average = int( ( getdvarint( "rm_min_rounds_before_special_round" ) + getdvarint( "rm_max_rounds_before_special_round" ) ) / 2 );
average_estimated_special_rounds = int( ( level.round_number - old_round_number ) / average );
level.special_round_count += average_estimated_special_rounds;
}

View File

@ -82,6 +82,7 @@ script,scripts/zm/zm_ai_pack/rounds/_zombie_dog.gsc
script,scripts/zm/zm_ai_pack/mixed_presets/_default.gsc
script,scripts/zm/zm_ai_pack/mixed_presets/_wave.gsc
script,scripts/zm/zm_ai_pack/mixed_variants/_brutus_wave.gsc
script,scripts/zm/zm_ai_pack/mixed_variants/_dog_wave.gsc
script,scripts/zm/zm_ai_pack/mixed_variants/_mechz_wave.gsc
script,scripts/zm/zm_ai_pack/mixed_variants/_normal_wave.gsc