mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-07-09 05:18:17 -05:00
Move replaced functions into separate scripts
This commit is contained in:
@ -1,15 +1,21 @@
|
||||
#include maps/mp/gametypes_zm/_hud_util;
|
||||
#include maps/mp/zombies/_zm_utility;
|
||||
#include common_scripts/utility;
|
||||
#include maps/mp/_utility;
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\zombies\_zm_utility;
|
||||
#include maps\mp\gametypes_zm\_hud_util;
|
||||
|
||||
#include scripts/zm/replaced/_zm;
|
||||
#include scripts/zm/replaced/_zm_playerhealth;
|
||||
#include scripts/zm/replaced/_zm_utility;
|
||||
#include scripts/zm/replaced/_zm_powerups;
|
||||
#include scripts/zm/replaced/_zm_equipment;
|
||||
|
||||
main()
|
||||
{
|
||||
replaceFunc(maps/mp/zombies/_zm::check_quickrevive_for_hotjoin, ::check_quickrevive_for_hotjoin);
|
||||
replaceFunc(maps/mp/zombies/_zm_playerhealth::playerhealthregen, ::playerhealthregen);
|
||||
replaceFunc(maps/mp/zombies/_zm_utility::track_players_intersection_tracker, ::track_players_intersection_tracker);
|
||||
replaceFunc(maps/mp/zombies/_zm_powerups::nuke_powerup, ::nuke_powerup);
|
||||
replaceFunc(maps/mp/zombies/_zm_equipment::placed_equipment_think, ::placed_equipment_think);
|
||||
replaceFunc(maps/mp/zombies/_zm::check_quickrevive_for_hotjoin, scripts/zm/replaced/_zm::check_quickrevive_for_hotjoin);
|
||||
replaceFunc(maps/mp/zombies/_zm_playerhealth::playerhealthregen, scripts/zm/replaced/_zm_playerhealth::playerhealthregen);
|
||||
replaceFunc(maps/mp/zombies/_zm_utility::track_players_intersection_tracker, scripts/zm/replaced/_zm_utility::track_players_intersection_tracker);
|
||||
replaceFunc(maps/mp/zombies/_zm_powerups::nuke_powerup, scripts/zm/replaced/_zm_powerups::nuke_powerup);
|
||||
replaceFunc(maps/mp/zombies/_zm_equipment::placed_equipment_think, scripts/zm/replaced/_zm_equipment::placed_equipment_think);
|
||||
}
|
||||
|
||||
init()
|
||||
@ -1636,375 +1642,6 @@ last_stand_restore_pistol_ammo()
|
||||
}
|
||||
}
|
||||
|
||||
check_quickrevive_for_hotjoin(disconnecting_player)
|
||||
{
|
||||
// always use coop quick revive
|
||||
}
|
||||
|
||||
playerhealthregen()
|
||||
{
|
||||
self notify( "playerHealthRegen" );
|
||||
self endon( "playerHealthRegen" );
|
||||
self endon( "death" );
|
||||
self endon( "disconnect" );
|
||||
|
||||
if ( !isDefined( self.flag ) )
|
||||
{
|
||||
self.flag = [];
|
||||
self.flags_lock = [];
|
||||
}
|
||||
|
||||
if ( !isDefined( self.flag[ "player_has_red_flashing_overlay" ] ) )
|
||||
{
|
||||
self player_flag_init( "player_has_red_flashing_overlay" );
|
||||
self player_flag_init( "player_is_invulnerable" );
|
||||
}
|
||||
|
||||
self player_flag_clear( "player_has_red_flashing_overlay" );
|
||||
self player_flag_clear( "player_is_invulnerable" );
|
||||
self thread maps/mp/zombies/_zm_playerhealth::healthoverlay();
|
||||
|
||||
level.playerhealth_regularregendelay = 2000;
|
||||
level.longregentime = 4000;
|
||||
|
||||
oldratio = 1;
|
||||
veryhurt = 0;
|
||||
playerjustgotredflashing = 0;
|
||||
invultime = 0;
|
||||
hurttime = 0;
|
||||
newhealth = 0;
|
||||
lastinvulratio = 1;
|
||||
healthoverlaycutoff = 0.2;
|
||||
|
||||
self thread maps/mp/zombies/_zm_playerhealth::playerhurtcheck();
|
||||
if ( !isDefined( self.veryhurt ) )
|
||||
{
|
||||
self.veryhurt = 0;
|
||||
}
|
||||
self.bolthit = 0;
|
||||
|
||||
if ( getDvar( "scr_playerInvulTimeScale" ) == "" )
|
||||
{
|
||||
setdvar( "scr_playerInvulTimeScale", 1 );
|
||||
}
|
||||
playerinvultimescale = getDvarFloat( "scr_playerInvulTimeScale" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0.05;
|
||||
waittillframeend;
|
||||
|
||||
health_ratio = self.health / self.maxhealth;
|
||||
maxhealthratio = self.maxhealth / 100;
|
||||
regenrate = 0.05 / maxhealthratio;
|
||||
regularregendelay = 2000;
|
||||
longregendelay = 4000;
|
||||
|
||||
has_revive = 0;
|
||||
if (flag("solo_game"))
|
||||
{
|
||||
if (isDefined(self.bought_solo_revive) && self.bought_solo_revive)
|
||||
{
|
||||
has_revive = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (self hasPerk("specialty_quickrevive"))
|
||||
{
|
||||
has_revive = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (has_revive)
|
||||
{
|
||||
regenrate *= 1.25;
|
||||
regularregendelay *= 0.75;
|
||||
longregendelay *= 0.75;
|
||||
}
|
||||
|
||||
if ( health_ratio > healthoverlaycutoff )
|
||||
{
|
||||
if ( self player_flag( "player_has_red_flashing_overlay" ) )
|
||||
{
|
||||
player_flag_clear( "player_has_red_flashing_overlay" );
|
||||
}
|
||||
lastinvulratio = 1;
|
||||
playerjustgotredflashing = 0;
|
||||
veryhurt = 0;
|
||||
|
||||
if ( self.health == self.maxhealth )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if ( self.health <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
wasveryhurt = veryhurt;
|
||||
|
||||
if ( health_ratio <= healthoverlaycutoff )
|
||||
{
|
||||
veryhurt = 1;
|
||||
if ( !wasveryhurt )
|
||||
{
|
||||
hurttime = getTime();
|
||||
self player_flag_set( "player_has_red_flashing_overlay" );
|
||||
playerjustgotredflashing = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( self.hurtagain )
|
||||
{
|
||||
hurttime = getTime();
|
||||
self.hurtagain = 0;
|
||||
}
|
||||
|
||||
if ( health_ratio >= oldratio )
|
||||
{
|
||||
if ( ( getTime() - hurttime ) < regularregendelay )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.veryhurt = veryhurt;
|
||||
newhealth = health_ratio;
|
||||
if ( veryhurt )
|
||||
{
|
||||
if ( ( getTime() - hurttime ) >= longregendelay )
|
||||
{
|
||||
newhealth += regenrate;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newhealth += regenrate;
|
||||
}
|
||||
}
|
||||
|
||||
if ( newhealth > 1 )
|
||||
{
|
||||
newhealth = 1;
|
||||
}
|
||||
|
||||
if ( newhealth <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
self setnormalhealth( newhealth );
|
||||
oldratio = self.health / self.maxhealth;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
invulworthyhealthdrop = ( lastinvulratio - health_ratio ) > level.worthydamageratio;
|
||||
}
|
||||
|
||||
if ( self.health <= 1 )
|
||||
{
|
||||
self setnormalhealth( 1 / self.maxhealth );
|
||||
invulworthyhealthdrop = 1;
|
||||
}
|
||||
|
||||
oldratio = self.health / self.maxhealth;
|
||||
self notify( "hit_again" );
|
||||
hurttime = getTime();
|
||||
|
||||
if ( !invulworthyhealthdrop || playerinvultimescale <= 0 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( self player_flag( "player_is_invulnerable" ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
self player_flag_set( "player_is_invulnerable" );
|
||||
level notify( "player_becoming_invulnerable" );
|
||||
if ( playerjustgotredflashing )
|
||||
{
|
||||
invultime = level.invultime_onshield;
|
||||
playerjustgotredflashing = 0;
|
||||
}
|
||||
else if ( veryhurt )
|
||||
{
|
||||
invultime = level.invultime_postshield;
|
||||
}
|
||||
else
|
||||
{
|
||||
invultime = level.invultime_preshield;
|
||||
}
|
||||
invultime *= playerinvultimescale;
|
||||
lastinvulratio = self.health / self.maxhealth;
|
||||
self thread maps/mp/zombies/_zm_playerhealth::playerinvul( invultime );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
track_players_intersection_tracker()
|
||||
{
|
||||
// BO2 has built in push mechanic
|
||||
}
|
||||
|
||||
nuke_powerup( drop_item, player_team )
|
||||
{
|
||||
location = drop_item.origin;
|
||||
playfx( drop_item.fx, location );
|
||||
level thread maps/mp/zombies/_zm_powerups::nuke_flash( player_team );
|
||||
wait 0.5;
|
||||
zombies = getaiarray( level.zombie_team );
|
||||
zombies = arraysort( zombies, location );
|
||||
zombies_nuked = [];
|
||||
i = 0;
|
||||
while ( i < zombies.size )
|
||||
{
|
||||
if ( is_true( zombies[ i ].ignore_nuke ) )
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if ( is_true( zombies[ i ].marked_for_death ) )
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if ( isdefined( zombies[ i ].nuke_damage_func ) )
|
||||
{
|
||||
zombies[ i ] thread [[ zombies[ i ].nuke_damage_func ]]();
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if ( is_magic_bullet_shield_enabled( zombies[ i ] ) )
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
zombies[ i ].marked_for_death = 1;
|
||||
//imported from bo3 _zm_powerup_nuke.gsc
|
||||
if ( !zombies[ i ].nuked && !is_magic_bullet_shield_enabled( zombies[ i ] ) )
|
||||
{
|
||||
zombies[ i ].nuked = 1;
|
||||
zombies_nuked[ zombies_nuked.size ] = zombies[ i ];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
i = 0;
|
||||
while ( i < zombies_nuked.size )
|
||||
{
|
||||
if ( !isdefined( zombies_nuked[ i ] ) )
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if ( is_magic_bullet_shield_enabled( zombies_nuked[ i ] ) )
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if ( i < 5 && !zombies_nuked[ i ].isdog )
|
||||
{
|
||||
zombies_nuked[ i ] thread maps/mp/animscripts/zm_death::flame_death_fx();
|
||||
}
|
||||
if ( !zombies_nuked[ i ].isdog )
|
||||
{
|
||||
if ( !is_true( zombies_nuked[ i ].no_gib ) )
|
||||
{
|
||||
zombies_nuked[ i ] maps/mp/zombies/_zm_spawner::zombie_head_gib();
|
||||
}
|
||||
zombies_nuked[ i ] playsound("evt_nuked");
|
||||
}
|
||||
zombies_nuked[ i ] dodamage(zombies_nuked[i].health + 666, zombies_nuked[ i ].origin );
|
||||
i++;
|
||||
}
|
||||
players = get_players( player_team );
|
||||
for ( i = 0; i < players.size; i++ )
|
||||
{
|
||||
players[ i ] maps/mp/zombies/_zm_score::player_add_points( "nuke_powerup", 400 );
|
||||
}
|
||||
}
|
||||
|
||||
placed_equipment_think( model, equipname, origin, angles, tradius, toffset )
|
||||
{
|
||||
pickupmodel = spawn( "script_model", origin );
|
||||
if ( isDefined( angles ) )
|
||||
{
|
||||
pickupmodel.angles = angles;
|
||||
}
|
||||
pickupmodel setmodel( model );
|
||||
if ( isDefined( level.equipment_safe_to_drop ) )
|
||||
{
|
||||
if ( !( self [[ level.equipment_safe_to_drop ]]( pickupmodel ) ) )
|
||||
{
|
||||
maps/mp/zombies/_zm_equipment::equipment_disappear_fx( pickupmodel.origin, undefined, pickupmodel.angles );
|
||||
pickupmodel delete();
|
||||
self maps/mp/zombies/_zm_equipment::equipment_take( equipname );
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
watchername = getsubstr( equipname, 0, equipname.size - 3 );
|
||||
if ( isDefined( level.retrievehints[ watchername ] ) )
|
||||
{
|
||||
hint = level.retrievehints[ watchername ].hint;
|
||||
}
|
||||
else
|
||||
{
|
||||
hint = &"MP_GENERIC_PICKUP";
|
||||
}
|
||||
icon = maps/mp/zombies/_zm_equipment::get_equipment_icon( equipname );
|
||||
if ( !isDefined( tradius ) )
|
||||
{
|
||||
tradius = 32;
|
||||
}
|
||||
torigin = origin;
|
||||
if ( isDefined( toffset ) )
|
||||
{
|
||||
tforward = anglesToForward( angles );
|
||||
torigin += toffset * tforward;
|
||||
}
|
||||
tup = anglesToUp( angles );
|
||||
eq_unitrigger_offset = 12 * tup;
|
||||
pickupmodel.stub = maps/mp/zombies/_zm_equipment::generate_equipment_unitrigger( "trigger_radius_use", torigin + eq_unitrigger_offset, angles, 0, tradius, 64, hint, equipname, maps/mp/zombies/_zm_equipment::placed_equipment_unitrigger_think, pickupmodel.canmove );
|
||||
pickupmodel.stub.model = pickupmodel;
|
||||
pickupmodel.stub.equipname = equipname;
|
||||
pickupmodel.equipname = equipname;
|
||||
//pickupmodel thread maps/mp/zombies/_zm_equipment::item_attract_zombies();
|
||||
pickupmodel thread item_watch_damage();
|
||||
if ( maps/mp/zombies/_zm_equipment::is_limited_equipment( equipname ) )
|
||||
{
|
||||
if ( !isDefined( level.dropped_equipment ) )
|
||||
{
|
||||
level.dropped_equipment = [];
|
||||
}
|
||||
if ( isDefined( level.dropped_equipment[ equipname ] ) && isDefined( level.dropped_equipment[ equipname ].model ) )
|
||||
{
|
||||
level.dropped_equipment[ equipname ].model maps/mp/zombies/_zm_equipment::dropped_equipment_destroy( 1 );
|
||||
}
|
||||
level.dropped_equipment[ equipname ] = pickupmodel.stub;
|
||||
}
|
||||
maps/mp/zombies/_zm_equipment::destructible_equipment_list_add( pickupmodel );
|
||||
return pickupmodel;
|
||||
}
|
||||
|
||||
item_watch_damage()
|
||||
{
|
||||
self endon( "death" );
|
||||
self setcandamage( 1 );
|
||||
while ( 1 )
|
||||
{
|
||||
self.health = 1000000;
|
||||
self waittill( "damage", amount );
|
||||
self maps/mp/zombies/_zm_equipment::item_damage( amount );
|
||||
}
|
||||
}
|
||||
|
||||
setscoreboardcolumns_gametype()
|
||||
{
|
||||
if(getDvar("g_gametype") == "zgrief")
|
||||
|
@ -4,6 +4,11 @@
|
||||
#include maps\mp\gametypes_zm\_hud_util;
|
||||
#include maps\mp\gametypes_zm\_hud_message;
|
||||
|
||||
#include scripts/zm/replaced/_zm;
|
||||
#include scripts/zm/replaced/_zm_audio_announcer;
|
||||
#include scripts/zm/replaced/_zm_game_module;
|
||||
#include scripts/zm/replaced/_zm_blockers;
|
||||
|
||||
main()
|
||||
{
|
||||
if ( getDvar( "g_gametype" ) != "zgrief" )
|
||||
@ -11,10 +16,10 @@ main()
|
||||
return;
|
||||
}
|
||||
|
||||
replaceFunc(maps/mp/zombies/_zm::onallplayersready, ::onallplayersready);
|
||||
replaceFunc(maps/mp/zombies/_zm_audio_announcer::playleaderdialogonplayer, ::playleaderdialogonplayer);
|
||||
replaceFunc(maps/mp/zombies/_zm_game_module::wait_for_team_death_and_round_end, ::wait_for_team_death_and_round_end);
|
||||
replaceFunc(maps/mp/zombies/_zm_blockers::handle_post_board_repair_rewards, ::handle_post_board_repair_rewards);
|
||||
replaceFunc(maps/mp/zombies/_zm::onallplayersready, scripts/zm/replaced/_zm::onallplayersready);
|
||||
replaceFunc(maps/mp/zombies/_zm_audio_announcer::playleaderdialogonplayer, scripts/zm/replaced/_zm_audio_announcer::playleaderdialogonplayer);
|
||||
replaceFunc(maps/mp/zombies/_zm_game_module::wait_for_team_death_and_round_end, scripts/zm/replaced/_zm_game_module::wait_for_team_death_and_round_end);
|
||||
replaceFunc(maps/mp/zombies/_zm_blockers::handle_post_board_repair_rewards, scripts/zm/replaced/_zm_blockers::handle_post_board_repair_rewards);
|
||||
}
|
||||
|
||||
init()
|
||||
@ -360,111 +365,6 @@ headstomp_watcher()
|
||||
}
|
||||
}
|
||||
|
||||
wait_for_team_death_and_round_end()
|
||||
{
|
||||
level endon( "game_module_ended" );
|
||||
level endon( "end_game" );
|
||||
|
||||
checking_for_round_end = 0;
|
||||
level.isresetting_grief = 0;
|
||||
while ( 1 )
|
||||
{
|
||||
cdc_total = 0;
|
||||
cia_total = 0;
|
||||
cdc_alive = 0;
|
||||
cia_alive = 0;
|
||||
players = get_players();
|
||||
i = 0;
|
||||
while ( i < players.size )
|
||||
{
|
||||
if ( !isDefined( players[ i ]._encounters_team ) )
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if ( players[ i ]._encounters_team == "A" )
|
||||
{
|
||||
cia_total++;
|
||||
if ( is_player_valid( players[ i ] ) )
|
||||
{
|
||||
cia_alive++;
|
||||
}
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
cdc_total++;
|
||||
if ( is_player_valid( players[ i ] ) )
|
||||
{
|
||||
cdc_alive++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if ( !checking_for_round_end )
|
||||
{
|
||||
if ( cia_alive == 0 )
|
||||
{
|
||||
level thread round_end( "B", cia_total == 0 );
|
||||
checking_for_round_end = 1;
|
||||
}
|
||||
else if ( cdc_alive == 0 )
|
||||
{
|
||||
level thread round_end( "A", cdc_total == 0 );
|
||||
checking_for_round_end = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( cia_alive > 0 && cdc_alive > 0 )
|
||||
{
|
||||
level notify( "stop_round_end_check" );
|
||||
checking_for_round_end = 0;
|
||||
}
|
||||
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
zombie_goto_round(target_round)
|
||||
{
|
||||
level endon( "end_game" );
|
||||
|
||||
if ( target_round < 1 )
|
||||
{
|
||||
target_round = 1;
|
||||
}
|
||||
|
||||
level.zombie_total = 0;
|
||||
zombies = get_round_enemy_array();
|
||||
if ( isDefined( zombies ) )
|
||||
{
|
||||
for ( i = 0; i < zombies.size; i++ )
|
||||
{
|
||||
zombies[ i ] dodamage( zombies[ i ].health + 666, zombies[ i ].origin );
|
||||
}
|
||||
}
|
||||
|
||||
maps/mp/zombies/_zm_game_module::respawn_players();
|
||||
maps/mp/zombies/_zm::award_grenades_for_survivors();
|
||||
players = get_players();
|
||||
foreach(player in players)
|
||||
{
|
||||
if(player.score < level.player_starting_points)
|
||||
{
|
||||
player maps/mp/zombies/_zm_score::add_to_player_score(level.player_starting_points - player.score);
|
||||
}
|
||||
|
||||
if(isDefined(player get_player_placeable_mine()))
|
||||
{
|
||||
player giveweapon(player get_player_placeable_mine());
|
||||
player set_player_placeable_mine(player get_player_placeable_mine());
|
||||
player setactionslot(4, "weapon", player get_player_placeable_mine());
|
||||
player setweaponammoclip(player get_player_placeable_mine(), 2);
|
||||
}
|
||||
}
|
||||
|
||||
level thread round_start_wait(5);
|
||||
}
|
||||
|
||||
round_start_wait(time, initial)
|
||||
{
|
||||
if(!isDefined(initial))
|
||||
@ -606,106 +506,6 @@ zombie_spawn_wait(time)
|
||||
flag_set("spawn_zombies");
|
||||
}
|
||||
|
||||
round_end(winner, force_win)
|
||||
{
|
||||
if(!isDefined(force_win))
|
||||
{
|
||||
force_win = false;
|
||||
}
|
||||
|
||||
winner_alive = 0;
|
||||
team = "axis";
|
||||
if(winner == "B")
|
||||
{
|
||||
team = "allies";
|
||||
}
|
||||
|
||||
if(!force_win)
|
||||
{
|
||||
wait 5;
|
||||
}
|
||||
|
||||
players = get_players();
|
||||
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_hud.score[team] setValue(level.grief_score[winner]);
|
||||
setteamscore(team, level.grief_score[winner]);
|
||||
}
|
||||
|
||||
if(level.grief_score[winner] == level.grief_winning_score || force_win)
|
||||
{
|
||||
level.gamemodulewinningteam = winner;
|
||||
level.zombie_vars[ "spectators_respawn" ] = 0;
|
||||
players = get_players();
|
||||
i = 0;
|
||||
while ( i < players.size )
|
||||
{
|
||||
players[ i ] freezecontrols( 1 );
|
||||
if ( players[ i ]._encounters_team == winner )
|
||||
{
|
||||
players[ i ] thread maps/mp/zombies/_zm_audio_announcer::leaderdialogonplayer( "grief_won" );
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
players[ i ] thread maps/mp/zombies/_zm_audio_announcer::leaderdialogonplayer( "grief_lost" );
|
||||
i++;
|
||||
}
|
||||
level notify( "game_module_ended", winner );
|
||||
level._game_module_game_end_check = undefined;
|
||||
maps/mp/gametypes_zm/_zm_gametype::track_encounters_win_stats( level.gamemodulewinningteam );
|
||||
level notify( "end_game" );
|
||||
}
|
||||
else
|
||||
{
|
||||
players = get_players();
|
||||
foreach(player in players)
|
||||
{
|
||||
// don't give score back from down
|
||||
player.pers["score"] = player.score;
|
||||
|
||||
if(is_player_valid(player))
|
||||
{
|
||||
// don't give perk
|
||||
player notify("perk_abort_drinking");
|
||||
// save weapons
|
||||
player [[level._game_module_player_laststand_callback]]();
|
||||
}
|
||||
}
|
||||
|
||||
level.isresetting_grief = 1;
|
||||
level notify( "end_round_think" );
|
||||
level.zombie_vars[ "spectators_respawn" ] = 1;
|
||||
level notify( "keep_griefing" );
|
||||
level notify( "restart_round" );
|
||||
|
||||
level.round_number++;
|
||||
setroundsplayed(level.round_number);
|
||||
|
||||
level thread maps/mp/zombies/_zm_audio_announcer::leaderdialog( "grief_restarted" );
|
||||
if(!winner_alive)
|
||||
{
|
||||
foreach(player in players)
|
||||
{
|
||||
player thread show_grief_hud_msg( &"ZOMBIE_GRIEF_RESET" );
|
||||
}
|
||||
}
|
||||
|
||||
zombie_goto_round( level.round_number );
|
||||
level thread maps/mp/zombies/_zm_game_module::reset_grief();
|
||||
level thread maps/mp/zombies/_zm::round_think( 1 );
|
||||
}
|
||||
}
|
||||
|
||||
update_players_on_downed(excluded_player)
|
||||
{
|
||||
players_remaining = 0;
|
||||
@ -1360,124 +1160,6 @@ unlimited_zombies()
|
||||
}
|
||||
}
|
||||
|
||||
onallplayersready()
|
||||
{
|
||||
while ( getPlayers().size < getDvarInt( "zombies_minplayers" ) )
|
||||
{
|
||||
wait 0.1;
|
||||
}
|
||||
game[ "state" ] = "playing";
|
||||
wait_for_all_players_to_connect( level.crash_delay );
|
||||
setinitialplayersconnected();
|
||||
flag_set( "initial_players_connected" );
|
||||
while ( !aretexturesloaded() )
|
||||
{
|
||||
wait 0.05;
|
||||
}
|
||||
thread maps/mp/zombies/_zm::start_zombie_logic_in_x_sec( 3 );
|
||||
maps/mp/zombies/_zm::fade_out_intro_screen_zm( 5, 1.5, 1 );
|
||||
}
|
||||
|
||||
wait_for_all_players_to_connect( max_wait )
|
||||
{
|
||||
timeout = int( max_wait * 10 );
|
||||
cur_time = 0;
|
||||
player_count_actual = 0;
|
||||
while ( getnumconnectedplayers() < getnumexpectedplayers() || player_count_actual != getnumexpectedplayers() )
|
||||
{
|
||||
players = getPlayers();
|
||||
player_count_actual = 0;
|
||||
for ( i = 0; i < players.size; i++ )
|
||||
{
|
||||
players[ i ] freezecontrols( 1 );
|
||||
if ( players[ i ].sessionstate == "playing" )
|
||||
{
|
||||
player_count_actual++;
|
||||
}
|
||||
}
|
||||
wait 0.1;
|
||||
cur_time++;
|
||||
if ( cur_time >= timeout )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
playleaderdialogonplayer( dialog, team, waittime )
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
if ( level.allowzmbannouncer )
|
||||
{
|
||||
if ( !isDefined( game[ "zmbdialog" ][ dialog ] ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
self.zmbdialogactive = 1;
|
||||
if ( isDefined( self.zmbdialoggroups[ dialog ] ) )
|
||||
{
|
||||
group = dialog;
|
||||
dialog = self.zmbdialoggroups[ group ];
|
||||
self.zmbdialoggroups[ group ] = undefined;
|
||||
self.zmbdialoggroup = group;
|
||||
}
|
||||
if ( level.allowzmbannouncer )
|
||||
{
|
||||
alias = game[ "zmbdialog" ][ "prefix" ] + "_" + game[ "zmbdialog" ][ dialog ];
|
||||
variant = self maps/mp/zombies/_zm_audio_announcer::getleaderdialogvariant( alias );
|
||||
if ( !isDefined( variant ) )
|
||||
{
|
||||
full_alias = alias + "_" + "0";
|
||||
if ( level.script == "zm_prison" )
|
||||
{
|
||||
dialogType = strtok( game[ "zmbdialog" ][ dialog ], "_" );
|
||||
switch ( dialogType[ 0 ] )
|
||||
{
|
||||
case "powerup":
|
||||
full_alias = alias;
|
||||
break;
|
||||
case "grief":
|
||||
full_alias = alias + "_" + "0";
|
||||
break;
|
||||
default:
|
||||
full_alias = alias;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
full_alias = alias + "_" + variant;
|
||||
}
|
||||
self playlocalsound( full_alias );
|
||||
}
|
||||
|
||||
/*
|
||||
if ( isDefined( waittime ) )
|
||||
{
|
||||
wait waittime;
|
||||
}
|
||||
else
|
||||
{
|
||||
wait 4;
|
||||
}
|
||||
*/
|
||||
|
||||
self.zmbdialogactive = 0;
|
||||
self.zmbdialoggroup = "";
|
||||
if ( self.zmbdialogqueue.size > 0 && level.allowzmbannouncer )
|
||||
{
|
||||
nextdialog = self.zmbdialogqueue[0];
|
||||
for( i = 1; i < self.zmbdialogqueue.size; i++ )
|
||||
{
|
||||
self.zmbdialogqueue[ i - 1 ] = self.zmbdialogqueue[ i ];
|
||||
}
|
||||
self.zmbdialogqueue[ i - 1 ] = undefined;
|
||||
self thread playleaderdialogonplayer( nextdialog, team );
|
||||
}
|
||||
}
|
||||
|
||||
zombie_damage( mod, hit_location, hit_origin, player, amount, team )
|
||||
{
|
||||
if ( is_magic_bullet_shield_enabled( self ) )
|
||||
@ -1599,26 +1281,6 @@ zombie_damage( mod, hit_location, hit_origin, player, amount, team )
|
||||
self thread maps/mp/zombies/_zm_powerups::check_for_instakill( player, mod, hit_location );
|
||||
}
|
||||
|
||||
handle_post_board_repair_rewards( cost, zbarrier )
|
||||
{
|
||||
self maps/mp/zombies/_zm_stats::increment_client_stat( "boards" );
|
||||
self maps/mp/zombies/_zm_stats::increment_player_stat( "boards" );
|
||||
if ( isDefined( self.pers[ "boards" ] ) && ( self.pers[ "boards" ] % 10 ) == 0 )
|
||||
{
|
||||
self thread do_player_general_vox( "general", "reboard", 90 );
|
||||
}
|
||||
self maps/mp/zombies/_zm_pers_upgrades_functions::pers_boards_updated( zbarrier );
|
||||
self.rebuild_barrier_reward += cost;
|
||||
|
||||
self maps/mp/zombies/_zm_score::player_add_points( "rebuild_board", cost );
|
||||
self play_sound_on_ent( "purchase" );
|
||||
|
||||
if ( isDefined( self.board_repair ) )
|
||||
{
|
||||
self.board_repair += 1;
|
||||
}
|
||||
}
|
||||
|
||||
func_should_drop_meat()
|
||||
{
|
||||
players = get_players();
|
||||
|
Reference in New Issue
Block a user