checked 8 scripts 5 for mp only 3 for both mp and zombies

checked _clientids, _scoreboard, and _spectating for mp and zombies. Checked_deathicons, _friendicons, _killcam, _objpoints, and _rank for mp.
This commit is contained in:
JezuzLizard 2020-05-08 23:17:16 -07:00
parent d0b1a4648e
commit ec75d8b49a
13 changed files with 407 additions and 477 deletions

View File

@ -1,11 +1,11 @@
init() init() //checked matches cerberus output
{ {
level.clientid = 0; level.clientid = 0;
level thread onplayerconnect(); level thread onplayerconnect();
} }
onplayerconnect() onplayerconnect() //checked matches cerberus output
{ {
for ( ;; ) for ( ;; )
{ {

View File

@ -1,7 +1,8 @@
//checked includes match cerberus output
#include maps/mp/gametypes/_deathicons; #include maps/mp/gametypes/_deathicons;
#include maps/mp/gametypes/_globallogic_utils; #include maps/mp/gametypes/_globallogic_utils;
init() init() //checked matches cerberus output
{ {
if ( !isDefined( level.ragdoll_override ) ) if ( !isDefined( level.ragdoll_override ) )
{ {
@ -15,7 +16,7 @@ init()
level thread onplayerconnect(); level thread onplayerconnect();
} }
onplayerconnect() onplayerconnect() //checked matches cerberus output
{ {
for ( ;; ) for ( ;; )
{ {
@ -24,11 +25,11 @@ onplayerconnect()
} }
} }
updatedeathiconsenabled() updatedeathiconsenabled() //checked matches cerberus output
{ {
} }
adddeathicon( entity, dyingplayer, team, timeout ) adddeathicon( entity, dyingplayer, team, timeout ) //checked matches cerberus output
{ {
if ( !level.teambased ) if ( !level.teambased )
{ {
@ -37,11 +38,13 @@ adddeathicon( entity, dyingplayer, team, timeout )
iconorg = entity.origin; iconorg = entity.origin;
dyingplayer endon( "spawned_player" ); dyingplayer endon( "spawned_player" );
dyingplayer endon( "disconnect" ); dyingplayer endon( "disconnect" );
wait 0,05; wait 0.05;
maps/mp/gametypes/_globallogic_utils::waittillslowprocessallowed(); maps/mp/gametypes/_globallogic_utils::waittillslowprocessallowed();
/*
/# /#
assert( isDefined( level.teams[ team ] ) ); assert( isDefined( level.teams[ team ] ) );
#/ #/
*/
if ( getDvar( "ui_hud_showdeathicons" ) == "0" ) if ( getDvar( "ui_hud_showdeathicons" ) == "0" )
{ {
return; return;
@ -58,7 +61,7 @@ adddeathicon( entity, dyingplayer, team, timeout )
newdeathicon.x = iconorg[ 0 ]; newdeathicon.x = iconorg[ 0 ];
newdeathicon.y = iconorg[ 1 ]; newdeathicon.y = iconorg[ 1 ];
newdeathicon.z = iconorg[ 2 ] + 54; newdeathicon.z = iconorg[ 2 ] + 54;
newdeathicon.alpha = 0,61; newdeathicon.alpha = 0.61;
newdeathicon.archived = 1; newdeathicon.archived = 1;
if ( level.splitscreen ) if ( level.splitscreen )
{ {
@ -73,7 +76,7 @@ adddeathicon( entity, dyingplayer, team, timeout )
newdeathicon thread destroyslowly( timeout ); newdeathicon thread destroyslowly( timeout );
} }
destroyslowly( timeout ) destroyslowly( timeout ) //checked matches cerberus output
{ {
self endon( "death" ); self endon( "death" );
wait timeout; wait timeout;
@ -83,7 +86,7 @@ destroyslowly( timeout )
self destroy(); self destroy();
} }
ragdoll_override( idamage, smeansofdeath, sweapon, shitloc, vdir, vattackerorigin, deathanimduration, einflictor, ragdoll_jib, body ) ragdoll_override( idamage, smeansofdeath, sweapon, shitloc, vdir, vattackerorigin, deathanimduration, einflictor, ragdoll_jib, body ) //checked matches cerberus output
{ {
if ( smeansofdeath == "MOD_FALLING" && self isonground() == 1 ) if ( smeansofdeath == "MOD_FALLING" && self isonground() == 1 )
{ {
@ -96,3 +99,4 @@ ragdoll_override( idamage, smeansofdeath, sweapon, shitloc, vdir, vattackerorigi
} }
return 0; return 0;
} }

View File

@ -1,5 +1,5 @@
init() init() //checked matches cerberus output
{ {
if ( level.createfx_enabled || sessionmodeiszombiesgame() ) if ( level.createfx_enabled || sessionmodeiszombiesgame() )
{ {
@ -10,12 +10,14 @@ init()
setdvar( "scr_drawfriend", "0" ); setdvar( "scr_drawfriend", "0" );
} }
level.drawfriend = getDvarInt( "scr_drawfriend" ); level.drawfriend = getDvarInt( "scr_drawfriend" );
/*
/# /#
assert( isDefined( game[ "headicon_allies" ] ), "Allied head icons are not defined. Check the team set for the level." ); assert( isDefined( game[ "headicon_allies" ] ), "Allied head icons are not defined. Check the team set for the level." );
#/ #/
/# /#
assert( isDefined( game[ "headicon_axis" ] ), "Axis head icons are not defined. Check the team set for the level." ); assert( isDefined( game[ "headicon_axis" ] ), "Axis head icons are not defined. Check the team set for the level." );
#/ #/
*/
precacheheadicon( game[ "headicon_allies" ] ); precacheheadicon( game[ "headicon_allies" ] );
precacheheadicon( game[ "headicon_axis" ] ); precacheheadicon( game[ "headicon_axis" ] );
level thread onplayerconnect(); level thread onplayerconnect();
@ -26,7 +28,7 @@ init()
} }
} }
onplayerconnect() onplayerconnect() //checked matches cerberus output
{ {
for ( ;; ) for ( ;; )
{ {
@ -36,7 +38,7 @@ onplayerconnect()
} }
} }
onplayerspawned() onplayerspawned() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) for ( ;; )
@ -46,7 +48,7 @@ onplayerspawned()
} }
} }
onplayerkilled() onplayerkilled() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) for ( ;; )
@ -56,7 +58,7 @@ onplayerkilled()
} }
} }
showfriendicon() showfriendicon() //checked matches cerberus output
{ {
if ( level.drawfriend ) if ( level.drawfriend )
{ {
@ -66,7 +68,7 @@ showfriendicon()
} }
} }
updatefriendiconsettings() updatefriendiconsettings() //checked matches cerberus output
{ {
drawfriend = getDvarFloat( "scr_drawfriend" ); drawfriend = getDvarFloat( "scr_drawfriend" );
if ( level.drawfriend != drawfriend ) if ( level.drawfriend != drawfriend )
@ -79,35 +81,29 @@ updatefriendiconsettings()
updatefriendicons() updatefriendicons()
{ {
players = level.players; players = level.players;
i = 0; for ( i = 0; i < players.size; i++ )
while ( i < players.size )
{ {
player = players[ i ]; player = players[ i ];
while ( isDefined( player.pers[ "team" ] ) && player.pers[ "team" ] != "spectator" && player.sessionstate == "playing" ) if ( isDefined( player.pers[ "team" ] ) && player.pers[ "team" ] != "spectator" && player.sessionstate == "playing" )
{ {
if ( level.drawfriend ) if ( level.drawfriend )
{ {
team = self.pers[ "team" ]; team = self.pers[ "team" ];
self.headicon = game[ "headicon_" + team ]; self.headicon = game[ "headicon_" + team ];
self.headiconteam = team; self.headiconteam = team;
i++; break;
continue;
} }
else players = level.players;
for ( j = 0; i < players.size; j++ )
{ {
players = level.players; player = players[ j ];
i = 0; if ( isDefined( player.pers[ "team" ] ) && player.pers[ "team" ] != "spectator" && player.sessionstate == "playing" )
while ( i < players.size )
{ {
player = players[ i ]; player.headicon = "";
if ( isDefined( player.pers[ "team" ] ) && player.pers[ "team" ] != "spectator" && player.sessionstate == "playing" )
{
player.headicon = "";
}
i++;
} }
} }
} }
i++; i++;
} }
} }

View File

@ -6,7 +6,7 @@
#include maps/mp/gametypes/_hud_util; #include maps/mp/gametypes/_hud_util;
#include maps/mp/_utility; #include maps/mp/_utility;
init() init() //checked matches cerberus output
{ {
precachestring( &"PLATFORM_PRESS_TO_SKIP" ); precachestring( &"PLATFORM_PRESS_TO_SKIP" );
precachestring( &"PLATFORM_PRESS_TO_RESPAWN" ); precachestring( &"PLATFORM_PRESS_TO_RESPAWN" );
@ -16,28 +16,24 @@ init()
initfinalkillcam(); initfinalkillcam();
} }
initfinalkillcam() initfinalkillcam() //checked changed to match cerberus output
{ {
level.finalkillcamsettings = []; level.finalkillcamsettings = [];
initfinalkillcamteam( "none" ); initfinalkillcamteam( "none" );
_a23 = level.teams; foreach ( team in level.teams )
_k23 = getFirstArrayKey( _a23 );
while ( isDefined( _k23 ) )
{ {
team = _a23[ _k23 ];
initfinalkillcamteam( team ); initfinalkillcamteam( team );
_k23 = getNextArrayKey( _a23, _k23 );
} }
level.finalkillcam_winner = undefined; level.finalkillcam_winner = undefined;
} }
initfinalkillcamteam( team ) initfinalkillcamteam( team ) //checked matches cerberus output
{ {
level.finalkillcamsettings[ team ] = spawnstruct(); level.finalkillcamsettings[ team ] = spawnstruct();
clearfinalkillcamteam( team ); clearfinalkillcamteam( team );
} }
clearfinalkillcamteam( team ) clearfinalkillcamteam( team ) //checked matches cerberus output
{ {
level.finalkillcamsettings[ team ].spectatorclient = undefined; level.finalkillcamsettings[ team ].spectatorclient = undefined;
level.finalkillcamsettings[ team ].weapon = undefined; level.finalkillcamsettings[ team ].weapon = undefined;
@ -52,7 +48,7 @@ clearfinalkillcamteam( team )
level.finalkillcamsettings[ team ].attacker = undefined; level.finalkillcamsettings[ team ].attacker = undefined;
} }
recordkillcamsettings( spectatorclient, targetentityindex, sweapon, deathtime, deathtimeoffset, offsettime, entityindex, entitystarttime, perks, killstreaks, attacker ) recordkillcamsettings( spectatorclient, targetentityindex, sweapon, deathtime, deathtimeoffset, offsettime, entityindex, entitystarttime, perks, killstreaks, attacker ) //checked matches cerberus output
{ {
if ( level.teambased && isDefined( attacker.team ) && isDefined( level.teams[ attacker.team ] ) ) if ( level.teambased && isDefined( attacker.team ) && isDefined( level.teams[ attacker.team ] ) )
{ {
@ -82,21 +78,17 @@ recordkillcamsettings( spectatorclient, targetentityindex, sweapon, deathtime, d
level.finalkillcamsettings[ "none" ].attacker = attacker; level.finalkillcamsettings[ "none" ].attacker = attacker;
} }
erasefinalkillcam() erasefinalkillcam() //checked changed to match cerberus output
{ {
clearfinalkillcamteam( "none" ); clearfinalkillcamteam( "none" );
_a89 = level.teams; foreach ( team in level.teams )
_k89 = getFirstArrayKey( _a89 );
while ( isDefined( _k89 ) )
{ {
team = _a89[ _k89 ];
clearfinalkillcamteam( team ); clearfinalkillcamteam( team );
_k89 = getNextArrayKey( _a89, _k89 );
} }
level.finalkillcam_winner = undefined; level.finalkillcam_winner = undefined;
} }
finalkillcamwaiter() finalkillcamwaiter() //checked matches cerberus output
{ {
if ( !isDefined( level.finalkillcam_winner ) ) if ( !isDefined( level.finalkillcam_winner ) )
{ {
@ -106,7 +98,7 @@ finalkillcamwaiter()
return 1; return 1;
} }
postroundfinalkillcam() postroundfinalkillcam() //checked matches cerberus output
{ {
if ( isDefined( level.sidebet ) && level.sidebet ) if ( isDefined( level.sidebet ) && level.sidebet )
{ {
@ -117,7 +109,7 @@ postroundfinalkillcam()
finalkillcamwaiter(); finalkillcamwaiter();
} }
dofinalkillcam() dofinalkillcam() //checked changed to match cerberus output
{ {
level waittill( "play_final_killcam" ); level waittill( "play_final_killcam" );
level.infinalkillcam = 1; level.infinalkillcam = 1;
@ -138,45 +130,41 @@ dofinalkillcam()
} }
visionsetnaked( getDvar( "mapname" ), 0 ); visionsetnaked( getDvar( "mapname" ), 0 );
players = level.players; players = level.players;
index = 0; for ( index = 0; index < players.size; index++ )
while ( index < players.size )
{ {
player = players[ index ]; player = players[ index ];
player closemenu(); player closemenu();
player closeingamemenu(); player closeingamemenu();
player thread finalkillcam( winner ); player thread finalkillcam( winner );
index++;
} }
wait 0,1; wait 0.1;
while ( areanyplayerswatchingthekillcam() ) while ( areanyplayerswatchingthekillcam() )
{ {
wait 0,05; wait 0.05;
} }
level notify( "final_killcam_done" ); level notify( "final_killcam_done" );
level.infinalkillcam = 0; level.infinalkillcam = 0;
} }
startlastkillcam() startlastkillcam() //checked matches cerberus output
{ {
} }
areanyplayerswatchingthekillcam() areanyplayerswatchingthekillcam() //checked changed to match cerberus output
{ {
players = level.players; players = level.players;
index = 0; for ( index = 0; index < players.size; index++ )
while ( index < players.size )
{ {
player = players[ index ]; player = players[ index ];
if ( isDefined( player.killcam ) ) if ( isDefined( player.killcam ) )
{ {
return 1; return 1;
} }
index++;
} }
return 0; return 0;
} }
killcam( attackernum, targetnum, killcamentity, killcamentityindex, killcamentitystarttime, sweapon, deathtime, deathtimeoffset, offsettime, respawn, maxtime, perks, killstreaks, attacker ) killcam( attackernum, targetnum, killcamentity, killcamentityindex, killcamentitystarttime, sweapon, deathtime, deathtimeoffset, offsettime, respawn, maxtime, perks, killstreaks, attacker ) //checked changed to match cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "spawned" ); self endon( "spawned" );
@ -222,18 +210,14 @@ killcam( attackernum, targetnum, killcamentity, killcamentityindex, killcamentit
self.killcamlength = killcamlength; self.killcamlength = killcamlength;
self.psoffsettime = offsettime; self.psoffsettime = offsettime;
recordkillcamsettings( attackernum, targetnum, sweapon, deathtime, deathtimeoffset, offsettime, killcamentityindex, killcamentitystarttime, perks, killstreaks, attacker ); recordkillcamsettings( attackernum, targetnum, sweapon, deathtime, deathtimeoffset, offsettime, killcamentityindex, killcamentitystarttime, perks, killstreaks, attacker );
_a268 = level.teams; foreach ( team in level.teams )
_k268 = getFirstArrayKey( _a268 );
while ( isDefined( _k268 ) )
{ {
team = _a268[ _k268 ];
self allowspectateteam( team, 1 ); self allowspectateteam( team, 1 );
_k268 = getNextArrayKey( _a268, _k268 );
} }
self allowspectateteam( "freelook", 1 ); self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 ); self allowspectateteam( "none", 1 );
self thread endedkillcamcleanup(); self thread endedkillcamcleanup();
wait 0,05; wait 0.05;
if ( self.archivetime <= predelay ) if ( self.archivetime <= predelay )
{ {
self.sessionstate = "dead"; self.sessionstate = "dead";
@ -266,7 +250,7 @@ killcam( attackernum, targetnum, killcamentity, killcamentityindex, killcamentit
self.psoffsettime = 0; self.psoffsettime = 0;
} }
setkillcamentity( killcamentityindex, delayms ) setkillcamentity( killcamentityindex, delayms ) //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "end_killcam" ); self endon( "end_killcam" );
@ -278,15 +262,15 @@ setkillcamentity( killcamentityindex, delayms )
self.killcamentity = killcamentityindex; self.killcamentity = killcamentityindex;
} }
waitkillcamtime() waitkillcamtime() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "end_killcam" ); self endon( "end_killcam" );
wait ( self.killcamlength - 0,05 ); wait ( self.killcamlength - 0.05 );
self notify( "end_killcam" ); self notify( "end_killcam" );
} }
waitfinalkillcamslowdown( deathtime, starttime ) waitfinalkillcamslowdown( deathtime, starttime ) //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "end_killcam" ); self endon( "end_killcam" );
@ -295,30 +279,30 @@ waitfinalkillcamslowdown( deathtime, starttime )
waitbeforedeath = 2; waitbeforedeath = 2;
maps/mp/_utility::setclientsysstate( "levelNotify", "fkcb" ); maps/mp/_utility::setclientsysstate( "levelNotify", "fkcb" );
wait max( 0, secondsuntildeath - waitbeforedeath ); wait max( 0, secondsuntildeath - waitbeforedeath );
setslowmotion( 1, 0,25, waitbeforedeath ); setslowmotion( 1, 0.25, waitbeforedeath );
wait ( waitbeforedeath + 0,5 ); wait ( waitbeforedeath + 0.5 );
setslowmotion( 0,25, 1, 1 ); setslowmotion( 0.25, 1, 1 );
wait 0,5; wait 0.5;
maps/mp/_utility::setclientsysstate( "levelNotify", "fkce" ); maps/mp/_utility::setclientsysstate( "levelNotify", "fkce" );
} }
waitskipkillcambutton() waitskipkillcambutton() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "end_killcam" ); self endon( "end_killcam" );
while ( self usebuttonpressed() ) while ( self usebuttonpressed() )
{ {
wait 0,05; wait 0.05;
} }
while ( !self usebuttonpressed() ) while ( !self usebuttonpressed() )
{ {
wait 0,05; wait 0.05;
} }
self notify( "end_killcam" ); self notify( "end_killcam" );
self clientnotify( "fkce" ); self clientnotify( "fkce" );
} }
waitteamchangeendkillcam() waitteamchangeendkillcam() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "end_killcam" ); self endon( "end_killcam" );
@ -326,23 +310,23 @@ waitteamchangeendkillcam()
endkillcam( 0 ); endkillcam( 0 );
} }
waitskipkillcamsafespawnbutton() waitskipkillcamsafespawnbutton() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "end_killcam" ); self endon( "end_killcam" );
while ( self fragbuttonpressed() ) while ( self fragbuttonpressed() )
{ {
wait 0,05; wait 0.05;
} }
while ( !self fragbuttonpressed() ) while ( !self fragbuttonpressed() )
{ {
wait 0,05; wait 0.05;
} }
self.wantsafespawn = 1; self.wantsafespawn = 1;
self notify( "end_killcam" ); self notify( "end_killcam" );
} }
endkillcam( final ) endkillcam( final ) //checked matches cerberus output
{ {
if ( isDefined( self.kc_skiptext ) ) if ( isDefined( self.kc_skiptext ) )
{ {
@ -360,7 +344,7 @@ endkillcam( final )
self thread maps/mp/gametypes/_spectating::setspectatepermissions(); self thread maps/mp/gametypes/_spectating::setspectatepermissions();
} }
checkforabruptkillcamend() checkforabruptkillcamend() //checked changed to match cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "end_killcam" ); self endon( "end_killcam" );
@ -370,15 +354,12 @@ checkforabruptkillcamend()
{ {
break; break;
} }
else wait 0.05;
{
wait 0,05;
}
} }
self notify( "end_killcam" ); self notify( "end_killcam" );
} }
spawnedkillcamcleanup() spawnedkillcamcleanup() //checked matches cerberus output
{ {
self endon( "end_killcam" ); self endon( "end_killcam" );
self endon( "disconnect" ); self endon( "disconnect" );
@ -386,7 +367,7 @@ spawnedkillcamcleanup()
self endkillcam( 0 ); self endkillcam( 0 );
} }
spectatorkillcamcleanup( attacker ) spectatorkillcamcleanup( attacker ) //checked matches cerberus output
{ {
self endon( "end_killcam" ); self endon( "end_killcam" );
self endon( "disconnect" ); self endon( "disconnect" );
@ -397,7 +378,7 @@ spectatorkillcamcleanup( attacker )
self endkillcam( 0 ); self endkillcam( 0 );
} }
endedkillcamcleanup() endedkillcamcleanup() //checked matches cerberus output
{ {
self endon( "end_killcam" ); self endon( "end_killcam" );
self endon( "disconnect" ); self endon( "disconnect" );
@ -405,7 +386,7 @@ endedkillcamcleanup()
self endkillcam( 0 ); self endkillcam( 0 );
} }
endedfinalkillcamcleanup() endedfinalkillcamcleanup() //checked matches cerberus output
{ {
self endon( "end_killcam" ); self endon( "end_killcam" );
self endon( "disconnect" ); self endon( "disconnect" );
@ -413,61 +394,61 @@ endedfinalkillcamcleanup()
self endkillcam( 1 ); self endkillcam( 1 );
} }
cancelkillcamusebutton() cancelkillcamusebutton() //checked matches cerberus output
{ {
return self usebuttonpressed(); return self usebuttonpressed();
} }
cancelkillcamsafespawnbutton() cancelkillcamsafespawnbutton() //checked matches cerberus output
{ {
return self fragbuttonpressed(); return self fragbuttonpressed();
} }
cancelkillcamcallback() cancelkillcamcallback() //checked matches cerberus output
{ {
self.cancelkillcam = 1; self.cancelkillcam = 1;
} }
cancelkillcamsafespawncallback() cancelkillcamsafespawncallback() //checked matches cerberus output
{ {
self.cancelkillcam = 1; self.cancelkillcam = 1;
self.wantsafespawn = 1; self.wantsafespawn = 1;
} }
cancelkillcamonuse() cancelkillcamonuse() //checked matches cerberus output
{ {
self thread cancelkillcamonuse_specificbutton( ::cancelkillcamusebutton, ::cancelkillcamcallback ); self thread cancelkillcamonuse_specificbutton( ::cancelkillcamusebutton, ::cancelkillcamcallback );
} }
cancelkillcamonuse_specificbutton( pressingbuttonfunc, finishedfunc ) cancelkillcamonuse_specificbutton( pressingbuttonfunc, finishedfunc ) //checked changed at own discretion
{ {
self endon( "death_delay_finished" ); self endon( "death_delay_finished" );
self endon( "disconnect" ); self endon( "disconnect" );
level endon( "game_ended" ); level endon( "game_ended" );
for ( ;; ) for ( ;; )
{ {
if ( !( self [[ pressingbuttonfunc ]]() ) ) if ( !self [[ pressingbuttonfunc ]]() )
{ {
wait 0,05; wait 0.05;
continue; continue;
} }
else buttontime = 0; buttontime = 0;
while ( self [[ pressingbuttonfunc ]]() ) while ( self [[ pressingbuttonfunc ]]() )
{ {
buttontime += 0,05; buttontime += 0.05;
wait 0,05; wait 0.05;
} }
if ( buttontime >= 0,5 ) if ( buttontime >= 0.5 )
{ {
continue; continue;
} }
else buttontime = 0; buttontime = 0;
while ( !( self [[ pressingbuttonfunc ]]() ) && buttontime < 0,5 ) while ( !( self [[ pressingbuttonfunc ]]() ) && buttontime < 0.5 )
{ {
buttontime += 0,05; buttontime += 0.05;
wait 0,05; wait 0.05;
} }
if ( buttontime >= 0,5 ) if ( buttontime >= 0.5 )
{ {
continue; continue;
} }
@ -476,10 +457,11 @@ cancelkillcamonuse_specificbutton( pressingbuttonfunc, finishedfunc )
self [[ finishedfunc ]](); self [[ finishedfunc ]]();
return; return;
} }
wait 0.05;
} }
} }
finalkillcam( winner ) finalkillcam( winner ) //checked changed to match cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
level endon( "game_ended" ); level endon( "game_ended" );
@ -493,6 +475,7 @@ finalkillcam( winner )
setmatchflag( "final_killcam", 0 ); setmatchflag( "final_killcam", 0 );
setmatchflag( "round_end_killcam", 1 ); setmatchflag( "round_end_killcam", 1 );
} }
/*
/# /#
if ( getDvarInt( "scr_force_finalkillcam" ) == 1 ) if ( getDvarInt( "scr_force_finalkillcam" ) == 1 )
{ {
@ -500,6 +483,7 @@ finalkillcam( winner )
setmatchflag( "round_end_killcam", 0 ); setmatchflag( "round_end_killcam", 0 );
#/ #/
} }
*/
if ( level.console ) if ( level.console )
{ {
self maps/mp/gametypes/_globallogic_spawn::setthirdperson( 0 ); self maps/mp/gametypes/_globallogic_spawn::setthirdperson( 0 );
@ -510,7 +494,7 @@ finalkillcam( winner )
camtime = calckillcamtime( killcamsettings.weapon, killcamsettings.entitystarttime, predelay, 0, undefined ); camtime = calckillcamtime( killcamsettings.weapon, killcamsettings.entitystarttime, predelay, 0, undefined );
postdelay = calcpostdelay(); postdelay = calcpostdelay();
killcamoffset = camtime + predelay; killcamoffset = camtime + predelay;
killcamlength = ( camtime + postdelay ) - 0,05; killcamlength = ( camtime + postdelay ) - 0.05;
killcamstarttime = getTime() - ( killcamoffset * 1000 ); killcamstarttime = getTime() - ( killcamoffset * 1000 );
self notify( "begin_killcam" ); self notify( "begin_killcam" );
self.sessionstate = "spectator"; self.sessionstate = "spectator";
@ -524,18 +508,14 @@ finalkillcam( winner )
self.archivetime = killcamoffset; self.archivetime = killcamoffset;
self.killcamlength = killcamlength; self.killcamlength = killcamlength;
self.psoffsettime = killcamsettings.offsettime; self.psoffsettime = killcamsettings.offsettime;
_a613 = level.teams; foreach ( team in level.teams )
_k613 = getFirstArrayKey( _a613 );
while ( isDefined( _k613 ) )
{ {
team = _a613[ _k613 ];
self allowspectateteam( team, 1 ); self allowspectateteam( team, 1 );
_k613 = getNextArrayKey( _a613, _k613 );
} }
self allowspectateteam( "freelook", 1 ); self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 ); self allowspectateteam( "none", 1 );
self thread endedfinalkillcamcleanup(); self thread endedfinalkillcamcleanup();
wait 0,05; wait 0.05;
if ( self.archivetime <= predelay ) if ( self.archivetime <= predelay )
{ {
self.sessionstate = "dead"; self.sessionstate = "dead";
@ -561,13 +541,13 @@ finalkillcam( winner )
self spawnendoffinalkillcam(); self spawnendoffinalkillcam();
} }
spawnendoffinalkillcam() spawnendoffinalkillcam() //checked matches cerberus output
{ {
[[ level.spawnspectator ]](); [[ level.spawnspectator ]]();
self freezecontrols( 1 ); self freezecontrols( 1 );
} }
iskillcamentityweapon( sweapon ) iskillcamentityweapon( sweapon ) //checked matches cerberus output
{ {
if ( sweapon == "planemortar_mp" ) if ( sweapon == "planemortar_mp" )
{ {
@ -576,44 +556,35 @@ iskillcamentityweapon( sweapon )
return 0; return 0;
} }
iskillcamgrenadeweapon( sweapon ) iskillcamgrenadeweapon( sweapon ) //checked changed to match cerberus output
{ {
if ( sweapon == "frag_grenade_mp" ) if ( sweapon == "frag_grenade_mp" )
{ {
return 1; return 1;
} }
else else if ( sweapon == "frag_grenade_short_mp" )
{ {
if ( sweapon == "frag_grenade_short_mp" ) return 1;
{ }
return 1; else if ( sweapon == "sticky_grenade_mp" )
} {
else return 1;
{ }
if ( sweapon == "sticky_grenade_mp" ) else if ( sweapon == "tabun_gas_mp" )
{ {
return 1; return 1;
}
else
{
if ( sweapon == "tabun_gas_mp" )
{
return 1;
}
}
}
} }
return 0; return 0;
} }
calckillcamtime( sweapon, entitystarttime, predelay, respawn, maxtime ) calckillcamtime( sweapon, entitystarttime, predelay, respawn, maxtime ) //checked matches cerberus output dvars found in another dump
{ {
camtime = 0; camtime = 0;
if ( getDvar( #"C45D9077" ) == "" ) if ( getDvar( "scr_killcam_time" ) == "" )
{ {
if ( iskillcamentityweapon( sweapon ) ) if ( iskillcamentityweapon( sweapon ) )
{ {
camtime = ( ( getTime() - entitystarttime ) / 1000 ) - predelay - 0,1; camtime = ( ( getTime() - entitystarttime ) / 1000 ) - predelay - 0.1;
} }
else if ( !respawn ) else if ( !respawn )
{ {
@ -621,16 +592,16 @@ calckillcamtime( sweapon, entitystarttime, predelay, respawn, maxtime )
} }
else if ( iskillcamgrenadeweapon( sweapon ) ) else if ( iskillcamgrenadeweapon( sweapon ) )
{ {
camtime = 4,25; camtime = 4.25;
} }
else else
{ {
camtime = 2,5; camtime = 2.5;
} }
} }
else else
{ {
camtime = getDvarFloat( #"C45D9077" ); camtime = getDvarFloat( "scr_killcam_time" );
} }
if ( isDefined( maxtime ) ) if ( isDefined( maxtime ) )
{ {
@ -638,33 +609,33 @@ calckillcamtime( sweapon, entitystarttime, predelay, respawn, maxtime )
{ {
camtime = maxtime; camtime = maxtime;
} }
if ( camtime < 0,05 ) if ( camtime < 0.05 )
{ {
camtime = 0,05; camtime = 0.05;
} }
} }
return camtime; return camtime;
} }
calcpostdelay() calcpostdelay() //checked matches cerberus output dvars found in another dump
{ {
postdelay = 0; postdelay = 0;
if ( getDvar( #"0D34D95D" ) == "" ) if ( getDvar( "scr_killcam_posttime" ) == "" )
{ {
postdelay = 2; postdelay = 2;
} }
else else
{ {
postdelay = getDvarFloat( #"0D34D95D" ); postdelay = getDvarFloat( "scr_killcam_posttime" );
if ( postdelay < 0,05 ) if ( postdelay < 0.05 )
{ {
postdelay = 0,05; postdelay = 0.05;
} }
} }
return postdelay; return postdelay;
} }
addkillcamskiptext( respawn ) addkillcamskiptext( respawn ) //checked matches cerberus output
{ {
if ( !isDefined( self.kc_skiptext ) ) if ( !isDefined( self.kc_skiptext ) )
{ {
@ -681,7 +652,7 @@ addkillcamskiptext( respawn )
if ( self issplitscreen() ) if ( self issplitscreen() )
{ {
self.kc_skiptext.y = -100; self.kc_skiptext.y = -100;
self.kc_skiptext.fontscale = 1,4; self.kc_skiptext.fontscale = 1.4;
} }
else else
{ {
@ -699,11 +670,11 @@ addkillcamskiptext( respawn )
self.kc_skiptext.alpha = 1; self.kc_skiptext.alpha = 1;
} }
addkillcamtimer( camtime ) addkillcamtimer( camtime ) //checked matches cerberus output
{ {
} }
initkcelements() initkcelements() //checked matches cerberus output
{ {
if ( !isDefined( self.kc_skiptext ) ) if ( !isDefined( self.kc_skiptext ) )
{ {
@ -721,12 +692,12 @@ initkcelements()
if ( self issplitscreen() ) if ( self issplitscreen() )
{ {
self.kc_skiptext.y = 20; self.kc_skiptext.y = 20;
self.kc_skiptext.fontscale = 1,2; self.kc_skiptext.fontscale = 1.2;
} }
else else
{ {
self.kc_skiptext.y = 32; self.kc_skiptext.y = 32;
self.kc_skiptext.fontscale = 1,8; self.kc_skiptext.fontscale = 1.8;
} }
} }
if ( !isDefined( self.kc_othertext ) ) if ( !isDefined( self.kc_othertext ) )
@ -745,12 +716,12 @@ initkcelements()
if ( self issplitscreen() ) if ( self issplitscreen() )
{ {
self.kc_othertext.x = 16; self.kc_othertext.x = 16;
self.kc_othertext.fontscale = 1,2; self.kc_othertext.fontscale = 1.2;
} }
else else
{ {
self.kc_othertext.x = 32; self.kc_othertext.x = 32;
self.kc_othertext.fontscale = 1,6; self.kc_othertext.fontscale = 1.6;
} }
} }
if ( !isDefined( self.kc_icon ) ) if ( !isDefined( self.kc_icon ) )
@ -782,8 +753,9 @@ initkcelements()
self.kc_timer.sort = 1; self.kc_timer.sort = 1;
self.kc_timer.font = "hudbig"; self.kc_timer.font = "hudbig";
self.kc_timer.foreground = 1; self.kc_timer.foreground = 1;
self.kc_timer.color = vectorScale( ( 1, 1, 1 ), 0,85 ); self.kc_timer.color = vectorScale( ( 1, 1, 1 ), 0.85 );
self.kc_timer.hidewheninmenu = 1; self.kc_timer.hidewheninmenu = 1;
} }
} }
} }

View File

@ -1,7 +1,8 @@
//checked includes match cerberus output
#include maps/mp/gametypes/_hud_util; #include maps/mp/gametypes/_hud_util;
#include maps/mp/_utility; #include maps/mp/_utility;
init() init() //checked matches cerberus output
{ {
precacheshader( "objpoint_default" ); precacheshader( "objpoint_default" );
level.objpointnames = []; level.objpointnames = [];
@ -14,18 +15,20 @@ init()
{ {
level.objpointsize = 8; level.objpointsize = 8;
} }
level.objpoint_alpha_default = 0,5; level.objpoint_alpha_default = 0.5;
level.objpointscale = 1; level.objpointscale = 1;
} }
createteamobjpoint( name, origin, team, shader, alpha, scale ) createteamobjpoint( name, origin, team, shader, alpha, scale ) //checked matches cerberus output
{ {
/*
/# /#
if ( !isDefined( level.teams[ team ] ) ) if ( !isDefined( level.teams[ team ] ) )
{ {
assert( team == "all" ); assert( team == "all" );
} }
#/ #/
*/
objpoint = getobjpointbyname( name ); objpoint = getobjpointbyname( name );
if ( isDefined( objpoint ) ) if ( isDefined( objpoint ) )
{ {
@ -73,19 +76,23 @@ createteamobjpoint( name, origin, team, shader, alpha, scale )
return objpoint; return objpoint;
} }
deleteobjpoint( oldobjpoint ) deleteobjpoint( oldobjpoint ) //checked changed to match cerberus output
{ {
/*
/# /#
assert( level.objpoints.size == level.objpointnames.size ); assert( level.objpoints.size == level.objpointnames.size );
#/ #/
*/
if ( level.objpoints.size == 1 ) if ( level.objpoints.size == 1 )
{ {
/*
/# /#
assert( level.objpointnames[ 0 ] == oldobjpoint.name ); assert( level.objpointnames[ 0 ] == oldobjpoint.name );
#/ #/
/# /#
assert( isDefined( level.objpoints[ oldobjpoint.name ] ) ); assert( isDefined( level.objpoints[ oldobjpoint.name ] ) );
#/ #/
*/
level.objpoints = []; level.objpoints = [];
level.objpointnames = []; level.objpointnames = [];
oldobjpoint destroy(); oldobjpoint destroy();
@ -96,10 +103,12 @@ deleteobjpoint( oldobjpoint )
objpoint = getobjpointbyindex( oldindex ); objpoint = getobjpointbyindex( oldindex );
level.objpointnames[ newindex ] = objpoint.name; level.objpointnames[ newindex ] = objpoint.name;
objpoint.index = newindex; objpoint.index = newindex;
level.objpointnames[oldindex] = undefined;
level.objpoints[oldobjpoint.name] = undefined;
oldobjpoint destroy(); oldobjpoint destroy();
} }
updateorigin( origin ) updateorigin( origin ) //checked matches cerberus output
{ {
if ( self.x != origin[ 0 ] ) if ( self.x != origin[ 0 ] )
{ {
@ -115,13 +124,13 @@ updateorigin( origin )
} }
} }
setoriginbyname( name, origin ) setoriginbyname( name, origin ) //checked matches cerberus output
{ {
objpoint = getobjpointbyname( name ); objpoint = getobjpointbyname( name );
objpoint updateorigin( origin ); objpoint updateorigin( origin );
} }
getobjpointbyname( name ) getobjpointbyname( name ) //checked matches cerberus output
{ {
if ( isDefined( level.objpoints[ name ] ) ) if ( isDefined( level.objpoints[ name ] ) )
{ {
@ -133,7 +142,7 @@ getobjpointbyname( name )
} }
} }
getobjpointbyindex( index ) getobjpointbyindex( index ) //checked matches cerberus output
{ {
if ( isDefined( level.objpointnames[ index ] ) ) if ( isDefined( level.objpointnames[ index ] ) )
{ {
@ -145,7 +154,7 @@ getobjpointbyindex( index )
} }
} }
startflashing() startflashing() //checked matches cerberus output
{ {
self endon( "stop_flashing_thread" ); self endon( "stop_flashing_thread" );
if ( self.isflashing ) if ( self.isflashing )
@ -155,17 +164,17 @@ startflashing()
self.isflashing = 1; self.isflashing = 1;
while ( self.isflashing ) while ( self.isflashing )
{ {
self fadeovertime( 0,75 ); self fadeovertime( 0.75 );
self.alpha = 0,35 * self.basealpha; self.alpha = 0.35 * self.basealpha;
wait 0,75; wait 0.75;
self fadeovertime( 0,75 ); self fadeovertime( 0.75 );
self.alpha = self.basealpha; self.alpha = self.basealpha;
wait 0,75; wait 0.75;
} }
self.alpha = self.basealpha; self.alpha = self.basealpha;
} }
stopflashing() stopflashing() //checked matches cerberus output
{ {
if ( !self.isflashing ) if ( !self.isflashing )
{ {
@ -173,3 +182,4 @@ stopflashing()
} }
self.isflashing = 0; self.isflashing = 0;
} }

View File

@ -1,3 +1,4 @@
//checked includes match cerberus output
#include maps/mp/gametypes/_globallogic; #include maps/mp/gametypes/_globallogic;
#include maps/mp/gametypes/_hud; #include maps/mp/gametypes/_hud;
#include maps/mp/gametypes/_hud_util; #include maps/mp/gametypes/_hud_util;
@ -5,7 +6,7 @@
#include maps/mp/_utility; #include maps/mp/_utility;
#include common_scripts/utility; #include common_scripts/utility;
init() init() //checked partially changed to match cerberus output changed at own discretion
{ {
level.scoreinfo = []; level.scoreinfo = [];
level.xpscale = getDvarFloat( "scr_xpscale" ); level.xpscale = getDvarFloat( "scr_xpscale" );
@ -18,9 +19,9 @@ init()
level.usingscorestreaks = getDvarInt( "scr_scorestreaks" ) != 0; level.usingscorestreaks = getDvarInt( "scr_scorestreaks" ) != 0;
level.scorestreaksmaxstacking = getDvarInt( "scr_scorestreaks_maxstacking" ); level.scorestreaksmaxstacking = getDvarInt( "scr_scorestreaks_maxstacking" );
level.maxinventoryscorestreaks = getdvarintdefault( "scr_maxinventory_scorestreaks", 3 ); level.maxinventoryscorestreaks = getdvarintdefault( "scr_maxinventory_scorestreaks", 3 );
if ( isDefined( level.usingscorestreaks ) ) if ( !isDefined( level.usingscorestreaks ) || !level.usingscorestreaks )
{ {
level.usingrampage = !level.usingscorestreaks; level.usingrampage = 1;
} }
level.rampagebonusscale = getDvarFloat( "scr_rampagebonusscale" ); level.rampagebonusscale = getDvarFloat( "scr_rampagebonusscale" );
level.ranktable = []; level.ranktable = [];
@ -38,27 +39,23 @@ init()
} }
level.maxrank = int( tablelookup( "mp/rankTable.csv", 0, "maxrank", 1 ) ); level.maxrank = int( tablelookup( "mp/rankTable.csv", 0, "maxrank", 1 ) );
level.maxprestige = int( tablelookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ) ); level.maxprestige = int( tablelookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ) );
pid = 0; for ( pid = 0; pid <= level.maxprestige; pid++ )
rid = 0;
pid = 0;
while ( pid <= level.maxprestige )
{ {
rid = 0; for ( rid = 0; rid <= level.maxrank; rid++ )
while ( rid <= level.maxrank )
{ {
precacheshader( tablelookup( "mp/rankIconTable.csv", 0, rid, pid + 1 ) ); precacheshader( tablelookup( "mp/rankIconTable.csv", 0, rid, pid + 1 ) );
rid++;
} }
pid++;
} }
rankid = 0; rankid = 0;
rankname = tablelookup( "mp/ranktable.csv", 0, rankid, 1 ); rankname = tablelookup( "mp/ranktable.csv", 0, rankid, 1 );
/*
/# /#
if ( isDefined( rankname ) ) if ( isDefined( rankname ) )
{ {
assert( rankname != "" ); assert( rankname != "" );
} }
#/ #/
*/
while ( isDefined( rankname ) && rankname != "" ) while ( isDefined( rankname ) && rankname != "" )
{ {
level.ranktable[ rankid ][ 1 ] = tablelookup( "mp/ranktable.csv", 0, rankid, 1 ); level.ranktable[ rankid ][ 1 ] = tablelookup( "mp/ranktable.csv", 0, rankid, 1 );
@ -73,34 +70,39 @@ init()
level thread onplayerconnect(); level thread onplayerconnect();
} }
initscoreinfo() initscoreinfo() //checked changed to match cerberus output
{ {
scoreinfotableid = getscoreeventtableid(); scoreinfotableid = getscoreeventtableid();
/*
/# /#
assert( isDefined( scoreinfotableid ) ); assert( isDefined( scoreinfotableid ) );
#/ #/
*/
if ( !isDefined( scoreinfotableid ) ) if ( !isDefined( scoreinfotableid ) )
{ {
return; return;
} }
scorecolumn = getscoreeventcolumn( level.gametype ); scorecolumn = getscoreeventcolumn( level.gametype );
xpcolumn = getxpeventcolumn( level.gametype ); xpcolumn = getxpeventcolumn( level.gametype );
/*
/# /#
assert( scorecolumn >= 0 ); assert( scorecolumn >= 0 );
#/ #/
*/
if ( scorecolumn < 0 ) if ( scorecolumn < 0 )
{ {
return; return;
} }
/*
/# /#
assert( xpcolumn >= 0 ); assert( xpcolumn >= 0 );
#/ #/
*/
if ( xpcolumn < 0 ) if ( xpcolumn < 0 )
{ {
return; return;
} }
row = 1; for ( row = 1; row < 512; row++ )
while ( row < 512 )
{ {
type = tablelookupcolumnforrow( scoreinfotableid, row, 0 ); type = tablelookupcolumnforrow( scoreinfotableid, row, 0 );
if ( type != "" ) if ( type != "" )
@ -141,11 +143,10 @@ initscoreinfo()
level.scoreinfo[ type ][ "allowKillstreakWeapons" ] = 1; level.scoreinfo[ type ][ "allowKillstreakWeapons" ] = 1;
} }
} }
row++;
} }
} }
getrankxpcapped( inrankxp ) getrankxpcapped( inrankxp ) //checked matches cerberus output
{ {
if ( isDefined( level.rankxpcap ) && level.rankxpcap && level.rankxpcap <= inrankxp ) if ( isDefined( level.rankxpcap ) && level.rankxpcap && level.rankxpcap <= inrankxp )
{ {
@ -154,7 +155,7 @@ getrankxpcapped( inrankxp )
return inrankxp; return inrankxp;
} }
getcodpointscapped( incodpoints ) getcodpointscapped( incodpoints ) //checked matches cerberus output
{ {
if ( isDefined( level.codpointscap ) && level.codpointscap && level.codpointscap <= incodpoints ) if ( isDefined( level.codpointscap ) && level.codpointscap && level.codpointscap <= incodpoints )
{ {
@ -163,7 +164,7 @@ getcodpointscapped( incodpoints )
return incodpoints; return incodpoints;
} }
registerscoreinfo( type, value, label ) registerscoreinfo( type, value, label ) //checked matches cerberus output
{ {
overridedvar = "scr_" + level.gametype + "_score_" + type; overridedvar = "scr_" + level.gametype + "_score_" + type;
if ( getDvar( overridedvar ) != "" ) if ( getDvar( overridedvar ) != "" )
@ -186,7 +187,7 @@ registerscoreinfo( type, value, label )
} }
} }
getscoreinfovalue( type ) getscoreinfovalue( type ) //checked matches cerberus output
{ {
if ( isDefined( level.scoreinfo[ type ] ) ) if ( isDefined( level.scoreinfo[ type ] ) )
{ {
@ -194,12 +195,12 @@ getscoreinfovalue( type )
} }
} }
getscoreinfolabel( type ) getscoreinfolabel( type ) //checked matches cerberus output
{ {
return level.scoreinfo[ type ][ "label" ]; return level.scoreinfo[ type ][ "label" ];
} }
killstreakweaponsallowedscore( type ) killstreakweaponsallowedscore( type ) //checked matches cerberus output
{ {
if ( isDefined( level.scoreinfo[ type ][ "allowKillstreakWeapons" ] ) && level.scoreinfo[ type ][ "allowKillstreakWeapons" ] == 1 ) if ( isDefined( level.scoreinfo[ type ][ "allowKillstreakWeapons" ] ) && level.scoreinfo[ type ][ "allowKillstreakWeapons" ] == 1 )
{ {
@ -211,50 +212,51 @@ killstreakweaponsallowedscore( type )
} }
} }
doesscoreinfocounttowardrampage( type ) doesscoreinfocounttowardrampage( type ) //checked changed at own discretion
{ {
if ( isDefined( level.scoreinfo[ type ][ "rampage" ] ) ) if ( isDefined( level.scoreinfo[ type ][ "rampage" ] ) && level.scoreinfo[ type ][ "rampage" ] )
{ {
return level.scoreinfo[ type ][ "rampage" ]; return 1;
} }
return 0;
} }
getrankinfominxp( rankid ) getrankinfominxp( rankid ) //checked matches cerberus output
{ {
return int( level.ranktable[ rankid ][ 2 ] ); return int( level.ranktable[ rankid ][ 2 ] );
} }
getrankinfoxpamt( rankid ) getrankinfoxpamt( rankid ) //checked matches cerberus output
{ {
return int( level.ranktable[ rankid ][ 3 ] ); return int( level.ranktable[ rankid ][ 3 ] );
} }
getrankinfomaxxp( rankid ) getrankinfomaxxp( rankid ) //checked matches cerberus output
{ {
return int( level.ranktable[ rankid ][ 7 ] ); return int( level.ranktable[ rankid ][ 7 ] );
} }
getrankinfofull( rankid ) getrankinfofull( rankid ) //checked matches cerberus output
{ {
return tablelookupistring( "mp/ranktable.csv", 0, rankid, 16 ); return tablelookupistring( "mp/ranktable.csv", 0, rankid, 16 );
} }
getrankinfoicon( rankid, prestigeid ) getrankinfoicon( rankid, prestigeid ) //checked matches cerberus output
{ {
return tablelookup( "mp/rankIconTable.csv", 0, rankid, prestigeid + 1 ); return tablelookup( "mp/rankIconTable.csv", 0, rankid, prestigeid + 1 );
} }
getrankinfolevel( rankid ) getrankinfolevel( rankid ) //checked matches cerberus output
{ {
return int( tablelookup( "mp/ranktable.csv", 0, rankid, 13 ) ); return int( tablelookup( "mp/ranktable.csv", 0, rankid, 13 ) );
} }
getrankinfocodpointsearned( rankid ) getrankinfocodpointsearned( rankid ) //checked matches cerberus output
{ {
return int( tablelookup( "mp/ranktable.csv", 0, rankid, 17 ) ); return int( tablelookup( "mp/ranktable.csv", 0, rankid, 17 ) );
} }
shouldkickbyrank() shouldkickbyrank() //checked matches cerberus output
{ {
if ( self ishost() ) if ( self ishost() )
{ {
@ -275,7 +277,7 @@ shouldkickbyrank()
return 0; return 0;
} }
getcodpointsstat() getcodpointsstat() //checked matches cerberus output
{ {
codpoints = self getdstat( "playerstatslist", "CODPOINTS", "StatValue" ); codpoints = self getdstat( "playerstatslist", "CODPOINTS", "StatValue" );
codpointscapped = getcodpointscapped( codpoints ); codpointscapped = getcodpointscapped( codpoints );
@ -286,12 +288,12 @@ getcodpointsstat()
return codpointscapped; return codpointscapped;
} }
setcodpointsstat( codpoints ) setcodpointsstat( codpoints ) //checked matches cerberus output
{ {
self setdstat( "PlayerStatsList", "CODPOINTS", "StatValue", getcodpointscapped( codpoints ) ); self setdstat( "PlayerStatsList", "CODPOINTS", "StatValue", getcodpointscapped( codpoints ) );
} }
getrankxpstat() getrankxpstat() //checked matches cerberus output
{ {
rankxp = self getdstat( "playerstatslist", "RANKXP", "StatValue" ); rankxp = self getdstat( "playerstatslist", "RANKXP", "StatValue" );
rankxpcapped = getrankxpcapped( rankxp ); rankxpcapped = getrankxpcapped( rankxp );
@ -302,7 +304,7 @@ getrankxpstat()
return rankxpcapped; return rankxpcapped;
} }
onplayerconnect() onplayerconnect() //checked changed to match cerberus output
{ {
for ( ;; ) for ( ;; )
{ {
@ -318,50 +320,49 @@ onplayerconnect()
kick( player getentitynumber() ); kick( player getentitynumber() );
continue; continue;
} }
else if ( !isDefined( player.pers[ "participation" ] ) || level.gametype == "twar" && game[ "roundsplayed" ] >= 0 && player.pers[ "participation" ] >= 0 )
{ {
if ( !isDefined( player.pers[ "participation" ] ) || level.gametype == "twar" && game[ "roundsplayed" ] >= 0 && player.pers[ "participation" ] >= 0 ) player.pers[ "participation" ] = 0;
{
player.pers[ "participation" ] = 0;
}
player.rankupdatetotal = 0;
player.cur_ranknum = rankid;
/#
assert( isDefined( player.cur_ranknum ), "rank: " + rankid + " does not have an index, check mp/ranktable.csv" );
#/
prestige = player getdstat( "playerstatslist", "plevel", "StatValue" );
player setrank( rankid, prestige );
player.pers[ "prestige" ] = prestige;
if ( !isDefined( player.pers[ "summary" ] ) )
{
player.pers[ "summary" ] = [];
player.pers[ "summary" ][ "xp" ] = 0;
player.pers[ "summary" ][ "score" ] = 0;
player.pers[ "summary" ][ "challenge" ] = 0;
player.pers[ "summary" ][ "match" ] = 0;
player.pers[ "summary" ][ "misc" ] = 0;
player.pers[ "summary" ][ "codpoints" ] = 0;
}
if ( !level.rankedmatch || level.wagermatch && level.leaguematch )
{
player setdstat( "AfterActionReportStats", "lobbyPopup", "none" );
}
if ( level.rankedmatch )
{
player setdstat( "playerstatslist", "rank", "StatValue", rankid );
player setdstat( "playerstatslist", "minxp", "StatValue", getrankinfominxp( rankid ) );
player setdstat( "playerstatslist", "maxxp", "StatValue", getrankinfomaxxp( rankid ) );
player setdstat( "playerstatslist", "lastxp", "StatValue", getrankxpcapped( player.pers[ "rankxp" ] ) );
}
player.explosivekills[ 0 ] = 0;
player thread onplayerspawned();
player thread onjoinedteam();
player thread onjoinedspectators();
} }
player.rankupdatetotal = 0;
player.cur_ranknum = rankid;
/*
/#
assert( isDefined( player.cur_ranknum ), "rank: " + rankid + " does not have an index, check mp/ranktable.csv" );
#/
*/
prestige = player getdstat( "playerstatslist", "plevel", "StatValue" );
player setrank( rankid, prestige );
player.pers[ "prestige" ] = prestige;
if ( !isDefined( player.pers[ "summary" ] ) )
{
player.pers[ "summary" ] = [];
player.pers[ "summary" ][ "xp" ] = 0;
player.pers[ "summary" ][ "score" ] = 0;
player.pers[ "summary" ][ "challenge" ] = 0;
player.pers[ "summary" ][ "match" ] = 0;
player.pers[ "summary" ][ "misc" ] = 0;
player.pers[ "summary" ][ "codpoints" ] = 0;
}
if ( !level.rankedmatch || level.wagermatch && level.leaguematch )
{
player setdstat( "AfterActionReportStats", "lobbyPopup", "none" );
}
if ( level.rankedmatch )
{
player setdstat( "playerstatslist", "rank", "StatValue", rankid );
player setdstat( "playerstatslist", "minxp", "StatValue", getrankinfominxp( rankid ) );
player setdstat( "playerstatslist", "maxxp", "StatValue", getrankinfomaxxp( rankid ) );
player setdstat( "playerstatslist", "lastxp", "StatValue", getrankxpcapped( player.pers[ "rankxp" ] ) );
}
player.explosivekills[ 0 ] = 0;
player thread onplayerspawned();
player thread onjoinedteam();
player thread onjoinedspectators();
} }
} }
onjoinedteam() onjoinedteam() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) for ( ;; )
@ -371,7 +372,7 @@ onjoinedteam()
} }
} }
onjoinedspectators() onjoinedspectators() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) for ( ;; )
@ -381,7 +382,7 @@ onjoinedspectators()
} }
} }
onplayerspawned() onplayerspawned() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) for ( ;; )
@ -406,7 +407,7 @@ onplayerspawned()
self.hud_rankscroreupdate.font = "default"; self.hud_rankscroreupdate.font = "default";
self.hud_rankscroreupdate.fontscale = 2; self.hud_rankscroreupdate.fontscale = 2;
self.hud_rankscroreupdate.archived = 0; self.hud_rankscroreupdate.archived = 0;
self.hud_rankscroreupdate.color = ( 1, 1, 0,5 ); self.hud_rankscroreupdate.color = ( 1, 1, 0.5 );
self.hud_rankscroreupdate.alpha = 0; self.hud_rankscroreupdate.alpha = 0;
self.hud_rankscroreupdate.sort = 50; self.hud_rankscroreupdate.sort = 50;
self.hud_rankscroreupdate maps/mp/gametypes/_hud::fontpulseinit(); self.hud_rankscroreupdate maps/mp/gametypes/_hud::fontpulseinit();
@ -414,7 +415,7 @@ onplayerspawned()
} }
} }
inccodpoints( amount ) inccodpoints( amount ) //checked matches cerberus output
{ {
if ( !isrankenabled() ) if ( !isrankenabled() )
{ {
@ -433,23 +434,19 @@ inccodpoints( amount )
setcodpointsstat( int( newcodpoints ) ); setcodpointsstat( int( newcodpoints ) );
} }
atleastoneplayeroneachteam() atleastoneplayeroneachteam() //checked changed to match cerberus output
{ {
_a507 = level.teams; foreach ( team in level.teams )
_k507 = getFirstArrayKey( _a507 );
while ( isDefined( _k507 ) )
{ {
team = _a507[ _k507 ];
if ( !level.playercount[ team ] ) if ( !level.playercount[ team ] )
{ {
return 0; return 0;
} }
_k507 = getNextArrayKey( _a507, _k507 );
} }
return 1; return 1;
} }
giverankxp( type, value, devadd ) giverankxp( type, value, devadd ) //checked changed to match cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
if ( sessionmodeiszombiesgame() ) if ( sessionmodeiszombiesgame() )
@ -460,12 +457,9 @@ giverankxp( type, value, devadd )
{ {
return; return;
} }
else else if ( !level.teambased && maps/mp/gametypes/_globallogic::totalplayercount() < 2 && !isDefined( devadd ) )
{ {
if ( !level.teambased && maps/mp/gametypes/_globallogic::totalplayercount() < 2 && !isDefined( devadd ) ) return;
{
return;
}
} }
if ( !isrankenabled() ) if ( !isrankenabled() )
{ {
@ -582,13 +576,13 @@ giverankxp( type, value, devadd )
pixendevent(); pixendevent();
} }
round_this_number( value ) round_this_number( value ) //checked matches cerberus output
{ {
value = int( value + 0,5 ); value = int( value + 0.5 );
return value; return value;
} }
updaterank() updaterank() //checked matches cerberus output
{ {
newrankid = self getrank(); newrankid = self getrank();
if ( newrankid == self.pers[ "rank" ] ) if ( newrankid == self.pers[ "rank" ] )
@ -625,7 +619,7 @@ updaterank()
return 1; return 1;
} }
codecallback_rankup( rank, prestige, unlocktokensadded ) codecallback_rankup( rank, prestige, unlocktokensadded ) //checked matches cerberus output
{ {
if ( rank > 8 ) if ( rank > 8 )
{ {
@ -635,21 +629,23 @@ codecallback_rankup( rank, prestige, unlocktokensadded )
self luinotifyeventtospectators( &"rank_up", 3, rank, prestige, unlocktokensadded ); self luinotifyeventtospectators( &"rank_up", 3, rank, prestige, unlocktokensadded );
} }
getitemindex( refstring ) getitemindex( refstring ) //checked matches cerberus output
{ {
itemindex = int( tablelookup( "mp/statstable.csv", 4, refstring, 0 ) ); itemindex = int( tablelookup( "mp/statstable.csv", 4, refstring, 0 ) );
/*
/# /#
assert( itemindex > 0, "statsTable refstring " + refstring + " has invalid index: " + itemindex ); assert( itemindex > 0, "statsTable refstring " + refstring + " has invalid index: " + itemindex );
#/ #/
*/
return itemindex; return itemindex;
} }
endgameupdate() endgameupdate() //checked matches cerberus output
{ {
player = self; player = self;
} }
updaterankscorehud( amount ) updaterankscorehud( amount ) //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "joined_team" ); self endon( "joined_team" );
@ -665,30 +661,30 @@ updaterankscorehud( amount )
self notify( "update_score" ); self notify( "update_score" );
self endon( "update_score" ); self endon( "update_score" );
self.rankupdatetotal += amount; self.rankupdatetotal += amount;
wait 0,05; wait 0.05;
if ( isDefined( self.hud_rankscroreupdate ) ) if ( isDefined( self.hud_rankscroreupdate ) )
{ {
if ( self.rankupdatetotal < 0 ) if ( self.rankupdatetotal < 0 )
{ {
self.hud_rankscroreupdate.label = &""; self.hud_rankscroreupdate.label = &"";
self.hud_rankscroreupdate.color = ( 0,73, 0,19, 0,19 ); self.hud_rankscroreupdate.color = ( 0.73, 0.19, 0.19 );
} }
else else
{ {
self.hud_rankscroreupdate.label = &"MP_PLUS"; self.hud_rankscroreupdate.label = &"MP_PLUS";
self.hud_rankscroreupdate.color = ( 1, 1, 0,5 ); self.hud_rankscroreupdate.color = ( 1, 1, 0.5 );
} }
self.hud_rankscroreupdate setvalue( self.rankupdatetotal ); self.hud_rankscroreupdate setvalue( self.rankupdatetotal );
self.hud_rankscroreupdate.alpha = 0,85; self.hud_rankscroreupdate.alpha = 0.85;
self.hud_rankscroreupdate thread maps/mp/gametypes/_hud::fontpulse( self ); self.hud_rankscroreupdate thread maps/mp/gametypes/_hud::fontpulse( self );
wait 1; wait 1;
self.hud_rankscroreupdate fadeovertime( 0,75 ); self.hud_rankscroreupdate fadeovertime( 0.75 );
self.hud_rankscroreupdate.alpha = 0; self.hud_rankscroreupdate.alpha = 0;
self.rankupdatetotal = 0; self.rankupdatetotal = 0;
} }
} }
updatemomentumhud( amount, reason, reasonvalue ) updatemomentumhud( amount, reason, reasonvalue ) //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "joined_team" ); self endon( "joined_team" );
@ -705,15 +701,15 @@ updatemomentumhud( amount, reason, reasonvalue )
if ( self.rankupdatetotal < 0 ) if ( self.rankupdatetotal < 0 )
{ {
self.hud_rankscroreupdate.label = &""; self.hud_rankscroreupdate.label = &"";
self.hud_rankscroreupdate.color = ( 0,73, 0,19, 0,19 ); self.hud_rankscroreupdate.color = ( 0.73, 0.19, 0.19 );
} }
else else
{ {
self.hud_rankscroreupdate.label = &"MP_PLUS"; self.hud_rankscroreupdate.label = &"MP_PLUS";
self.hud_rankscroreupdate.color = ( 1, 1, 0,5 ); self.hud_rankscroreupdate.color = ( 1, 1, 0.5 );
} }
self.hud_rankscroreupdate setvalue( self.rankupdatetotal ); self.hud_rankscroreupdate setvalue( self.rankupdatetotal );
self.hud_rankscroreupdate.alpha = 0,85; self.hud_rankscroreupdate.alpha = 0.85;
self.hud_rankscroreupdate thread maps/mp/gametypes/_hud::fontpulse( self ); self.hud_rankscroreupdate thread maps/mp/gametypes/_hud::fontpulse( self );
if ( isDefined( self.hud_momentumreason ) ) if ( isDefined( self.hud_momentumreason ) )
{ {
@ -729,29 +725,29 @@ updatemomentumhud( amount, reason, reasonvalue )
self.hud_momentumreason.label = reason; self.hud_momentumreason.label = reason;
self.hud_momentumreason setvalue( amount ); self.hud_momentumreason setvalue( amount );
} }
self.hud_momentumreason.alpha = 0,85; self.hud_momentumreason.alpha = 0.85;
self.hud_momentumreason thread maps/mp/gametypes/_hud::fontpulse( self ); self.hud_momentumreason thread maps/mp/gametypes/_hud::fontpulse( self );
} }
else else
{ {
self.hud_momentumreason fadeovertime( 0,01 ); self.hud_momentumreason fadeovertime( 0.01 );
self.hud_momentumreason.alpha = 0; self.hud_momentumreason.alpha = 0;
} }
} }
wait 1; wait 1;
self.hud_rankscroreupdate fadeovertime( 0,75 ); self.hud_rankscroreupdate fadeovertime( 0.75 );
self.hud_rankscroreupdate.alpha = 0; self.hud_rankscroreupdate.alpha = 0;
if ( isDefined( self.hud_momentumreason ) && isDefined( reason ) ) if ( isDefined( self.hud_momentumreason ) && isDefined( reason ) )
{ {
self.hud_momentumreason fadeovertime( 0,75 ); self.hud_momentumreason fadeovertime( 0.75 );
self.hud_momentumreason.alpha = 0; self.hud_momentumreason.alpha = 0;
} }
wait 0,75; wait 0.75;
self.rankupdatetotal = 0; self.rankupdatetotal = 0;
} }
} }
removerankhud() removerankhud() //checked matches cerberus output
{ {
if ( isDefined( self.hud_rankscroreupdate ) ) if ( isDefined( self.hud_rankscroreupdate ) )
{ {
@ -763,7 +759,7 @@ removerankhud()
} }
} }
getrank() getrank() //checked matches cerberus output
{ {
rankxp = getrankxpcapped( self.pers[ "rankxp" ] ); rankxp = getrankxpcapped( self.pers[ "rankxp" ] );
rankid = self.pers[ "rank" ]; rankid = self.pers[ "rank" ];
@ -777,13 +773,15 @@ getrank()
} }
} }
getrankforxp( xpval ) getrankforxp( xpval ) //checked matches cerberus output
{ {
rankid = 0; rankid = 0;
rankname = level.ranktable[ rankid ][ 1 ]; rankname = level.ranktable[ rankid ][ 1 ];
/*
/# /#
assert( isDefined( rankname ) ); assert( isDefined( rankname ) );
#/ #/
*/
while ( isDefined( rankname ) && rankname != "" ) while ( isDefined( rankname ) && rankname != "" )
{ {
if ( xpval < ( getrankinfominxp( rankid ) + getrankinfoxpamt( rankid ) ) ) if ( xpval < ( getrankinfominxp( rankid ) + getrankinfoxpamt( rankid ) ) )
@ -806,18 +804,18 @@ getrankforxp( xpval )
return rankid; return rankid;
} }
getspm() getspm() //checked matches cerberus output
{ {
ranklevel = self getrank() + 1; ranklevel = self getrank() + 1;
return ( 3 + ( ranklevel * 0,5 ) ) * 10; return ( 3 + ( ranklevel * 0.5 ) ) * 10;
} }
getrankxp() getrankxp() //checked matches cerberus output
{ {
return getrankxpcapped( self.pers[ "rankxp" ] ); return getrankxpcapped( self.pers[ "rankxp" ] );
} }
incrankxp( amount ) incrankxp( amount ) //checked matches cerberus output
{ {
if ( !level.rankedmatch ) if ( !level.rankedmatch )
{ {
@ -838,10 +836,11 @@ incrankxp( amount )
return xpincrease; return xpincrease;
} }
syncxpstat() syncxpstat() //checked matches cerberus output
{ {
xp = getrankxpcapped( self getrankxp() ); xp = getrankxpcapped( self getrankxp() );
cp = getcodpointscapped( int( self.pers[ "codpoints" ] ) ); cp = getcodpointscapped( int( self.pers[ "codpoints" ] ) );
self setdstat( "playerstatslist", "rankxp", "StatValue", xp ); self setdstat( "playerstatslist", "rankxp", "StatValue", xp );
self setdstat( "playerstatslist", "codpoints", "StatValue", cp ); self setdstat( "playerstatslist", "codpoints", "StatValue", cp );
} }

View File

@ -1,5 +1,5 @@
init() init() //checked matches cerberus output
{ {
if ( level.createfx_enabled ) if ( level.createfx_enabled )
{ {

View File

@ -1,18 +1,14 @@
init() init() //checked changed to match cerberus output
{ {
_a3 = level.teams; foreach ( team in level.teams )
_k3 = getFirstArrayKey( _a3 );
while ( isDefined( _k3 ) )
{ {
team = _a3[ _k3 ];
level.spectateoverride[ team ] = spawnstruct(); level.spectateoverride[ team ] = spawnstruct();
_k3 = getNextArrayKey( _a3, _k3 );
} }
level thread onplayerconnect(); level thread onplayerconnect();
} }
onplayerconnect() onplayerconnect() //checked matches cerberus output
{ {
for ( ;; ) for ( ;; )
{ {
@ -23,7 +19,7 @@ onplayerconnect()
} }
} }
onplayerspawned() onplayerspawned() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) for ( ;; )
@ -33,7 +29,7 @@ onplayerspawned()
} }
} }
onjoinedteam() onjoinedteam() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) for ( ;; )
@ -43,7 +39,7 @@ onjoinedteam()
} }
} }
onjoinedspectators() onjoinedspectators() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) for ( ;; )
@ -53,18 +49,16 @@ onjoinedspectators()
} }
} }
updatespectatesettings() updatespectatesettings() //checked changed to match cerberus output
{ {
level endon( "game_ended" ); level endon( "game_ended" );
index = 0; for ( index = 0; index < level.players.size; index++ )
while ( index < level.players.size )
{ {
level.players[ index ] setspectatepermissions(); level.players[ index ] setspectatepermissions();
index++;
} }
} }
getsplitscreenteam() getsplitscreenteam() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{ {
index = 0; index = 0;
while ( index < level.players.size ) while ( index < level.players.size )
@ -74,30 +68,27 @@ getsplitscreenteam()
index++; index++;
continue; continue;
} }
else if ( level.players[ index ] == self ) if ( level.players[ index ] == self )
{ {
index++; index++;
continue; continue;
} }
else if ( !self isplayeronsamemachine( level.players[ index ] ) ) if ( !self isplayeronsamemachine( level.players[ index ] ) )
{ {
index++; index++;
continue; continue;
} }
else team = level.players[ index ].sessionteam;
if ( team != "spectator" )
{ {
team = level.players[ index ].sessionteam; return team;
if ( team != "spectator" )
{
return team;
}
} }
index++; index++;
} }
return self.sessionteam; return self.sessionteam;
} }
otherlocalplayerstillalive() otherlocalplayerstillalive() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{ {
index = 0; index = 0;
while ( index < level.players.size ) while ( index < level.players.size )
@ -107,47 +98,37 @@ otherlocalplayerstillalive()
index++; index++;
continue; continue;
} }
else if ( level.players[ index ] == self ) if ( level.players[ index ] == self )
{ {
index++; index++;
continue; continue;
} }
else if ( !self isplayeronsamemachine( level.players[ index ] ) ) if ( !self isplayeronsamemachine( level.players[ index ] ) )
{ {
index++; index++;
continue; continue;
} }
else if ( isalive( level.players[ index ] ) )
{ {
if ( isalive( level.players[ index ] ) ) return 1;
{
return 1;
}
} }
index++; index++;
} }
return 0; return 0;
} }
allowspectateallteams( allow ) allowspectateallteams( allow ) //checked changed to match cerberus output
{ {
_a114 = level.teams; foreach ( team in level.teams )
_k114 = getFirstArrayKey( _a114 );
while ( isDefined( _k114 ) )
{ {
team = _a114[ _k114 ];
self allowspectateteam( team, allow ); self allowspectateteam( team, allow );
_k114 = getNextArrayKey( _a114, _k114 );
} }
} }
allowspectateallteamsexceptteam( skip_team, allow ) allowspectateallteamsexceptteam( skip_team, allow ) //checked partially changed to match cerberus output did not use continue in foreach see github for more info
{ {
_a122 = level.teams; foreach ( team in level.teams )
_k122 = getFirstArrayKey( _a122 );
while ( isDefined( _k122 ) )
{ {
team = _a122[ _k122 ];
if ( team == skip_team ) if ( team == skip_team )
{ {
} }
@ -155,11 +136,10 @@ allowspectateallteamsexceptteam( skip_team, allow )
{ {
self allowspectateteam( team, allow ); self allowspectateteam( team, allow );
} }
_k122 = getNextArrayKey( _a122, _k122 );
} }
} }
setspectatepermissions() setspectatepermissions() //checked changed to match cerberus output
{ {
team = self.sessionteam; team = self.sessionteam;
if ( team == "spectator" ) if ( team == "spectator" )
@ -194,40 +174,37 @@ setspectatepermissions()
self allowspectateteam( "freelook", 0 ); self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 ); self allowspectateteam( "localplayers", 1 );
break; break;
} }
else case 1:
{ if ( !level.teambased )
case 1: {
if ( !level.teambased )
{
self allowspectateallteams( 1 );
self allowspectateteam( "none", 1 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 );
}
else if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{
self allowspectateteam( team, 1 );
self allowspectateallteamsexceptteam( team, 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
else
{
self allowspectateallteams( 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
break;
case 2:
self allowspectateallteams( 1 ); self allowspectateallteams( 1 );
self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 ); self allowspectateteam( "none", 1 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 ); self allowspectateteam( "localplayers", 1 );
break; }
} else if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{
self allowspectateteam( team, 1 );
self allowspectateallteamsexceptteam( team, 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
else
{
self allowspectateallteams( 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
break;
case 2:
self allowspectateallteams( 1 );
self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 );
self allowspectateteam( "localplayers", 1 );
break;
} }
if ( isDefined( team ) && isDefined( level.teams[ team ] ) ) if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{ {
@ -242,7 +219,7 @@ setspectatepermissions()
} }
} }
setspectatepermissionsformachine() setspectatepermissionsformachine() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{ {
self setspectatepermissions(); self setspectatepermissions();
if ( !self issplitscreen() ) if ( !self issplitscreen() )
@ -267,10 +244,8 @@ setspectatepermissionsformachine()
index++; index++;
continue; continue;
} }
else level.players[ index ] setspectatepermissions();
{
level.players[ index ] setspectatepermissions();
}
index++; index++;
} }
} }

View File

@ -22,16 +22,30 @@ patch_mp/maps/mp/gametypes/_shellshock.gsc
patch_mp/maps/mp/bots/_bot.gsc patch_mp/maps/mp/bots/_bot.gsc
patch_mp/maps/mp/bots/_bot_combat.gsc patch_mp/maps/mp/bots/_bot_combat.gsc
patch_mp/maps/mp/bots/_bot_loadout.gsc patch_mp/maps/mp/bots/_bot_loadout.gsc
patch_mp/maps/mp/bots/_bot_conf.gsc
patch_mp/maps/mp/bots/_bot_ctf.gsc
patch_mp/maps/mp/bots/_bot_dem.gsc
patch_mp/maps/mp/bots/_bot_dom.gsc
patch_mp/maps/mp/bots/_bot_hack.gsc
patch_mp/maps/mp/bots/_bot_hq.gsc
patch_mp/maps/mp/bots/_bot_koth.gsc
patch_mp/maps/mp/bots/_bot_sd.gsc
patch_mp/maps/mp/gametypes/_callbacksetup.gsc patch_mp/maps/mp/gametypes/_callbacksetup.gsc
patch_mp/maps/mp/gametypes/_damagefeedback.gsc patch_mp/maps/mp/gametypes/_damagefeedback.gsc
patch_mp/maps/mp/gametypes/_deathicons.gsc
patch_mp/maps/mp/gametypes/_friendicons.gsc
patch_mp/maps/mp/gametypes/_globallogic.gsc patch_mp/maps/mp/gametypes/_globallogic.gsc
patch_mp/maps/mp/gametypes/_healthoverlay.gsc patch_mp/maps/mp/gametypes/_healthoverlay.gsc
patch_mp/maps/mp/gametypes/_hostmigration.gsc patch_mp/maps/mp/gametypes/_hostmigration.gsc
patch_mp/maps/mp/gametypes/_hud.gsc patch_mp/maps/mp/gametypes/_hud.gsc
patch_mp/maps/mp/gametypes/_killcam.gsc
patch_mp/maps/mp/gametypes/_menus.gsc patch_mp/maps/mp/gametypes/_menus.gsc
patch_mp/maps/mp/gametypes/_objpoints.gsc
patch_mp/maps/mp/gametypes/_perplayer.gsc patch_mp/maps/mp/gametypes/_perplayer.gsc
patch_mp/maps/mp/gametypes/_rank.gsc
patch_mp/maps/mp/gametypes/_serversettings.gsc patch_mp/maps/mp/gametypes/_serversettings.gsc
patch_mp/maps/mp/gametypes/_spectating.gsc
patch_mp/maps/mp/gametypes/_tweakables.gsc patch_mp/maps/mp/gametypes/_tweakables.gsc
patch_mp/maps/mp/gametypes/_weapon_utils.gsc patch_mp/maps/mp/gametypes/_weapon_utils.gsc
patch_mp/maps/mp/gametypes/conf.gsc patch_mp/maps/mp/gametypes/conf.gsc
@ -51,20 +65,9 @@ patch_mp/maps/mp/gametypes/tdm.gsc
``` ```
### The following scripts are not checked yet, uploaded to setup a baseline: ### The following scripts are not checked yet, uploaded to setup a baseline:
``` ```
patch_mp/maps/mp/bots/_bot_conf.gsc
patch_mp/maps/mp/bots/_bot_ctf.gsc
patch_mp/maps/mp/bots/_bot_dem.gsc
patch_mp/maps/mp/bots/_bot_dom.gsc
patch_mp/maps/mp/bots/_bot_hack.gsc
patch_mp/maps/mp/bots/_bot_hq.gsc
patch_mp/maps/mp/bots/_bot_koth.gsc
patch_mp/maps/mp/bots/_bot_sd.gsc
patch_mp/maps/mp/gametypes/_battlechatter.gsc patch_mp/maps/mp/gametypes/_battlechatter.gsc
patch_mp/maps/mp/gametypes/_class.gsc patch_mp/maps/mp/gametypes/_class.gsc
patch_mp/maps/mp/gametypes/_copter.gsc patch_mp/maps/mp/gametypes/_copter.gsc
patch_mp/maps/mp/gametypes/_deathicons.gsc
patch_mp/maps/mp/gametypes/_friendicons.gsc
patch_mp/maps/mp/gametypes/_gameobjects.gsc patch_mp/maps/mp/gametypes/_gameobjects.gsc
patch_mp/maps/mp/gametypes/_globallogic_actor.gsc patch_mp/maps/mp/gametypes/_globallogic_actor.gsc
patch_mp/maps/mp/gametypes/_globallogic_audio.gsc patch_mp/maps/mp/gametypes/_globallogic_audio.gsc
@ -77,14 +80,10 @@ patch_mp/maps/mp/gametypes/_globallogic_utils.gsc
patch_mp/maps/mp/gametypes/_globallogic_vehicle.gsc patch_mp/maps/mp/gametypes/_globallogic_vehicle.gsc
patch_mp/maps/mp/gametypes/_hud_message.gsc patch_mp/maps/mp/gametypes/_hud_message.gsc
patch_mp/maps/mp/gametypes/_hud_util.gsc patch_mp/maps/mp/gametypes/_hud_util.gsc
patch_mp/maps/mp/gametypes/_killcam.gsc
patch_mp/maps/mp/gametypes/_objpoints.gsc
patch_mp/maps/mp/gametypes/_persistence.gsc patch_mp/maps/mp/gametypes/_persistence.gsc
patch_mp/maps/mp/gametypes/_pregame.gsc patch_mp/maps/mp/gametypes/_pregame.gsc
patch_mp/maps/mp/gametypes/_rank.gsc
patch_mp/maps/mp/gametypes/_spawning.gsc patch_mp/maps/mp/gametypes/_spawning.gsc
patch_mp/maps/mp/gametypes/_spawnlogic.gsc patch_mp/maps/mp/gametypes/_spawnlogic.gsc
patch_mp/maps/mp/gametypes/_spectating.gsc
patch_mp/maps/mp/gametypes/_wager.gsc patch_mp/maps/mp/gametypes/_wager.gsc
patch_mp/maps/mp/gametypes/_weaponobjects.gsc patch_mp/maps/mp/gametypes/_weaponobjects.gsc
patch_mp/maps/mp/gametypes/_weapons.gsc patch_mp/maps/mp/gametypes/_weapons.gsc

View File

@ -1,11 +1,11 @@
init() init() //checked matches cerberus output
{ {
level.clientid = 0; level.clientid = 0;
level thread onplayerconnect(); level thread onplayerconnect();
} }
onplayerconnect() onplayerconnect() //checked matches cerberus output
{ {
for ( ;; ) for ( ;; )
{ {

View File

@ -1,5 +1,5 @@
init() init() //checked matches cerberus output
{ {
setdvar( "g_ScoresColor_Spectator", ".25 .25 .25" ); setdvar( "g_ScoresColor_Spectator", ".25 .25 .25" );
setdvar( "g_ScoresColor_Free", ".76 .78 .10" ); setdvar( "g_ScoresColor_Free", ".76 .78 .10" );

View File

@ -1,18 +1,14 @@
init() init() //checked changed to match cerberus output
{ {
_a3 = level.teams; foreach ( team in level.teams )
_k3 = getFirstArrayKey( _a3 );
while ( isDefined( _k3 ) )
{ {
team = _a3[ _k3 ];
level.spectateoverride[ team ] = spawnstruct(); level.spectateoverride[ team ] = spawnstruct();
_k3 = getNextArrayKey( _a3, _k3 );
} }
level thread onplayerconnect(); level thread onplayerconnect();
} }
onplayerconnect() onplayerconnect() //checked matches cerberus output
{ {
for ( ;; ) for ( ;; )
{ {
@ -23,7 +19,7 @@ onplayerconnect()
} }
} }
onplayerspawned() onplayerspawned() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) for ( ;; )
@ -33,7 +29,7 @@ onplayerspawned()
} }
} }
onjoinedteam() onjoinedteam() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) for ( ;; )
@ -43,7 +39,7 @@ onjoinedteam()
} }
} }
onjoinedspectators() onjoinedspectators() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
for ( ;; ) for ( ;; )
@ -53,18 +49,16 @@ onjoinedspectators()
} }
} }
updatespectatesettings() updatespectatesettings() //checked changed to match cerberus output
{ {
level endon( "game_ended" ); level endon( "game_ended" );
index = 0; for ( index = 0; index < level.players.size; index++ )
while ( index < level.players.size )
{ {
level.players[ index ] setspectatepermissions(); level.players[ index ] setspectatepermissions();
index++;
} }
} }
getsplitscreenteam() getsplitscreenteam() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{ {
index = 0; index = 0;
while ( index < level.players.size ) while ( index < level.players.size )
@ -74,30 +68,27 @@ getsplitscreenteam()
index++; index++;
continue; continue;
} }
else if ( level.players[ index ] == self ) if ( level.players[ index ] == self )
{ {
index++; index++;
continue; continue;
} }
else if ( !self isplayeronsamemachine( level.players[ index ] ) ) if ( !self isplayeronsamemachine( level.players[ index ] ) )
{ {
index++; index++;
continue; continue;
} }
else team = level.players[ index ].sessionteam;
if ( team != "spectator" )
{ {
team = level.players[ index ].sessionteam; return team;
if ( team != "spectator" )
{
return team;
}
} }
index++; index++;
} }
return self.sessionteam; return self.sessionteam;
} }
otherlocalplayerstillalive() otherlocalplayerstillalive() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{ {
index = 0; index = 0;
while ( index < level.players.size ) while ( index < level.players.size )
@ -107,47 +98,37 @@ otherlocalplayerstillalive()
index++; index++;
continue; continue;
} }
else if ( level.players[ index ] == self ) if ( level.players[ index ] == self )
{ {
index++; index++;
continue; continue;
} }
else if ( !self isplayeronsamemachine( level.players[ index ] ) ) if ( !self isplayeronsamemachine( level.players[ index ] ) )
{ {
index++; index++;
continue; continue;
} }
else if ( isalive( level.players[ index ] ) )
{ {
if ( isalive( level.players[ index ] ) ) return 1;
{
return 1;
}
} }
index++; index++;
} }
return 0; return 0;
} }
allowspectateallteams( allow ) allowspectateallteams( allow ) //checked changed to match cerberus output
{ {
_a114 = level.teams; foreach ( team in level.teams )
_k114 = getFirstArrayKey( _a114 );
while ( isDefined( _k114 ) )
{ {
team = _a114[ _k114 ];
self allowspectateteam( team, allow ); self allowspectateteam( team, allow );
_k114 = getNextArrayKey( _a114, _k114 );
} }
} }
allowspectateallteamsexceptteam( skip_team, allow ) allowspectateallteamsexceptteam( skip_team, allow ) //checked partially changed to match cerberus output did not use continue in foreach see github for more info
{ {
_a122 = level.teams; foreach ( team in level.teams )
_k122 = getFirstArrayKey( _a122 );
while ( isDefined( _k122 ) )
{ {
team = _a122[ _k122 ];
if ( team == skip_team ) if ( team == skip_team )
{ {
} }
@ -155,11 +136,10 @@ allowspectateallteamsexceptteam( skip_team, allow )
{ {
self allowspectateteam( team, allow ); self allowspectateteam( team, allow );
} }
_k122 = getNextArrayKey( _a122, _k122 );
} }
} }
setspectatepermissions() setspectatepermissions() //checked changed to match cerberus output
{ {
team = self.sessionteam; team = self.sessionteam;
if ( team == "spectator" ) if ( team == "spectator" )
@ -194,40 +174,37 @@ setspectatepermissions()
self allowspectateteam( "freelook", 0 ); self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 ); self allowspectateteam( "localplayers", 1 );
break; break;
} }
else case 1:
{ if ( !level.teambased )
case 1: {
if ( !level.teambased )
{
self allowspectateallteams( 1 );
self allowspectateteam( "none", 1 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 );
}
else if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{
self allowspectateteam( team, 1 );
self allowspectateallteamsexceptteam( team, 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
else
{
self allowspectateallteams( 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
break;
case 2:
self allowspectateallteams( 1 ); self allowspectateallteams( 1 );
self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 ); self allowspectateteam( "none", 1 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "localplayers", 1 ); self allowspectateteam( "localplayers", 1 );
break; }
} else if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{
self allowspectateteam( team, 1 );
self allowspectateallteamsexceptteam( team, 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
else
{
self allowspectateallteams( 0 );
self allowspectateteam( "freelook", 0 );
self allowspectateteam( "none", 0 );
self allowspectateteam( "localplayers", 1 );
}
break;
case 2:
self allowspectateallteams( 1 );
self allowspectateteam( "freelook", 1 );
self allowspectateteam( "none", 1 );
self allowspectateteam( "localplayers", 1 );
break;
} }
if ( isDefined( team ) && isDefined( level.teams[ team ] ) ) if ( isDefined( team ) && isDefined( level.teams[ team ] ) )
{ {
@ -242,7 +219,7 @@ setspectatepermissions()
} }
} }
setspectatepermissionsformachine() setspectatepermissionsformachine() //checked partially changed to match cerberus output did not change while loop to for loop see github for more info
{ {
self setspectatepermissions(); self setspectatepermissions();
if ( !self issplitscreen() ) if ( !self issplitscreen() )
@ -267,10 +244,8 @@ setspectatepermissionsformachine()
index++; index++;
continue; continue;
} }
else level.players[ index ] setspectatepermissions();
{
level.players[ index ] setspectatepermissions();
}
index++; index++;
} }
} }

View File

@ -57,6 +57,7 @@ patch_zm/maps/mp/gametypes_zm/_hud.gsc
patch_zm/maps/mp/gametypes_zm/_menus.gsc patch_zm/maps/mp/gametypes_zm/_menus.gsc
patch_zm/maps/mp/gametypes_zm/_perplayer.gsc patch_zm/maps/mp/gametypes_zm/_perplayer.gsc
patch_zm/maps/mp/gametypes_zm/_serversettings.gsc patch_zm/maps/mp/gametypes_zm/_serversettings.gsc
patch_zm/maps/mp/gametypes_zm/_spectating.gsc
patch_zm/maps/mp/gametypes_zm/_tweakables.gsc patch_zm/maps/mp/gametypes_zm/_tweakables.gsc
patch_zm/maps/mp/gametypes_zm/_weapon_utils.gsc patch_zm/maps/mp/gametypes_zm/_weapon_utils.gsc
patch_zm/maps/mp/zombies/_zm_blockers.gsc patch_zm/maps/mp/zombies/_zm_blockers.gsc
@ -93,7 +94,6 @@ patch_zm/maps/mp/gametypes_zm/_hud_message.gsc
patch_zm/maps/mp/gametypes_zm/_hud_util.gsc patch_zm/maps/mp/gametypes_zm/_hud_util.gsc
patch_zm/maps/mp/gametypes_zm/_spawning.gsc patch_zm/maps/mp/gametypes_zm/_spawning.gsc
patch_zm/maps/mp/gametypes_zm/_spawnlogic.gsc patch_zm/maps/mp/gametypes_zm/_spawnlogic.gsc
patch_zm/maps/mp/gametypes_zm/_spectating.gsc
patch_zm/maps/mp/gametypes_zm/_weaponobjects.gsc patch_zm/maps/mp/gametypes_zm/_weaponobjects.gsc
patch_zm/maps/mp/gametypes_zm/_weapons.gsc patch_zm/maps/mp/gametypes_zm/_weapons.gsc
``` ```