checked 3 patch_mp scripts

Checked _hud_message.gsc, _hud_util.gsc, and _spawning.gsc.
This commit is contained in:
JezuzLizard 2020-06-02 03:59:48 -07:00
parent d59ccb7757
commit d6650c8259
4 changed files with 366 additions and 430 deletions

View File

@ -1,10 +1,11 @@
//checked includes match cerberus output
#include maps/mp/_utility;
#include maps/mp/gametypes/_globallogic_audio;
#include maps/mp/_music;
#include maps/mp/gametypes/_hud_message;
#include maps/mp/gametypes/_hud_util;
init()
init() //checked matches cerberus output
{
precachestring( &"MENU_POINTS" );
precachestring( &"MP_FIRSTPLACE_NAME" );
@ -41,7 +42,7 @@ init()
level thread onplayerconnect();
}
onplayerconnect()
onplayerconnect() //checked matches cerberus output
{
for ( ;; )
{
@ -53,16 +54,16 @@ onplayerconnect()
}
}
initcustomgametypeheader()
initcustomgametypeheader() //checked matches cerberus output
{
font = "default";
titlesize = 2,5;
titlesize = 2.5;
self.customgametypeheader = createfontstring( font, titlesize );
self.customgametypeheader setpoint( "TOP", undefined, 0, 30 );
self.customgametypeheader.glowalpha = 1;
self.customgametypeheader.hidewheninmenu = 1;
self.customgametypeheader.archived = 0;
self.customgametypeheader.color = ( 1, 1, 0,6 );
self.customgametypeheader.color = ( 1, 1, 0.6 );
self.customgametypeheader.alpha = 1;
titlesize = 2;
self.customgametypesubheader = createfontstring( font, titlesize );
@ -71,11 +72,11 @@ initcustomgametypeheader()
self.customgametypesubheader.glowalpha = 1;
self.customgametypesubheader.hidewheninmenu = 1;
self.customgametypesubheader.archived = 0;
self.customgametypesubheader.color = ( 1, 1, 0,6 );
self.customgametypesubheader.color = ( 1, 1, 0.6 );
self.customgametypesubheader.alpha = 1;
}
hintmessage( hinttext, duration )
hintmessage( hinttext, duration ) //checked matches cerberus output
{
notifydata = spawnstruct();
notifydata.notifytext = hinttext;
@ -83,33 +84,31 @@ hintmessage( hinttext, duration )
notifymessage( notifydata );
}
hintmessageplayers( players, hinttext, duration )
hintmessageplayers( players, hinttext, duration ) //checked changed to match cerberus output
{
notifydata = spawnstruct();
notifydata.notifytext = hinttext;
notifydata.duration = duration;
i = 0;
while ( i < players.size )
for ( i = 0; i < players.size; i++ )
{
players[ i ] notifymessage( notifydata );
i++;
}
}
showinitialfactionpopup( team )
showinitialfactionpopup( team ) //checked matches cerberus output
{
self luinotifyevent( &"faction_popup", 1, game[ "strings" ][ team + "_name" ] );
maps/mp/gametypes/_hud_message::oldnotifymessage( undefined, undefined, undefined, undefined );
}
initnotifymessage()
initnotifymessage() //checked matches cerberus output
{
if ( !sessionmodeiszombiesgame() )
{
if ( self issplitscreen() )
{
titlesize = 2;
textsize = 1,4;
textsize = 1.4;
iconsize = 24;
font = "big";
point = "TOP";
@ -119,8 +118,8 @@ initnotifymessage()
}
else
{
titlesize = 2,5;
textsize = 1,75;
titlesize = 2.5;
textsize = 1.75;
iconsize = 30;
font = "big";
point = "TOP";
@ -132,7 +131,7 @@ initnotifymessage()
else if ( self issplitscreen() )
{
titlesize = 2;
textsize = 1,4;
textsize = 1.4;
iconsize = 24;
font = "big";
point = "TOP";
@ -142,8 +141,8 @@ initnotifymessage()
}
else
{
titlesize = 2,5;
textsize = 1,75;
titlesize = 2.5;
textsize = 1.75;
iconsize = 30;
font = "big";
point = "BOTTOM LEFT";
@ -181,7 +180,7 @@ initnotifymessage()
self.notifyqueue = [];
}
oldnotifymessage( titletext, notifytext, iconname, glowcolor, sound, duration )
oldnotifymessage( titletext, notifytext, iconname, glowcolor, sound, duration ) //checked matches cerberus output
{
if ( level.wagermatch && !level.teambased )
{
@ -197,7 +196,7 @@ oldnotifymessage( titletext, notifytext, iconname, glowcolor, sound, duration )
self notify( "received award" );
}
notifymessage( notifydata )
notifymessage( notifydata ) //checked matches cerberus output
{
self endon( "death" );
self endon( "disconnect" );
@ -205,9 +204,9 @@ notifymessage( notifydata )
self notify( "received award" );
}
playnotifyloop( duration )
playnotifyloop( duration ) //checked changed to match cerberus output
{
playnotifyloop = spawn( "script_origin", ( 1, 1, 1 ) );
playnotifyloop = spawn( "script_origin", ( 0, 0, 0 ) );
playnotifyloop playloopsound( "uin_notify_data_loop" );
duration -= 4;
if ( duration < 1 )
@ -218,7 +217,7 @@ playnotifyloop( duration )
playnotifyloop delete();
}
shownotifymessage( notifydata, duration )
shownotifymessage( notifydata, duration ) //checked matches cerberus output
{
self endon( "disconnect" );
self.doingnotify = 1;
@ -243,7 +242,7 @@ shownotifymessage( notifydata, duration )
}
else
{
glowcolor = ( 1, 1, 1 );
glowcolor = ( 0, 0, 0 );
}
if ( isDefined( notifydata.color ) )
{
@ -362,9 +361,9 @@ shownotifymessage( notifydata, duration )
self.doingnotify = 0;
}
waitrequirevisibility( waittime )
waitrequirevisibility( waittime ) //checked matches cerberus output
{
interval = 0,05;
interval = 0.05;
while ( !self canreadtext() )
{
wait interval;
@ -379,7 +378,7 @@ waitrequirevisibility( waittime )
}
}
canreadtext()
canreadtext() //checked matches cerberus output
{
if ( self maps/mp/_utility::isflashbanged() )
{
@ -388,7 +387,7 @@ canreadtext()
return 1;
}
resetondeath()
resetondeath() //checked matches cerberus output
{
self endon( "notifyMessageDone" );
self endon( "disconnect" );
@ -397,7 +396,7 @@ resetondeath()
resetnotify();
}
resetoncancel()
resetoncancel() //checked matches cerberus output
{
self notify( "resetOnCancel" );
self endon( "resetOnCancel" );
@ -407,7 +406,7 @@ resetoncancel()
resetnotify();
}
resetnotify()
resetnotify() //checked matches cerberus output
{
self.notifytitle.alpha = 0;
self.notifytext.alpha = 0;
@ -415,7 +414,7 @@ resetnotify()
self.doingnotify = 0;
}
hintmessagedeaththink()
hintmessagedeaththink() //checked matches cerberus output
{
self endon( "disconnect" );
for ( ;; )
@ -428,7 +427,7 @@ hintmessagedeaththink()
}
}
lowermessagethink()
lowermessagethink() //checked matches cerberus output
{
self endon( "disconnect" );
messagetexty = level.lowertexty;
@ -440,10 +439,10 @@ lowermessagethink()
self.lowermessage setpoint( "CENTER", level.lowertextyalign, 0, messagetexty );
self.lowermessage settext( "" );
self.lowermessage.archived = 0;
timerfontsize = 1,5;
timerfontsize = 1.5;
if ( self issplitscreen() )
{
timerfontsize = 1,4;
timerfontsize = 1.4;
}
self.lowertimer = createfontstring( "default", timerfontsize );
self.lowertimer setparent( self.lowermessage );
@ -452,7 +451,7 @@ lowermessagethink()
self.lowertimer.archived = 0;
}
setmatchscorehudelemforteam( team )
setmatchscorehudelemforteam( team ) //checked matches cerberus output
{
if ( level.roundscorecarry )
{
@ -464,25 +463,20 @@ setmatchscorehudelemforteam( team )
}
}
teamoutcomenotify( winner, isround, endreasontext )
teamoutcomenotify( winner, isround, endreasontext ) //checked partially changed to match cerberus output see info.md
{
self endon( "disconnect" );
self notify( "reset_outcome" );
team = self.pers[ "team" ];
while ( isDefined( team ) && team == "spectator" )
if ( isDefined( team ) && team == "spectator" )
{
i = 0;
while ( i < level.players.size )
for ( i = 0; i < level.players.size; i++ )
{
if ( self.currentspectatingclient == level.players[ i ].clientid )
{
team = level.players[ i ].pers[ "team" ];
break;
}
else
{
i++;
}
}
}
if ( !isDefined( team ) || !isDefined( level.teams[ team ] ) )
@ -491,7 +485,7 @@ teamoutcomenotify( winner, isround, endreasontext )
}
while ( self.doingnotify )
{
wait 0,05;
wait 0.05;
}
self endon( "reset_outcome" );
headerfont = "extrabig";
@ -499,7 +493,7 @@ teamoutcomenotify( winner, isround, endreasontext )
if ( self issplitscreen() )
{
titlesize = 2;
textsize = 1,5;
textsize = 1.5;
iconsize = 30;
spacing = 10;
}
@ -560,7 +554,7 @@ teamoutcomenotify( winner, isround, endreasontext )
{
outcometitle settext( game[ "strings" ][ "draw" ] );
}
outcometitle.color = ( 0,29, 0,61, 0,7 );
outcometitle.color = ( 0.29, 0.61, 0.7 );
winner = "allies";
}
else if ( isDefined( self.pers[ "team" ] ) && winner == team )
@ -573,7 +567,7 @@ teamoutcomenotify( winner, isround, endreasontext )
{
outcometitle settext( game[ "strings" ][ "victory" ] );
}
outcometitle.color = ( 0,42, 0,68, 0,46 );
outcometitle.color = ( 0.42, 0.68, 0.46 );
if ( isDefined( level.endvictoryreasontext ) )
{
endreasontext = level.endvictoryreasontext;
@ -589,7 +583,7 @@ teamoutcomenotify( winner, isround, endreasontext )
{
outcometitle settext( game[ "strings" ][ "defeat" ] );
}
outcometitle.color = ( 0,73, 0,29, 0,19 );
outcometitle.color = ( 0.73, 0.29, 0.19 );
if ( isDefined( level.enddefeatreasontext ) )
{
endreasontext = level.enddefeatreasontext;
@ -612,11 +606,8 @@ teamoutcomenotify( winner, isround, endreasontext )
teamicons[ team ] fadeovertime( 0,5 );
teamicons[ team ].alpha = 1;
currentx += iconspacing;
_a650 = level.teams;
_k650 = getFirstArrayKey( _a650 );
while ( isDefined( _k650 ) )
foreach ( enemyteam in level.teams )
{
enemyteam = _a650[ _k650 ];
if ( team == enemyteam )
{
}
@ -634,7 +625,6 @@ teamoutcomenotify( winner, isround, endreasontext )
teamicons[ enemyteam ].alpha = 1;
currentx += iconspacing;
}
_k650 = getNextArrayKey( _a650, _k650 );
}
teamscores = [];
teamscores[ team ] = createfontstring( font, titlesize );
@ -654,11 +644,8 @@ teamoutcomenotify( winner, isround, endreasontext )
teamscores[ team ].immunetodemogamehudsettings = 1;
teamscores[ team ].immunetodemofreecamera = 1;
teamscores[ team ] setpulsefx( 100, duration, 1000 );
_a688 = level.teams;
_k688 = getFirstArrayKey( _a688 );
while ( isDefined( _k688 ) )
foreach ( enemyteam in level.teams )
{
enemyteam = _a688[ _k688 ];
if ( team == enemyteam )
{
}
@ -682,7 +669,6 @@ teamoutcomenotify( winner, isround, endreasontext )
teamscores[ enemyteam ].immunetodemofreecamera = 1;
teamscores[ enemyteam ] setpulsefx( 100, duration, 1000 );
}
_k688 = getNextArrayKey( _a688, _k688 );
}
font = "objective";
matchbonus = undefined;
@ -706,25 +692,20 @@ teamoutcomenotify( winner, isround, endreasontext )
self thread resetoutcomenotify( teamicons, teamscores, outcometitle, outcometext );
}
teamoutcomenotifyzombie( winner, isround, endreasontext )
teamoutcomenotifyzombie( winner, isround, endreasontext ) //checked changed to match beta dump
{
self endon( "disconnect" );
self notify( "reset_outcome" );
team = self.pers[ "team" ];
while ( isDefined( team ) && team == "spectator" )
if ( isDefined( team ) && team == "spectator" )
{
i = 0;
while ( i < level.players.size )
for ( i = 0; i < level.players.size; i++ )
{
if ( self.currentspectatingclient == level.players[ i ].clientid )
{
team = level.players[ i ].pers[ "team" ];
break;
}
else
{
i++;
}
}
}
if ( !isDefined( team ) || !isDefined( level.teams[ team ] ) )
@ -733,7 +714,7 @@ teamoutcomenotifyzombie( winner, isround, endreasontext )
}
while ( self.doingnotify )
{
wait 0,05;
wait 0.05;
}
self endon( "reset_outcome" );
if ( level.splitscreen )
@ -760,27 +741,25 @@ teamoutcomenotifyzombie( winner, isround, endreasontext )
self thread resetoutcomenotify( undefined, undefined, outcometitle );
}
isintop( players, topn )
isintop( players, topn ) //checkee changed to match cerberus output
{
i = 0;
while ( i < topn )
for ( i = 0; i < topn; i++ )
{
if ( isDefined( players[ i ] ) && self == players[ i ] )
{
return 1;
}
i++;
}
return 0;
}
outcomenotify( winner, isroundend, endreasontext )
outcomenotify( winner, isroundend, endreasontext ) //checked matches cerberus output
{
self endon( "disconnect" );
self notify( "reset_outcome" );
while ( self.doingnotify )
{
wait 0,05;
wait 0.05;
}
self endon( "reset_outcome" );
headerfont = "extrabig";
@ -788,8 +767,8 @@ outcomenotify( winner, isroundend, endreasontext )
if ( self issplitscreen() )
{
titlesize = 2;
winnersize = 1,5;
othersize = 1,5;
winnersize = 1.5;
othersize = 1.5;
iconsize = 30;
spacing = 10;
}
@ -797,7 +776,7 @@ outcomenotify( winner, isroundend, endreasontext )
{
titlesize = 3;
winnersize = 2;
othersize = 1,5;
othersize = 1.5;
iconsize = 30;
spacing = 20;
}
@ -818,12 +797,12 @@ outcomenotify( winner, isroundend, endreasontext )
else if ( self isintop( players, 3 ) )
{
outcometitle settext( game[ "strings" ][ "victory" ] );
outcometitle.color = ( 0,42, 0,68, 0,46 );
outcometitle.color = ( 0.42, 0.68, 0.46 );
}
else
{
outcometitle settext( game[ "strings" ][ "defeat" ] );
outcometitle.color = ( 0,73, 0,29, 0,19 );
outcometitle.color = ( 0.73, 0.29, 0.19 );
}
}
outcometitle.glowalpha = 1;
@ -905,13 +884,13 @@ outcomenotify( winner, isroundend, endreasontext )
self thread resetoutcomenotify( undefined, undefined, outcometitle, outcometext, firsttitle, secondtitle, thirdtitle, matchbonus );
}
wageroutcomenotify( winner, endreasontext )
wageroutcomenotify( winner, endreasontext ) //checked changed to match cerberus output
{
self endon( "disconnect" );
self notify( "reset_outcome" );
while ( self.doingnotify )
{
wait 0,05;
wait 0.05;
}
setmatchflag( "enable_popups", 0 );
self endon( "reset_outcome" );
@ -920,8 +899,8 @@ wageroutcomenotify( winner, endreasontext )
if ( self issplitscreen() )
{
titlesize = 2;
winnersize = 1,5;
othersize = 1,5;
winnersize = 1.5;
othersize = 1.5;
iconsize = 30;
spacing = 2;
}
@ -929,7 +908,7 @@ wageroutcomenotify( winner, endreasontext )
{
titlesize = 3;
winnersize = 2;
othersize = 1,5;
othersize = 1.5;
iconsize = 30;
spacing = 20;
}
@ -945,25 +924,25 @@ wageroutcomenotify( winner, endreasontext )
if ( halftime )
{
outcometitle settext( game[ "strings" ][ "intermission" ] );
outcometitle.color = ( 1, 1, 1 );
outcometitle.glowcolor = ( 1, 1, 1 );
outcometitle.color = ( 1, 1, 0 );
outcometitle.glowcolor = ( 1, 0, 0 );
}
else if ( isDefined( level.dontcalcwagerwinnings ) && level.dontcalcwagerwinnings == 1 )
{
outcometitle settext( game[ "strings" ][ "wager_topwinners" ] );
outcometitle.color = ( 0,42, 0,68, 0,46 );
outcometitle.color = ( 0.42, 0.68, 0.46 );
}
else
{
if ( isDefined( self.wagerwinnings ) && self.wagerwinnings > 0 )
{
outcometitle settext( game[ "strings" ][ "wager_inthemoney" ] );
outcometitle.color = ( 0,42, 0,68, 0,46 );
outcometitle.color = ( 0.42, 0.68, 0.46 );
}
else
{
outcometitle settext( game[ "strings" ][ "wager_loss" ] );
outcometitle.color = ( 0,73, 0,29, 0,19 );
outcometitle.color = ( 0.73, 0.29, 0.19 );
}
}
outcometitle.glowalpha = 1;
@ -984,8 +963,7 @@ wageroutcomenotify( winner, endreasontext )
playernamehudelems = [];
playercphudelems = [];
numplayers = players.size;
i = 0;
while ( i < numplayers )
for ( i = 0; i < numplayers; i++ )
{
if ( !halftime && isDefined( players[ i ] ) )
{
@ -1029,12 +1007,11 @@ wageroutcomenotify( winner, endreasontext )
}
if ( secondcp.targetvalue > 0 )
{
secondcp.color = ( 0,42, 0,68, 0,46 );
secondcp.color = ( 0.42, 0.68, 0.46 );
}
secondcp setvalue( 0 );
playercphudelems[ playercphudelems.size ] = secondcp;
}
i++;
}
self thread updatewageroutcome( playernamehudelems, playercphudelems );
self thread resetwageroutcomenotify( playernamehudelems, playercphudelems, outcometitle, outcometext );
@ -1047,7 +1024,7 @@ wageroutcomenotify( winner, endreasontext )
cpincrement = 9999;
if ( isDefined( playercphudelems[ 0 ] ) )
{
cpincrement = int( playercphudelems[ 0 ].targetvalue / ( countupduration / 0,05 ) );
cpincrement = int( playercphudelems[ 0 ].targetvalue / ( countupduration / 0.05 ) );
if ( cpincrement < 1 )
{
cpincrement = 1;
@ -1056,8 +1033,7 @@ wageroutcomenotify( winner, endreasontext )
while ( stillupdating )
{
stillupdating = 0;
i = 0;
while ( i < playercphudelems.size )
for ( i = 0; i < playercphudelems.size; i++ )
{
if ( isDefined( playercphudelems[ i ] ) && playercphudelems[ i ].currentvalue < playercphudelems[ i ].targetvalue )
{
@ -1069,13 +1045,12 @@ wageroutcomenotify( winner, endreasontext )
playercphudelems[ i ] setvalue( playercphudelems[ i ].currentvalue );
stillupdating = 1;
}
i++;
}
wait 0,05;
wait 0.05;
}
}
teamwageroutcomenotify( winner, isroundend, endreasontext )
teamwageroutcomenotify( winner, isroundend, endreasontext ) //checked partially changed to match cerberus output see info.md
{
self endon( "disconnect" );
self notify( "reset_outcome" );
@ -1084,10 +1059,10 @@ teamwageroutcomenotify( winner, isroundend, endreasontext )
{
team = "allies";
}
wait 0,05;
wait 0.05;
while ( self.doingnotify )
{
wait 0,05;
wait 0.05;
}
self endon( "reset_outcome" );
headerfont = "extrabig";
@ -1095,7 +1070,7 @@ teamwageroutcomenotify( winner, isroundend, endreasontext )
if ( self issplitscreen() )
{
titlesize = 2;
textsize = 1,5;
textsize = 1.5;
iconsize = 30;
spacing = 10;
}
@ -1155,7 +1130,7 @@ teamwageroutcomenotify( winner, isroundend, endreasontext )
{
outcometitle settext( game[ "strings" ][ "victory" ] );
}
outcometitle.color = ( 0,42, 0,68, 0,46 );
outcometitle.color = ( 0.42, 0.68, 0.46 );
}
else
{
@ -1167,7 +1142,7 @@ teamwageroutcomenotify( winner, isroundend, endreasontext )
{
outcometitle settext( game[ "strings" ][ "defeat" ] );
}
outcometitle.color = ( 0,73, 0,29, 0,19 );
outcometitle.color = ( 0.73, 0.29, 0.19 );
}
if ( !isDefined( level.dontshowendreason ) || !level.dontshowendreason )
{
@ -1182,15 +1157,12 @@ teamwageroutcomenotify( winner, isroundend, endreasontext )
teamicons[ team ].hidewheninmenu = 0;
teamicons[ team ].archived = 0;
teamicons[ team ].alpha = 0;
teamicons[ team ] fadeovertime( 0,5 );
teamicons[ team ] fadeovertime( 0.5 );
teamicons[ team ].alpha = 1;
teamicons[ team ].immunetodemogamehudsettings = 1;
teamicons[ team ].immunetodemofreecamera = 1;
_a1269 = level.teams;
_k1269 = getFirstArrayKey( _a1269 );
while ( isDefined( _k1269 ) )
foreach ( enemyteam in level.teams )
{
enemyteam = _a1269[ _k1269 ];
if ( team == enemyteam )
{
}
@ -1202,12 +1174,11 @@ teamwageroutcomenotify( winner, isroundend, endreasontext )
teamicons[ enemyteam ].hidewheninmenu = 0;
teamicons[ enemyteam ].archived = 0;
teamicons[ enemyteam ].alpha = 0;
teamicons[ enemyteam ] fadeovertime( 0,5 );
teamicons[ enemyteam ] fadeovertime( 0.5 );
teamicons[ enemyteam ].alpha = 1;
teamicons[ enemyteam ].immunetodemogamehudsettings = 1;
teamicons[ enemyteam ].immunetodemofreecamera = 1;
}
_k1269 = getNextArrayKey( _a1269, _k1269 );
}
teamscores = [];
teamscores[ team ] = createfontstring( font, titlesize );
@ -1220,11 +1191,8 @@ teamwageroutcomenotify( winner, isroundend, endreasontext )
teamscores[ team ].immunetodemogamehudsettings = 1;
teamscores[ team ].immunetodemofreecamera = 1;
teamscores[ team ] setpulsefx( 100, duration, 1000 );
_a1299 = level.teams;
_k1299 = getFirstArrayKey( _a1299 );
while ( isDefined( _k1299 ) )
foreach ( enemyteam in level.teams )
{
enemyteam = _a1299[ _k1299 ];
if ( team == enemyteam )
{
}
@ -1241,7 +1209,6 @@ teamwageroutcomenotify( winner, isroundend, endreasontext )
teamscores[ enemyteam ].immunetodemofreecamera = 1;
teamscores[ enemyteam ] setpulsefx( 100, duration, 1000 );
}
_k1299 = getNextArrayKey( _a1299, _k1299 );
}
matchbonus = undefined;
sidebetwinnings = undefined;
@ -1274,7 +1241,7 @@ teamwageroutcomenotify( winner, isroundend, endreasontext )
self thread resetoutcomenotify( teamicons, teamscores, outcometitle, outcometext, matchbonus, sidebetwinnings );
}
destroyhudelem( hudelem )
destroyhudelem( hudelem ) //checked matches cerberus output
{
if ( isDefined( hudelem ) )
{
@ -1282,7 +1249,7 @@ destroyhudelem( hudelem )
}
}
resetoutcomenotify( hudelemlist1, hudelemlist2, hudelem3, hudelem4, hudelem5, hudelem6, hudelem7, hudelem8, hudelem9, hudelem10 )
resetoutcomenotify( hudelemlist1, hudelemlist2, hudelem3, hudelem4, hudelem5, hudelem6, hudelem7, hudelem8, hudelem9, hudelem10 ) //checked changed to match beta dump
{
self endon( "disconnect" );
self waittill( "reset_outcome" );
@ -1294,53 +1261,39 @@ resetoutcomenotify( hudelemlist1, hudelemlist2, hudelem3, hudelem4, hudelem5, hu
destroyhudelem( hudelem8 );
destroyhudelem( hudelem9 );
destroyhudelem( hudelem10 );
while ( isDefined( hudelemlist1 ) )
if ( isDefined( hudelemlist1 ) )
{
_a1371 = hudelemlist1;
_k1371 = getFirstArrayKey( _a1371 );
while ( isDefined( _k1371 ) )
foreach ( elem in hudelemlist1 )
{
elem = _a1371[ _k1371 ];
destroyhudelem( elem );
_k1371 = getNextArrayKey( _a1371, _k1371 );
}
}
while ( isDefined( hudelemlist2 ) )
if ( isDefined( hudelemlist2 ) )
{
_a1379 = hudelemlist2;
_k1379 = getFirstArrayKey( _a1379 );
while ( isDefined( _k1379 ) )
foreach ( elem in hudelemlist2 )
{
elem = _a1379[ _k1379 ];
destroyhudelem( elem );
_k1379 = getNextArrayKey( _a1379, _k1379 );
}
}
}
resetwageroutcomenotify( playernamehudelems, playercphudelems, outcometitle, outcometext )
resetwageroutcomenotify( playernamehudelems, playercphudelems, outcometitle, outcometext ) //checked changed to match cerberus output
{
self endon( "disconnect" );
self waittill( "reset_outcome" );
i = playernamehudelems.size - 1;
while ( i >= 0 )
for ( i = playernamehudelems.size - 1; i >= 0; i-- )
{
if ( isDefined( playernamehudelems[ i ] ) )
{
playernamehudelems[ i ] destroy();
}
i--;
}
i = playercphudelems.size - 1;
while ( i >= 0 )
for ( i = playercphudelems.size - 1; i >= 0; i-- )
{
if ( isDefined( playercphudelems[ i ] ) )
{
playercphudelems[ i ] destroy();
}
i--;
}
if ( isDefined( outcometext ) )
{
@ -1352,7 +1305,7 @@ resetwageroutcomenotify( playernamehudelems, playercphudelems, outcometitle, out
}
}
updateoutcome( firsttitle, secondtitle, thirdtitle )
updateoutcome( firsttitle, secondtitle, thirdtitle ) //checked changed to match cerberus output
{
self endon( "disconnect" );
self endon( "reset_outcome" );
@ -1364,40 +1317,30 @@ updateoutcome( firsttitle, secondtitle, thirdtitle )
{
firsttitle setplayernamestring( players[ 0 ] );
}
else
else if ( isDefined( firsttitle ) )
{
if ( isDefined( firsttitle ) )
{
firsttitle.alpha = 0;
}
firsttitle.alpha = 0;
}
if ( isDefined( secondtitle ) && isDefined( players[ 1 ] ) )
{
secondtitle setplayernamestring( players[ 1 ] );
}
else
else if ( isDefined( secondtitle ) )
{
if ( isDefined( secondtitle ) )
{
secondtitle.alpha = 0;
}
secondtitle.alpha = 0;
}
if ( isDefined( thirdtitle ) && isDefined( players[ 2 ] ) )
{
thirdtitle setplayernamestring( players[ 2 ] );
continue;
}
else
else if ( isDefined( thirdtitle ) )
{
if ( isDefined( thirdtitle ) )
{
thirdtitle.alpha = 0;
}
thirdtitle.alpha = 0;
}
}
}
updatewageroutcome( playernamehudelems, playercphudelems )
updatewageroutcome( playernamehudelems, playercphudelems ) //checked changed to match betad ump
{
self endon( "disconnect" );
self endon( "reset_outcome" );
@ -1405,14 +1348,11 @@ updatewageroutcome( playernamehudelems, playercphudelems )
{
self waittill( "update_outcome" );
players = level.placement[ "all" ];
i = 0;
while ( i < playernamehudelems.size )
for ( i = 0; i < playernamehudelems.size; i++ )
{
if ( isDefined( playernamehudelems[ i ] ) && isDefined( players[ playernamehudelems[ i ].playernum ] ) )
{
playernamehudelems[ i ] setplayernamestring( players[ playernamehudelems[ i ].playernum ] );
i++;
continue;
}
else
{
@ -1425,16 +1365,15 @@ updatewageroutcome( playernamehudelems, playercphudelems )
playercphudelems[ i ].alpha = 0;
}
}
i++;
}
}
}
setshoutcasterwaitingmessage()
setshoutcasterwaitingmessage() //checked matches cerberus output
{
if ( !isDefined( self.waitingforplayerstext ) )
{
self.waitingforplayerstext = createfontstring( "objective", 2,5 );
self.waitingforplayerstext = createfontstring( "objective", 2.5 );
self.waitingforplayerstext setpoint( "CENTER", "CENTER", 0, -80 );
self.waitingforplayerstext.sort = 1001;
self.waitingforplayerstext settext( &"MP_WAITING_FOR_PLAYERS_SHOUTCASTER" );
@ -1443,7 +1382,7 @@ setshoutcasterwaitingmessage()
}
}
clearshoutcasterwaitingmessage()
clearshoutcasterwaitingmessage() //checked matches cerberus output
{
if ( isDefined( self.waitingforplayerstext ) )
{
@ -1451,3 +1390,4 @@ clearshoutcasterwaitingmessage()
self.waitingforplayerstext = undefined;
}
}

View File

@ -1,6 +1,7 @@
//checked includes match cerberus output
#include maps/mp/_utility;
setparent( element )
setparent( element ) //checked matches cerberus output
{
if ( isDefined( self.parent ) && self.parent == element )
{
@ -22,18 +23,18 @@ setparent( element )
}
}
getparent()
getparent() //checked matches cerberus output
{
return self.parent;
}
addchild( element )
addchild( element ) //checked matches cerberus output
{
element.index = self.children.size;
self.children[ self.children.size ] = element;
}
removechild( element )
removechild( element ) //checked matches cerberus output
{
element.parent = undefined;
if ( self.children[ self.children.size - 1 ] != element )
@ -44,7 +45,7 @@ removechild( element )
element.index = undefined;
}
setpoint( point, relativepoint, xoffset, yoffset, movetime )
setpoint( point, relativepoint, xoffset, yoffset, movetime ) //checked matches cerberus output
{
if ( !isDefined( movetime ) )
{
@ -109,9 +110,11 @@ setpoint( point, relativepoint, xoffset, yoffset, movetime )
self.alignx = "left";
break;
default:
/*
/#
println( "^3Warning: unknown point passed to setPoint(): " + point );
#/
*/
break;
}
if ( !isDefined( relativepoint ) )
@ -162,9 +165,11 @@ setpoint( point, relativepoint, xoffset, yoffset, movetime )
relativex = "left";
break;
default:
/*
/#
println( "^3Warning: unknown relativePoint passed to setPoint(): " + relativepoint );
#/
*/
break;
}
if ( element == level.uiparent )
@ -250,7 +255,7 @@ setpoint( point, relativepoint, xoffset, yoffset, movetime )
self updatechildren();
}
setpointbar( point, relativepoint, xoffset, yoffset )
setpointbar( point, relativepoint, xoffset, yoffset ) //checked changed to match cerberus output
{
self.bar.horzalign = self.horzalign;
self.bar.vertalign = self.vertalign;
@ -273,17 +278,14 @@ setpointbar( point, relativepoint, xoffset, yoffset )
{
self.bar.y = self.y;
}
else
else if ( self.aligny == "bottom" )
{
if ( self.aligny == "bottom" )
{
self.bar.y = self.y;
}
self.bar.y = self.y;
}
self updatebar( self.bar.frac );
}
updatebar( barfrac, rateofchange )
updatebar( barfrac, rateofchange ) //checked matches cerberus output
{
if ( self.elemtype == "bar" )
{
@ -291,43 +293,46 @@ updatebar( barfrac, rateofchange )
}
}
updatebarscale( barfrac, rateofchange )
updatebarscale( barfrac, rateofchange ) //checked changed to match cerberus output
{
barwidth = int( ( self.width * barfrac ) + 0,5 );
barwidth = int( ( self.width * barfrac ) + 0.5 );
if ( !barwidth )
{
barwidth = 1;
}
self.bar.frac = barfrac;
self.bar setshader( self.bar.shader, barwidth, self.height );
/*
/#
assert( barwidth <= self.width, "barWidth <= self.width: " + barwidth + " <= " + self.width + " - barFrac was " + barfrac );
#/
*/
if ( isDefined( rateofchange ) && barwidth < self.width )
{
if ( rateofchange > 0 )
{
/*
/#
assert( ( ( 1 - barfrac ) / rateofchange ) > 0, "barFrac: " + barfrac + "rateOfChange: " + rateofchange );
#/
*/
self.bar scaleovertime( ( 1 - barfrac ) / rateofchange, self.width, self.height );
}
else
else if ( rateofchange < 0 )
{
if ( rateofchange < 0 )
{
/*
/#
assert( ( barfrac / ( -1 * rateofchange ) ) > 0, "barFrac: " + barfrac + "rateOfChange: " + rateofchange );
assert( ( barfrac / ( -1 * rateofchange ) ) > 0, "barFrac: " + barfrac + "rateOfChange: " + rateofchange );
#/
self.bar scaleovertime( barfrac / ( -1 * rateofchange ), 1, self.height );
}
*/
self.bar scaleovertime( barfrac / ( -1 * rateofchange ), 1, self.height );
}
}
self.bar.rateofchange = rateofchange;
self.bar.lastupdatetime = getTime();
}
createfontstring( font, fontscale )
createfontstring( font, fontscale ) //checked matches cerberus output
{
fontelem = newclienthudelem( self );
fontelem.elemtype = "font";
@ -345,7 +350,7 @@ createfontstring( font, fontscale )
return fontelem;
}
createserverfontstring( font, fontscale, team )
createserverfontstring( font, fontscale, team ) //checked matches cerberus output
{
if ( isDefined( team ) )
{
@ -370,7 +375,7 @@ createserverfontstring( font, fontscale, team )
return fontelem;
}
createservertimer( font, fontscale, team )
createservertimer( font, fontscale, team ) //checked matches cerberus output
{
if ( isDefined( team ) )
{
@ -395,7 +400,7 @@ createservertimer( font, fontscale, team )
return timerelem;
}
createclienttimer( font, fontscale )
createclienttimer( font, fontscale ) //checked matches cerberus output
{
timerelem = newclienthudelem( self );
timerelem.elemtype = "timer";
@ -413,7 +418,7 @@ createclienttimer( font, fontscale )
return timerelem;
}
createicon( shader, width, height )
createicon( shader, width, height ) //checked matches cerberus output
{
iconelem = newclienthudelem( self );
iconelem.elemtype = "icon";
@ -433,7 +438,7 @@ createicon( shader, width, height )
return iconelem;
}
createservericon( shader, width, height, team )
createservericon( shader, width, height, team ) //checked matches cerberus output
{
if ( isDefined( team ) )
{
@ -460,7 +465,7 @@ createservericon( shader, width, height, team )
return iconelem;
}
createserverbar( color, width, height, flashfrac, team, selected )
createserverbar( color, width, height, flashfrac, team, selected ) //checked changed to match cerberus output
{
if ( isDefined( team ) )
{
@ -501,7 +506,7 @@ createserverbar( color, width, height, flashfrac, team, selected )
barelemframe.barframe = barelemframe;
barelemframe.children = [];
barelemframe.sort = -1;
barelemframe.color = ( 1, 0, 0 );
barelemframe.color = ( 1, 1, 1 );
barelemframe setparent( level.uiparent );
if ( isDefined( selected ) )
{
@ -531,15 +536,15 @@ createserverbar( color, width, height, flashfrac, team, selected )
barelembg.barframe = barelemframe;
barelembg.children = [];
barelembg.sort = -3;
barelembg.color = ( 1, 0, 0 );
barelembg.alpha = 0,5;
barelembg.color = ( 0, 0, 0 );
barelembg.alpha = 0.5;
barelembg setparent( level.uiparent );
barelembg setshader( "progress_bar_bg", width, height );
barelembg.hidden = 0;
return barelembg;
}
createbar( color, width, height, flashfrac )
createbar( color, width, height, flashfrac ) //checked changed to match cerberus output
{
barelem = newclienthudelem( self );
barelem.x = 0;
@ -566,7 +571,7 @@ createbar( color, width, height, flashfrac )
barelemframe.barframe = barelemframe;
barelemframe.children = [];
barelemframe.sort = -1;
barelemframe.color = ( 1, 0, 0 );
barelemframe.color = ( 1, 1, 1 );
barelemframe setparent( level.uiparent );
barelemframe.hidden = 0;
barelembg = newclienthudelem( self );
@ -584,8 +589,8 @@ createbar( color, width, height, flashfrac )
barelembg.barframe = barelemframe;
barelembg.children = [];
barelembg.sort = -3;
barelembg.color = ( 1, 0, 0 );
barelembg.alpha = 0,5;
barelembg.color = ( 0, 0, 0 );
barelembg.alpha = 0.5;
barelembg setparent( level.uiparent );
if ( !level.splitscreen )
{
@ -599,7 +604,7 @@ createbar( color, width, height, flashfrac )
return barelembg;
}
getcurrentfraction()
getcurrentfraction() //checked matches cerberus output
{
frac = self.bar.frac;
if ( isDefined( self.bar.rateofchange ) )
@ -617,9 +622,9 @@ getcurrentfraction()
return frac;
}
createprimaryprogressbar()
createprimaryprogressbar() //checked changed to match cerberus output
{
bar = createbar( ( 1, 0, 0 ), level.primaryprogressbarwidth, level.primaryprogressbarheight );
bar = createbar( ( 1, 1, 1 ), level.primaryprogressbarwidth, level.primaryprogressbarheight );
if ( level.splitscreen )
{
bar setpoint( "TOP", undefined, level.primaryprogressbarx, level.primaryprogressbary );
@ -631,7 +636,7 @@ createprimaryprogressbar()
return bar;
}
createprimaryprogressbartext()
createprimaryprogressbartext() //checked matches cerberus output
{
text = createfontstring( "objective", level.primaryprogressbarfontsize );
if ( level.splitscreen )
@ -646,12 +651,12 @@ createprimaryprogressbartext()
return text;
}
createsecondaryprogressbar()
createsecondaryprogressbar() //checked changed to match cerberus output
{
secondaryprogressbarheight = getdvarintdefault( "scr_secondaryProgressBarHeight", level.secondaryprogressbarheight );
secondaryprogressbarx = getdvarintdefault( "scr_secondaryProgressBarX", level.secondaryprogressbarx );
secondaryprogressbary = getdvarintdefault( "scr_secondaryProgressBarY", level.secondaryprogressbary );
bar = createbar( ( 1, 0, 0 ), level.secondaryprogressbarwidth, secondaryprogressbarheight );
bar = createbar( ( 1, 1, 1 ), level.secondaryprogressbarwidth, secondaryprogressbarheight );
if ( level.splitscreen )
{
bar setpoint( "TOP", undefined, secondaryprogressbarx, secondaryprogressbary );
@ -663,7 +668,7 @@ createsecondaryprogressbar()
return bar;
}
createsecondaryprogressbartext()
createsecondaryprogressbartext() //checked matches cerberus output
{
secondaryprogressbartextx = getdvarintdefault( "scr_btx", level.secondaryprogressbartextx );
secondaryprogressbartexty = getdvarintdefault( "scr_bty", level.secondaryprogressbartexty );
@ -680,26 +685,26 @@ createsecondaryprogressbartext()
return text;
}
createteamprogressbar( team )
createteamprogressbar( team ) //checked matches cerberus output
{
bar = createserverbar( ( 1, 0, 0 ), level.teamprogressbarwidth, level.teamprogressbarheight, undefined, team );
bar setpoint( "TOP", undefined, 0, level.teamprogressbary );
return bar;
}
createteamprogressbartext( team )
createteamprogressbartext( team ) //checked matches cerberus output
{
text = createserverfontstring( "default", level.teamprogressbarfontsize, team );
text setpoint( "TOP", undefined, 0, level.teamprogressbartexty );
return text;
}
setflashfrac( flashfrac )
setflashfrac( flashfrac ) //checked matches cerberus output
{
self.bar.flashfrac = flashfrac;
}
hideelem()
hideelem() //checked matches cerberus output
{
if ( self.hidden )
{
@ -725,7 +730,7 @@ hideelem()
}
}
showelem()
showelem() //checked changed to match cerberus output
{
if ( !self.hidden )
{
@ -734,9 +739,9 @@ showelem()
self.hidden = 0;
if ( self.elemtype == "bar" || self.elemtype == "bar_shader" )
{
if ( self.alpha != 0,5 )
if ( self.alpha != 0.5 )
{
self.alpha = 0,5;
self.alpha = 0.5;
}
self.bar.hidden = 0;
if ( self.bar.alpha != 1 )
@ -749,16 +754,13 @@ showelem()
self.barframe.alpha = 1;
}
}
else
else if ( self.alpha != 1 )
{
if ( self.alpha != 1 )
{
self.alpha = 1;
}
self.alpha = 1;
}
}
flashthread()
flashthread() //checked changed to match beta dump
{
self endon( "death" );
if ( !self.hidden )
@ -771,14 +773,13 @@ flashthread()
{
if ( !self.hidden )
{
self fadeovertime( 0,3 );
self.alpha = 0,2;
wait 0,35;
self fadeovertime( 0,3 );
self fadeovertime( 0.3 );
self.alpha = 0.2;
wait 0.35;
self fadeovertime( 0.3 );
self.alpha = 1;
}
wait 0,7;
continue;
wait 0.7;
}
else
{
@ -786,28 +787,24 @@ flashthread()
{
self.alpha = 1;
}
wait 0,05;
wait 0.05;
}
}
}
destroyelem()
destroyelem() //checked changed to match cerberus output
{
tempchildren = [];
index = 0;
while ( index < self.children.size )
for ( index = 0; index < self.children.size; index++ )
{
if ( isDefined( self.children[ index ] ) )
{
tempchildren[ tempchildren.size ] = self.children[ index ];
}
index++;
}
index = 0;
while ( index < tempchildren.size )
for ( index = 0; index < tempchildren.size; index++ )
{
tempchildren[ index ] setparent( self getparent() );
index++;
}
if ( self.elemtype == "bar" || self.elemtype == "bar_shader" )
{
@ -817,39 +814,37 @@ destroyelem()
self destroy();
}
seticonshader( shader )
seticonshader( shader ) //checked matches cerberus output
{
self setshader( shader, self.width, self.height );
}
setwidth( width )
setwidth( width ) //checked matches cerberus output
{
self.width = width;
}
setheight( height )
setheight( height ) //checked matches cerberus output
{
self.height = height;
}
setsize( width, height )
setsize( width, height ) //checked matches cerberus output
{
self.width = width;
self.height = height;
}
updatechildren()
updatechildren() //checked changed to match cerberus output
{
index = 0;
while ( index < self.children.size )
for ( index = 0; index < self.children.size; index++ )
{
child = self.children[ index ];
child setpoint( child.point, child.relativepoint, child.xoffset, child.yoffset );
index++;
}
}
createloadouticon( player, verindex, horindex, xpos, ypos )
createloadouticon( player, verindex, horindex, xpos, ypos ) //checked matches cerberus output
{
iconsize = 32;
if ( player issplitscreen() )
@ -867,7 +862,7 @@ createloadouticon( player, verindex, horindex, xpos, ypos )
return icon;
}
setloadouticoncoords( player, verindex, horindex, xpos, ypos )
setloadouticoncoords( player, verindex, horindex, xpos, ypos ) //checked matches cerberus output
{
iconsize = 32;
if ( player issplitscreen() )
@ -884,12 +879,12 @@ setloadouticoncoords( player, verindex, horindex, xpos, ypos )
self.alpha = 1;
}
setloadouttextcoords( xcoord )
setloadouttextcoords( xcoord ) //checked matches cerberus output
{
self setpoint( "RIGHT", "LEFT", xcoord, 0 );
}
createloadouttext( icon, xcoord )
createloadouttext( icon, xcoord ) //checked matches cerberus output
{
text = createfontstring( "small", 1 );
text setparent( icon );
@ -901,7 +896,7 @@ createloadouttext( icon, xcoord )
return text;
}
showloadoutattribute( iconelem, icon, alpha, textelem, text )
showloadoutattribute( iconelem, icon, alpha, textelem, text ) //checked matches cerberus output
{
iconsize = 32;
iconelem.alpha = alpha;
@ -919,7 +914,7 @@ showloadoutattribute( iconelem, icon, alpha, textelem, text )
}
}
hideloadoutattribute( iconelem, fadetime, textelem, hidetextonly )
hideloadoutattribute( iconelem, fadetime, textelem, hidetextonly ) //checked matches cerberus output
{
if ( isDefined( fadetime ) )
{
@ -942,7 +937,7 @@ hideloadoutattribute( iconelem, fadetime, textelem, hidetextonly )
}
}
showperks()
showperks() //checked matches cerberus output
{
ypos = 40;
if ( self issplitscreen() )
@ -960,16 +955,18 @@ showperks()
self.perkhudelem setperks( self );
self.perkhudelem.x = -20;
self.perkhudelem.alpha = 0;
self.perkhudelem fadeovertime( 0,4 );
self.perkhudelem fadeovertime( 0.4 );
self.perkhudelem.alpha = 1;
self.perkhudelem.hidewheninmenu = 1;
}
showperk( index, perk, ypos )
showperk( index, perk, ypos ) //checked matches cerberus output
{
/*
/#
assert( game[ "state" ] != "postgame" );
#/
*/
if ( !isDefined( self.perkicon ) )
{
self.perkicon = [];
@ -977,9 +974,11 @@ showperk( index, perk, ypos )
}
if ( !isDefined( self.perkicon[ index ] ) )
{
/*
/#
assert( !isDefined( self.perkname[ index ] ) );
#/
*/
self.perkicon[ index ] = createloadouticon( self, index, 0, 200, ypos );
self.perkname[ index ] = createloadouttext( self.perkicon[ index ], 160 );
}
@ -994,46 +993,52 @@ showperk( index, perk, ypos )
}
else
{
/*
/#
assert( isDefined( level.perknames[ perk ] ), perk );
#/
*/
alpha = 1;
}
showloadoutattribute( self.perkicon[ index ], perk, alpha, self.perkname[ index ], level.perknames[ perk ] );
self.perkicon[ index ] moveovertime( 0,3 );
self.perkicon[ index ] moveovertime( 0.3 );
self.perkicon[ index ].x = -5;
self.perkicon[ index ].hidewheninmenu = 1;
self.perkname[ index ] moveovertime( 0,3 );
self.perkname[ index ] moveovertime( 0.3 );
self.perkname[ index ].x = -40;
self.perkname[ index ].hidewheninmenu = 1;
}
hideperks( fadetime )
hideperks( fadetime ) //checked matches cerberus output
{
if ( level.perksenabled == 1 )
{
if ( game[ "state" ] == "postgame" )
{
/*
/#
assert( !isDefined( self.perkhudelem ) );
#/
*/
return;
}
}
/*
/#
assert( isDefined( self.perkhudelem ) );
#/
*/
if ( isDefined( self.perkhudelem ) )
{
hideloadoutattribute( self.perkhudelem, fadetime );
}
}
hideperk( index, fadetime, hidetextonly )
hideperk( index, fadetime, hidetextonly ) //checked matches cerberus output
{
if ( !isDefined( fadetime ) )
{
fadetime = 0,05;
fadetime = 0.05;
}
if ( level.perksenabled == 1 )
{
@ -1041,21 +1046,25 @@ hideperk( index, fadetime, hidetextonly )
{
if ( isDefined( self.perkicon ) )
{
/*
/#
assert( !isDefined( self.perkicon[ index ] ) );
#/
/#
assert( !isDefined( self.perkname[ index ] ) );
#/
*/
}
return;
}
/*
/#
assert( isDefined( self.perkicon[ index ] ) );
#/
/#
assert( isDefined( self.perkname[ index ] ) );
#/
*/
if ( isDefined( self.perkicon ) && isDefined( self.perkicon[ index ] ) && isDefined( self.perkname ) && isDefined( self.perkname[ index ] ) )
{
hideloadoutattribute( self.perkicon[ index ], fadetime, self.perkname[ index ], hidetextonly );
@ -1063,7 +1072,7 @@ hideperk( index, fadetime, hidetextonly )
}
}
hideallperks( fadetime, hidetextonly )
hideallperks( fadetime, hidetextonly ) //checked matches cerberus output
{
if ( level.perksenabled == 1 )
{
@ -1071,11 +1080,13 @@ hideallperks( fadetime, hidetextonly )
}
}
showkillstreak( index, killstreak, xpos, ypos )
showkillstreak( index, killstreak, xpos, ypos ) //checked matches cerberus output
{
/*
/#
assert( game[ "state" ] != "postgame" );
#/
*/
if ( !isDefined( self.killstreakicon ) )
{
self.killstreakicon = [];
@ -1090,33 +1101,39 @@ showkillstreak( index, killstreak, xpos, ypos )
}
else
{
/*
/#
assert( isDefined( level.killstreakicons[ killstreak ] ), killstreak );
#/
*/
alpha = 1;
}
showloadoutattribute( self.killstreakicon[ index ], level.killstreakicons[ killstreak ], alpha );
}
hidekillstreak( index, fadetime )
hidekillstreak( index, fadetime ) //checked matches cerberus output
{
if ( iskillstreaksenabled() )
{
if ( game[ "state" ] == "postgame" )
{
/*
/#
assert( !isDefined( self.killstreakicon[ index ] ) );
#/
*/
return;
}
/*
/#
assert( isDefined( self.killstreakicon[ index ] ) );
#/
*/
hideloadoutattribute( self.killstreakicon[ index ], fadetime );
}
}
setgamemodeinfopoint()
setgamemodeinfopoint() //checked matches cerberus output
{
self.x = 11;
self.y = 120;
@ -1125,3 +1142,4 @@ setgamemodeinfopoint()
self.alignx = "left";
self.aligny = "top";
}

View File

@ -1,3 +1,4 @@
//checked includes match cerberus output
#include maps/mp/gametypes/_spawnlogic;
#include maps/mp/gametypes/_callbacksetup;
#include maps/mp/_tacticalinsertion;
@ -5,7 +6,7 @@
#include common_scripts/utility;
#include maps/mp/_utility;
init()
init() //checked changed to match cerberus output dvars taken from beta dump
{
if ( !isDefined( level.gamemodespawndvars ) )
{
@ -13,24 +14,21 @@ init()
}
level init_spawn_system();
level.recently_deceased = [];
_a74 = level.teams;
_k74 = getFirstArrayKey( _a74 );
while ( isDefined( _k74 ) )
foreach ( team in level.teams )
{
team = _a74[ _k74 ];
level.recently_deceased[ team ] = spawn_array_struct();
_k74 = getNextArrayKey( _a74, _k74 );
}
level thread onplayerconnect();
if ( getDvar( #"AD6C19FE" ) == "" )
if ( getDvar( "scr_spawn_visibility_check_max" ) == "" )
{
level.spawn_visibility_check_max = 20;
}
else
{
level.spawn_visibility_check_max = getDvarInt( #"AD6C19FE" );
level.spawn_visibility_check_max = getDvarInt( "scr_spawn_visibility_check_max" );
}
level.spawnprotectiontime = getgametypesetting( "spawnprotectiontime" );
/*
/#
setdvar( "scr_debug_spawn_player", "" );
setdvar( "scr_debug_render_spawn_data", "1" );
@ -39,14 +37,15 @@ init()
level.test_spawn_point_index = 0;
setdvar( "scr_debug_render_spawn_text", "1" );
#/
*/
return;
}
default_gamemodespawndvars( reset_dvars )
default_gamemodespawndvars( reset_dvars ) //checked matches cerberus output
{
}
init_spawn_system()
init_spawn_system() //checked changed to match cerberus output
{
level.spawnsystem = spawnstruct();
spawnsystem = level.spawnsystem;
@ -71,20 +70,16 @@ init_spawn_system()
spawnsystem.ispawn_teammask[ "free" ] = spawnsystem.ispawn_teammask_free;
all = spawnsystem.ispawn_teammask_free;
count = 1;
_a146 = level.teams;
_k146 = getFirstArrayKey( _a146 );
while ( isDefined( _k146 ) )
foreach ( team in level.teams )
{
team = _a146[ _k146 ];
spawnsystem.ispawn_teammask[ team ] = 1 << count;
//spawnsystem.ispawn_teammask[ team ] = 1 << count; //current compiler doesn't support bit shift left/right
all |= spawnsystem.ispawn_teammask[ team ];
count++;
_k146 = getNextArrayKey( _a146, _k146 );
}
spawnsystem.ispawn_teammask[ "all" ] = all;
}
onplayerconnect()
onplayerconnect() //checked matches cerberus output
{
level endon( "game_ended" );
for ( ;; )
@ -98,7 +93,7 @@ onplayerconnect()
}
}
onplayerspawned()
onplayerspawned() //checked matches cerberus output
{
self endon( "disconnect" );
level endon( "game_ended" );
@ -117,7 +112,7 @@ onplayerspawned()
}
}
monitorgpsjammer()
monitorgpsjammer() //checked changed to match cerberus output
{
self endon( "death" );
self endon( "disconnect" );
@ -137,10 +132,12 @@ monitorgpsjammer()
{
return;
}
/*
/#
assert( timeperiodsec >= 0,05 );
assert( timeperiodsec >= 0.05 );
#/
if ( timeperiodsec < 0,05 )
*/
if ( timeperiodsec < 0.05 )
{
return;
}
@ -154,6 +151,7 @@ monitorgpsjammer()
gpsjammerprotection = 0;
while ( 1 )
{
/*
/#
graceperiods = getdvarintdefault( "perk_gpsjammer_graceperiods", graceperiods );
minspeed = getdvarintdefault( "perk_gpsjammer_min_speed", minspeed );
@ -163,32 +161,30 @@ monitorgpsjammer()
minspeedsq = minspeed * minspeed;
mindistancesq = mindistance * mindistance;
#/
*/
gpsjammerprotection = 0;
if ( !isusingremote() || is_true( self.isplanting ) && is_true( self.isdefusing ) )
if ( isusingremote() || is_true( self.isplanting ) || is_true( self.isdefusing ) )
{
gpsjammerprotection = 1;
}
else
else if ( timesincedistancecheck > 1 )
{
if ( timesincedistancecheck > 1 )
timesincedistancecheck = 0;
if ( distancesquared( previousorigin, self.origin ) < mindistancesq )
{
timesincedistancecheck = 0;
if ( distancesquared( previousorigin, self.origin ) < mindistancesq )
{
faileddistancecheck = 1;
}
else
{
faileddistancecheck = 0;
}
previousorigin = self.origin;
faileddistancecheck = 1;
}
velocity = self getvelocity();
speedsq = lengthsquared( velocity );
if ( speedsq > minspeedsq && faileddistancecheck == 0 )
else
{
gpsjammerprotection = 1;
faileddistancecheck = 0;
}
previousorigin = self.origin;
}
velocity = self getvelocity();
speedsq = lengthsquared( velocity );
if ( speedsq > minspeedsq && faileddistancecheck == 0 )
{
gpsjammerprotection = 1;
}
if ( gpsjammerprotection == 1 )
{
@ -219,7 +215,7 @@ monitorgpsjammer()
}
}
ondeath()
ondeath() //checked matches cerberus output
{
self endon( "disconnect" );
level endon( "game_ended" );
@ -228,7 +224,7 @@ ondeath()
self create_body_influencers();
}
onteamchange()
onteamchange() //checked matches cerberus output
{
self endon( "disconnect" );
level endon( "game_ended" );
@ -236,11 +232,11 @@ onteamchange()
{
self waittill( "joined_team" );
self player_influencers_set_team();
wait 0,05;
wait 0.05;
}
}
ongrenadethrow()
ongrenadethrow() //checked matches cerberus output
{
self endon( "disconnect" );
level endon( "game_ended" );
@ -248,17 +244,17 @@ ongrenadethrow()
{
self waittill( "grenade_fire", grenade, weaponname );
level thread create_grenade_influencers( self.pers[ "team" ], weaponname, grenade );
wait 0,05;
wait 0.05;
}
}
ondisconnect()
ondisconnect() //checked matches cerberus output
{
level endon( "game_ended" );
self waittill( "disconnect" );
}
get_score_curve_index( curve )
get_score_curve_index( curve ) //checked matches cerberus output
{
switch( curve )
{
@ -276,12 +272,13 @@ get_score_curve_index( curve )
}
}
get_influencer_type_index( curve )
get_influencer_type_index( curve ) //checked matches cerberus output
{
}
create_player_influencers()
create_player_influencers() //checked changed to match cerberus output
{
/*
/#
assert( !isDefined( self.influencer_enemy_sphere ) );
#/
@ -300,6 +297,7 @@ create_player_influencers()
assert( !isDefined( self.influencer_friendly_cylinder ) );
}
#/
*/
if ( !level.teambased )
{
team_mask = level.spawnsystem.ispawn_teammask_free;
@ -325,8 +323,8 @@ create_player_influencers()
}
angles = self.angles;
origin = self.origin;
up = ( 0, 0, 0 );
forward = ( 0, 0, 0 );
up = ( 0, 0, 1 );
forward = ( 1, 0, 0 );
cylinder_forward = up;
cylinder_up = forward;
self.influencer_enemy_sphere = addsphereinfluencer( level.spawnsystem.einfluencer_type_player, origin, level.spawnsystem.enemy_influencer_radius, level.spawnsystem.enemy_influencer_score, other_team_mask, "enemy,r,s", get_score_curve_index( level.spawnsystem.enemy_influencer_score_curve ), 0, self );
@ -342,7 +340,7 @@ create_player_influencers()
}
}
remove_player_influencers()
remove_player_influencers() //checked matches cerberus output
{
if ( level.teambased && isDefined( self.influencer_friendly_sphere ) )
{
@ -366,7 +364,7 @@ remove_player_influencers()
}
}
enable_player_influencers( enabled )
enable_player_influencers( enabled ) //checked matches cerberus output
{
if ( !isDefined( self.spawn_influencers_created ) )
{
@ -390,7 +388,7 @@ enable_player_influencers( enabled )
}
}
player_influencers_set_team()
player_influencers_set_team() //checked matches cerberus output
{
if ( !level.teambased )
{
@ -427,7 +425,7 @@ player_influencers_set_team()
}
}
create_body_influencers()
create_body_influencers() //checked matches cerberus output
{
if ( level.teambased )
{
@ -440,7 +438,7 @@ create_body_influencers()
addsphereinfluencer( level.spawnsystem.einfluencer_type_normal, self.origin, level.spawnsystem.dead_friend_influencer_radius, level.spawnsystem.dead_friend_influencer_score, team_mask, "dead_friend,r,s", get_score_curve_index( level.spawnsystem.dead_friend_influencer_score_curve ), level.spawnsystem.dead_friend_influencer_timeout_seconds );
}
create_grenade_influencers( parent_team, weaponname, grenade )
create_grenade_influencers( parent_team, weaponname, grenade ) //checked matches cerberus output
{
pixbeginevent( "create_grenade_influencers" );
if ( !level.teambased )
@ -479,7 +477,7 @@ create_grenade_influencers( parent_team, weaponname, grenade )
pixendevent();
}
create_napalm_fire_influencers( point, direction, parent_team, duration )
create_napalm_fire_influencers( point, direction, parent_team, duration ) //checked matches cerberus output
{
timeout = duration;
weapon_team_mask = 0;
@ -490,7 +488,7 @@ create_napalm_fire_influencers( point, direction, parent_team, duration )
addsphereinfluencer( level.spawnsystem.einfluencer_type_normal, point - offset, level.spawnsystem.napalm_influencer_radius, level.spawnsystem.napalm_influencer_score, weapon_team_mask, "napalm,r,s", get_score_curve_index( level.spawnsystem.napalm_influencer_score_curve ), timeout );
}
create_auto_turret_influencer( point, parent_team, angles )
create_auto_turret_influencer( point, parent_team, angles ) //checked matches cerberus output
{
if ( !level.teambased )
{
@ -500,12 +498,12 @@ create_auto_turret_influencer( point, parent_team, angles )
{
weapon_team_mask = getotherteamsmask( parent_team );
}
projected_point = point + vectorScale( anglesToForward( angles ), level.spawnsystem.auto_turret_influencer_radius * 0,7 );
projected_point = point + vectorScale( anglesToForward( angles ), level.spawnsystem.auto_turret_influencer_radius * 0.7 );
influencerid = addsphereinfluencer( level.spawnsystem.einfluencer_type_normal, projected_point, level.spawnsystem.auto_turret_influencer_radius, level.spawnsystem.auto_turret_influencer_score, weapon_team_mask, "auto_turret,r,s", get_score_curve_index( level.spawnsystem.auto_turret_influencer_score_curve ) );
return influencerid;
}
create_auto_turret_influencer_close( point, parent_team, angles )
create_auto_turret_influencer_close( point, parent_team, angles ) //checked matches cerberus output
{
if ( !level.teambased )
{
@ -515,12 +513,12 @@ create_auto_turret_influencer_close( point, parent_team, angles )
{
weapon_team_mask = getotherteamsmask( parent_team );
}
projected_point = point + vectorScale( anglesToForward( angles ), level.spawnsystem.auto_turret_influencer_close_radius * 0,7 );
projected_point = point + vectorScale( anglesToForward( angles ), level.spawnsystem.auto_turret_influencer_close_radius * 0.7 );
influencerid = addsphereinfluencer( level.spawnsystem.einfluencer_type_normal, projected_point, level.spawnsystem.auto_turret_influencer_close_radius, level.spawnsystem.auto_turret_influencer_close_score, weapon_team_mask, "auto_turret_close,r,s", get_score_curve_index( level.spawnsystem.auto_turret_influencer_close_score_curve ) );
return influencerid;
}
create_dog_influencers()
create_dog_influencers() //checked matches cerberus output
{
if ( !level.teambased )
{
@ -533,7 +531,7 @@ create_dog_influencers()
addsphereinfluencer( level.spawnsystem.einfluencer_type_dog, self.origin, level.spawnsystem.dog_influencer_radius, level.spawnsystem.dog_influencer_score, dog_enemy_team_mask, "dog,r,s", get_score_curve_index( level.spawnsystem.dog_influencer_score_curve ), 0, self );
}
create_helicopter_influencers( parent_team )
create_helicopter_influencers( parent_team ) //checked matches cerberus output
{
if ( !level.teambased )
{
@ -546,7 +544,7 @@ create_helicopter_influencers( parent_team )
self.influencer_helicopter_cylinder = addcylinderinfluencer( level.spawnsystem.einfluencer_type_normal, self.origin, ( 0, 0, 0 ), ( 0, 0, 0 ), level.spawnsystem.helicopter_influencer_radius, level.spawnsystem.helicopter_influencer_length, level.spawnsystem.helicopter_influencer_score, team_mask, "helicopter,r,s", get_score_curve_index( level.spawnsystem.helicopter_influencer_score_curve ), 0, self );
}
remove_helicopter_influencers()
remove_helicopter_influencers() //checked matches cerberus output
{
if ( isDefined( self.influencer_helicopter_cylinder ) )
{
@ -555,7 +553,7 @@ remove_helicopter_influencers()
self.influencer_helicopter_cylinder = undefined;
}
create_tvmissile_influencers( parent_team )
create_tvmissile_influencers( parent_team ) //checked matches cerberus output
{
if ( !level.teambased || is_hardcore() )
{
@ -568,7 +566,7 @@ create_tvmissile_influencers( parent_team )
self.influencer_tvmissile_cylinder = addcylinderinfluencer( level.spawnsystem.einfluencer_type_normal, self.origin, ( 0, 0, 0 ), ( 0, 0, 0 ), level.spawnsystem.tvmissile_influencer_radius, level.spawnsystem.tvmissile_influencer_length, level.spawnsystem.tvmissile_influencer_score, team_mask, "tvmissile,r,s", get_score_curve_index( level.spawnsystem.tvmissile_influencer_score_curve ), 0, self );
}
remove_tvmissile_influencers()
remove_tvmissile_influencers() //checked matches cerberus output
{
if ( isDefined( self.influencer_tvmissile_cylinder ) )
{
@ -577,7 +575,7 @@ remove_tvmissile_influencers()
self.influencer_tvmissile_cylinder = undefined;
}
create_artillery_influencers( point, radius )
create_artillery_influencers( point, radius ) //checked changed to match cerberus output
{
weapon_team_mask = 0;
if ( radius < 0 )
@ -588,22 +586,22 @@ create_artillery_influencers( point, radius )
{
thisradius = radius;
}
return addcylinderinfluencer( level.spawnsystem.einfluencer_type_normal, point + vectorScale( ( 0, 0, 0 ), 2000 ), ( 0, 0, 0 ), ( 0, 0, 0 ), thisradius, 5000, level.spawnsystem.artillery_influencer_score, weapon_team_mask, "artillery,s,r", get_score_curve_index( level.spawnsystem.artillery_influencer_score_curve ), 7 );
return addcylinderinfluencer( level.spawnsystem.einfluencer_type_normal, point + vectorScale( ( 0, 0, 0 ), 2000 ), ( 1, 0, 0 ), ( 0, 0, 1 ), thisradius, 5000, level.spawnsystem.artillery_influencer_score, weapon_team_mask, "artillery,s,r", get_score_curve_index( level.spawnsystem.artillery_influencer_score_curve ), 7 );
}
create_vehicle_influencers()
create_vehicle_influencers() //checked changed to match cerberus output
{
weapon_team_mask = 0;
vehicleradius = 144;
cylinderlength = level.spawnsystem.vehicle_influencer_lead_seconds;
up = ( 0, 0, 0 );
forward = ( 0, 0, 0 );
up = ( 0, 0, 1 );
forward = ( 1, 0, 0 );
cylinder_forward = up;
cylinder_up = forward;
return addcylinderinfluencer( level.spawnsystem.einfluencer_type_vehicle, self.origin, cylinder_forward, cylinder_up, vehicleradius, cylinderlength, level.spawnsystem.vehicle_influencer_score, weapon_team_mask, "vehicle,s", get_score_curve_index( level.spawnsystem.vehicle_influencer_score_curve ), 0, self );
}
create_rcbomb_influencers( team )
create_rcbomb_influencers( team ) //checked matches cerberus output
{
if ( !level.teambased )
{
@ -616,7 +614,7 @@ create_rcbomb_influencers( team )
return addsphereinfluencer( level.spawnsystem.einfluencer_type_normal, self.origin, level.spawnsystem.rcbomb_influencer_radius, level.spawnsystem.rcbomb_influencer_score, other_team_mask, "rcbomb,r,s", get_score_curve_index( level.spawnsystem.rcbomb_influencer_score_curve ), 0, self );
}
create_qrdrone_influencers( team )
create_qrdrone_influencers( team ) //checked matches cerberus output
{
if ( !level.teambased )
{
@ -630,7 +628,7 @@ create_qrdrone_influencers( team )
return addsphereinfluencer( level.spawnsystem.einfluencer_type_normal, self.origin, level.spawnsystem.qrdrone_influencer_radius, level.spawnsystem.qrdrone_influencer_score, other_team_mask, "qrdrone,r,s", get_score_curve_index( level.spawnsystem.qrdrone_influencer_score_curve ), 0, self );
}
create_aitank_influencers( team )
create_aitank_influencers( team ) //checked matches cerberus output
{
if ( !level.teambased )
{
@ -643,7 +641,7 @@ create_aitank_influencers( team )
return addsphereinfluencer( level.spawnsystem.einfluencer_type_normal, self.origin, level.spawnsystem.aitank_influencer_radius, level.spawnsystem.aitank_influencer_score, other_team_mask, "aitank,r,s", get_score_curve_index( level.spawnsystem.aitank_influencer_score_curve ), 0, self );
}
create_pegasus_influencer( origin, team )
create_pegasus_influencer( origin, team ) //checked matches cerberus output
{
if ( !level.teambased )
{
@ -656,7 +654,7 @@ create_pegasus_influencer( origin, team )
return addsphereinfluencer( level.spawnsystem.einfluencer_type_normal, origin, level.spawnsystem.pegasus_influencer_radius, level.spawnsystem.pegasus_influencer_score, other_team_mask, "pegasus,r,s", get_score_curve_index( level.spawnsystem.pegasus_influencer_score_curve ), 0 );
}
create_map_placed_influencers()
create_map_placed_influencers() //checked partially changed to match cerberus output see info.md
{
staticinfluencerents = getentarray( "mp_uspawn_influencer", "classname" );
i = 0;
@ -668,15 +666,12 @@ create_map_placed_influencers()
i++;
continue;
}
else
{
create_map_placed_influencer( staticinfluencerent );
}
create_map_placed_influencer( staticinfluencerent );
i++;
}
}
create_map_placed_influencer( influencer_entity, optional_score_override )
create_map_placed_influencer( influencer_entity, optional_score_override ) //checked matches cerberus output
{
influencer_id = -1;
if ( isDefined( influencer_entity.script_shape ) && isDefined( influencer_entity.script_score ) && isDefined( influencer_entity.script_score_curve ) )
@ -698,9 +693,11 @@ create_map_placed_influencer( influencer_entity, optional_score_override )
}
else
{
/*
/#
assertmsg( "Radiant-placed sphere spawn influencers require 'radius' parameter" );
#/
*/
}
break;
case "cylinder":
@ -718,28 +715,34 @@ create_map_placed_influencer( influencer_entity, optional_score_override )
}
else
{
/*
/#
assertmsg( "Radiant-placed cylinder spawn influencers require 'radius' and 'height' parameters" );
#/
*/
}
break;
default:
/*
/#
assertmsg( "Unsupported script_shape value ("" + influencer_entity.script_shape + "") for unified spawning system static influencer. Supported shapes are "cylinder" and "sphere"." );
#/
*/
break;
}
}
else
{
/*
/#
assertmsg( "Radiant-placed spawn influencers require 'script_shape', 'script_score' and 'script_score_curve' parameters" );
#/
*/
}
return influencer_id;
}
create_enemy_spawned_influencers( origin, team )
create_enemy_spawned_influencers( origin, team ) //checked matches cerberus output
{
if ( !level.teambased )
{
@ -752,41 +755,33 @@ create_enemy_spawned_influencers( origin, team )
return addsphereinfluencer( level.spawnsystem.einfluencer_type_enemy_spawned, origin, level.spawnsystem.enemy_spawned_influencer_radius, level.spawnsystem.enemy_spawned_influencer_score, other_team_mask, "enemy_spawned,r,s", get_score_curve_index( level.spawnsystem.enemy_spawned_influencer_score_curve ), level.spawnsystem.enemy_spawned_influencer_timeout_seconds );
}
updateallspawnpoints()
updateallspawnpoints() //checked changed to match beta dump
{
_a1176 = level.teams;
_k1176 = getFirstArrayKey( _a1176 );
while ( isDefined( _k1176 ) )
foreach ( team in level.teams )
{
team = _a1176[ _k1176 ];
gatherspawnentities( team );
_k1176 = getNextArrayKey( _a1176, _k1176 );
}
clearspawnpoints();
if ( level.teambased )
{
_a1185 = level.teams;
_k1185 = getFirstArrayKey( _a1185 );
while ( isDefined( _k1185 ) )
foreach ( team in level.teams )
{
team = _a1185[ _k1185 ];
addspawnpoints( team, level.unified_spawn_points[ team ].a );
_k1185 = getNextArrayKey( _a1185, _k1185 );
}
}
else _a1192 = level.teams;
_k1192 = getFirstArrayKey( _a1192 );
while ( isDefined( _k1192 ) )
else
{
team = _a1192[ _k1192 ];
addspawnpoints( "free", level.unified_spawn_points[ team ].a );
_k1192 = getNextArrayKey( _a1192, _k1192 );
foreach ( team in level.teams )
{
addspawnpoints( "free", level.unified_spawn_points[ team ].a );
}
}
remove_unused_spawn_entities();
}
initialize_player_spawning_dvars()
initialize_player_spawning_dvars() //checked matches cerberus output
{
/*
/#
reset_dvars = 1;
while ( 1 )
@ -796,9 +791,10 @@ initialize_player_spawning_dvars()
wait 2;
#/
}
*/
}
get_player_spawning_dvars( reset_dvars )
get_player_spawning_dvars( reset_dvars ) //checked matches cerberus output
{
k_player_height = get_player_height();
player_height_times_10 = "" + ( 10 * k_player_height );
@ -910,16 +906,17 @@ get_player_spawning_dvars( reset_dvars )
setspawnpointrandomvariation( ss.randomness_range );
}
level_use_unified_spawning( use )
level_use_unified_spawning( use ) //checked matches cerberus output
{
}
onspawnplayer_unified( predictedspawn )
onspawnplayer_unified( predictedspawn ) //checked changed to match cerberus output dvar taken from beta dump
{
if ( !isDefined( predictedspawn ) )
{
predictedspawn = 0;
}
/*
/#
if ( getDvarInt( "scr_spawn_point_test_mode" ) != 0 )
{
@ -928,6 +925,7 @@ onspawnplayer_unified( predictedspawn )
return;
#/
}
*/
use_new_spawn_system = 1;
initial_spawn = 1;
if ( isDefined( self.uspawn_already_spawned ) )
@ -944,7 +942,7 @@ onspawnplayer_unified( predictedspawn )
}
set_dvar_if_unset( "scr_spawn_force_unified", "0" );
spawnoverride = self maps/mp/_tacticalinsertion::overridespawn( predictedspawn );
if ( use_new_spawn_system || getDvarInt( #"0BD11226" ) != 0 )
if ( use_new_spawn_system || getDvarInt( "scr_spawn_force_unified" ) != 0 )
{
if ( !spawnoverride )
{
@ -963,18 +961,17 @@ onspawnplayer_unified( predictedspawn )
}
else
{
/*
/#
println( "ERROR: unable to locate a usable spawn point for player" );
#/
*/
maps/mp/gametypes/_callbacksetup::abortlevel();
}
}
else
else if ( predictedspawn && isDefined( self.tacticalinsertion ) )
{
if ( predictedspawn && isDefined( self.tacticalinsertion ) )
{
self predictspawnpoint( self.tacticalinsertion.origin, self.tacticalinsertion.angles );
}
self predictspawnpoint( self.tacticalinsertion.origin, self.tacticalinsertion.angles );
}
if ( !predictedspawn )
{
@ -982,12 +979,9 @@ onspawnplayer_unified( predictedspawn )
self enable_player_influencers( 1 );
}
}
else
else if ( !spawnoverride )
{
if ( !spawnoverride )
{
[[ level.onspawnplayer ]]( predictedspawn );
}
[[ level.onspawnplayer ]]( predictedspawn );
}
if ( !predictedspawn )
{
@ -996,7 +990,7 @@ onspawnplayer_unified( predictedspawn )
return;
}
getspawnpoint( player_entity, predictedspawn )
getspawnpoint( player_entity, predictedspawn ) //checked matches cerberus output
{
if ( !isDefined( predictedspawn ) )
{
@ -1024,7 +1018,7 @@ getspawnpoint( player_entity, predictedspawn )
return best_spawn_entity;
}
get_debug_spawnpoint( player )
get_debug_spawnpoint( player ) //checked changed to match beta dump
{
if ( level.teambased )
{
@ -1039,41 +1033,36 @@ get_debug_spawnpoint( player )
if ( team == "free" )
{
spawn_counts = 0;
_a1556 = level.teams;
_k1556 = getFirstArrayKey( _a1556 );
while ( isDefined( _k1556 ) )
foreach ( team in level.teams )
{
team = _a1556[ _k1556 ];
spawn_counts += level.unified_spawn_points[ team ].a.size;
_k1556 = getNextArrayKey( _a1556, _k1556 );
}
if ( level.test_spawn_point_index >= spawn_counts )
{
level.test_spawn_point_index = 0;
}
count = 0;
_a1567 = level.teams;
_k1567 = getFirstArrayKey( _a1567 );
while ( isDefined( _k1567 ) )
foreach ( team in level.teams )
{
team = _a1567[ _k1567 ];
size = level.unified_spawn_points[ team ].a.size;
if ( level.test_spawn_point_index < ( count + size ) )
{
return level.unified_spawn_points[ team ].a[ level.test_spawn_point_index - count ];
}
count += size;
_k1567 = getNextArrayKey( _a1567, _k1567 );
}
}
else if ( level.test_spawn_point_index >= level.unified_spawn_points[ team ].a.size )
else
{
level.test_spawn_point_index = 0;
if ( level.test_spawn_point_index >= level.unified_spawn_points[ team ].a.size )
{
level.test_spawn_point_index = 0;
}
return level.unified_spawn_points[ team ].a[ level.test_spawn_point_index ];
}
return level.unified_spawn_points[ team ].a[ level.test_spawn_point_index ];
}
get_best_spawnpoint( point_team, influencer_team, player, predictedspawn )
get_best_spawnpoint( point_team, influencer_team, player, predictedspawn ) //checked matches cerberus output
{
if ( level.teambased )
{
@ -1084,12 +1073,14 @@ get_best_spawnpoint( point_team, influencer_team, player, predictedspawn )
vis_team_mask = level.spawnsystem.ispawn_teammask_free;
}
scored_spawn_points = getsortedspawnpoints( point_team, influencer_team, vis_team_mask, player, predictedspawn );
/*
/#
assert( scored_spawn_points.size > 0 );
#/
/#
assert( scored_spawn_points.size == 1 );
#/
*/
if ( !predictedspawn )
{
bbprint( "mpspawnpointsused", "reason %s x %d y %d z %d", "point used", scored_spawn_points[ 0 ].origin );
@ -1097,7 +1088,7 @@ get_best_spawnpoint( point_team, influencer_team, player, predictedspawn )
return scored_spawn_points[ 0 ];
}
gatherspawnentities( player_team )
gatherspawnentities( player_team ) //checked changed to match cerberus output
{
if ( !isDefined( level.unified_spawn_points ) )
{
@ -1117,37 +1108,37 @@ gatherspawnentities( player_team )
spawn_entities_s.a = [];
}
legacy_spawn_points = maps/mp/gametypes/_spawnlogic::getteamspawnpoints( player_team );
legacy_spawn_index = 0;
while ( legacy_spawn_index < legacy_spawn_points.size )
for ( legacy_spawn_index = 0; legacy_spawn_index < legacy_spawn_points.size; legacy_spawn_index++ )
{
spawn_entities_s.a[ spawn_entities_s.a.size ] = legacy_spawn_points[ legacy_spawn_index ];
legacy_spawn_index++;
}
level.unified_spawn_points[ player_team ] = spawn_entities_s;
return spawn_entities_s;
}
is_hardcore()
is_hardcore() //checked changed at own discretion
{
if ( isDefined( level.hardcoremode ) )
if ( isDefined( level.hardcoremode ) && level.hardcoremode )
{
return level.hardcoremode;
return 1;
}
return 0;
}
teams_have_enmity( team1, team2 )
{
if ( isDefined( team1 ) || !isDefined( team2 ) && level.gametype == "dm" )
if ( isDefined( team1 ) || !isDefined( team2 ) || level.gametype == "dm" )
{
return 1;
}
if ( team1 != "neutral" && team2 != "neutral" )
if ( team1 != "neutral" && team2 != "neutral" && team1 != team2 )
{
return team1 != team2;
return 1;
}
return 0;
}
remove_unused_spawn_entities()
remove_unused_spawn_entities() //checked partially changed to match cerberus output see info.md
{
spawn_entity_types = [];
spawn_entity_types[ spawn_entity_types.size ] = "mp_dm_spawn";
@ -1193,58 +1184,47 @@ remove_unused_spawn_entities()
i++;
continue;
}
else
{
spawnpoints = maps/mp/gametypes/_spawnlogic::getspawnpointarray( spawn_entity_types[ i ] );
delete_all_spawns( spawnpoints );
}
spawnpoints = maps/mp/gametypes/_spawnlogic::getspawnpointarray( spawn_entity_types[ i ] );
delete_all_spawns( spawnpoints );
i++;
}
}
delete_all_spawns( spawnpoints )
delete_all_spawns( spawnpoints ) //checked changed to match cerberus output
{
i = 0;
while ( i < spawnpoints.size )
for ( i = 0; i < spawnpoints.size; i++ )
{
spawnpoints[ i ] delete();
i++;
}
}
spawn_point_class_name_being_used( name )
spawn_point_class_name_being_used( name ) //checked changed to match cerberus output
{
if ( !isDefined( level.spawn_point_class_names ) )
{
return 0;
}
i = 0;
while ( i < level.spawn_point_class_names.size )
for ( i = 0; i < level.spawn_point_class_names.size; i++ )
{
if ( level.spawn_point_class_names[ i ] == name )
{
return 1;
}
i++;
}
return 0;
}
codecallback_updatespawnpoints()
codecallback_updatespawnpoints() //checked changed to match cerberus output
{
_a1788 = level.teams;
_k1788 = getFirstArrayKey( _a1788 );
while ( isDefined( _k1788 ) )
foreach ( team in level.teams )
{
team = _a1788[ _k1788 ];
maps/mp/gametypes/_spawnlogic::rebuildspawnpoints( team );
_k1788 = getNextArrayKey( _a1788, _k1788 );
}
level.unified_spawn_points = undefined;
updateallspawnpoints();
}
initialspawnprotection()
initialspawnprotection() //checked matches cerberus output
{
self endon( "death" );
self endon( "disconnect" );
@ -1260,7 +1240,7 @@ initialspawnprotection()
self.specialty_nottargetedbyairsupport = undefined;
}
getteamstartspawnname( team, spawnpointnamebase )
getteamstartspawnname( team, spawnpointnamebase ) //checked changed to match cerberus output
{
spawn_point_team_name = team;
if ( !level.multiteam && game[ "switchedsides" ] )
@ -1273,12 +1253,9 @@ getteamstartspawnname( team, spawnpointnamebase )
{
spawn_point_team_name = "team1";
}
else
else if ( team == "allies" )
{
if ( team == "allies" )
{
spawn_point_team_name = "team2";
}
spawn_point_team_name = "team2";
}
if ( !isoneround() )
{
@ -1290,7 +1267,9 @@ getteamstartspawnname( team, spawnpointnamebase )
return ( spawnpointnamebase + "_" ) + spawn_point_team_name + "_start";
}
gettdmstartspawnname( team )
gettdmstartspawnname( team ) //checked matches cerberus output
{
return getteamstartspawnname( team, "mp_tdm_spawn" );
}

View File

@ -52,6 +52,8 @@ 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.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
@ -60,6 +62,7 @@ patch_mp/maps/mp/gametypes/_persistence.gsc
patch_mp/maps/mp/gametypes/_pregame.gsc
patch_mp/maps/mp/gametypes/_rank.gsc
patch_mp/maps/mp/gametypes/_serversettings.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
@ -177,10 +180,6 @@ patch_mp/maps/mp/mp_uplink.gsc
patch_mp/maps/mp/mp_vertigo.gsc
patch_mp/maps/mp/mp_village.gsc
patch_mp/maps/mp/gametypes/_hud_message.gsc
patch_mp/maps/mp/gametypes/_hud_util.gsc
patch_mp/maps/mp/gametypes/_spawning.gsc
patch_mp/maps/mp/killstreaks/_ai_tank.gsc
patch_mp/maps/mp/killstreaks/_airsupport.gsc
patch_mp/maps/mp/killstreaks/_dogs.gsc