mirror of
https://github.com/JezuzLizard/Recompilable-gscs-for-BO2-zombies-and-multiplayer.git
synced 2025-06-08 01:47:50 -05:00
checked 10 more scripts
8 are for mp and zm _healthoverlay, _hostmigration, _menus, and _tweakables. Additionally _zm_chugabud, and _zm_equipment were checked for zm.
This commit is contained in:
parent
535c5c1737
commit
09e3ff45ed
@ -1,16 +1,16 @@
|
||||
#include maps/mp/gametypes/_globallogic_player;
|
||||
|
||||
init()
|
||||
init() //checked matches cerberus output
|
||||
{
|
||||
precacheshader( "overlay_low_health" );
|
||||
level.healthoverlaycutoff = 0,55;
|
||||
level.healthoverlaycutoff = 0.55;
|
||||
regentime = level.playerhealthregentime;
|
||||
level.playerhealth_regularregendelay = regentime * 1000;
|
||||
level.healthregendisabled = level.playerhealth_regularregendelay <= 0;
|
||||
level thread onplayerconnect();
|
||||
}
|
||||
|
||||
onplayerconnect()
|
||||
onplayerconnect() //checked matches cerberus output
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
@ -23,7 +23,7 @@ onplayerconnect()
|
||||
}
|
||||
}
|
||||
|
||||
onjoinedteam()
|
||||
onjoinedteam() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -33,7 +33,7 @@ onjoinedteam()
|
||||
}
|
||||
}
|
||||
|
||||
onjoinedspectators()
|
||||
onjoinedspectators() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -43,7 +43,7 @@ onjoinedspectators()
|
||||
}
|
||||
}
|
||||
|
||||
onplayerspawned()
|
||||
onplayerspawned() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -53,7 +53,7 @@ onplayerspawned()
|
||||
}
|
||||
}
|
||||
|
||||
onplayerkilled()
|
||||
onplayerkilled() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -63,38 +63,40 @@ onplayerkilled()
|
||||
}
|
||||
}
|
||||
|
||||
onplayerdisconnect()
|
||||
onplayerdisconnect() //checked matches cerberus output
|
||||
{
|
||||
self waittill( "disconnect" );
|
||||
self notify( "end_healthregen" );
|
||||
}
|
||||
|
||||
playerhealthregen()
|
||||
playerhealthregen() //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
if ( self.health <= 0 )
|
||||
{
|
||||
/*
|
||||
/#
|
||||
assert( !isalive( self ) );
|
||||
#/
|
||||
*/
|
||||
return;
|
||||
}
|
||||
maxhealth = self.health;
|
||||
oldhealth = maxhealth;
|
||||
player = self;
|
||||
health_add = 0;
|
||||
regenrate = 0,1;
|
||||
regenrate = 0.1;
|
||||
usetrueregen = 0;
|
||||
veryhurt = 0;
|
||||
player.breathingstoptime = -10000;
|
||||
thread playerbreathingsound( maxhealth * 0,35 );
|
||||
thread playerheartbeatsound( maxhealth * 0,35 );
|
||||
thread playerbreathingsound( maxhealth * 0.35 );
|
||||
thread playerheartbeatsound( maxhealth * 0.35 );
|
||||
lastsoundtime_recover = 0;
|
||||
hurttime = 0;
|
||||
newhealth = 0;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0,05;
|
||||
wait 0.05;
|
||||
if ( isDefined( player.regenrate ) )
|
||||
{
|
||||
regenrate = player.regenrate;
|
||||
@ -106,7 +108,7 @@ playerhealthregen()
|
||||
self.atbrinkofdeath = 0;
|
||||
continue;
|
||||
}
|
||||
else if ( player.health <= 0 )
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -114,8 +116,6 @@ playerhealthregen()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
wasveryhurt = veryhurt;
|
||||
ratio = player.health / maxhealth;
|
||||
if ( ratio <= level.healthoverlaycutoff )
|
||||
@ -136,11 +136,11 @@ playerhealthregen()
|
||||
}
|
||||
if ( ( getTime() - hurttime ) < regentime )
|
||||
{
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
else if ( level.healthregendisabled )
|
||||
{
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
else if ( ( getTime() - lastsoundtime_recover ) > regentime )
|
||||
{
|
||||
@ -184,20 +184,16 @@ playerhealthregen()
|
||||
player decayplayerdamages( change );
|
||||
}
|
||||
oldhealth = player.health;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
oldhealth = player.health;
|
||||
health_add = 0;
|
||||
hurttime = getTime();
|
||||
player.breathingstoptime = hurttime + 6000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
decayplayerdamages( decay )
|
||||
decayplayerdamages( decay ) //checked partially changed to match cerberus output //continues in for loops bad see github for more info
|
||||
{
|
||||
if ( !isDefined( self.attackerdamage ) )
|
||||
{
|
||||
@ -211,26 +207,23 @@ decayplayerdamages( decay )
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.attackerdamage[ i ].damage -= decay;
|
||||
if ( self.attackerdamage[ i ].damage < 0 )
|
||||
{
|
||||
self.attackerdamage[ i ].damage = 0;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
playerbreathingsound( healthcap )
|
||||
playerbreathingsound( healthcap ) //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
wait 2;
|
||||
player = self;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0,2;
|
||||
wait 0.2;
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
return;
|
||||
@ -243,46 +236,41 @@ playerbreathingsound( healthcap )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
player notify( "snd_breathing_hurt" );
|
||||
wait 0,784;
|
||||
wait ( 0,1 + randomfloat( 0,8 ) );
|
||||
wait 0.784;
|
||||
wait ( 0.1 + randomfloat( 0.8 ) );
|
||||
}
|
||||
}
|
||||
|
||||
playerheartbeatsound( healthcap ) //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
self.hearbeatwait = 0.2;
|
||||
wait 2;
|
||||
player = self;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0.2;
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( player.health >= healthcap )
|
||||
{
|
||||
self.hearbeatwait = 0.3;
|
||||
continue;
|
||||
}
|
||||
else if ( level.healthregendisabled && getTime() > player.breathingstoptime )
|
||||
{
|
||||
self.hearbeatwait = 0.3;
|
||||
continue;
|
||||
}
|
||||
player playlocalsound( "mpl_player_heartbeat" );
|
||||
wait self.hearbeatwait;
|
||||
if ( self.hearbeatwait <= 0.6 )
|
||||
{
|
||||
self.hearbeatwait += 0.1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
playerheartbeatsound( healthcap )
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
self.hearbeatwait = 0,2;
|
||||
wait 2;
|
||||
player = self;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0,2;
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( player.health >= healthcap )
|
||||
{
|
||||
self.hearbeatwait = 0,3;
|
||||
continue;
|
||||
}
|
||||
else if ( level.healthregendisabled && getTime() > player.breathingstoptime )
|
||||
{
|
||||
self.hearbeatwait = 0,3;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
player playlocalsound( "mpl_player_heartbeat" );
|
||||
wait self.hearbeatwait;
|
||||
if ( self.hearbeatwait <= 0,6 )
|
||||
{
|
||||
self.hearbeatwait += 0,1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,9 @@
|
||||
#include common_scripts/utility;
|
||||
#include maps/mp/_utility;
|
||||
|
||||
debug_script_structs()
|
||||
debug_script_structs() //dev call did not check
|
||||
{
|
||||
/*
|
||||
/#
|
||||
if ( isDefined( level.struct ) )
|
||||
{
|
||||
@ -29,9 +30,10 @@ debug_script_structs()
|
||||
}
|
||||
else println( "*** No structs defined." );
|
||||
#/
|
||||
*/
|
||||
}
|
||||
|
||||
updatetimerpausedness()
|
||||
updatetimerpausedness() //checked matches cerberus output
|
||||
{
|
||||
shouldbestopped = isDefined( level.hostmigrationtimer );
|
||||
if ( !level.timerstopped && shouldbestopped )
|
||||
@ -39,38 +41,35 @@ updatetimerpausedness()
|
||||
level.timerstopped = 1;
|
||||
level.timerpausetime = getTime();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( level.timerstopped && !shouldbestopped )
|
||||
else if ( level.timerstopped && !shouldbestopped )
|
||||
{
|
||||
level.timerstopped = 0;
|
||||
level.discardtime += getTime() - level.timerpausetime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
callback_hostmigrationsave()
|
||||
callback_hostmigrationsave() //checked matches cerberus output
|
||||
{
|
||||
}
|
||||
|
||||
pausetimer()
|
||||
pausetimer() //checked matches cerberus output
|
||||
{
|
||||
level.migrationtimerpausetime = getTime();
|
||||
}
|
||||
|
||||
resumetimer()
|
||||
resumetimer() //checked matches cerberus output
|
||||
{
|
||||
level.discardtime += getTime() - level.migrationtimerpausetime;
|
||||
}
|
||||
|
||||
locktimer()
|
||||
locktimer() //checked matches cerberus output
|
||||
{
|
||||
level endon( "host_migration_begin" );
|
||||
level endon( "host_migration_end" );
|
||||
for ( ;; )
|
||||
{
|
||||
currtime = getTime();
|
||||
wait 0,05;
|
||||
wait 0.05;
|
||||
if ( !level.timerstopped && isDefined( level.discardtime ) )
|
||||
{
|
||||
level.discardtime += getTime() - currtime;
|
||||
@ -78,7 +77,7 @@ locktimer()
|
||||
}
|
||||
}
|
||||
|
||||
callback_hostmigration()
|
||||
callback_hostmigration() //checked changed to match cerberus output
|
||||
{
|
||||
setslowmotion( 1, 1, 0 );
|
||||
makedvarserverinfo( "ui_guncycle", 0 );
|
||||
@ -89,38 +88,42 @@ callback_hostmigration()
|
||||
}
|
||||
if ( level.gameended )
|
||||
{
|
||||
/*
|
||||
/#
|
||||
println( "Migration starting at time " + getTime() + ", but game has ended, so no countdown." );
|
||||
#/
|
||||
*/
|
||||
return;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
println( "Migration starting at time " + getTime() );
|
||||
#/
|
||||
*/
|
||||
level.hostmigrationtimer = 1;
|
||||
sethostmigrationstatus( 1 );
|
||||
level notify( "host_migration_begin" );
|
||||
thread locktimer();
|
||||
players = level.players;
|
||||
i = 0;
|
||||
while ( i < players.size )
|
||||
for ( i = 0; i < players.size; i++ )
|
||||
{
|
||||
player = players[ i ];
|
||||
player thread hostmigrationtimerthink();
|
||||
i++;
|
||||
}
|
||||
level endon( "host_migration_begin" );
|
||||
hostmigrationwait();
|
||||
level.hostmigrationtimer = undefined;
|
||||
sethostmigrationstatus( 0 );
|
||||
/*
|
||||
/#
|
||||
println( "Migration finished at time " + getTime() );
|
||||
#/
|
||||
*/
|
||||
recordmatchbegin();
|
||||
level notify( "host_migration_end" );
|
||||
}
|
||||
|
||||
matchstarttimerconsole_internal( counttime, matchstarttimer )
|
||||
matchstarttimerconsole_internal( counttime, matchstarttimer ) //checked matches cerberus output
|
||||
{
|
||||
waittillframeend;
|
||||
visionsetnaked( "mpIntro", 0 );
|
||||
@ -128,7 +131,7 @@ matchstarttimerconsole_internal( counttime, matchstarttimer )
|
||||
while ( counttime > 0 && !level.gameended )
|
||||
{
|
||||
matchstarttimer thread maps/mp/gametypes/_hud::fontpulse( level );
|
||||
wait ( matchstarttimer.inframes * 0,05 );
|
||||
wait ( matchstarttimer.inframes * 0.05 );
|
||||
matchstarttimer setvalue( counttime );
|
||||
if ( counttime == 2 )
|
||||
{
|
||||
@ -136,22 +139,22 @@ matchstarttimerconsole_internal( counttime, matchstarttimer )
|
||||
}
|
||||
counttime--;
|
||||
|
||||
wait ( 1 - ( matchstarttimer.inframes * 0,05 ) );
|
||||
wait ( 1 - ( matchstarttimer.inframes * 0.05 ) );
|
||||
}
|
||||
}
|
||||
|
||||
matchstarttimerconsole( type, duration )
|
||||
matchstarttimerconsole( type, duration ) //checked matches cerberus output
|
||||
{
|
||||
level notify( "match_start_timer_beginning" );
|
||||
wait 0,05;
|
||||
matchstarttext = createserverfontstring( "objective", 1,5 );
|
||||
matchstarttext = createserverfontstring( "objective", 1.5 );
|
||||
matchstarttext setpoint( "CENTER", "CENTER", 0, -40 );
|
||||
matchstarttext.sort = 1001;
|
||||
matchstarttext settext( game[ "strings" ][ "waiting_for_teams" ] );
|
||||
matchstarttext.foreground = 0;
|
||||
matchstarttext.hidewheninmenu = 1;
|
||||
matchstarttext settext( game[ "strings" ][ type ] );
|
||||
matchstarttimer = createserverfontstring( "objective", 2,2 );
|
||||
matchstarttimer = createserverfontstring( "objective", 2.2 );
|
||||
matchstarttimer setpoint( "CENTER", "CENTER", 0, 0 );
|
||||
matchstarttimer.sort = 1001;
|
||||
matchstarttimer.color = ( 1, 1, 0 );
|
||||
@ -173,7 +176,7 @@ matchstarttimerconsole( type, duration )
|
||||
matchstarttext destroyelem();
|
||||
}
|
||||
|
||||
hostmigrationwait()
|
||||
hostmigrationwait() //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
level endon( "game_ended" );
|
||||
if ( level.hostmigrationreturnedplayercount < ( ( level.players.size * 2 ) / 3 ) )
|
||||
@ -186,7 +189,7 @@ hostmigrationwait()
|
||||
wait 5;
|
||||
}
|
||||
|
||||
waittillhostmigrationcountdown()
|
||||
waittillhostmigrationcountdown() //checked matches cerberus output
|
||||
{
|
||||
level endon( "host_migration_end" );
|
||||
if ( !isDefined( level.hostmigrationtimer ) )
|
||||
@ -196,13 +199,13 @@ waittillhostmigrationcountdown()
|
||||
level waittill( "host_migration_countdown_begin" );
|
||||
}
|
||||
|
||||
hostmigrationwaitforplayers()
|
||||
hostmigrationwaitforplayers() //checked matches cerberus output
|
||||
{
|
||||
level endon( "hostmigration_enoughplayers" );
|
||||
wait 15;
|
||||
}
|
||||
|
||||
hostmigrationtimerthink_internal()
|
||||
hostmigrationtimerthink_internal() //checked matches cerberus output
|
||||
{
|
||||
level endon( "host_migration_begin" );
|
||||
level endon( "host_migration_end" );
|
||||
@ -216,7 +219,7 @@ hostmigrationtimerthink_internal()
|
||||
level waittill( "host_migration_end" );
|
||||
}
|
||||
|
||||
hostmigrationtimerthink()
|
||||
hostmigrationtimerthink() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
level endon( "host_migration_begin" );
|
||||
@ -227,7 +230,7 @@ hostmigrationtimerthink()
|
||||
}
|
||||
}
|
||||
|
||||
waittillhostmigrationdone()
|
||||
waittillhostmigrationdone() //checked matches cerberus output
|
||||
{
|
||||
if ( !isDefined( level.hostmigrationtimer ) )
|
||||
{
|
||||
@ -238,7 +241,7 @@ waittillhostmigrationdone()
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
waittillhostmigrationstarts( duration )
|
||||
waittillhostmigrationstarts( duration ) //checked matches cerberus output
|
||||
{
|
||||
if ( isDefined( level.hostmigrationtimer ) )
|
||||
{
|
||||
@ -248,15 +251,17 @@ waittillhostmigrationstarts( duration )
|
||||
wait duration;
|
||||
}
|
||||
|
||||
waitlongdurationwithhostmigrationpause( duration )
|
||||
waitlongdurationwithhostmigrationpause( duration ) //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
if ( duration == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( duration > 0 );
|
||||
#/
|
||||
*/
|
||||
starttime = getTime();
|
||||
endtime = getTime() + ( duration * 1000 );
|
||||
while ( getTime() < endtime )
|
||||
@ -268,25 +273,29 @@ waitlongdurationwithhostmigrationpause( duration )
|
||||
endtime += timepassed;
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getTime() != endtime )
|
||||
{
|
||||
println( "SCRIPT WARNING: gettime() = " + getTime() + " NOT EQUAL TO endtime = " + endtime );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
waittillhostmigrationdone();
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
waitlongdurationwithhostmigrationpauseemp( duration )
|
||||
waitlongdurationwithhostmigrationpauseemp( duration ) //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
if ( duration == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( duration > 0 );
|
||||
#/
|
||||
*/
|
||||
starttime = getTime();
|
||||
empendtime = getTime() + ( duration * 1000 );
|
||||
level.empendtime = empendtime;
|
||||
@ -302,26 +311,30 @@ waitlongdurationwithhostmigrationpauseemp( duration )
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getTime() != empendtime )
|
||||
{
|
||||
println( "SCRIPT WARNING: gettime() = " + getTime() + " NOT EQUAL TO empendtime = " + empendtime );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
waittillhostmigrationdone();
|
||||
level.empendtime = undefined;
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
waitlongdurationwithgameendtimeupdate( duration )
|
||||
waitlongdurationwithgameendtimeupdate( duration ) //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
if ( duration == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( duration > 0 );
|
||||
#/
|
||||
*/
|
||||
starttime = getTime();
|
||||
endtime = getTime() + ( duration * 1000 );
|
||||
while ( getTime() < endtime )
|
||||
@ -334,12 +347,14 @@ waitlongdurationwithgameendtimeupdate( duration )
|
||||
wait 1;
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getTime() != endtime )
|
||||
{
|
||||
println( "SCRIPT WARNING: gettime() = " + getTime() + " NOT EQUAL TO endtime = " + endtime );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
while ( isDefined( level.hostmigrationtimer ) )
|
||||
{
|
||||
endtime += 1000;
|
||||
@ -348,3 +363,4 @@ waitlongdurationwithgameendtimeupdate( duration )
|
||||
}
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include maps/mp/gametypes/_globallogic;
|
||||
#include maps/mp/_utility;
|
||||
|
||||
init()
|
||||
init() //checked changed to match cerberus output
|
||||
{
|
||||
precachestring( &"open_ingame_menu" );
|
||||
game[ "menu_team" ] = "team_marinesopfor";
|
||||
@ -16,13 +16,9 @@ init()
|
||||
game[ "menu_changeclass_wager" ] = "changeclass_wager";
|
||||
game[ "menu_changeclass_custom" ] = "changeclass_custom";
|
||||
game[ "menu_changeclass_barebones" ] = "changeclass_barebones";
|
||||
_a18 = level.teams;
|
||||
_k18 = getFirstArrayKey( _a18 );
|
||||
while ( isDefined( _k18 ) )
|
||||
foreach ( team in level.teams )
|
||||
{
|
||||
team = _a18[ _k18 ];
|
||||
game[ "menu_changeclass_" + team ] = "changeclass";
|
||||
_k18 = getNextArrayKey( _a18, _k18 );
|
||||
}
|
||||
game[ "menu_controls" ] = "ingame_controls";
|
||||
game[ "menu_options" ] = "ingame_options";
|
||||
@ -50,7 +46,7 @@ init()
|
||||
level thread onplayerconnect();
|
||||
}
|
||||
|
||||
onplayerconnect()
|
||||
onplayerconnect() //checked matches cerberus output
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
@ -59,7 +55,7 @@ onplayerconnect()
|
||||
}
|
||||
}
|
||||
|
||||
onmenuresponse()
|
||||
onmenuresponse() //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -71,7 +67,7 @@ onmenuresponse()
|
||||
self closeingamemenu();
|
||||
if ( level.console )
|
||||
{
|
||||
if ( game[ "menu_changeclass" ] != menu && game[ "menu_changeclass_offline" ] != menu || menu == game[ "menu_team" ] && menu == game[ "menu_controls" ] )
|
||||
if ( menu == game[ "menu_changeclass" ] || menu == game[ "menu_changeclass_offline" ] || menu == game[ "menu_team" ] || menu == game[ "menu_controls" ] )
|
||||
{
|
||||
if ( isDefined( level.teams[ self.pers[ "team" ] ] ) )
|
||||
{
|
||||
@ -81,7 +77,7 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if ( response == "changeteam" && level.allow_teamchange == "1" )
|
||||
if ( response == "changeteam" && level.allow_teamchange == "1" )
|
||||
{
|
||||
self closemenu();
|
||||
self closeingamemenu();
|
||||
@ -107,12 +103,12 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if ( response == "killserverpc" )
|
||||
if ( response == "killserverpc" )
|
||||
{
|
||||
level thread maps/mp/gametypes/_globallogic::killserverpc();
|
||||
continue;
|
||||
}
|
||||
else if ( response == "endround" )
|
||||
if ( response == "endround" )
|
||||
{
|
||||
if ( !level.gameended )
|
||||
{
|
||||
@ -127,7 +123,7 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if ( menu == game[ "menu_team" ] && level.allow_teamchange == "1" )
|
||||
if ( menu == game[ "menu_team" ] && level.allow_teamchange == "1" )
|
||||
{
|
||||
switch( response )
|
||||
{
|
||||
@ -143,9 +139,7 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( game[ "menu_changeclass" ] != menu && game[ "menu_changeclass_offline" ] != menu && game[ "menu_changeclass_wager" ] != menu || menu == game[ "menu_changeclass_custom" ] && menu == game[ "menu_changeclass_barebones" ] )
|
||||
if ( menu == game[ "menu_changeclass" ] || menu == game[ "menu_changeclass_offline" ] || menu == game[ "menu_changeclass_wager" ] || menu == game[ "menu_changeclass_custom" ] || menu == game[ "menu_changeclass_barebones" ] )
|
||||
{
|
||||
self closemenu();
|
||||
self closeingamemenu();
|
||||
@ -158,10 +152,8 @@ onmenuresponse()
|
||||
}
|
||||
self.selectedclass = 1;
|
||||
self [[ level.class ]]( response );
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( menu == "spectate" )
|
||||
{
|
||||
player = getplayerfromclientnum( int( response ) );
|
||||
@ -171,6 +163,5 @@ onmenuresponse()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include maps/mp/_utility;
|
||||
|
||||
gettweakabledvarvalue( category, name )
|
||||
gettweakabledvarvalue( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -32,14 +32,16 @@ gettweakabledvarvalue( category, name )
|
||||
dvar = undefined;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( dvar ) );
|
||||
#/
|
||||
*/
|
||||
value = getDvarInt( dvar );
|
||||
return value;
|
||||
}
|
||||
|
||||
gettweakabledvar( category, name )
|
||||
gettweakabledvar( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -71,13 +73,15 @@ gettweakabledvar( category, name )
|
||||
value = undefined;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( value ) );
|
||||
#/
|
||||
*/
|
||||
return value;
|
||||
}
|
||||
|
||||
gettweakablevalue( category, name )
|
||||
gettweakablevalue( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -114,13 +118,15 @@ gettweakablevalue( category, name )
|
||||
{
|
||||
return getDvarInt( overridedvar );
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( value ) );
|
||||
#/
|
||||
*/
|
||||
return value;
|
||||
}
|
||||
|
||||
gettweakablelastvalue( category, name )
|
||||
gettweakablelastvalue( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -152,13 +158,15 @@ gettweakablelastvalue( category, name )
|
||||
value = undefined;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( value ) );
|
||||
#/
|
||||
*/
|
||||
return value;
|
||||
}
|
||||
|
||||
settweakablevalue( category, name, value )
|
||||
settweakablevalue( category, name, value ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -193,7 +201,7 @@ settweakablevalue( category, name, value )
|
||||
setdvar( dvar, value );
|
||||
}
|
||||
|
||||
settweakablelastvalue( category, name, value )
|
||||
settweakablelastvalue( category, name, value ) //checked changed to match cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -222,11 +230,11 @@ settweakablelastvalue( category, name, value )
|
||||
level.hudtweaks[ name ].lastvalue = value;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
registertweakable( category, name, dvar, value )
|
||||
registertweakable( category, name, dvar, value ) //checked matches cerberus output
|
||||
{
|
||||
if ( isstring( value ) )
|
||||
{
|
||||
@ -324,7 +332,7 @@ registertweakable( category, name, dvar, value )
|
||||
}
|
||||
}
|
||||
|
||||
init()
|
||||
init() //checked matches cerberus output
|
||||
{
|
||||
level.clienttweakables = [];
|
||||
level.tweakablesinitialized = 1;
|
||||
@ -362,17 +370,16 @@ init()
|
||||
level thread updateuitweakables();
|
||||
}
|
||||
|
||||
setclienttweakable( category, name )
|
||||
setclienttweakable( category, name ) //checked matches cerberus output
|
||||
{
|
||||
level.clienttweakables[ level.clienttweakables.size ] = name;
|
||||
}
|
||||
|
||||
updateuitweakables()
|
||||
updateuitweakables() //checked changed to match cerberus output
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
index = 0;
|
||||
while ( index < level.clienttweakables.size )
|
||||
for ( index = 0; index < level.clienttweakables.size; index++ )
|
||||
{
|
||||
clienttweakable = level.clienttweakables[ index ];
|
||||
curvalue = gettweakabledvarvalue( "hud", clienttweakable );
|
||||
@ -382,13 +389,13 @@ updateuitweakables()
|
||||
updateserverdvar( gettweakabledvar( "hud", clienttweakable ), curvalue );
|
||||
settweakablelastvalue( "hud", clienttweakable, curvalue );
|
||||
}
|
||||
index++;
|
||||
}
|
||||
wait 1;
|
||||
}
|
||||
}
|
||||
|
||||
updateserverdvar( dvar, value )
|
||||
updateserverdvar( dvar, value ) //checked matches cerberus output
|
||||
{
|
||||
makedvarserverinfo( dvar, value );
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
### The following gscs compile and run successfully with no known errors:
|
||||
### The following scripts compile and run successfully with no known errors:
|
||||
```
|
||||
patch_mp/maps/mp/gametypes/_clientids.gsc
|
||||
patch_mp/maps/mp/gametypes/_globalentities.gsc
|
||||
@ -23,9 +23,13 @@ patch_mp/maps/mp/bots/_bot.gsc
|
||||
|
||||
patch_mp/maps/mp/gametypes/_callbacksetup.gsc
|
||||
patch_mp/maps/mp/gametypes/_damagefeedback.gsc
|
||||
patch_mp/maps/mp/gametypes/_healthoverlay.gsc
|
||||
patch_mp/maps/mp/gametypes/_hostmigration.gsc
|
||||
patch_mp/maps/mp/gametypes/_hud.gsc
|
||||
patch_mp/maps/mp/gametypes/_menus.gsc
|
||||
patch_mp/maps/mp/gametypes/_perplayer.gsc
|
||||
patch_mp/maps/mp/gametypes/_serversettings.gsc
|
||||
patch_mp/maps/mp/gametypes/_tweakables.gsc
|
||||
patch_mp/maps/mp/gametypes/_weapon_utils.gsc
|
||||
```
|
||||
### The following scripts are not checked yet, uploaded to setup a baseline:
|
||||
@ -45,8 +49,6 @@ patch_mp/maps/mp/gametypes/_battlechatter.gsc
|
||||
patch_mp/maps/mp/gametypes/_class.gsc
|
||||
patch_mp/maps/mp/gametypes/_copter.gsc
|
||||
patch_mp/maps/mp/gametypes/_deathicons.gsc
|
||||
patch_mp/maps/mp/gametypes/_dev.gsc
|
||||
patch_mp/maps/mp/gametypes/_dev_class.gsc
|
||||
patch_mp/maps/mp/gametypes/_friendicons.gsc
|
||||
patch_mp/maps/mp/gametypes/_gameobjects.gsc
|
||||
patch_mp/maps/mp/gametypes/_globallogic.gsc
|
||||
@ -59,12 +61,9 @@ patch_mp/maps/mp/gametypes/_globallogic_spawn.gsc
|
||||
patch_mp/maps/mp/gametypes/_globallogic_ui.gsc
|
||||
patch_mp/maps/mp/gametypes/_globallogic_utils.gsc
|
||||
patch_mp/maps/mp/gametypes/_globallogic_vehicle.gsc
|
||||
patch_mp/maps/mp/gametypes/_healthoverlay.gsc
|
||||
patch_mp/maps/mp/gametypes/_hostmigration.gsc
|
||||
patch_mp/maps/mp/gametypes/_hud_message.gsc
|
||||
patch_mp/maps/mp/gametypes/_hud_util.gsc
|
||||
patch_mp/maps/mp/gametypes/_killcam.gsc
|
||||
patch_mp/maps/mp/gametypes/_menus.gsc
|
||||
patch_mp/maps/mp/gametypes/_objpoints.gsc
|
||||
patch_mp/maps/mp/gametypes/_persistence.gsc
|
||||
patch_mp/maps/mp/gametypes/_pregame.gsc
|
||||
@ -72,7 +71,6 @@ patch_mp/maps/mp/gametypes/_rank.gsc
|
||||
patch_mp/maps/mp/gametypes/_spawning.gsc
|
||||
patch_mp/maps/mp/gametypes/_spawnlogic.gsc
|
||||
patch_mp/maps/mp/gametypes/_spectating.gsc
|
||||
patch_mp/maps/mp/gametypes/_tweakables.gsc
|
||||
patch_mp/maps/mp/gametypes/_wager.gsc
|
||||
patch_mp/maps/mp/gametypes/_weaponobjects.gsc
|
||||
patch_mp/maps/mp/gametypes/_weapons.gsc
|
||||
@ -91,6 +89,13 @@ patch_mp/maps/mp/gametypes/sd.gsc
|
||||
patch_mp/maps/mp/gametypes/shrp.gsc
|
||||
patch_mp/maps/mp/gametypes/tdm.gsc
|
||||
```
|
||||
### The following scipts are dev scripts filled with dev calls making them useless to modify for now
|
||||
```
|
||||
patch_mp/maps/mp/gametypes/_dev.gsc
|
||||
patch_mp/maps/mp/gametypes/_dev_class.gsc
|
||||
```
|
||||
|
||||
|
||||
### notes:
|
||||
```
|
||||
```
|
||||
|
@ -1,16 +1,16 @@
|
||||
#include maps/mp/gametypes_zm/_globallogic_player;
|
||||
#include maps/mp/gametypes/_globallogic_player;
|
||||
|
||||
init()
|
||||
init() //checked matches cerberus output
|
||||
{
|
||||
precacheshader( "overlay_low_health" );
|
||||
level.healthoverlaycutoff = 0,55;
|
||||
level.healthoverlaycutoff = 0.55;
|
||||
regentime = level.playerhealthregentime;
|
||||
level.playerhealth_regularregendelay = regentime * 1000;
|
||||
level.healthregendisabled = level.playerhealth_regularregendelay <= 0;
|
||||
level thread onplayerconnect();
|
||||
}
|
||||
|
||||
onplayerconnect()
|
||||
onplayerconnect() //checked matches cerberus output
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
@ -23,7 +23,7 @@ onplayerconnect()
|
||||
}
|
||||
}
|
||||
|
||||
onjoinedteam()
|
||||
onjoinedteam() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -33,7 +33,7 @@ onjoinedteam()
|
||||
}
|
||||
}
|
||||
|
||||
onjoinedspectators()
|
||||
onjoinedspectators() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -43,7 +43,7 @@ onjoinedspectators()
|
||||
}
|
||||
}
|
||||
|
||||
onplayerspawned()
|
||||
onplayerspawned() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -53,7 +53,7 @@ onplayerspawned()
|
||||
}
|
||||
}
|
||||
|
||||
onplayerkilled()
|
||||
onplayerkilled() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -63,38 +63,40 @@ onplayerkilled()
|
||||
}
|
||||
}
|
||||
|
||||
onplayerdisconnect()
|
||||
onplayerdisconnect() //checked matches cerberus output
|
||||
{
|
||||
self waittill( "disconnect" );
|
||||
self notify( "end_healthregen" );
|
||||
}
|
||||
|
||||
playerhealthregen()
|
||||
playerhealthregen() //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
if ( self.health <= 0 )
|
||||
{
|
||||
/*
|
||||
/#
|
||||
assert( !isalive( self ) );
|
||||
#/
|
||||
*/
|
||||
return;
|
||||
}
|
||||
maxhealth = self.health;
|
||||
oldhealth = maxhealth;
|
||||
player = self;
|
||||
health_add = 0;
|
||||
regenrate = 0,1;
|
||||
regenrate = 0.1;
|
||||
usetrueregen = 0;
|
||||
veryhurt = 0;
|
||||
player.breathingstoptime = -10000;
|
||||
thread playerbreathingsound( maxhealth * 0,35 );
|
||||
thread playerheartbeatsound( maxhealth * 0,35 );
|
||||
thread playerbreathingsound( maxhealth * 0.35 );
|
||||
thread playerheartbeatsound( maxhealth * 0.35 );
|
||||
lastsoundtime_recover = 0;
|
||||
hurttime = 0;
|
||||
newhealth = 0;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0,05;
|
||||
wait 0.05;
|
||||
if ( isDefined( player.regenrate ) )
|
||||
{
|
||||
regenrate = player.regenrate;
|
||||
@ -106,7 +108,7 @@ playerhealthregen()
|
||||
self.atbrinkofdeath = 0;
|
||||
continue;
|
||||
}
|
||||
else if ( player.health <= 0 )
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -114,8 +116,6 @@ playerhealthregen()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
wasveryhurt = veryhurt;
|
||||
ratio = player.health / maxhealth;
|
||||
if ( ratio <= level.healthoverlaycutoff )
|
||||
@ -136,11 +136,11 @@ playerhealthregen()
|
||||
}
|
||||
if ( ( getTime() - hurttime ) < regentime )
|
||||
{
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
else if ( level.healthregendisabled )
|
||||
{
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
else if ( ( getTime() - lastsoundtime_recover ) > regentime )
|
||||
{
|
||||
@ -170,7 +170,7 @@ playerhealthregen()
|
||||
}
|
||||
if ( newhealth >= 1 )
|
||||
{
|
||||
self maps/mp/gametypes_zm/_globallogic_player::resetattackerlist();
|
||||
self maps/mp/gametypes/_globallogic_player::resetattackerlist();
|
||||
newhealth = 1;
|
||||
}
|
||||
if ( newhealth <= 0 )
|
||||
@ -184,20 +184,16 @@ playerhealthregen()
|
||||
player decayplayerdamages( change );
|
||||
}
|
||||
oldhealth = player.health;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
oldhealth = player.health;
|
||||
health_add = 0;
|
||||
hurttime = getTime();
|
||||
player.breathingstoptime = hurttime + 6000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
decayplayerdamages( decay )
|
||||
decayplayerdamages( decay ) //checked partially changed to match cerberus output //continues in for loops bad see github for more info
|
||||
{
|
||||
if ( !isDefined( self.attackerdamage ) )
|
||||
{
|
||||
@ -211,26 +207,23 @@ decayplayerdamages( decay )
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.attackerdamage[ i ].damage -= decay;
|
||||
if ( self.attackerdamage[ i ].damage < 0 )
|
||||
{
|
||||
self.attackerdamage[ i ].damage = 0;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
playerbreathingsound( healthcap )
|
||||
playerbreathingsound( healthcap ) //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
wait 2;
|
||||
player = self;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0,2;
|
||||
wait 0.2;
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
return;
|
||||
@ -243,46 +236,41 @@ playerbreathingsound( healthcap )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
player notify( "snd_breathing_hurt" );
|
||||
wait 0,784;
|
||||
wait ( 0,1 + randomfloat( 0,8 ) );
|
||||
wait 0.784;
|
||||
wait ( 0.1 + randomfloat( 0.8 ) );
|
||||
}
|
||||
}
|
||||
|
||||
playerheartbeatsound( healthcap ) //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
self.hearbeatwait = 0.2;
|
||||
wait 2;
|
||||
player = self;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0.2;
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( player.health >= healthcap )
|
||||
{
|
||||
self.hearbeatwait = 0.3;
|
||||
continue;
|
||||
}
|
||||
else if ( level.healthregendisabled && getTime() > player.breathingstoptime )
|
||||
{
|
||||
self.hearbeatwait = 0.3;
|
||||
continue;
|
||||
}
|
||||
player playlocalsound( "mpl_player_heartbeat" );
|
||||
wait self.hearbeatwait;
|
||||
if ( self.hearbeatwait <= 0.6 )
|
||||
{
|
||||
self.hearbeatwait += 0.1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
playerheartbeatsound( healthcap )
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
self.hearbeatwait = 0,2;
|
||||
wait 2;
|
||||
player = self;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0,2;
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( player.health >= healthcap )
|
||||
{
|
||||
self.hearbeatwait = 0,3;
|
||||
continue;
|
||||
}
|
||||
else if ( level.healthregendisabled && getTime() > player.breathingstoptime )
|
||||
{
|
||||
self.hearbeatwait = 0,3;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
player playlocalsound( "mpl_player_heartbeat" );
|
||||
wait self.hearbeatwait;
|
||||
if ( self.hearbeatwait <= 0,6 )
|
||||
{
|
||||
self.hearbeatwait += 0,1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
#include maps/mp/zombies/_zm;
|
||||
#include maps/mp/gametypes_zm/_hud;
|
||||
#include maps/mp/zombies/_zm_utility;
|
||||
#include maps/mp/gametypes_zm/_hud_util;
|
||||
#include common_scripts/utility;
|
||||
#include maps/mp/_utility;
|
||||
|
||||
debug_script_structs()
|
||||
debug_script_structs() //dev call did not check
|
||||
{
|
||||
/*
|
||||
/#
|
||||
if ( isDefined( level.struct ) )
|
||||
{
|
||||
@ -31,9 +30,10 @@ debug_script_structs()
|
||||
}
|
||||
else println( "*** No structs defined." );
|
||||
#/
|
||||
*/
|
||||
}
|
||||
|
||||
updatetimerpausedness()
|
||||
updatetimerpausedness() //checked matches cerberus output
|
||||
{
|
||||
shouldbestopped = isDefined( level.hostmigrationtimer );
|
||||
if ( !level.timerstopped && shouldbestopped )
|
||||
@ -41,54 +41,49 @@ updatetimerpausedness()
|
||||
level.timerstopped = 1;
|
||||
level.timerpausetime = getTime();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( level.timerstopped && !shouldbestopped )
|
||||
else if ( level.timerstopped && !shouldbestopped )
|
||||
{
|
||||
level.timerstopped = 0;
|
||||
level.discardtime += getTime() - level.timerpausetime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
callback_hostmigrationsave()
|
||||
callback_hostmigrationsave() //checked matches cerberus output
|
||||
{
|
||||
}
|
||||
|
||||
callback_prehostmigrationsave()
|
||||
callback_prehostmigrationsave() //checked matches cerberus output
|
||||
{
|
||||
undo_link_changes();
|
||||
disablezombies( 1 );
|
||||
disablezombies(1);
|
||||
if ( is_true( level._hm_should_pause_spawning ) )
|
||||
{
|
||||
flag_set( "spawn_zombies" );
|
||||
}
|
||||
i = 0;
|
||||
while ( i < level.players.size )
|
||||
for ( i = 0; i < level.players.size; i++ )
|
||||
{
|
||||
level.players[ i ] enableinvulnerability();
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
pausetimer()
|
||||
pausetimer() //checked matches cerberus output
|
||||
{
|
||||
level.migrationtimerpausetime = getTime();
|
||||
}
|
||||
|
||||
resumetimer()
|
||||
resumetimer() //checked matches cerberus output
|
||||
{
|
||||
level.discardtime += getTime() - level.migrationtimerpausetime;
|
||||
}
|
||||
|
||||
locktimer()
|
||||
locktimer() //checked matches cerberus output
|
||||
{
|
||||
level endon( "host_migration_begin" );
|
||||
level endon( "host_migration_end" );
|
||||
for ( ;; )
|
||||
{
|
||||
currtime = getTime();
|
||||
wait 0,05;
|
||||
wait 0.05;
|
||||
if ( !level.timerstopped && isDefined( level.discardtime ) )
|
||||
{
|
||||
level.discardtime += getTime() - currtime;
|
||||
@ -96,7 +91,7 @@ locktimer()
|
||||
}
|
||||
}
|
||||
|
||||
callback_hostmigration()
|
||||
callback_hostmigration() //checked changed to match cerberus output
|
||||
{
|
||||
redo_link_changes();
|
||||
setslowmotion( 1, 1, 0 );
|
||||
@ -104,71 +99,65 @@ callback_hostmigration()
|
||||
level.hostmigrationreturnedplayercount = 0;
|
||||
if ( level.gameended )
|
||||
{
|
||||
/#
|
||||
println( "Migration starting at time " + getTime() + ", but game has ended, so no countdown." );
|
||||
#/
|
||||
/*
|
||||
/#
|
||||
println("Migration starting at time " + GetTime() + ", but game has ended, so no countdown.");
|
||||
#/
|
||||
*/
|
||||
return;
|
||||
}
|
||||
sethostmigrationstatus( 1 );
|
||||
sethostmigrationstatus(1);
|
||||
level notify( "host_migration_begin" );
|
||||
i = 0;
|
||||
while ( i < level.players.size )
|
||||
for ( i = 0; i < level.players.size; i++ )
|
||||
{
|
||||
if ( isDefined( level.hostmigration_link_entity_callback ) )
|
||||
if ( isdefined( level.hostmigration_link_entity_callback ) )
|
||||
{
|
||||
if ( !isDefined( level.players[ i ]._host_migration_link_entity ) )
|
||||
if ( !isdefined( level.players[ i ]._host_migration_link_entity ) )
|
||||
{
|
||||
level.players[ i ]._host_migration_link_entity = level.players[ i ] [[ level.hostmigration_link_entity_callback ]]();
|
||||
level.players[i]._host_migration_link_entity = level.players[ i ] [[ level.hostmigration_link_entity_callback ]]();
|
||||
}
|
||||
}
|
||||
level.players[ i ] thread hostmigrationtimerthink();
|
||||
i++;
|
||||
}
|
||||
while ( isDefined( level.hostmigration_ai_link_entity_callback ) )
|
||||
if ( isdefined( level.hostmigration_ai_link_entity_callback ) )
|
||||
{
|
||||
zombies = getaiarray( level.zombie_team );
|
||||
while ( isDefined( zombies ) && zombies.size > 0 )
|
||||
zombies = getaiarray(level.zombie_team);
|
||||
if ( isdefined( zombies ) && zombies.size > 0 )
|
||||
{
|
||||
_a133 = zombies;
|
||||
_k133 = getFirstArrayKey( _a133 );
|
||||
while ( isDefined( _k133 ) )
|
||||
foreach(zombie in zombies)
|
||||
{
|
||||
zombie = _a133[ _k133 ];
|
||||
if ( !isDefined( zombie._host_migration_link_entity ) )
|
||||
if ( !isdefined( zombie._host_migration_link_entity ) )
|
||||
{
|
||||
zombie._host_migration_link_entity = zombie [[ level.hostmigration_ai_link_entity_callback ]]();
|
||||
}
|
||||
_k133 = getNextArrayKey( _a133, _k133 );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( level.inprematchperiod )
|
||||
else if ( level.inprematchperiod )
|
||||
{
|
||||
level waittill( "prematch_over" );
|
||||
level waittill("prematch_over");
|
||||
}
|
||||
/#
|
||||
println( "Migration starting at time " + getTime() );
|
||||
#/
|
||||
/*
|
||||
/#
|
||||
println( "Migration starting at time " + GetTime() );
|
||||
#/
|
||||
*/
|
||||
level.hostmigrationtimer = 1;
|
||||
thread locktimer();
|
||||
zombies = getaiarray( level.zombie_team );
|
||||
while ( isDefined( zombies ) && zombies.size > 0 )
|
||||
if ( isdefined( zombies ) && zombies.size > 0 )
|
||||
{
|
||||
_a156 = zombies;
|
||||
_k156 = getFirstArrayKey( _a156 );
|
||||
while ( isDefined( _k156 ) )
|
||||
foreach ( zombie in zombies )
|
||||
{
|
||||
zombie = _a156[ _k156 ];
|
||||
if ( isDefined( zombie._host_migration_link_entity ) )
|
||||
if ( isdefined(zombie._host_migration_link_entity ) )
|
||||
{
|
||||
ent = spawn( "script_origin", zombie.origin );
|
||||
ent.angles = zombie.angles;
|
||||
zombie linkto( ent );
|
||||
zombie linkto(ent);
|
||||
ent linkto( zombie._host_migration_link_entity, "tag_origin", zombie._host_migration_link_entity worldtolocalcoords( ent.origin ), ent.angles + zombie._host_migration_link_entity.angles );
|
||||
zombie._host_migration_link_helper = ent;
|
||||
zombie linkto( zombie._host_migration_link_helper );
|
||||
}
|
||||
_k156 = getNextArrayKey( _a156, _k156 );
|
||||
}
|
||||
}
|
||||
level endon( "host_migration_begin" );
|
||||
@ -178,33 +167,25 @@ callback_hostmigration()
|
||||
flag_clear( "spawn_zombies" );
|
||||
}
|
||||
hostmigrationwait();
|
||||
_a185 = level.players;
|
||||
_k185 = getFirstArrayKey( _a185 );
|
||||
while ( isDefined( _k185 ) )
|
||||
foreach ( player in level.players )
|
||||
{
|
||||
player = _a185[ _k185 ];
|
||||
player thread post_migration_become_vulnerable();
|
||||
_k185 = getNextArrayKey( _a185, _k185 );
|
||||
}
|
||||
zombies = getaiarray( level.zombie_team );
|
||||
while ( isDefined( zombies ) && zombies.size > 0 )
|
||||
if ( isdefined( zombies ) && zombies.size > 0 )
|
||||
{
|
||||
_a193 = zombies;
|
||||
_k193 = getFirstArrayKey( _a193 );
|
||||
while ( isDefined( _k193 ) )
|
||||
foreach ( zombie in zombies )
|
||||
{
|
||||
zombie = _a193[ _k193 ];
|
||||
if ( isDefined( zombie._host_migration_link_entity ) )
|
||||
if ( isdefined(zombie._host_migration_link_entity ) )
|
||||
{
|
||||
zombie unlink();
|
||||
zombie._host_migration_link_helper delete();
|
||||
zombie._host_migration_link_helper = undefined;
|
||||
zombie._host_migration_link_entity = undefined;
|
||||
}
|
||||
_k193 = getNextArrayKey( _a193, _k193 );
|
||||
}
|
||||
}
|
||||
enablezombies( 1 );
|
||||
enablezombies(1);
|
||||
if ( level._hm_should_pause_spawning )
|
||||
{
|
||||
flag_set( "spawn_zombies" );
|
||||
@ -212,46 +193,48 @@ callback_hostmigration()
|
||||
level.hostmigrationtimer = undefined;
|
||||
level._hm_should_pause_spawning = undefined;
|
||||
sethostmigrationstatus( 0 );
|
||||
/#
|
||||
println( "Migration finished at time " + getTime() );
|
||||
#/
|
||||
/*
|
||||
/#
|
||||
println("Migration finished at time " + GetTime());
|
||||
#/
|
||||
*/
|
||||
level notify( "host_migration_end" );
|
||||
}
|
||||
|
||||
post_migration_become_vulnerable()
|
||||
post_migration_become_vulnerable() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
wait 3;
|
||||
wait( 3 );
|
||||
self disableinvulnerability();
|
||||
}
|
||||
|
||||
matchstarttimerconsole_internal( counttime, matchstarttimer )
|
||||
matchstarttimerconsole_internal( counttime, matchstarttimer ) //checked matches cerberus output
|
||||
{
|
||||
waittillframeend;
|
||||
visionsetnaked( "mpIntro", 0 );
|
||||
level endon( "match_start_timer_beginning" );
|
||||
while ( counttime > 0 && !level.gameended )
|
||||
{
|
||||
matchstarttimer thread maps/mp/gametypes_zm/_hud::fontpulse( level );
|
||||
wait ( matchstarttimer.inframes * 0,05 );
|
||||
wait ( matchstarttimer.inframes * 0.05 );
|
||||
matchstarttimer setvalue( counttime );
|
||||
counttime--;
|
||||
|
||||
wait ( 1 - ( matchstarttimer.inframes * 0,05 ) );
|
||||
wait ( 1 - ( matchstarttimer.inframes * 0.05 ) );
|
||||
}
|
||||
}
|
||||
|
||||
matchstarttimerconsole( type, duration )
|
||||
matchstarttimerconsole( type, duration ) //checked matches cerberus output
|
||||
{
|
||||
level notify( "match_start_timer_beginning" );
|
||||
wait 0,05;
|
||||
matchstarttext = createserverfontstring( "objective", 1,5 );
|
||||
matchstarttext = createserverfontstring( "objective", 1.5 );
|
||||
matchstarttext setpoint( "CENTER", "CENTER", 0, -40 );
|
||||
matchstarttext.sort = 1001;
|
||||
matchstarttext settext( game[ "strings" ][ "waiting_for_teams" ] );
|
||||
matchstarttext.foreground = 0;
|
||||
matchstarttext.hidewheninmenu = 1;
|
||||
matchstarttext settext( game[ "strings" ][ type ] );
|
||||
matchstarttimer = createserverfontstring( "objective", 2,2 );
|
||||
matchstarttimer = createserverfontstring( "objective", 2.2 );
|
||||
matchstarttimer setpoint( "CENTER", "CENTER", 0, 0 );
|
||||
matchstarttimer.sort = 1001;
|
||||
matchstarttimer.color = ( 1, 1, 0 );
|
||||
@ -267,7 +250,7 @@ matchstarttimerconsole( type, duration )
|
||||
matchstarttext destroyelem();
|
||||
}
|
||||
|
||||
hostmigrationwait()
|
||||
hostmigrationwait() //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
level endon( "game_ended" );
|
||||
if ( level.hostmigrationreturnedplayercount < ( ( level.players.size * 2 ) / 3 ) )
|
||||
@ -275,17 +258,18 @@ hostmigrationwait()
|
||||
thread matchstarttimerconsole( "waiting_for_teams", 20 );
|
||||
hostmigrationwaitforplayers();
|
||||
}
|
||||
level notify( "host_migration_countdown_begin" );
|
||||
thread matchstarttimerconsole( "match_starting_in", 5 );
|
||||
wait 5;
|
||||
}
|
||||
|
||||
hostmigrationwaitforplayers()
|
||||
hostmigrationwaitforplayers() //checked matches cerberus output
|
||||
{
|
||||
level endon( "hostmigration_enoughplayers" );
|
||||
wait 15;
|
||||
}
|
||||
|
||||
hostmigrationtimerthink_internal()
|
||||
hostmigrationtimerthink_internal() //checked matches cerberus output
|
||||
{
|
||||
level endon( "host_migration_begin" );
|
||||
level endon( "host_migration_end" );
|
||||
@ -294,23 +278,25 @@ hostmigrationtimerthink_internal()
|
||||
{
|
||||
self waittill( "spawned" );
|
||||
}
|
||||
if ( isDefined( self._host_migration_link_entity ) )
|
||||
if ( isdefined( self._host_migration_link_entity ) )
|
||||
{
|
||||
ent = spawn( "script_origin", self.origin );
|
||||
ent.angles = self.angles;
|
||||
self linkto( ent );
|
||||
ent linkto( self._host_migration_link_entity, "tag_origin", self._host_migration_link_entity worldtolocalcoords( ent.origin ), ent.angles + self._host_migration_link_entity.angles );
|
||||
self._host_migration_link_helper = ent;
|
||||
/#
|
||||
/*
|
||||
/#
|
||||
println( "Linking player to ent " + self._host_migration_link_entity.targetname );
|
||||
#/
|
||||
#/
|
||||
*/
|
||||
}
|
||||
self.hostmigrationcontrolsfrozen = 1;
|
||||
self freezecontrols( 1 );
|
||||
level waittill( "host_migration_end" );
|
||||
}
|
||||
|
||||
hostmigrationtimerthink()
|
||||
hostmigrationtimerthink() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
level endon( "host_migration_begin" );
|
||||
@ -319,16 +305,18 @@ hostmigrationtimerthink()
|
||||
{
|
||||
self freezecontrols( 0 );
|
||||
self.hostmigrationcontrolsfrozen = 0;
|
||||
/#
|
||||
println( " Host migration unfreeze controls" );
|
||||
#/
|
||||
/*
|
||||
/#
|
||||
println(" Host migration unfreeze controls");
|
||||
#/
|
||||
*/
|
||||
}
|
||||
if ( isDefined( self._host_migration_link_entity ) )
|
||||
if ( isdefined( self._host_migration_link_entity ) )
|
||||
{
|
||||
self unlink();
|
||||
self._host_migration_link_helper delete();
|
||||
self._host_migration_link_helper = undefined;
|
||||
if ( isDefined( self._host_migration_link_entity._post_host_migration_thread ) )
|
||||
if ( isdefined( self._host_migration_link_entity._post_host_migration_thread ) )
|
||||
{
|
||||
self thread [[ self._host_migration_link_entity._post_host_migration_thread ]]( self._host_migration_link_entity );
|
||||
}
|
||||
@ -336,7 +324,7 @@ hostmigrationtimerthink()
|
||||
}
|
||||
}
|
||||
|
||||
waittillhostmigrationdone()
|
||||
waittillhostmigrationdone() //checked matches cerberus output
|
||||
{
|
||||
if ( !isDefined( level.hostmigrationtimer ) )
|
||||
{
|
||||
@ -347,7 +335,7 @@ waittillhostmigrationdone()
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
waittillhostmigrationstarts( duration )
|
||||
waittillhostmigrationstarts( duration ) //checked matches cerberus output
|
||||
{
|
||||
if ( isDefined( level.hostmigrationtimer ) )
|
||||
{
|
||||
@ -357,15 +345,17 @@ waittillhostmigrationstarts( duration )
|
||||
wait duration;
|
||||
}
|
||||
|
||||
waitlongdurationwithhostmigrationpause( duration )
|
||||
waitlongdurationwithhostmigrationpause( duration ) //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
if ( duration == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( duration > 0 );
|
||||
#/
|
||||
*/
|
||||
starttime = getTime();
|
||||
endtime = getTime() + ( duration * 1000 );
|
||||
while ( getTime() < endtime )
|
||||
@ -377,25 +367,68 @@ waitlongdurationwithhostmigrationpause( duration )
|
||||
endtime += timepassed;
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getTime() != endtime )
|
||||
{
|
||||
/#
|
||||
println( "SCRIPT WARNING: gettime() = " + getTime() + " NOT EQUAL TO endtime = " + endtime );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
waittillhostmigrationdone();
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
waitlongdurationwithgameendtimeupdate( duration )
|
||||
waitlongdurationwithhostmigrationpauseemp( duration ) //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
if ( duration == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( duration > 0 );
|
||||
#/
|
||||
*/
|
||||
starttime = getTime();
|
||||
empendtime = getTime() + ( duration * 1000 );
|
||||
level.empendtime = empendtime;
|
||||
while ( getTime() < empendtime )
|
||||
{
|
||||
waittillhostmigrationstarts( ( empendtime - getTime() ) / 1000 );
|
||||
if ( isDefined( level.hostmigrationtimer ) )
|
||||
{
|
||||
timepassed = waittillhostmigrationdone();
|
||||
if ( isDefined( empendtime ) )
|
||||
{
|
||||
empendtime += timepassed;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getTime() != empendtime )
|
||||
{
|
||||
println( "SCRIPT WARNING: gettime() = " + getTime() + " NOT EQUAL TO empendtime = " + empendtime );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
waittillhostmigrationdone();
|
||||
level.empendtime = undefined;
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
waitlongdurationwithgameendtimeupdate( duration ) //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
if ( duration == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( duration > 0 );
|
||||
#/
|
||||
*/
|
||||
starttime = getTime();
|
||||
endtime = getTime() + ( duration * 1000 );
|
||||
while ( getTime() < endtime )
|
||||
@ -408,12 +441,14 @@ waitlongdurationwithgameendtimeupdate( duration )
|
||||
wait 1;
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getTime() != endtime )
|
||||
{
|
||||
println( "SCRIPT WARNING: gettime() = " + getTime() + " NOT EQUAL TO endtime = " + endtime );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
while ( isDefined( level.hostmigrationtimer ) )
|
||||
{
|
||||
endtime += 1000;
|
||||
@ -423,28 +458,26 @@ waitlongdurationwithgameendtimeupdate( duration )
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
find_alternate_player_place( v_origin, min_radius, max_radius, max_height, ignore_targetted_nodes )
|
||||
find_alternate_player_place( v_origin, min_radius, max_radius, max_height, ignore_targetted_nodes ) //checked partially changed to match cerberus output //continue in for loop bad see github for more info
|
||||
{
|
||||
found_node = undefined;
|
||||
a_nodes = getnodesinradiussorted( v_origin, max_radius, min_radius, max_height, "pathnodes" );
|
||||
while ( isDefined( a_nodes ) && a_nodes.size > 0 )
|
||||
if ( isdefined( a_nodes) && a_nodes.size > 0 )
|
||||
{
|
||||
a_player_volumes = getentarray( "player_volume", "script_noteworthy" );
|
||||
index = a_nodes.size - 1;
|
||||
i = index;
|
||||
while ( i >= 0 )
|
||||
while ( i >= 0; )
|
||||
{
|
||||
n_node = a_nodes[ i ];
|
||||
n_node = a_nodes[i];
|
||||
if ( ignore_targetted_nodes == 1 )
|
||||
{
|
||||
if ( isDefined( n_node.target ) )
|
||||
if ( isdefined( n_node.target ) )
|
||||
{
|
||||
i--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !positionwouldtelefrag( n_node.origin ) )
|
||||
{
|
||||
if ( maps/mp/zombies/_zm_utility::check_point_in_enabled_zone( n_node.origin, 1, a_player_volumes ) )
|
||||
@ -452,10 +485,10 @@ find_alternate_player_place( v_origin, min_radius, max_radius, max_height, ignor
|
||||
v_start = ( n_node.origin[ 0 ], n_node.origin[ 1 ], n_node.origin[ 2 ] + 30 );
|
||||
v_end = ( n_node.origin[ 0 ], n_node.origin[ 1 ], n_node.origin[ 2 ] - 30 );
|
||||
trace = bullettrace( v_start, v_end, 0, undefined );
|
||||
if ( trace[ "fraction" ] < 1 )
|
||||
if ( trace["fraction"] < 1 )
|
||||
{
|
||||
override_abort = 0;
|
||||
if ( isDefined( level._chugabud_reject_node_override_func ) )
|
||||
if ( isdefined( level._chugabud_reject_node_override_func ) )
|
||||
{
|
||||
override_abort = [[ level._chugabud_reject_node_override_func ]]( v_origin, n_node );
|
||||
}
|
||||
@ -467,80 +500,72 @@ find_alternate_player_place( v_origin, min_radius, max_radius, max_height, ignor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i--;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return found_node;
|
||||
}
|
||||
|
||||
hostmigration_put_player_in_better_place()
|
||||
hostmigration_put_player_in_better_place() //checked changed to match cerberus output
|
||||
{
|
||||
spawnpoint = undefined;
|
||||
spawnpoint = find_alternate_player_place( self.origin, 50, 150, 64, 1 );
|
||||
if ( !isDefined( spawnpoint ) )
|
||||
if ( !isdefined(spawnpoint ) )
|
||||
{
|
||||
spawnpoint = find_alternate_player_place( self.origin, 150, 400, 64, 1 );
|
||||
}
|
||||
if ( !isDefined( spawnpoint ) )
|
||||
if ( !isdefined(spawnpoint ) )
|
||||
{
|
||||
spawnpoint = find_alternate_player_place( self.origin, 50, 400, 256, 0 );
|
||||
}
|
||||
if ( !isDefined( spawnpoint ) )
|
||||
if ( !isdefined( spawnpoint ) )
|
||||
{
|
||||
spawnpoint = maps/mp/zombies/_zm::check_for_valid_spawn_near_team( self, 1 );
|
||||
}
|
||||
if ( !isDefined( spawnpoint ) )
|
||||
if ( !isdefined( spawnpoint ) )
|
||||
{
|
||||
match_string = "";
|
||||
location = level.scr_zm_map_start_location;
|
||||
if ( location != "default" && location == "" && isDefined( level.default_start_location ) )
|
||||
if ( location == "default" || location == "" && isdefined(level.default_start_location ) )
|
||||
{
|
||||
location = level.default_start_location;
|
||||
}
|
||||
match_string = ( level.scr_zm_ui_gametype + "_" ) + location;
|
||||
match_string = level.scr_zm_ui_gametype + "_" + location;
|
||||
spawnpoints = [];
|
||||
structs = getstructarray( "initial_spawn", "script_noteworthy" );
|
||||
while ( isDefined( structs ) )
|
||||
if ( isdefined( structs ) )
|
||||
{
|
||||
_a559 = structs;
|
||||
_k559 = getFirstArrayKey( _a559 );
|
||||
while ( isDefined( _k559 ) )
|
||||
foreach ( struct in structs )
|
||||
{
|
||||
struct = _a559[ _k559 ];
|
||||
while ( isDefined( struct.script_string ) )
|
||||
if ( isdefined( struct.script_string ) )
|
||||
{
|
||||
tokens = strtok( struct.script_string, " " );
|
||||
_a565 = tokens;
|
||||
_k565 = getFirstArrayKey( _a565 );
|
||||
while ( isDefined( _k565 ) )
|
||||
i = 0;
|
||||
while ( i < tokens.size )
|
||||
{
|
||||
token = _a565[ _k565 ];
|
||||
if ( token == match_string )
|
||||
{
|
||||
spawnpoints[ spawnpoints.size ] = struct;
|
||||
}
|
||||
_k565 = getNextArrayKey( _a565, _k565 );
|
||||
i++;
|
||||
}
|
||||
}
|
||||
_k559 = getNextArrayKey( _a559, _k559 );
|
||||
}
|
||||
}
|
||||
if ( !isDefined( spawnpoints ) || spawnpoints.size == 0 )
|
||||
else if ( !isdefined(spawnpoints) || spawnpoints.size == 0 )
|
||||
{
|
||||
spawnpoints = getstructarray( "initial_spawn_points", "targetname" );
|
||||
}
|
||||
/#
|
||||
assert( isDefined( spawnpoints ), "Could not find initial spawn points!" );
|
||||
#/
|
||||
/*
|
||||
/#
|
||||
assert( isdefined( spawnpoints ), "Could not find initial spawn points!" );
|
||||
#/
|
||||
*/
|
||||
spawnpoint = maps/mp/zombies/_zm::getfreespawnpoint( spawnpoints, self );
|
||||
}
|
||||
if ( isDefined( spawnpoint ) )
|
||||
if ( isdefined( spawnpoint ) )
|
||||
{
|
||||
self setorigin( spawnpoint.origin );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include maps/mp/gametypes_zm/_globallogic;
|
||||
#include maps/mp/_utility;
|
||||
|
||||
init()
|
||||
init() //checked changed to match cerberus output
|
||||
{
|
||||
precachestring( &"open_ingame_menu" );
|
||||
game[ "menu_team" ] = "team_marinesopfor";
|
||||
@ -16,13 +16,9 @@ init()
|
||||
game[ "menu_changeclass_wager" ] = "changeclass_wager";
|
||||
game[ "menu_changeclass_custom" ] = "changeclass_custom";
|
||||
game[ "menu_changeclass_barebones" ] = "changeclass_barebones";
|
||||
_a18 = level.teams;
|
||||
_k18 = getFirstArrayKey( _a18 );
|
||||
while ( isDefined( _k18 ) )
|
||||
foreach ( team in level.teams )
|
||||
{
|
||||
team = _a18[ _k18 ];
|
||||
game[ "menu_changeclass_" + team ] = "changeclass";
|
||||
_k18 = getNextArrayKey( _a18, _k18 );
|
||||
}
|
||||
game[ "menu_controls" ] = "ingame_controls";
|
||||
game[ "menu_options" ] = "ingame_options";
|
||||
@ -50,7 +46,7 @@ init()
|
||||
level thread onplayerconnect();
|
||||
}
|
||||
|
||||
onplayerconnect()
|
||||
onplayerconnect() //checked matches cerberus output
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
@ -59,7 +55,7 @@ onplayerconnect()
|
||||
}
|
||||
}
|
||||
|
||||
onmenuresponse()
|
||||
onmenuresponse() //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -71,7 +67,7 @@ onmenuresponse()
|
||||
self closeingamemenu();
|
||||
if ( level.console )
|
||||
{
|
||||
if ( game[ "menu_changeclass" ] != menu && game[ "menu_changeclass_offline" ] != menu || menu == game[ "menu_team" ] && menu == game[ "menu_controls" ] )
|
||||
if ( menu == game[ "menu_changeclass" ] || menu == game[ "menu_changeclass_offline" ] || menu == game[ "menu_team" ] || menu == game[ "menu_controls" ] )
|
||||
{
|
||||
if ( isDefined( level.teams[ self.pers[ "team" ] ] ) )
|
||||
{
|
||||
@ -81,7 +77,7 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if ( response == "changeteam" && level.allow_teamchange == "1" )
|
||||
if ( response == "changeteam" && level.allow_teamchange == "1" )
|
||||
{
|
||||
self closemenu();
|
||||
self closeingamemenu();
|
||||
@ -97,7 +93,7 @@ onmenuresponse()
|
||||
}
|
||||
if ( response == "endgame" )
|
||||
{
|
||||
if ( self issplitscreen() )
|
||||
if ( level.splitscreen )
|
||||
{
|
||||
level.skipvote = 1;
|
||||
if ( !level.gameended )
|
||||
@ -107,15 +103,16 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if ( response == "killserverpc" )
|
||||
if ( response == "killserverpc" )
|
||||
{
|
||||
level thread maps/mp/gametypes_zm/_globallogic::killserverpc();
|
||||
continue;
|
||||
}
|
||||
else if ( response == "endround" )
|
||||
if ( response == "endround" )
|
||||
{
|
||||
if ( !level.gameended )
|
||||
{
|
||||
self gamehistoryplayerquit();
|
||||
level thread maps/mp/gametypes_zm/_globallogic::forceend();
|
||||
}
|
||||
else
|
||||
@ -126,7 +123,7 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if ( menu == game[ "menu_team" ] && level.allow_teamchange == "1" )
|
||||
if ( menu == game[ "menu_team" ] && level.allow_teamchange == "1" )
|
||||
{
|
||||
switch( response )
|
||||
{
|
||||
@ -142,9 +139,7 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( game[ "menu_changeclass" ] != menu && game[ "menu_changeclass_offline" ] != menu && game[ "menu_changeclass_wager" ] != menu || menu == game[ "menu_changeclass_custom" ] && menu == game[ "menu_changeclass_barebones" ] )
|
||||
if ( menu == game[ "menu_changeclass" ] || menu == game[ "menu_changeclass_offline" ] || menu == game[ "menu_changeclass_wager" ] || menu == game[ "menu_changeclass_custom" ] || menu == game[ "menu_changeclass_barebones" ] )
|
||||
{
|
||||
self closemenu();
|
||||
self closeingamemenu();
|
||||
@ -157,10 +152,8 @@ onmenuresponse()
|
||||
}
|
||||
self.selectedclass = 1;
|
||||
self [[ level.class ]]( response );
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( menu == "spectate" )
|
||||
{
|
||||
player = getplayerfromclientnum( int( response ) );
|
||||
@ -170,6 +163,5 @@ onmenuresponse()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include maps/mp/_utility;
|
||||
|
||||
gettweakabledvarvalue( category, name )
|
||||
gettweakabledvarvalue( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -32,14 +32,16 @@ gettweakabledvarvalue( category, name )
|
||||
dvar = undefined;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( dvar ) );
|
||||
#/
|
||||
*/
|
||||
value = getDvarInt( dvar );
|
||||
return value;
|
||||
}
|
||||
|
||||
gettweakabledvar( category, name )
|
||||
gettweakabledvar( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -71,13 +73,15 @@ gettweakabledvar( category, name )
|
||||
value = undefined;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( value ) );
|
||||
#/
|
||||
*/
|
||||
return value;
|
||||
}
|
||||
|
||||
gettweakablevalue( category, name )
|
||||
gettweakablevalue( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -114,13 +118,15 @@ gettweakablevalue( category, name )
|
||||
{
|
||||
return getDvarInt( overridedvar );
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( value ) );
|
||||
#/
|
||||
*/
|
||||
return value;
|
||||
}
|
||||
|
||||
gettweakablelastvalue( category, name )
|
||||
gettweakablelastvalue( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -152,13 +158,15 @@ gettweakablelastvalue( category, name )
|
||||
value = undefined;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( value ) );
|
||||
#/
|
||||
*/
|
||||
return value;
|
||||
}
|
||||
|
||||
settweakablevalue( category, name, value )
|
||||
settweakablevalue( category, name, value ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -193,7 +201,7 @@ settweakablevalue( category, name, value )
|
||||
setdvar( dvar, value );
|
||||
}
|
||||
|
||||
settweakablelastvalue( category, name, value )
|
||||
settweakablelastvalue( category, name, value ) //checked changed to match cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -222,11 +230,11 @@ settweakablelastvalue( category, name, value )
|
||||
level.hudtweaks[ name ].lastvalue = value;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
registertweakable( category, name, dvar, value )
|
||||
registertweakable( category, name, dvar, value ) //checked matches cerberus output
|
||||
{
|
||||
if ( isstring( value ) )
|
||||
{
|
||||
@ -324,7 +332,7 @@ registertweakable( category, name, dvar, value )
|
||||
}
|
||||
}
|
||||
|
||||
init()
|
||||
init() //checked matches cerberus output
|
||||
{
|
||||
level.clienttweakables = [];
|
||||
level.tweakablesinitialized = 1;
|
||||
@ -362,17 +370,16 @@ init()
|
||||
level thread updateuitweakables();
|
||||
}
|
||||
|
||||
setclienttweakable( category, name )
|
||||
setclienttweakable( category, name ) //checked matches cerberus output
|
||||
{
|
||||
level.clienttweakables[ level.clienttweakables.size ] = name;
|
||||
}
|
||||
|
||||
updateuitweakables()
|
||||
updateuitweakables() //checked changed to match cerberus output
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
index = 0;
|
||||
while ( index < level.clienttweakables.size )
|
||||
for ( index = 0; index < level.clienttweakables.size; index++ )
|
||||
{
|
||||
clienttweakable = level.clienttweakables[ index ];
|
||||
curvalue = gettweakabledvarvalue( "hud", clienttweakable );
|
||||
@ -382,13 +389,13 @@ updateuitweakables()
|
||||
updateserverdvar( gettweakabledvar( "hud", clienttweakable ), curvalue );
|
||||
settweakablelastvalue( "hud", clienttweakable, curvalue );
|
||||
}
|
||||
index++;
|
||||
}
|
||||
wait 1;
|
||||
}
|
||||
}
|
||||
|
||||
updateserverdvar( dvar, value )
|
||||
updateserverdvar( dvar, value ) //checked matches cerberus output
|
||||
{
|
||||
makedvarserverinfo( dvar, value );
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include maps/mp/_utility;
|
||||
#include maps/mp/zombies/_zm_perks;
|
||||
|
||||
init()
|
||||
init() //checked matches cerberus output
|
||||
{
|
||||
level.chugabud_laststand_func = ::chugabud_laststand;
|
||||
level thread chugabud_hostmigration();
|
||||
@ -20,15 +20,15 @@ init()
|
||||
add_custom_limited_weapon_check( ::is_weapon_available_in_chugabud_corpse );
|
||||
}
|
||||
|
||||
chugabug_precache()
|
||||
chugabug_precache() //checked matches cerberus output
|
||||
{
|
||||
}
|
||||
|
||||
chugabud_player_init()
|
||||
chugabud_player_init() //checked matches cerberus output
|
||||
{
|
||||
}
|
||||
|
||||
chugabud_laststand()
|
||||
chugabud_laststand() //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "player_suicide" );
|
||||
self endon( "disconnect" );
|
||||
@ -39,7 +39,7 @@ chugabud_laststand()
|
||||
self maps/mp/zombies/_zm_chugabud::chugabud_save_loadout();
|
||||
self maps/mp/zombies/_zm_chugabud::chugabud_fake_death();
|
||||
wait 3;
|
||||
if ( isDefined( self.insta_killed ) || self.insta_killed && isDefined( self.disable_chugabud_corpse ) )
|
||||
if ( isDefined( self.insta_killed ) && self.insta_killed || isDefined( self.disable_chugabud_corpse ) )
|
||||
{
|
||||
create_corpse = 0;
|
||||
}
|
||||
@ -102,7 +102,7 @@ chugabud_laststand()
|
||||
self chugabud_laststand_cleanup( corpse, undefined );
|
||||
}
|
||||
|
||||
chugabud_laststand_cleanup( corpse, str_notify )
|
||||
chugabud_laststand_cleanup( corpse, str_notify ) //checked matches cerberus output
|
||||
{
|
||||
if ( isDefined( str_notify ) )
|
||||
{
|
||||
@ -112,23 +112,22 @@ chugabud_laststand_cleanup( corpse, str_notify )
|
||||
self chugabud_corpse_cleanup( corpse, 1 );
|
||||
}
|
||||
|
||||
chugabud_bleed_timeout( delay, corpse )
|
||||
chugabud_bleed_timeout( delay, corpse ) //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "player_suicide" );
|
||||
self endon( "disconnect" );
|
||||
corpse endon( "death" );
|
||||
wait delay;
|
||||
while ( isDefined( corpse.revivetrigger ) )
|
||||
if ( isDefined( corpse.revivetrigger ) )
|
||||
{
|
||||
while ( corpse.revivetrigger.beingrevived )
|
||||
{
|
||||
wait 0.01;
|
||||
}
|
||||
}
|
||||
while ( isDefined( self.loadout.perks ) && flag( "solo_game" ) )
|
||||
if ( isDefined( self.loadout.perks ) && flag( "solo_game" ) )
|
||||
{
|
||||
i = 0;
|
||||
while ( i < self.loadout.perks.size )
|
||||
for ( i = 0; i < self.loadout.perks.size; i++ )
|
||||
{
|
||||
perk = self.loadout.perks[ i ];
|
||||
if ( perk == "specialty_quickrevive" )
|
||||
@ -137,13 +136,12 @@ chugabud_bleed_timeout( delay, corpse )
|
||||
corpse notify( "player_revived" );
|
||||
return;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
self chugabud_corpse_cleanup( corpse, 0 );
|
||||
}
|
||||
|
||||
chugabud_corpse_cleanup( corpse, was_revived )
|
||||
chugabud_corpse_cleanup( corpse, was_revived ) //checked matches cerberus output
|
||||
{
|
||||
self notify( "chugabud_effects_cleanup" );
|
||||
if ( was_revived )
|
||||
@ -174,14 +172,14 @@ chugabud_corpse_cleanup( corpse, was_revived )
|
||||
self.e_chugabud_corpse = undefined;
|
||||
}
|
||||
|
||||
chugabud_handle_multiple_instances( corpse )
|
||||
chugabud_handle_multiple_instances( corpse ) //checked matches cerberus output
|
||||
{
|
||||
corpse endon( "death" );
|
||||
self waittill( "perk_chugabud_activated" );
|
||||
self chugabud_corpse_cleanup( corpse, 0 );
|
||||
}
|
||||
|
||||
chugabud_spawn_corpse()
|
||||
chugabud_spawn_corpse() //checked matches cerberus output
|
||||
{
|
||||
corpse = maps/mp/zombies/_zm_clone::spawn_player_clone( self, self.origin, undefined, self.whos_who_shader );
|
||||
corpse.angles = self.angles;
|
||||
@ -192,7 +190,7 @@ chugabud_spawn_corpse()
|
||||
return corpse;
|
||||
}
|
||||
|
||||
chugabud_revive_hud_create()
|
||||
chugabud_revive_hud_create() //checked matches cerberus output
|
||||
{
|
||||
self.revive_hud = newclienthudelem( self );
|
||||
self.revive_hud.alignx = "center";
|
||||
@ -209,7 +207,7 @@ chugabud_revive_hud_create()
|
||||
return self.revive_hud;
|
||||
}
|
||||
|
||||
chugabud_save_loadout()
|
||||
chugabud_save_loadout() //checked changed to match cerberus output
|
||||
{
|
||||
primaries = self getweaponslistprimaries();
|
||||
currentweapon = self getcurrentweapon();
|
||||
@ -218,17 +216,13 @@ chugabud_save_loadout()
|
||||
self.loadout.weapons = [];
|
||||
self.loadout.score = self.score;
|
||||
self.loadout.current_weapon = -1;
|
||||
_a376 = primaries;
|
||||
index = getFirstArrayKey( _a376 );
|
||||
while ( isDefined( index ) )
|
||||
foreach ( weapon in primaries )
|
||||
{
|
||||
weapon = _a376[ index ];
|
||||
self.loadout.weapons[ index ] = maps/mp/zombies/_zm_weapons::get_player_weapondata( self, weapon );
|
||||
if ( weapon == currentweapon || self.loadout.weapons[ index ][ "alt_name" ] == currentweapon )
|
||||
{
|
||||
self.loadout.current_weapon = index;
|
||||
}
|
||||
index = getNextArrayKey( _a376, index );
|
||||
}
|
||||
self.loadout.equipment = self get_player_equipment();
|
||||
if ( isDefined( self.loadout.equipment ) )
|
||||
@ -249,7 +243,7 @@ chugabud_save_loadout()
|
||||
}
|
||||
}
|
||||
|
||||
chugabud_save_grenades()
|
||||
chugabud_save_grenades() //checked matches cerberus output
|
||||
{
|
||||
if ( self hasweapon( "emp_grenade_zm" ) )
|
||||
{
|
||||
@ -268,20 +262,16 @@ chugabud_save_grenades()
|
||||
}
|
||||
}
|
||||
|
||||
chugabud_give_loadout()
|
||||
chugabud_give_loadout() //checked partially changed to match cerberus output continues in for loops bad see the github for more info
|
||||
{
|
||||
self takeallweapons();
|
||||
loadout = self.loadout;
|
||||
primaries = self getweaponslistprimaries();
|
||||
while ( loadout.weapons.size > 1 || primaries.size > 1 )
|
||||
if ( loadout.weapons.size > 1 || primaries.size > 1 )
|
||||
{
|
||||
_a458 = primaries;
|
||||
_k458 = getFirstArrayKey( _a458 );
|
||||
while ( isDefined( _k458 ) )
|
||||
foreach ( weapon in primaries )
|
||||
{
|
||||
weapon = _a458[ _k458 ];
|
||||
self takeweapon( weapon );
|
||||
_k458 = getNextArrayKey( _a458, _k458 );
|
||||
}
|
||||
}
|
||||
i = 0;
|
||||
@ -292,15 +282,12 @@ chugabud_give_loadout()
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else if ( loadout.weapons[ i ][ "name" ] == "none" )
|
||||
if ( loadout.weapons[ i ][ "name" ] == "none" )
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
self maps/mp/zombies/_zm_weapons::weapondata_give( loadout.weapons[ i ] );
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if ( loadout.current_weapon >= 0 && isDefined( loadout.weapons[ loadout.current_weapon ][ "name" ] ) )
|
||||
@ -314,17 +301,14 @@ chugabud_give_loadout()
|
||||
self.score = loadout.score;
|
||||
self.pers[ "score" ] = loadout.score;
|
||||
perk_array = maps/mp/zombies/_zm_perks::get_perk_array( 1 );
|
||||
i = 0;
|
||||
while ( i < perk_array.size )
|
||||
for ( i = 0; i < perk_array.size; i++ )
|
||||
{
|
||||
perk = perk_array[ i ];
|
||||
self unsetperk( perk );
|
||||
self.num_perks--;
|
||||
|
||||
self set_perk_clientfield( perk, 0 );
|
||||
i++;
|
||||
}
|
||||
while ( isDefined( loadout.perks ) && loadout.perks.size > 0 )
|
||||
if ( isDefined( loadout.perks ) && loadout.perks.size > 0 )
|
||||
{
|
||||
i = 0;
|
||||
while ( i < loadout.perks.size )
|
||||
@ -334,7 +318,7 @@ chugabud_give_loadout()
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else if ( loadout.perks[ i ] == "specialty_quickrevive" && flag( "solo_game" ) )
|
||||
if ( loadout.perks[ i ] == "specialty_quickrevive" && flag( "solo_game" ) )
|
||||
{
|
||||
level.solo_game_free_player_quickrevive = 1;
|
||||
}
|
||||
@ -343,10 +327,7 @@ chugabud_give_loadout()
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
maps/mp/zombies/_zm_perks::give_perk( loadout.perks[ i ] );
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@ -361,7 +342,7 @@ chugabud_give_loadout()
|
||||
}
|
||||
}
|
||||
|
||||
chugabud_restore_grenades()
|
||||
chugabud_restore_grenades() //checked matches cerberus output
|
||||
{
|
||||
if ( isDefined( self.loadout.hasemp ) && self.loadout.hasemp )
|
||||
{
|
||||
@ -375,7 +356,7 @@ chugabud_restore_grenades()
|
||||
}
|
||||
}
|
||||
|
||||
chugabud_restore_claymore()
|
||||
chugabud_restore_claymore() //checked matches cerberus output
|
||||
{
|
||||
if ( isDefined( self.loadout.hasclaymore ) && self.loadout.hasclaymore && !self hasweapon( "claymore_zm" ) )
|
||||
{
|
||||
@ -386,7 +367,7 @@ chugabud_restore_claymore()
|
||||
}
|
||||
}
|
||||
|
||||
chugabud_fake_death()
|
||||
chugabud_fake_death() //checked matches cerberus output
|
||||
{
|
||||
level notify( "fake_death" );
|
||||
self notify( "fake_death" );
|
||||
@ -401,7 +382,7 @@ chugabud_fake_death()
|
||||
wait 0.9;
|
||||
}
|
||||
|
||||
chugabud_fake_revive()
|
||||
chugabud_fake_revive() //checked matches cerberus output
|
||||
{
|
||||
level notify( "fake_revive" );
|
||||
self notify( "fake_revive" );
|
||||
@ -446,7 +427,7 @@ chugabud_fake_revive()
|
||||
self disableinvulnerability();
|
||||
}
|
||||
|
||||
chugabud_get_spawnpoint()
|
||||
chugabud_get_spawnpoint() //checked partially changed to match cerberus output nested foreach is probably bad
|
||||
{
|
||||
spawnpoint = undefined;
|
||||
if ( get_chugabug_spawn_point_from_nodes( self.origin, 500, 700, 64, 1 ) )
|
||||
@ -475,36 +456,30 @@ chugabud_get_spawnpoint()
|
||||
{
|
||||
match_string = "";
|
||||
location = level.scr_zm_map_start_location;
|
||||
if ( location != "default" && location == "" && isDefined( level.default_start_location ) )
|
||||
if ( (location == "default" || location == "" ) && isdefined( level.default_start_location ) )
|
||||
{
|
||||
location = level.default_start_location;
|
||||
}
|
||||
match_string = ( level.scr_zm_ui_gametype + "_" ) + location;
|
||||
match_string = level.scr_zm_ui_gametype + "_" + location;
|
||||
spawnpoints = [];
|
||||
structs = getstructarray( "initial_spawn", "script_noteworthy" );
|
||||
while ( isDefined( structs ) )
|
||||
if ( isdefined( structs ) )
|
||||
{
|
||||
_a744 = structs;
|
||||
_k744 = getFirstArrayKey( _a744 );
|
||||
while ( isDefined( _k744 ) )
|
||||
foreach ( struct in structs )
|
||||
{
|
||||
struct = _a744[ _k744 ];
|
||||
while ( isDefined( struct.script_string ) )
|
||||
if ( isdefined( struct.script_string ) )
|
||||
{
|
||||
tokens = strtok( struct.script_string, " " );
|
||||
_a750 = tokens;
|
||||
_k750 = getFirstArrayKey( _a750 );
|
||||
while ( isDefined( _k750 ) )
|
||||
i = 0;
|
||||
while ( i < tokens.size )
|
||||
{
|
||||
token = _a750[ _k750 ];
|
||||
if ( token == match_string )
|
||||
if ( tokens[ i ] == match_string )
|
||||
{
|
||||
spawnpoints[ spawnpoints.size ] = struct;
|
||||
}
|
||||
_k750 = getNextArrayKey( _a750, _k750 );
|
||||
i++;
|
||||
}
|
||||
}
|
||||
_k744 = getNextArrayKey( _a744, _k744 );
|
||||
}
|
||||
}
|
||||
if ( !isDefined( spawnpoints ) || spawnpoints.size == 0 )
|
||||
@ -521,7 +496,7 @@ chugabud_get_spawnpoint()
|
||||
return spawnpoint;
|
||||
}
|
||||
|
||||
get_chugabug_spawn_point_from_nodes( v_origin, min_radius, max_radius, max_height, ignore_targetted_nodes )
|
||||
get_chugabug_spawn_point_from_nodes( v_origin, min_radius, max_radius, max_height, ignore_targetted_nodes ) //checked partially changed to match cerberus output changed at own discretion
|
||||
{
|
||||
if ( !isDefined( level.chugabud_spawn_struct ) )
|
||||
{
|
||||
@ -529,7 +504,7 @@ get_chugabug_spawn_point_from_nodes( v_origin, min_radius, max_radius, max_heigh
|
||||
}
|
||||
found_node = undefined;
|
||||
a_nodes = getnodesinradiussorted( v_origin, max_radius, min_radius, max_height, "pathnodes" );
|
||||
while ( isDefined( a_nodes ) && a_nodes.size > 0 )
|
||||
if ( isDefined( a_nodes ) && a_nodes.size > 0 )
|
||||
{
|
||||
a_player_volumes = getentarray( "player_volume", "script_noteworthy" );
|
||||
index = a_nodes.size - 1;
|
||||
@ -545,7 +520,7 @@ get_chugabug_spawn_point_from_nodes( v_origin, min_radius, max_radius, max_heigh
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if ( !positionwouldtelefrag( n_node.origin ) )
|
||||
if ( !positionwouldtelefrag( n_node.origin ) )
|
||||
{
|
||||
if ( maps/mp/zombies/_zm_utility::check_point_in_enabled_zone( n_node.origin, 1, a_player_volumes ) )
|
||||
{
|
||||
@ -567,11 +542,7 @@ get_chugabug_spawn_point_from_nodes( v_origin, min_radius, max_radius, max_heigh
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i--;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( isDefined( found_node ) )
|
||||
@ -584,28 +555,26 @@ get_chugabug_spawn_point_from_nodes( v_origin, min_radius, max_radius, max_heigh
|
||||
return 0;
|
||||
}
|
||||
|
||||
force_corpse_respawn_position( forced_corpse_position )
|
||||
force_corpse_respawn_position( forced_corpse_position ) //checked matches cerberus output
|
||||
{
|
||||
level.chugabud_force_corpse_position = forced_corpse_position;
|
||||
}
|
||||
|
||||
force_player_respawn_position( forced_player_position )
|
||||
force_player_respawn_position( forced_player_position ) //checked matches cerberus output
|
||||
{
|
||||
level.chugabud_force_player_position = forced_player_position;
|
||||
}
|
||||
|
||||
save_weapons_for_chugabud( player )
|
||||
save_weapons_for_chugabud( player ) //checked changed to match cerberus output
|
||||
{
|
||||
self.chugabud_melee_weapons = [];
|
||||
i = 0;
|
||||
while ( i < level._melee_weapons.size )
|
||||
for ( i = 0; i < level._melee_weapons.size; i++ )
|
||||
{
|
||||
self save_weapon_for_chugabud( player, level._melee_weapons[ i ].weapon_name );
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
save_weapon_for_chugabud( player, weapon_name )
|
||||
save_weapon_for_chugabud( player, weapon_name ) //checked matches cerberus output
|
||||
{
|
||||
if ( player hasweapon( weapon_name ) )
|
||||
{
|
||||
@ -613,20 +582,18 @@ save_weapon_for_chugabud( player, weapon_name )
|
||||
}
|
||||
}
|
||||
|
||||
restore_weapons_for_chugabud( player )
|
||||
restore_weapons_for_chugabud( player ) //checked changed to match cerberus output
|
||||
{
|
||||
i = 0;
|
||||
while ( i < level._melee_weapons.size )
|
||||
for ( i = 0; i < level._melee_weapons.size; i++ )
|
||||
{
|
||||
self restore_weapon_for_chugabud( player, level._melee_weapons[ i ].weapon_name );
|
||||
i++;
|
||||
}
|
||||
self.chugabud_melee_weapons = undefined;
|
||||
}
|
||||
|
||||
restore_weapon_for_chugabud( player, weapon_name )
|
||||
restore_weapon_for_chugabud( player, weapon_name ) //checked changed to match cerberus output
|
||||
{
|
||||
if ( isDefined( weapon_name ) || !isDefined( self.chugabud_melee_weapons ) && !isDefined( self.chugabud_melee_weapons[ weapon_name ] ) )
|
||||
if ( isDefined( weapon_name ) || !isDefined( self.chugabud_melee_weapons ) || !isDefined( self.chugabud_melee_weapons[ weapon_name ] ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -638,21 +605,17 @@ restore_weapon_for_chugabud( player, weapon_name )
|
||||
}
|
||||
}
|
||||
|
||||
chugabud_save_perks( ent )
|
||||
chugabud_save_perks( ent ) //checked changed to match cerberus output
|
||||
{
|
||||
perk_array = ent get_perk_array( 1 );
|
||||
_a941 = perk_array;
|
||||
_k941 = getFirstArrayKey( _a941 );
|
||||
while ( isDefined( _k941 ) )
|
||||
foreach ( perk in perk_array )
|
||||
{
|
||||
perk = _a941[ _k941 ];
|
||||
ent unsetperk( perk );
|
||||
_k941 = getNextArrayKey( _a941, _k941 );
|
||||
}
|
||||
return perk_array;
|
||||
}
|
||||
|
||||
playchugabudtimeraudio()
|
||||
playchugabudtimeraudio() //checked matches cerberus output
|
||||
{
|
||||
self endon( "chugabud_grabbed" );
|
||||
self endon( "chugabud_timedout" );
|
||||
@ -665,14 +628,14 @@ playchugabudtimeraudio()
|
||||
}
|
||||
}
|
||||
|
||||
playchugabudtimerout( player )
|
||||
playchugabudtimerout( player ) //checked matches cerberus output
|
||||
{
|
||||
self endon( "chugabud_grabbed" );
|
||||
self waittill( "chugabud_timedout" );
|
||||
player playsoundtoplayer( "zmb_chugabud_timer_out", player );
|
||||
}
|
||||
|
||||
chugabud_hostmigration()
|
||||
chugabud_hostmigration() //checked changed to match cerberus output
|
||||
{
|
||||
level endon( "end_game" );
|
||||
level notify( "chugabud_hostmigration" );
|
||||
@ -681,22 +644,18 @@ chugabud_hostmigration()
|
||||
{
|
||||
level waittill( "host_migration_end" );
|
||||
chugabuds = getentarray( "player_chugabud_model", "script_noteworthy" );
|
||||
_a1000 = chugabuds;
|
||||
_k1000 = getFirstArrayKey( _a1000 );
|
||||
while ( isDefined( _k1000 ) )
|
||||
foreach ( model in chugabuds )
|
||||
{
|
||||
model = _a1000[ _k1000 ];
|
||||
playfxontag( level._effect[ "powerup_on" ], model, "tag_origin" );
|
||||
_k1000 = getNextArrayKey( _a1000, _k1000 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
player_revived_cleanup_chugabud_corpse()
|
||||
player_revived_cleanup_chugabud_corpse() //checked matches cerberus output
|
||||
{
|
||||
}
|
||||
|
||||
player_has_chugabud_corpse()
|
||||
player_has_chugabud_corpse() //checked matches cerberus output
|
||||
{
|
||||
if ( isDefined( self.e_chugabud_corpse ) )
|
||||
{
|
||||
@ -705,7 +664,7 @@ player_has_chugabud_corpse()
|
||||
return 0;
|
||||
}
|
||||
|
||||
is_weapon_available_in_chugabud_corpse( weapon, player_to_check )
|
||||
is_weapon_available_in_chugabud_corpse( weapon, player_to_check ) //checked partially changed to match cerberus output
|
||||
{
|
||||
count = 0;
|
||||
upgradedweapon = weapon;
|
||||
@ -714,7 +673,7 @@ is_weapon_available_in_chugabud_corpse( weapon, player_to_check )
|
||||
upgradedweapon = level.zombie_weapons[ weapon ].upgrade_name;
|
||||
}
|
||||
players = getplayers();
|
||||
while ( isDefined( players ) )
|
||||
if ( isDefined( players ) )
|
||||
{
|
||||
player_index = 0;
|
||||
while ( player_index < players.size )
|
||||
@ -725,22 +684,17 @@ is_weapon_available_in_chugabud_corpse( weapon, player_to_check )
|
||||
player_index++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
if ( player player_has_chugabud_corpse() )
|
||||
{
|
||||
while ( player player_has_chugabud_corpse() )
|
||||
if ( isDefined( player.loadout ) && isDefined( player.loadout.weapons ) )
|
||||
{
|
||||
while ( isDefined( player.loadout ) && isDefined( player.loadout.weapons ) )
|
||||
{
|
||||
i = 0;
|
||||
while ( i < player.loadout.weapons.size )
|
||||
for ( i = 0; i < player.loadout.weapons.size; i++ )
|
||||
{
|
||||
chugabud_weapon = player.loadout.weapons[ i ];
|
||||
if ( isDefined( chugabud_weapon ) || chugabud_weapon[ "name" ] == weapon && chugabud_weapon[ "name" ] == upgradedweapon )
|
||||
if ( isDefined( chugabud_weapon ) && chugabud_weapon[ "name" ] == weapon || chugabud_weapon[ "name" ] == upgradedweapon )
|
||||
{
|
||||
count++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -750,7 +704,7 @@ is_weapon_available_in_chugabud_corpse( weapon, player_to_check )
|
||||
return count;
|
||||
}
|
||||
|
||||
chugabud_corpse_cleanup_on_spectator( player )
|
||||
chugabud_corpse_cleanup_on_spectator( player ) //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "death" );
|
||||
player endon( "disconnect" );
|
||||
@ -760,15 +714,12 @@ chugabud_corpse_cleanup_on_spectator( player )
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
wait 0.01;
|
||||
}
|
||||
}
|
||||
player chugabud_corpse_cleanup( self, 0 );
|
||||
}
|
||||
|
||||
chugabud_corpse_revive_icon( player )
|
||||
chugabud_corpse_revive_icon( player ) //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "death" );
|
||||
height_offset = 30;
|
||||
@ -788,19 +739,16 @@ chugabud_corpse_revive_icon( player )
|
||||
{
|
||||
if ( !isDefined( self.revive_hud_elem ) )
|
||||
{
|
||||
return;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
hud_elem.x = self.origin[ 0 ];
|
||||
hud_elem.y = self.origin[ 1 ];
|
||||
hud_elem.z = self.origin[ 2 ] + height_offset;
|
||||
wait 0.01;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
activate_chugabud_effects_and_audio()
|
||||
activate_chugabud_effects_and_audio() //checked matches cerberus output
|
||||
{
|
||||
if ( isDefined( level.whos_who_client_setup ) )
|
||||
{
|
||||
@ -822,7 +770,7 @@ activate_chugabud_effects_and_audio()
|
||||
}
|
||||
}
|
||||
|
||||
deactivate_chugabud_effects_and_audio()
|
||||
deactivate_chugabud_effects_and_audio() //checked matches cerberus output
|
||||
{
|
||||
self waittill_any( "death", "chugabud_effects_cleanup" );
|
||||
if ( isDefined( level.whos_who_client_setup ) )
|
||||
@ -845,3 +793,4 @@ deactivate_chugabud_effects_and_audio()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
### The following gscs compile and run successfully with no known errors:
|
||||
### The following scripts compile and run successfully with no known errors:
|
||||
```
|
||||
patch_zm/maps/mp/gametypes_zm/_clientids.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_globalentities.gsc
|
||||
@ -50,12 +50,18 @@ patch_zm/maps/mp/zombies/_zm_pers_upgrades_functions.gsc
|
||||
```
|
||||
patch_zm/maps/mp/gametypes_zm/_callbacksetup.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_damagefeedback.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_healthoverlay.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_hostmigration.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_hud.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_menus.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_perplayer.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_serversettings.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_tweakables.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_weapon_utils.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_blockers.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_buildables.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_chugabud.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_equipment.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_equip_turbine.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_game_module.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_laststand.gsc
|
||||
@ -71,7 +77,6 @@ patch_zm/maps/mp/zombies/_zm_weap_cymbal_monkey.gsc
|
||||
```
|
||||
### The following scripts are not checked yet, uploaded to setup a baseline:
|
||||
```
|
||||
patch_zm/maps/mp/gametypes_zm/_dev.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_gameobjects.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_globallogic.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_globallogic_actor.gsc
|
||||
@ -84,15 +89,11 @@ patch_zm/maps/mp/gametypes_zm/_globallogic_ui.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_globallogic_utils.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_globallogic_vehicle.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_gv_actions.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_healthoverlay.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_hostmigration.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_hud_message.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_hud_util.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_menus.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_spawning.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_spawnlogic.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_spectating.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_tweakables.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_weaponobjects.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_weapons.gsc
|
||||
```
|
||||
@ -100,9 +101,8 @@ patch_zm/maps/mp/gametypes_zm/_weapons.gsc
|
||||
```
|
||||
//I will put these off to towards much later since the hacker and gas mask are parts of the game that do not exist inside the game in any capacity whatsoever.
|
||||
//Therefore, whether or not they work is irrelevant.
|
||||
patch_zm/maps/mp/gametypes_zm/_dev.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_devgui.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_chugabud.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_equipment.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_equip_hacker.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_equip_gasmask.gsc
|
||||
patch_zm/maps/mp/zombies/_zm_hackables_boards.gsc
|
||||
|
Loading…
x
Reference in New Issue
Block a user