mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-13 00:28:03 -05:00
Grief: round restart optimizations
This commit is contained in:
@ -377,6 +377,8 @@ headstomp_watcher()
|
|||||||
|
|
||||||
round_start_wait(time, initial)
|
round_start_wait(time, initial)
|
||||||
{
|
{
|
||||||
|
level endon("end_game");
|
||||||
|
|
||||||
if(!isDefined(initial))
|
if(!isDefined(initial))
|
||||||
{
|
{
|
||||||
initial = false;
|
initial = false;
|
||||||
@ -509,6 +511,9 @@ countdown_pulse( hud_elem, duration )
|
|||||||
|
|
||||||
zombie_spawn_wait(time)
|
zombie_spawn_wait(time)
|
||||||
{
|
{
|
||||||
|
level endon("end_game");
|
||||||
|
level endon( "restart_round" );
|
||||||
|
|
||||||
flag_clear("spawn_zombies");
|
flag_clear("spawn_zombies");
|
||||||
|
|
||||||
wait time;
|
wait time;
|
||||||
|
@ -8,6 +8,7 @@ wait_for_team_death_and_round_end()
|
|||||||
level endon( "end_game" );
|
level endon( "end_game" );
|
||||||
|
|
||||||
checking_for_round_end = 0;
|
checking_for_round_end = 0;
|
||||||
|
checking_for_round_tie = 0;
|
||||||
level.isresetting_grief = 0;
|
level.isresetting_grief = 0;
|
||||||
while ( 1 )
|
while ( 1 )
|
||||||
{
|
{
|
||||||
@ -42,16 +43,40 @@ wait_for_team_death_and_round_end()
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( cia_total == 0 )
|
||||||
|
{
|
||||||
|
level notify( "stop_round_end_check" );
|
||||||
|
level thread round_end( "B", true );
|
||||||
|
checking_for_round_end = 1;
|
||||||
|
}
|
||||||
|
else if ( cdc_total == 0 )
|
||||||
|
{
|
||||||
|
level notify( "stop_round_end_check" );
|
||||||
|
level thread round_end( "A", true );
|
||||||
|
checking_for_round_end = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !checking_for_round_tie )
|
||||||
|
{
|
||||||
|
if(cia_alive == 0 && cdc_alive == 0)
|
||||||
|
{
|
||||||
|
level notify( "stop_round_end_check" );
|
||||||
|
level thread check_for_round_end();
|
||||||
|
checking_for_round_tie = 1;
|
||||||
|
checking_for_round_end = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( !checking_for_round_end )
|
if ( !checking_for_round_end )
|
||||||
{
|
{
|
||||||
if ( cia_alive == 0 )
|
if ( cia_alive == 0 )
|
||||||
{
|
{
|
||||||
level thread round_end( "B", cia_total == 0 );
|
level thread check_for_round_end( "B" );
|
||||||
checking_for_round_end = 1;
|
checking_for_round_end = 1;
|
||||||
}
|
}
|
||||||
else if ( cdc_alive == 0 )
|
else if ( cdc_alive == 0 )
|
||||||
{
|
{
|
||||||
level thread round_end( "A", cdc_total == 0 );
|
level thread check_for_round_end( "A" );
|
||||||
checking_for_round_end = 1;
|
checking_for_round_end = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -60,12 +85,29 @@ wait_for_team_death_and_round_end()
|
|||||||
{
|
{
|
||||||
level notify( "stop_round_end_check" );
|
level notify( "stop_round_end_check" );
|
||||||
checking_for_round_end = 0;
|
checking_for_round_end = 0;
|
||||||
|
checking_for_round_tie = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
wait 0.05;
|
wait 0.05;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_for_round_end(winner)
|
||||||
|
{
|
||||||
|
level endon( "stop_round_end_check" );
|
||||||
|
|
||||||
|
if(isDefined(winner))
|
||||||
|
{
|
||||||
|
wait 5;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
level thread round_end(winner);
|
||||||
|
}
|
||||||
|
|
||||||
round_end(winner, force_win)
|
round_end(winner, force_win)
|
||||||
{
|
{
|
||||||
if(!isDefined(force_win))
|
if(!isDefined(force_win))
|
||||||
@ -73,34 +115,24 @@ round_end(winner, force_win)
|
|||||||
force_win = false;
|
force_win = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
winner_alive = 0;
|
team = undefined;
|
||||||
|
if(isDefined(winner))
|
||||||
|
{
|
||||||
|
if(winner == "A")
|
||||||
|
{
|
||||||
team = "axis";
|
team = "axis";
|
||||||
if(winner == "B")
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
team = "allies";
|
team = "allies";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!force_win)
|
|
||||||
{
|
|
||||||
wait 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
players = get_players();
|
if(isDefined(winner))
|
||||||
foreach(player in players)
|
|
||||||
{
|
|
||||||
if(is_player_valid(player) && player.team == team)
|
|
||||||
{
|
|
||||||
winner_alive = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(winner_alive)
|
|
||||||
{
|
{
|
||||||
level.grief_score[winner]++;
|
level.grief_score[winner]++;
|
||||||
level.grief_hud.score[team] setValue(level.grief_score[winner]);
|
level.grief_hud.score[team] setValue(level.grief_score[winner]);
|
||||||
setteamscore(team, level.grief_score[winner]);
|
setteamscore(team, level.grief_score[winner]);
|
||||||
}
|
|
||||||
|
|
||||||
if(level.grief_score[winner] == level.grief_winning_score || force_win)
|
if(level.grief_score[winner] == level.grief_winning_score || force_win)
|
||||||
{
|
{
|
||||||
@ -124,9 +156,10 @@ round_end(winner, force_win)
|
|||||||
level._game_module_game_end_check = undefined;
|
level._game_module_game_end_check = undefined;
|
||||||
maps/mp/gametypes_zm/_zm_gametype::track_encounters_win_stats( level.gamemodulewinningteam );
|
maps/mp/gametypes_zm/_zm_gametype::track_encounters_win_stats( level.gamemodulewinningteam );
|
||||||
level notify( "end_game" );
|
level notify( "end_game" );
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
|
||||||
players = get_players();
|
players = get_players();
|
||||||
foreach(player in players)
|
foreach(player in players)
|
||||||
{
|
{
|
||||||
@ -152,7 +185,7 @@ round_end(winner, force_win)
|
|||||||
setroundsplayed(level.round_number);
|
setroundsplayed(level.round_number);
|
||||||
|
|
||||||
level thread maps/mp/zombies/_zm_audio_announcer::leaderdialog( "grief_restarted" );
|
level thread maps/mp/zombies/_zm_audio_announcer::leaderdialog( "grief_restarted" );
|
||||||
if(winner_alive)
|
if(isDefined(winner))
|
||||||
{
|
{
|
||||||
foreach(player in players)
|
foreach(player in players)
|
||||||
{
|
{
|
||||||
@ -178,7 +211,6 @@ round_end(winner, force_win)
|
|||||||
level thread maps/mp/zombies/_zm_game_module::reset_grief();
|
level thread maps/mp/zombies/_zm_game_module::reset_grief();
|
||||||
level thread maps/mp/zombies/_zm::round_think( 1 );
|
level thread maps/mp/zombies/_zm::round_think( 1 );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
zombie_goto_round(target_round)
|
zombie_goto_round(target_round)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user