mirror of
https://github.com/JezuzLizard/Recompilable-gscs-for-BO2-zombies-and-multiplayer.git
synced 2025-06-10 10:47:58 -05:00
checked 10 more scripts
8 are for mp and zm _healthoverlay, _hostmigration, _menus, and _tweakables. Additionally _zm_chugabud, and _zm_equipment were checked for zm.
This commit is contained in:
@ -1,16 +1,16 @@
|
||||
#include maps/mp/gametypes/_globallogic_player;
|
||||
|
||||
init()
|
||||
init() //checked matches cerberus output
|
||||
{
|
||||
precacheshader( "overlay_low_health" );
|
||||
level.healthoverlaycutoff = 0,55;
|
||||
level.healthoverlaycutoff = 0.55;
|
||||
regentime = level.playerhealthregentime;
|
||||
level.playerhealth_regularregendelay = regentime * 1000;
|
||||
level.healthregendisabled = level.playerhealth_regularregendelay <= 0;
|
||||
level thread onplayerconnect();
|
||||
}
|
||||
|
||||
onplayerconnect()
|
||||
onplayerconnect() //checked matches cerberus output
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
@ -23,7 +23,7 @@ onplayerconnect()
|
||||
}
|
||||
}
|
||||
|
||||
onjoinedteam()
|
||||
onjoinedteam() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -33,7 +33,7 @@ onjoinedteam()
|
||||
}
|
||||
}
|
||||
|
||||
onjoinedspectators()
|
||||
onjoinedspectators() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -43,7 +43,7 @@ onjoinedspectators()
|
||||
}
|
||||
}
|
||||
|
||||
onplayerspawned()
|
||||
onplayerspawned() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -53,7 +53,7 @@ onplayerspawned()
|
||||
}
|
||||
}
|
||||
|
||||
onplayerkilled()
|
||||
onplayerkilled() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -63,38 +63,40 @@ onplayerkilled()
|
||||
}
|
||||
}
|
||||
|
||||
onplayerdisconnect()
|
||||
onplayerdisconnect() //checked matches cerberus output
|
||||
{
|
||||
self waittill( "disconnect" );
|
||||
self notify( "end_healthregen" );
|
||||
}
|
||||
|
||||
playerhealthregen()
|
||||
playerhealthregen() //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
if ( self.health <= 0 )
|
||||
{
|
||||
/*
|
||||
/#
|
||||
assert( !isalive( self ) );
|
||||
#/
|
||||
*/
|
||||
return;
|
||||
}
|
||||
maxhealth = self.health;
|
||||
oldhealth = maxhealth;
|
||||
player = self;
|
||||
health_add = 0;
|
||||
regenrate = 0,1;
|
||||
regenrate = 0.1;
|
||||
usetrueregen = 0;
|
||||
veryhurt = 0;
|
||||
player.breathingstoptime = -10000;
|
||||
thread playerbreathingsound( maxhealth * 0,35 );
|
||||
thread playerheartbeatsound( maxhealth * 0,35 );
|
||||
thread playerbreathingsound( maxhealth * 0.35 );
|
||||
thread playerheartbeatsound( maxhealth * 0.35 );
|
||||
lastsoundtime_recover = 0;
|
||||
hurttime = 0;
|
||||
newhealth = 0;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0,05;
|
||||
wait 0.05;
|
||||
if ( isDefined( player.regenrate ) )
|
||||
{
|
||||
regenrate = player.regenrate;
|
||||
@ -106,7 +108,7 @@ playerhealthregen()
|
||||
self.atbrinkofdeath = 0;
|
||||
continue;
|
||||
}
|
||||
else if ( player.health <= 0 )
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -114,90 +116,84 @@ playerhealthregen()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
wasveryhurt = veryhurt;
|
||||
ratio = player.health / maxhealth;
|
||||
if ( ratio <= level.healthoverlaycutoff )
|
||||
{
|
||||
wasveryhurt = veryhurt;
|
||||
ratio = player.health / maxhealth;
|
||||
if ( ratio <= level.healthoverlaycutoff )
|
||||
veryhurt = 1;
|
||||
self.atbrinkofdeath = 1;
|
||||
if ( !wasveryhurt )
|
||||
{
|
||||
veryhurt = 1;
|
||||
self.atbrinkofdeath = 1;
|
||||
if ( !wasveryhurt )
|
||||
{
|
||||
hurttime = getTime();
|
||||
}
|
||||
hurttime = getTime();
|
||||
}
|
||||
if ( player.health >= oldhealth )
|
||||
}
|
||||
if ( player.health >= oldhealth )
|
||||
{
|
||||
regentime = level.playerhealth_regularregendelay;
|
||||
if ( player hasperk( "specialty_healthregen" ) )
|
||||
{
|
||||
regentime = level.playerhealth_regularregendelay;
|
||||
regentime = int( regentime / getDvarFloat( "perk_healthRegenMultiplier" ) );
|
||||
}
|
||||
if ( ( getTime() - hurttime ) < regentime )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if ( level.healthregendisabled )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if ( ( getTime() - lastsoundtime_recover ) > regentime )
|
||||
{
|
||||
lastsoundtime_recover = getTime();
|
||||
self notify( "snd_breathing_better" );
|
||||
}
|
||||
if ( veryhurt )
|
||||
{
|
||||
newhealth = ratio;
|
||||
veryhurttime = 3000;
|
||||
if ( player hasperk( "specialty_healthregen" ) )
|
||||
{
|
||||
regentime = int( regentime / getDvarFloat( "perk_healthRegenMultiplier" ) );
|
||||
veryhurttime = int( veryhurttime / getDvarFloat( "perk_healthRegenMultiplier" ) );
|
||||
}
|
||||
if ( ( getTime() - hurttime ) < regentime )
|
||||
if ( getTime() > ( hurttime + veryhurttime ) )
|
||||
{
|
||||
break;
|
||||
newhealth += regenrate;
|
||||
}
|
||||
else if ( level.healthregendisabled )
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if ( ( getTime() - lastsoundtime_recover ) > regentime )
|
||||
{
|
||||
lastsoundtime_recover = getTime();
|
||||
self notify( "snd_breathing_better" );
|
||||
}
|
||||
if ( veryhurt )
|
||||
{
|
||||
newhealth = ratio;
|
||||
veryhurttime = 3000;
|
||||
if ( player hasperk( "specialty_healthregen" ) )
|
||||
{
|
||||
veryhurttime = int( veryhurttime / getDvarFloat( "perk_healthRegenMultiplier" ) );
|
||||
}
|
||||
if ( getTime() > ( hurttime + veryhurttime ) )
|
||||
{
|
||||
newhealth += regenrate;
|
||||
}
|
||||
}
|
||||
else if ( usetrueregen )
|
||||
{
|
||||
newhealth = ratio + regenrate;
|
||||
}
|
||||
else
|
||||
{
|
||||
newhealth = 1;
|
||||
}
|
||||
if ( newhealth >= 1 )
|
||||
{
|
||||
self maps/mp/gametypes/_globallogic_player::resetattackerlist();
|
||||
newhealth = 1;
|
||||
}
|
||||
if ( newhealth <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
player setnormalhealth( newhealth );
|
||||
change = player.health - oldhealth;
|
||||
if ( change > 0 )
|
||||
{
|
||||
player decayplayerdamages( change );
|
||||
}
|
||||
oldhealth = player.health;
|
||||
break;
|
||||
}
|
||||
else if ( usetrueregen )
|
||||
{
|
||||
newhealth = ratio + regenrate;
|
||||
}
|
||||
else
|
||||
{
|
||||
oldhealth = player.health;
|
||||
health_add = 0;
|
||||
hurttime = getTime();
|
||||
player.breathingstoptime = hurttime + 6000;
|
||||
newhealth = 1;
|
||||
}
|
||||
if ( newhealth >= 1 )
|
||||
{
|
||||
self maps/mp/gametypes/_globallogic_player::resetattackerlist();
|
||||
newhealth = 1;
|
||||
}
|
||||
if ( newhealth <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
player setnormalhealth( newhealth );
|
||||
change = player.health - oldhealth;
|
||||
if ( change > 0 )
|
||||
{
|
||||
player decayplayerdamages( change );
|
||||
}
|
||||
oldhealth = player.health;
|
||||
continue;
|
||||
}
|
||||
oldhealth = player.health;
|
||||
health_add = 0;
|
||||
hurttime = getTime();
|
||||
player.breathingstoptime = hurttime + 6000;
|
||||
}
|
||||
}
|
||||
|
||||
decayplayerdamages( decay )
|
||||
decayplayerdamages( decay ) //checked partially changed to match cerberus output //continues in for loops bad see github for more info
|
||||
{
|
||||
if ( !isDefined( self.attackerdamage ) )
|
||||
{
|
||||
@ -211,26 +207,23 @@ decayplayerdamages( decay )
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
self.attackerdamage[ i ].damage -= decay;
|
||||
if ( self.attackerdamage[ i ].damage < 0 )
|
||||
{
|
||||
self.attackerdamage[ i ].damage -= decay;
|
||||
if ( self.attackerdamage[ i ].damage < 0 )
|
||||
{
|
||||
self.attackerdamage[ i ].damage = 0;
|
||||
}
|
||||
self.attackerdamage[ i ].damage = 0;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
playerbreathingsound( healthcap )
|
||||
playerbreathingsound( healthcap ) //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
wait 2;
|
||||
player = self;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0,2;
|
||||
wait 0.2;
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
return;
|
||||
@ -243,46 +236,41 @@ playerbreathingsound( healthcap )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
player notify( "snd_breathing_hurt" );
|
||||
wait 0.784;
|
||||
wait ( 0.1 + randomfloat( 0.8 ) );
|
||||
}
|
||||
}
|
||||
|
||||
playerheartbeatsound( healthcap ) //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
self.hearbeatwait = 0.2;
|
||||
wait 2;
|
||||
player = self;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0.2;
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
player notify( "snd_breathing_hurt" );
|
||||
wait 0,784;
|
||||
wait ( 0,1 + randomfloat( 0,8 ) );
|
||||
return;
|
||||
}
|
||||
if ( player.health >= healthcap )
|
||||
{
|
||||
self.hearbeatwait = 0.3;
|
||||
continue;
|
||||
}
|
||||
else if ( level.healthregendisabled && getTime() > player.breathingstoptime )
|
||||
{
|
||||
self.hearbeatwait = 0.3;
|
||||
continue;
|
||||
}
|
||||
player playlocalsound( "mpl_player_heartbeat" );
|
||||
wait self.hearbeatwait;
|
||||
if ( self.hearbeatwait <= 0.6 )
|
||||
{
|
||||
self.hearbeatwait += 0.1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
playerheartbeatsound( healthcap )
|
||||
{
|
||||
self endon( "end_healthregen" );
|
||||
self.hearbeatwait = 0,2;
|
||||
wait 2;
|
||||
player = self;
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0,2;
|
||||
if ( player.health <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( player.health >= healthcap )
|
||||
{
|
||||
self.hearbeatwait = 0,3;
|
||||
continue;
|
||||
}
|
||||
else if ( level.healthregendisabled && getTime() > player.breathingstoptime )
|
||||
{
|
||||
self.hearbeatwait = 0,3;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
player playlocalsound( "mpl_player_heartbeat" );
|
||||
wait self.hearbeatwait;
|
||||
if ( self.hearbeatwait <= 0,6 )
|
||||
{
|
||||
self.hearbeatwait += 0,1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,9 @@
|
||||
#include common_scripts/utility;
|
||||
#include maps/mp/_utility;
|
||||
|
||||
debug_script_structs()
|
||||
debug_script_structs() //dev call did not check
|
||||
{
|
||||
/*
|
||||
/#
|
||||
if ( isDefined( level.struct ) )
|
||||
{
|
||||
@ -29,9 +30,10 @@ debug_script_structs()
|
||||
}
|
||||
else println( "*** No structs defined." );
|
||||
#/
|
||||
*/
|
||||
}
|
||||
|
||||
updatetimerpausedness()
|
||||
updatetimerpausedness() //checked matches cerberus output
|
||||
{
|
||||
shouldbestopped = isDefined( level.hostmigrationtimer );
|
||||
if ( !level.timerstopped && shouldbestopped )
|
||||
@ -39,38 +41,35 @@ updatetimerpausedness()
|
||||
level.timerstopped = 1;
|
||||
level.timerpausetime = getTime();
|
||||
}
|
||||
else
|
||||
else if ( level.timerstopped && !shouldbestopped )
|
||||
{
|
||||
if ( level.timerstopped && !shouldbestopped )
|
||||
{
|
||||
level.timerstopped = 0;
|
||||
level.discardtime += getTime() - level.timerpausetime;
|
||||
}
|
||||
level.timerstopped = 0;
|
||||
level.discardtime += getTime() - level.timerpausetime;
|
||||
}
|
||||
}
|
||||
|
||||
callback_hostmigrationsave()
|
||||
callback_hostmigrationsave() //checked matches cerberus output
|
||||
{
|
||||
}
|
||||
|
||||
pausetimer()
|
||||
pausetimer() //checked matches cerberus output
|
||||
{
|
||||
level.migrationtimerpausetime = getTime();
|
||||
}
|
||||
|
||||
resumetimer()
|
||||
resumetimer() //checked matches cerberus output
|
||||
{
|
||||
level.discardtime += getTime() - level.migrationtimerpausetime;
|
||||
}
|
||||
|
||||
locktimer()
|
||||
locktimer() //checked matches cerberus output
|
||||
{
|
||||
level endon( "host_migration_begin" );
|
||||
level endon( "host_migration_end" );
|
||||
for ( ;; )
|
||||
{
|
||||
currtime = getTime();
|
||||
wait 0,05;
|
||||
wait 0.05;
|
||||
if ( !level.timerstopped && isDefined( level.discardtime ) )
|
||||
{
|
||||
level.discardtime += getTime() - currtime;
|
||||
@ -78,7 +77,7 @@ locktimer()
|
||||
}
|
||||
}
|
||||
|
||||
callback_hostmigration()
|
||||
callback_hostmigration() //checked changed to match cerberus output
|
||||
{
|
||||
setslowmotion( 1, 1, 0 );
|
||||
makedvarserverinfo( "ui_guncycle", 0 );
|
||||
@ -89,38 +88,42 @@ callback_hostmigration()
|
||||
}
|
||||
if ( level.gameended )
|
||||
{
|
||||
/*
|
||||
/#
|
||||
println( "Migration starting at time " + getTime() + ", but game has ended, so no countdown." );
|
||||
#/
|
||||
*/
|
||||
return;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
println( "Migration starting at time " + getTime() );
|
||||
#/
|
||||
*/
|
||||
level.hostmigrationtimer = 1;
|
||||
sethostmigrationstatus( 1 );
|
||||
level notify( "host_migration_begin" );
|
||||
thread locktimer();
|
||||
players = level.players;
|
||||
i = 0;
|
||||
while ( i < players.size )
|
||||
for ( i = 0; i < players.size; i++ )
|
||||
{
|
||||
player = players[ i ];
|
||||
player thread hostmigrationtimerthink();
|
||||
i++;
|
||||
}
|
||||
level endon( "host_migration_begin" );
|
||||
hostmigrationwait();
|
||||
level.hostmigrationtimer = undefined;
|
||||
sethostmigrationstatus( 0 );
|
||||
/*
|
||||
/#
|
||||
println( "Migration finished at time " + getTime() );
|
||||
#/
|
||||
*/
|
||||
recordmatchbegin();
|
||||
level notify( "host_migration_end" );
|
||||
}
|
||||
|
||||
matchstarttimerconsole_internal( counttime, matchstarttimer )
|
||||
matchstarttimerconsole_internal( counttime, matchstarttimer ) //checked matches cerberus output
|
||||
{
|
||||
waittillframeend;
|
||||
visionsetnaked( "mpIntro", 0 );
|
||||
@ -128,7 +131,7 @@ matchstarttimerconsole_internal( counttime, matchstarttimer )
|
||||
while ( counttime > 0 && !level.gameended )
|
||||
{
|
||||
matchstarttimer thread maps/mp/gametypes/_hud::fontpulse( level );
|
||||
wait ( matchstarttimer.inframes * 0,05 );
|
||||
wait ( matchstarttimer.inframes * 0.05 );
|
||||
matchstarttimer setvalue( counttime );
|
||||
if ( counttime == 2 )
|
||||
{
|
||||
@ -136,22 +139,22 @@ matchstarttimerconsole_internal( counttime, matchstarttimer )
|
||||
}
|
||||
counttime--;
|
||||
|
||||
wait ( 1 - ( matchstarttimer.inframes * 0,05 ) );
|
||||
wait ( 1 - ( matchstarttimer.inframes * 0.05 ) );
|
||||
}
|
||||
}
|
||||
|
||||
matchstarttimerconsole( type, duration )
|
||||
matchstarttimerconsole( type, duration ) //checked matches cerberus output
|
||||
{
|
||||
level notify( "match_start_timer_beginning" );
|
||||
wait 0,05;
|
||||
matchstarttext = createserverfontstring( "objective", 1,5 );
|
||||
matchstarttext = createserverfontstring( "objective", 1.5 );
|
||||
matchstarttext setpoint( "CENTER", "CENTER", 0, -40 );
|
||||
matchstarttext.sort = 1001;
|
||||
matchstarttext settext( game[ "strings" ][ "waiting_for_teams" ] );
|
||||
matchstarttext.foreground = 0;
|
||||
matchstarttext.hidewheninmenu = 1;
|
||||
matchstarttext settext( game[ "strings" ][ type ] );
|
||||
matchstarttimer = createserverfontstring( "objective", 2,2 );
|
||||
matchstarttimer = createserverfontstring( "objective", 2.2 );
|
||||
matchstarttimer setpoint( "CENTER", "CENTER", 0, 0 );
|
||||
matchstarttimer.sort = 1001;
|
||||
matchstarttimer.color = ( 1, 1, 0 );
|
||||
@ -173,7 +176,7 @@ matchstarttimerconsole( type, duration )
|
||||
matchstarttext destroyelem();
|
||||
}
|
||||
|
||||
hostmigrationwait()
|
||||
hostmigrationwait() //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
level endon( "game_ended" );
|
||||
if ( level.hostmigrationreturnedplayercount < ( ( level.players.size * 2 ) / 3 ) )
|
||||
@ -186,7 +189,7 @@ hostmigrationwait()
|
||||
wait 5;
|
||||
}
|
||||
|
||||
waittillhostmigrationcountdown()
|
||||
waittillhostmigrationcountdown() //checked matches cerberus output
|
||||
{
|
||||
level endon( "host_migration_end" );
|
||||
if ( !isDefined( level.hostmigrationtimer ) )
|
||||
@ -196,13 +199,13 @@ waittillhostmigrationcountdown()
|
||||
level waittill( "host_migration_countdown_begin" );
|
||||
}
|
||||
|
||||
hostmigrationwaitforplayers()
|
||||
hostmigrationwaitforplayers() //checked matches cerberus output
|
||||
{
|
||||
level endon( "hostmigration_enoughplayers" );
|
||||
wait 15;
|
||||
}
|
||||
|
||||
hostmigrationtimerthink_internal()
|
||||
hostmigrationtimerthink_internal() //checked matches cerberus output
|
||||
{
|
||||
level endon( "host_migration_begin" );
|
||||
level endon( "host_migration_end" );
|
||||
@ -216,7 +219,7 @@ hostmigrationtimerthink_internal()
|
||||
level waittill( "host_migration_end" );
|
||||
}
|
||||
|
||||
hostmigrationtimerthink()
|
||||
hostmigrationtimerthink() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
level endon( "host_migration_begin" );
|
||||
@ -227,7 +230,7 @@ hostmigrationtimerthink()
|
||||
}
|
||||
}
|
||||
|
||||
waittillhostmigrationdone()
|
||||
waittillhostmigrationdone() //checked matches cerberus output
|
||||
{
|
||||
if ( !isDefined( level.hostmigrationtimer ) )
|
||||
{
|
||||
@ -238,7 +241,7 @@ waittillhostmigrationdone()
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
waittillhostmigrationstarts( duration )
|
||||
waittillhostmigrationstarts( duration ) //checked matches cerberus output
|
||||
{
|
||||
if ( isDefined( level.hostmigrationtimer ) )
|
||||
{
|
||||
@ -248,15 +251,17 @@ waittillhostmigrationstarts( duration )
|
||||
wait duration;
|
||||
}
|
||||
|
||||
waitlongdurationwithhostmigrationpause( duration )
|
||||
waitlongdurationwithhostmigrationpause( duration ) //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
if ( duration == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( duration > 0 );
|
||||
#/
|
||||
*/
|
||||
starttime = getTime();
|
||||
endtime = getTime() + ( duration * 1000 );
|
||||
while ( getTime() < endtime )
|
||||
@ -268,25 +273,29 @@ waitlongdurationwithhostmigrationpause( duration )
|
||||
endtime += timepassed;
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getTime() != endtime )
|
||||
{
|
||||
println( "SCRIPT WARNING: gettime() = " + getTime() + " NOT EQUAL TO endtime = " + endtime );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
waittillhostmigrationdone();
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
waitlongdurationwithhostmigrationpauseemp( duration )
|
||||
waitlongdurationwithhostmigrationpauseemp( duration ) //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
if ( duration == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( duration > 0 );
|
||||
#/
|
||||
*/
|
||||
starttime = getTime();
|
||||
empendtime = getTime() + ( duration * 1000 );
|
||||
level.empendtime = empendtime;
|
||||
@ -302,26 +311,30 @@ waitlongdurationwithhostmigrationpauseemp( duration )
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getTime() != empendtime )
|
||||
{
|
||||
println( "SCRIPT WARNING: gettime() = " + getTime() + " NOT EQUAL TO empendtime = " + empendtime );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
waittillhostmigrationdone();
|
||||
level.empendtime = undefined;
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
waitlongdurationwithgameendtimeupdate( duration )
|
||||
waitlongdurationwithgameendtimeupdate( duration ) //checked matches cerberus output may need to check order of operations
|
||||
{
|
||||
if ( duration == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( duration > 0 );
|
||||
#/
|
||||
*/
|
||||
starttime = getTime();
|
||||
endtime = getTime() + ( duration * 1000 );
|
||||
while ( getTime() < endtime )
|
||||
@ -334,12 +347,14 @@ waitlongdurationwithgameendtimeupdate( duration )
|
||||
wait 1;
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getTime() != endtime )
|
||||
{
|
||||
println( "SCRIPT WARNING: gettime() = " + getTime() + " NOT EQUAL TO endtime = " + endtime );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
while ( isDefined( level.hostmigrationtimer ) )
|
||||
{
|
||||
endtime += 1000;
|
||||
@ -348,3 +363,4 @@ waitlongdurationwithgameendtimeupdate( duration )
|
||||
}
|
||||
return getTime() - starttime;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include maps/mp/gametypes/_globallogic;
|
||||
#include maps/mp/_utility;
|
||||
|
||||
init()
|
||||
init() //checked changed to match cerberus output
|
||||
{
|
||||
precachestring( &"open_ingame_menu" );
|
||||
game[ "menu_team" ] = "team_marinesopfor";
|
||||
@ -16,13 +16,9 @@ init()
|
||||
game[ "menu_changeclass_wager" ] = "changeclass_wager";
|
||||
game[ "menu_changeclass_custom" ] = "changeclass_custom";
|
||||
game[ "menu_changeclass_barebones" ] = "changeclass_barebones";
|
||||
_a18 = level.teams;
|
||||
_k18 = getFirstArrayKey( _a18 );
|
||||
while ( isDefined( _k18 ) )
|
||||
foreach ( team in level.teams )
|
||||
{
|
||||
team = _a18[ _k18 ];
|
||||
game[ "menu_changeclass_" + team ] = "changeclass";
|
||||
_k18 = getNextArrayKey( _a18, _k18 );
|
||||
}
|
||||
game[ "menu_controls" ] = "ingame_controls";
|
||||
game[ "menu_options" ] = "ingame_options";
|
||||
@ -50,7 +46,7 @@ init()
|
||||
level thread onplayerconnect();
|
||||
}
|
||||
|
||||
onplayerconnect()
|
||||
onplayerconnect() //checked matches cerberus output
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
@ -59,7 +55,7 @@ onplayerconnect()
|
||||
}
|
||||
}
|
||||
|
||||
onmenuresponse()
|
||||
onmenuresponse() //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
@ -71,7 +67,7 @@ onmenuresponse()
|
||||
self closeingamemenu();
|
||||
if ( level.console )
|
||||
{
|
||||
if ( game[ "menu_changeclass" ] != menu && game[ "menu_changeclass_offline" ] != menu || menu == game[ "menu_team" ] && menu == game[ "menu_controls" ] )
|
||||
if ( menu == game[ "menu_changeclass" ] || menu == game[ "menu_changeclass_offline" ] || menu == game[ "menu_team" ] || menu == game[ "menu_controls" ] )
|
||||
{
|
||||
if ( isDefined( level.teams[ self.pers[ "team" ] ] ) )
|
||||
{
|
||||
@ -81,7 +77,7 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if ( response == "changeteam" && level.allow_teamchange == "1" )
|
||||
if ( response == "changeteam" && level.allow_teamchange == "1" )
|
||||
{
|
||||
self closemenu();
|
||||
self closeingamemenu();
|
||||
@ -107,12 +103,12 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if ( response == "killserverpc" )
|
||||
if ( response == "killserverpc" )
|
||||
{
|
||||
level thread maps/mp/gametypes/_globallogic::killserverpc();
|
||||
continue;
|
||||
}
|
||||
else if ( response == "endround" )
|
||||
if ( response == "endround" )
|
||||
{
|
||||
if ( !level.gameended )
|
||||
{
|
||||
@ -127,7 +123,7 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if ( menu == game[ "menu_team" ] && level.allow_teamchange == "1" )
|
||||
if ( menu == game[ "menu_team" ] && level.allow_teamchange == "1" )
|
||||
{
|
||||
switch( response )
|
||||
{
|
||||
@ -143,34 +139,29 @@ onmenuresponse()
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else
|
||||
if ( menu == game[ "menu_changeclass" ] || menu == game[ "menu_changeclass_offline" ] || menu == game[ "menu_changeclass_wager" ] || menu == game[ "menu_changeclass_custom" ] || menu == game[ "menu_changeclass_barebones" ] )
|
||||
{
|
||||
if ( game[ "menu_changeclass" ] != menu && game[ "menu_changeclass_offline" ] != menu && game[ "menu_changeclass_wager" ] != menu || menu == game[ "menu_changeclass_custom" ] && menu == game[ "menu_changeclass_barebones" ] )
|
||||
self closemenu();
|
||||
self closeingamemenu();
|
||||
if ( level.rankedmatch && issubstr( response, "custom" ) )
|
||||
{
|
||||
self closemenu();
|
||||
self closeingamemenu();
|
||||
if ( level.rankedmatch && issubstr( response, "custom" ) )
|
||||
if ( self isitemlocked( maps/mp/gametypes/_rank::getitemindex( "feature_cac" ) ) )
|
||||
{
|
||||
if ( self isitemlocked( maps/mp/gametypes/_rank::getitemindex( "feature_cac" ) ) )
|
||||
{
|
||||
kick( self getentitynumber() );
|
||||
}
|
||||
kick( self getentitynumber() );
|
||||
}
|
||||
self.selectedclass = 1;
|
||||
self [[ level.class ]]( response );
|
||||
break;
|
||||
}
|
||||
else
|
||||
self.selectedclass = 1;
|
||||
self [[ level.class ]]( response );
|
||||
continue;
|
||||
}
|
||||
if ( menu == "spectate" )
|
||||
{
|
||||
player = getplayerfromclientnum( int( response ) );
|
||||
if ( isDefined( player ) )
|
||||
{
|
||||
if ( menu == "spectate" )
|
||||
{
|
||||
player = getplayerfromclientnum( int( response ) );
|
||||
if ( isDefined( player ) )
|
||||
{
|
||||
self setcurrentspectatorclient( player );
|
||||
}
|
||||
}
|
||||
self setcurrentspectatorclient( player );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include maps/mp/_utility;
|
||||
|
||||
gettweakabledvarvalue( category, name )
|
||||
gettweakabledvarvalue( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -32,14 +32,16 @@ gettweakabledvarvalue( category, name )
|
||||
dvar = undefined;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( dvar ) );
|
||||
#/
|
||||
*/
|
||||
value = getDvarInt( dvar );
|
||||
return value;
|
||||
}
|
||||
|
||||
gettweakabledvar( category, name )
|
||||
gettweakabledvar( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -71,13 +73,15 @@ gettweakabledvar( category, name )
|
||||
value = undefined;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( value ) );
|
||||
#/
|
||||
*/
|
||||
return value;
|
||||
}
|
||||
|
||||
gettweakablevalue( category, name )
|
||||
gettweakablevalue( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -114,13 +118,15 @@ gettweakablevalue( category, name )
|
||||
{
|
||||
return getDvarInt( overridedvar );
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( value ) );
|
||||
#/
|
||||
*/
|
||||
return value;
|
||||
}
|
||||
|
||||
gettweakablelastvalue( category, name )
|
||||
gettweakablelastvalue( category, name ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -152,13 +158,15 @@ gettweakablelastvalue( category, name )
|
||||
value = undefined;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( value ) );
|
||||
#/
|
||||
*/
|
||||
return value;
|
||||
}
|
||||
|
||||
settweakablevalue( category, name, value )
|
||||
settweakablevalue( category, name, value ) //checked matches cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -193,7 +201,7 @@ settweakablevalue( category, name, value )
|
||||
setdvar( dvar, value );
|
||||
}
|
||||
|
||||
settweakablelastvalue( category, name, value )
|
||||
settweakablelastvalue( category, name, value ) //checked changed to match cerberus output
|
||||
{
|
||||
switch( category )
|
||||
{
|
||||
@ -222,11 +230,11 @@ settweakablelastvalue( category, name, value )
|
||||
level.hudtweaks[ name ].lastvalue = value;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
registertweakable( category, name, dvar, value )
|
||||
registertweakable( category, name, dvar, value ) //checked matches cerberus output
|
||||
{
|
||||
if ( isstring( value ) )
|
||||
{
|
||||
@ -324,7 +332,7 @@ registertweakable( category, name, dvar, value )
|
||||
}
|
||||
}
|
||||
|
||||
init()
|
||||
init() //checked matches cerberus output
|
||||
{
|
||||
level.clienttweakables = [];
|
||||
level.tweakablesinitialized = 1;
|
||||
@ -362,17 +370,16 @@ init()
|
||||
level thread updateuitweakables();
|
||||
}
|
||||
|
||||
setclienttweakable( category, name )
|
||||
setclienttweakable( category, name ) //checked matches cerberus output
|
||||
{
|
||||
level.clienttweakables[ level.clienttweakables.size ] = name;
|
||||
}
|
||||
|
||||
updateuitweakables()
|
||||
updateuitweakables() //checked changed to match cerberus output
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
index = 0;
|
||||
while ( index < level.clienttweakables.size )
|
||||
for ( index = 0; index < level.clienttweakables.size; index++ )
|
||||
{
|
||||
clienttweakable = level.clienttweakables[ index ];
|
||||
curvalue = gettweakabledvarvalue( "hud", clienttweakable );
|
||||
@ -382,13 +389,13 @@ updateuitweakables()
|
||||
updateserverdvar( gettweakabledvar( "hud", clienttweakable ), curvalue );
|
||||
settweakablelastvalue( "hud", clienttweakable, curvalue );
|
||||
}
|
||||
index++;
|
||||
}
|
||||
wait 1;
|
||||
}
|
||||
}
|
||||
|
||||
updateserverdvar( dvar, value )
|
||||
updateserverdvar( dvar, value ) //checked matches cerberus output
|
||||
{
|
||||
makedvarserverinfo( dvar, value );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user