gamemode fixes
parent
9696e39099
commit
7744518f3c
|
@ -33,11 +33,14 @@ getLosingPlayers()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
givePlayerScore( event, player, victim, overridePointsPopup )
|
givePlayerScore( event, player, victim, overrideCheckPlayerScoreLimitSoon, overridePointsPopup )
|
||||||
{
|
{
|
||||||
if ( isDefined( level.nukeIncoming ) )
|
if ( isDefined( level.nukeIncoming ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if ( !isDefined( overrideCheckPlayerScoreLimitSoon ) )
|
||||||
|
overrideCheckPlayerScoreLimitSoon = false;
|
||||||
|
|
||||||
if ( !isDefined( overridePointsPopup ) )
|
if ( !isDefined( overridePointsPopup ) )
|
||||||
overridePointsPopup = false;
|
overridePointsPopup = false;
|
||||||
|
|
||||||
|
@ -58,7 +61,11 @@ givePlayerScore( event, player, victim, overridePointsPopup )
|
||||||
if ( !level.teambased )
|
if ( !level.teambased )
|
||||||
thread sendUpdatedDMScores();
|
thread sendUpdatedDMScores();
|
||||||
|
|
||||||
|
// player score and team score aren't always the same values towards winning the match
|
||||||
|
// checkScoreLimit() checks team score correctly, checkPlayerScoreLimitSoon() uses player score
|
||||||
|
if ( !overrideCheckPlayerScoreLimitSoon )
|
||||||
player maps\mp\gametypes\_gamelogic::checkPlayerScoreLimitSoon();
|
player maps\mp\gametypes\_gamelogic::checkPlayerScoreLimitSoon();
|
||||||
|
|
||||||
scoreEndedMatch = player maps\mp\gametypes\_gamelogic::checkScoreLimit();
|
scoreEndedMatch = player maps\mp\gametypes\_gamelogic::checkScoreLimit();
|
||||||
|
|
||||||
if ( scoreEndedMatch && event == "kill" )
|
if ( scoreEndedMatch && event == "kill" )
|
||||||
|
|
|
@ -189,11 +189,10 @@ waitLoadoutDone()
|
||||||
|
|
||||||
self waittill( "spawned_player" );
|
self waittill( "spawned_player" );
|
||||||
|
|
||||||
self _setPerk( "specialty_bling" );
|
|
||||||
self giveNextGun( true );
|
self giveNextGun( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration )
|
onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration, lifeId )
|
||||||
{
|
{
|
||||||
if ( sMeansOfDeath == "MOD_FALLING" || ( isDefined( attacker ) && isPlayer( attacker ) ) )
|
if ( sMeansOfDeath == "MOD_FALLING" || ( isDefined( attacker ) && isPlayer( attacker ) ) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,6 +26,7 @@ main()
|
||||||
level.onSpawnPlayer = ::onSpawnPlayer;
|
level.onSpawnPlayer = ::onSpawnPlayer;
|
||||||
level.getSpawnPoint = ::getSpawnPoint;
|
level.getSpawnPoint = ::getSpawnPoint;
|
||||||
level.onPlayerKilled = ::onPlayerKilled;
|
level.onPlayerKilled = ::onPlayerKilled;
|
||||||
|
level.onDeadEvent = ::onDeadEvent;
|
||||||
level.onTimeLimit = ::onTimeLimit;
|
level.onTimeLimit = ::onTimeLimit;
|
||||||
|
|
||||||
level.infect_perks = [];
|
level.infect_perks = [];
|
||||||
|
@ -54,18 +55,26 @@ determineWinningTeam()
|
||||||
|
|
||||||
onPrecacheGameType()
|
onPrecacheGameType()
|
||||||
{
|
{
|
||||||
precachestring( &"MP_CONSCRIPTION_STARTS_IN" );
|
precacheString( &"MP_CONSCRIPTION_STARTS_IN" );
|
||||||
}
|
}
|
||||||
|
|
||||||
onStartGameType()
|
onStartGameType()
|
||||||
{
|
{
|
||||||
setclientnamemode( "auto_change" );
|
setClientNameMode("auto_change");
|
||||||
|
|
||||||
setObjectiveText( "allies", &"OBJECTIVES_INFECT" );
|
setObjectiveText( "allies", &"OBJECTIVES_INFECT" );
|
||||||
setObjectiveText( "axis", &"OBJECTIVES_INFECT" );
|
setObjectiveText( "axis", &"OBJECTIVES_INFECT" );
|
||||||
|
|
||||||
|
if ( level.splitscreen )
|
||||||
|
{
|
||||||
|
setObjectiveScoreText( "allies", &"OBJECTIVES_INFECT" );
|
||||||
|
setObjectiveScoreText( "axis", &"OBJECTIVES_INFECT" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
setObjectiveScoreText( "allies", &"OBJECTIVES_INFECT_SCORE" );
|
setObjectiveScoreText( "allies", &"OBJECTIVES_INFECT_SCORE" );
|
||||||
setObjectiveScoreText( "axis", &"OBJECTIVES_INFECT_SCORE" );
|
setObjectiveScoreText( "axis", &"OBJECTIVES_INFECT_SCORE" );
|
||||||
|
}
|
||||||
setObjectiveHintText( "allies", &"OBJECTIVES_INFECT_HINT" );
|
setObjectiveHintText( "allies", &"OBJECTIVES_INFECT_HINT" );
|
||||||
setObjectiveHintText( "axis", &"OBJECTIVES_INFECT_HINT" );
|
setObjectiveHintText( "axis", &"OBJECTIVES_INFECT_HINT" );
|
||||||
|
|
||||||
|
@ -103,7 +112,6 @@ onStartGameType()
|
||||||
level.infect_choseFirstInfected = false;
|
level.infect_choseFirstInfected = false;
|
||||||
level.infect_choosingFirstInfected = false;
|
level.infect_choosingFirstInfected = false;
|
||||||
level.infect_awardedFinalSurvivor = false;
|
level.infect_awardedFinalSurvivor = false;
|
||||||
level.infect_countdownInProgress = false;
|
|
||||||
|
|
||||||
level.infect_teamScores["axis"] = 0;
|
level.infect_teamScores["axis"] = 0;
|
||||||
level.infect_teamScores["allies"] = 0;
|
level.infect_teamScores["allies"] = 0;
|
||||||
|
@ -118,20 +126,15 @@ onPlayerConnect()
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
level waittill( "connected", player );
|
level waittill( "connected", player );
|
||||||
|
|
||||||
player.infect_firstSpawn = true;
|
player.infect_firstSpawn = true;
|
||||||
player.infected_Rejoined = false;
|
|
||||||
player.infect_JoinedAtStart = true;
|
|
||||||
|
|
||||||
if ( gameFlag( "prematch_done" ) )
|
if ( gameFlag( "prematch_done" ) )
|
||||||
{
|
player.infect_joinedatstart = false;
|
||||||
player.infect_JoinedAtStart = false;
|
else
|
||||||
}
|
player.infect_joinedatstart = true;
|
||||||
// infected who quit and rejoined same game
|
|
||||||
if( IsDefined( level.infect_players[player.name] ) )
|
if ( isDefined( level.infect_players[player.name] ) )
|
||||||
{
|
player.infect_rejoined = true;
|
||||||
player.infected_Rejoined = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,18 +151,13 @@ getSpawnPoint()
|
||||||
self.class = self.pers["class"];
|
self.class = self.pers["class"];
|
||||||
self.lastClass = self.pers["lastClass"];
|
self.lastClass = self.pers["lastClass"];
|
||||||
|
|
||||||
// survivors are allies
|
if ( isDefined( self.infect_rejoined ) )
|
||||||
teamChoice = "allies";
|
maps\mp\gametypes\_menus::addToTeam( "axis", true );
|
||||||
|
else
|
||||||
// everyone starts as survivors, unless an infected quit and rejoined same game
|
maps\mp\gametypes\_menus::addToTeam( "allies", true );
|
||||||
if( self.infected_Rejoined )
|
|
||||||
{
|
|
||||||
teamChoice = "axis";
|
|
||||||
}
|
|
||||||
|
|
||||||
self maps\mp\gametypes\_menus::addToTeam( teamChoice, true );
|
|
||||||
|
|
||||||
thread onPlayerDisconnect();
|
thread onPlayerDisconnect();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( level.inGracePeriod )
|
if ( level.inGracePeriod )
|
||||||
|
@ -176,12 +174,11 @@ getSpawnPoint()
|
||||||
return spawnPoint;
|
return spawnPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onSpawnPlayer()
|
onSpawnPlayer()
|
||||||
{
|
{
|
||||||
self.teamChangedThisFrame = undefined;
|
self.teamchangedthisframe = undefined;
|
||||||
self.infect_spawnPos = self.origin;
|
self.infect_spawnpos = self.origin;
|
||||||
|
|
||||||
// resynch teams
|
|
||||||
updateTeamScores();
|
updateTeamScores();
|
||||||
|
|
||||||
// let the first spawned player kick this off
|
// let the first spawned player kick this off
|
||||||
|
@ -191,17 +188,16 @@ onSpawnPlayer()
|
||||||
level thread chooseFirstInfected();
|
level thread chooseFirstInfected();
|
||||||
}
|
}
|
||||||
|
|
||||||
// infected who quit and rejoined same game?
|
if ( isDefined( self.infect_rejoined ) )
|
||||||
if( self.infected_Rejoined )
|
|
||||||
{
|
{
|
||||||
self.infect_rejoined = undefined;
|
self.infect_rejoined = undefined;
|
||||||
|
|
||||||
// stop initial infect countdown (if quit/join player was initial and a new coutdown is underway)
|
if ( !level.infect_allowsuicide )
|
||||||
if ( !level.infect_allowSuicide )
|
|
||||||
{
|
{
|
||||||
level notify( "infect_stopCountdown" );
|
level notify( "infect_stopCountdown" );
|
||||||
level.infect_choseFirstInfected = true;
|
level.infect_choseFirstInfected = 1;
|
||||||
level.infect_allowSuicide = true;
|
level.infect_allowsuicide = 1;
|
||||||
|
|
||||||
foreach ( player in level.players )
|
foreach ( player in level.players )
|
||||||
{
|
{
|
||||||
if ( isDefined( player.infect_isBeingChosen ) )
|
if ( isDefined( player.infect_isBeingChosen ) )
|
||||||
|
@ -209,16 +205,14 @@ onSpawnPlayer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if an initial was already chosen while they were gone and they are still initial, set them to normal
|
|
||||||
foreach ( player in level.players )
|
foreach ( player in level.players )
|
||||||
{
|
{
|
||||||
if ( isDefined( player.isInitialInfected ) )
|
if ( isDefined( player.isInitialInfected ) )
|
||||||
player thread setInitialToNormalInfected();
|
player thread setInitialToNormalInfected();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if they're the only infected, then set them as initial infected
|
if ( level.infect_teamscores["axis"] == 1 )
|
||||||
if ( level.infect_teamScores["axis"] == 1 )
|
self.isInitialInfected = 1;
|
||||||
self.isInitialInfected = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// onSpawnPlayer() is called before giveLoadout()
|
// onSpawnPlayer() is called before giveLoadout()
|
||||||
|
@ -228,8 +222,7 @@ onSpawnPlayer()
|
||||||
else
|
else
|
||||||
self.pers["gamemodeLoadout"] = level.infect_loadouts[self.pers["team"]];
|
self.pers["gamemodeLoadout"] = level.infect_loadouts[self.pers["team"]];
|
||||||
|
|
||||||
self thread onSpawnFinished();
|
thread onSpawnFinished();
|
||||||
|
|
||||||
level notify ( "spawned_player" );
|
level notify ( "spawned_player" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,32 +316,19 @@ chooseFirstInfected()
|
||||||
level endon( "game_ended" );
|
level endon( "game_ended" );
|
||||||
level endon( "infect_stopCountdown" );
|
level endon( "infect_stopCountdown" );
|
||||||
|
|
||||||
level.infect_allowSuicide = false;
|
level.infect_allowsuicide = false;
|
||||||
|
|
||||||
gameFlagWait( "prematch_done" );
|
gameFlagWait( "prematch_done" );
|
||||||
|
|
||||||
level.infect_timerDisplay.label = &"MP_DRAFT_STARTS_IN";
|
level.infect_timerDisplay.label = &"MP_DRAFT_STARTS_IN";
|
||||||
level.infect_timerDisplay setTimer( 15 );
|
level.infect_timerDisplay settimer( 8 );
|
||||||
level.infect_timerDisplay.alpha = 1;
|
level.infect_timerDisplay.alpha = 1;
|
||||||
|
|
||||||
maps\mp\gametypes\_hostmigration::waitLongDurationWithHostMigrationPause( 15.0 );
|
maps\mp\gametypes\_hostmigration::waitLongDurationWithHostMigrationPause( 8.0 );
|
||||||
|
|
||||||
level.infect_timerDisplay.alpha = 0;
|
level.infect_timerDisplay.alpha = 0;
|
||||||
|
|
||||||
possibleInfected = [];
|
level.players[randomint( level.players.size )] setFirstInfected( true );
|
||||||
|
|
||||||
foreach( player in level.players )
|
|
||||||
{
|
|
||||||
if ( player.team == "spectator" )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ( !player.hasSpawned )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
possibleInfected[possibleInfected.size] = player;
|
|
||||||
}
|
|
||||||
|
|
||||||
firstInfectedPlayer = possibleInfected[ randomInt( possibleInfected.size ) ];
|
|
||||||
firstInfectedPlayer setFirstInfected( true );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setFirstInfected( wasChosen )
|
setFirstInfected( wasChosen )
|
||||||
|
@ -359,14 +339,14 @@ setFirstInfected( wasChosen )
|
||||||
self.infect_isBeingChosen = true;
|
self.infect_isBeingChosen = true;
|
||||||
|
|
||||||
// wait alive
|
// wait alive
|
||||||
while( !isReallyAlive( self ) || self isUsingRemote() )
|
while ( !isReallyAlive( self ) || isUsingRemote() )
|
||||||
wait( 0.05 );
|
wait 0.05;
|
||||||
|
|
||||||
// remove placement item if carrying
|
// remove placement item if carrying
|
||||||
if ( IsDefined( self.isCarrying ) && self.isCarrying == true )
|
if ( isDefined( self.isCarrying ) && self.isCarrying == 1 )
|
||||||
{
|
{
|
||||||
self notify( "force_cancel_placement" );
|
self notify( "force_cancel_placement" );
|
||||||
wait( 0.05 );
|
wait 0.05;
|
||||||
}
|
}
|
||||||
|
|
||||||
// not while mantling
|
// not while mantling
|
||||||
|
@ -377,6 +357,9 @@ setFirstInfected( wasChosen )
|
||||||
while ( !self isOnGround() && !self IsOnLadder() )
|
while ( !self isOnGround() && !self IsOnLadder() )
|
||||||
wait( 0.05 );
|
wait( 0.05 );
|
||||||
|
|
||||||
|
while ( !isAlive( self ) )
|
||||||
|
waitframe();
|
||||||
|
|
||||||
// move to other team
|
// move to other team
|
||||||
if ( wasChosen )
|
if ( wasChosen )
|
||||||
{
|
{
|
||||||
|
@ -385,7 +368,6 @@ setFirstInfected( wasChosen )
|
||||||
self.infect_isBeingChosen = undefined;
|
self.infect_isBeingChosen = undefined;
|
||||||
|
|
||||||
// resynch teams
|
// resynch teams
|
||||||
level notify( "update_game_time" );
|
|
||||||
updateTeamScores();
|
updateTeamScores();
|
||||||
|
|
||||||
// allow suicides now
|
// allow suicides now
|
||||||
|
@ -400,7 +382,7 @@ setFirstInfected( wasChosen )
|
||||||
|
|
||||||
// remove old TI if it exists
|
// remove old TI if it exists
|
||||||
if ( isDefined( self.setSpawnpoint ) )
|
if ( isDefined( self.setSpawnpoint ) )
|
||||||
self maps\mp\perks\_perkfunctions::deleteTI( self.setSpawnpoint );
|
maps\mp\perks\_perkfunctions::deleteTI( self.setSpawnpoint );
|
||||||
|
|
||||||
// set faux TI to respawn in place
|
// set faux TI to respawn in place
|
||||||
spawnPoint = spawn( "script_model", self.origin );
|
spawnPoint = spawn( "script_model", self.origin );
|
||||||
|
@ -412,13 +394,12 @@ setFirstInfected( wasChosen )
|
||||||
// faux spawn
|
// faux spawn
|
||||||
self notify( "faux_spawn" );
|
self notify( "faux_spawn" );
|
||||||
self.faux_spawn_stance = self getStance();
|
self.faux_spawn_stance = self getStance();
|
||||||
thread maps\mp\gametypes\_playerlogic::spawnPlayer( true );
|
self thread maps\mp\gametypes\_playerlogic::spawnPlayer( true );
|
||||||
|
|
||||||
// store infected
|
// store infected
|
||||||
if ( wasChosen )
|
if ( wasChosen )
|
||||||
level.infect_players[self.name] = true;
|
level.infect_players[self.name] = true;
|
||||||
|
|
||||||
// tell the world!
|
|
||||||
thread teamPlayerCardSplash( "callout_first_mercenary", self );
|
thread teamPlayerCardSplash( "callout_first_mercenary", self );
|
||||||
playSoundOnPlayers( "mp_enemy_obj_captured" );
|
playSoundOnPlayers( "mp_enemy_obj_captured" );
|
||||||
}
|
}
|
||||||
|
@ -472,11 +453,11 @@ setInitialToNormalInfected( gotKill )
|
||||||
// faux spawn
|
// faux spawn
|
||||||
self notify( "faux_spawn" );
|
self notify( "faux_spawn" );
|
||||||
self.faux_spawn_stance = self getStance();
|
self.faux_spawn_stance = self getStance();
|
||||||
|
|
||||||
thread maps\mp\gametypes\_playerlogic::spawnPlayer( true );
|
thread maps\mp\gametypes\_playerlogic::spawnPlayer( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration )
|
|
||||||
|
onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration, lifeId )
|
||||||
{
|
{
|
||||||
processKill = false;
|
processKill = false;
|
||||||
wasSuicide = false;
|
wasSuicide = false;
|
||||||
|
@ -518,10 +499,8 @@ onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if ( isDefined( attacker.isInitialInfected ) )
|
||||||
{
|
|
||||||
// set attacker to regular infected if they were the first infected
|
// set attacker to regular infected if they were the first infected
|
||||||
if ( isDefined( attacker.isInitialInfected ) )
|
|
||||||
attacker thread setInitialToNormalInfected( true );
|
attacker thread setInitialToNormalInfected( true );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -530,7 +509,6 @@ onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHi
|
||||||
maps\mp\gametypes\_gamescore::givePlayerScore( "draft_rogue", attacker, self, true );
|
maps\mp\gametypes\_gamescore::givePlayerScore( "draft_rogue", attacker, self, true );
|
||||||
attacker thread maps\mp\gametypes\_rank::giveRankXP( "draft_rogue" );
|
attacker thread maps\mp\gametypes\_rank::giveRankXP( "draft_rogue" );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// generic messages/sounds, and reward survivors
|
// generic messages/sounds, and reward survivors
|
||||||
if ( level.infect_teamScores["allies"] > 1 )
|
if ( level.infect_teamScores["allies"] > 1 )
|
||||||
|
@ -545,10 +523,7 @@ onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHi
|
||||||
|
|
||||||
foreach ( player in level.players )
|
foreach ( player in level.players )
|
||||||
{
|
{
|
||||||
if( !isReallyAlive( player ) || self.sessionstate == "spectator" )
|
if ( player.team == "allies" && player != self && distance( player.infect_spawnpos, player.origin ) > 32 )
|
||||||
continue;
|
|
||||||
|
|
||||||
if ( player.team == "allies" && player != self && distance( player.infect_spawnPos, player.origin ) > 32 )
|
|
||||||
{
|
{
|
||||||
player thread maps\mp\gametypes\_rank::xpEventPopup( &"SPLASHES_SURVIVOR" );
|
player thread maps\mp\gametypes\_rank::xpEventPopup( &"SPLASHES_SURVIVOR" );
|
||||||
maps\mp\gametypes\_gamescore::givePlayerScore( "survivor", player, undefined, true );
|
maps\mp\gametypes\_gamescore::givePlayerScore( "survivor", player, undefined, true );
|
||||||
|
@ -559,16 +534,11 @@ onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHi
|
||||||
}
|
}
|
||||||
// inform/reward last
|
// inform/reward last
|
||||||
else if ( level.infect_teamScores["allies"] == 1 )
|
else if ( level.infect_teamScores["allies"] == 1 )
|
||||||
{
|
|
||||||
onFinalSurvivor();
|
onFinalSurvivor();
|
||||||
}
|
|
||||||
// infected win
|
// infected win
|
||||||
else if ( level.infect_teamScores["allies"] == 0 )
|
else if ( level.infect_teamScores["allies"] == 0 )
|
||||||
{
|
|
||||||
onSurvivorsEliminated();
|
onSurvivorsEliminated();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onFinalSurvivor()
|
onFinalSurvivor()
|
||||||
|
@ -582,27 +552,27 @@ onFinalSurvivor()
|
||||||
if ( player.team == "allies" )
|
if ( player.team == "allies" )
|
||||||
{
|
{
|
||||||
player thread maps\mp\gametypes\_rank::xpEventPopup( &"SPLASHES_FINAL_ROGUE" );
|
player thread maps\mp\gametypes\_rank::xpEventPopup( &"SPLASHES_FINAL_ROGUE" );
|
||||||
|
|
||||||
if ( !level.infect_awardedFinalSurvivor )
|
if ( !level.infect_awardedFinalSurvivor )
|
||||||
{
|
{
|
||||||
if ( player.gameModeJoinedAtStart && isDefined( player.infect_spawnPos ) && distance( player.infect_spawnPos, player.origin ) > 32 )
|
if ( player.infect_joinedatstart && distance( player.infect_spawnpos, player.origin ) > 32 )
|
||||||
{
|
{
|
||||||
maps\mp\gametypes\_gamescore::givePlayerScore( "final_rogue", player, undefined, true );
|
maps\mp\gametypes\_gamescore::givePlayerScore( "final_rogue", player, undefined, true );
|
||||||
player thread maps\mp\gametypes\_rank::giveRankXP( "final_rogue" );
|
player thread maps\mp\gametypes\_rank::giveRankXP( "final_rogue" );
|
||||||
}
|
}
|
||||||
|
|
||||||
level.infect_awardedFinalSurvivor = true;
|
level.infect_awardedFinalSurvivor = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
thread teamplayercardsplash( "callout_final_rogue", player );
|
thread maps\mp\_utility::teamPlayerCardSplash( "callout_final_rogue", player );
|
||||||
|
|
||||||
if ( matchMakingGame() )
|
if ( matchMakingGame() )
|
||||||
level thread finalsurvivoruav( player );
|
level thread finalSurvivorUAV( player );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
finalSurvivorUAV( finalPlayer )
|
finalSurvivorUAV( finalPlayer )
|
||||||
{
|
{
|
||||||
level endon( "game_ended" );
|
level endon( "game_ended" );
|
||||||
|
@ -612,34 +582,31 @@ finalSurvivorUAV( finalPlayer )
|
||||||
level thread endUAVonLateJoiner( finalPlayer );
|
level thread endUAVonLateJoiner( finalPlayer );
|
||||||
|
|
||||||
removeUAV = false;
|
removeUAV = false;
|
||||||
level.radarMode["axis"] = "normal_radar";
|
level.radarmode["axis"] = "normal_radar";
|
||||||
|
|
||||||
foreach ( player in level.players )
|
foreach ( player in level.players )
|
||||||
{
|
{
|
||||||
if ( player.team == "axis" )
|
if ( player.team == "axis" )
|
||||||
player.radarMode = "normal_radar";
|
player.radarmode = "normal_radar";
|
||||||
}
|
}
|
||||||
|
|
||||||
//setTeamRadarStrength( "axis", 1 );
|
for (;;)
|
||||||
|
|
||||||
while( true )
|
|
||||||
{
|
{
|
||||||
prevPos = finalPlayer.origin;
|
prevPos = finalPlayer.origin;
|
||||||
|
wait 4;
|
||||||
|
|
||||||
wait( 4 );
|
|
||||||
if ( removeUAV )
|
if ( removeUAV )
|
||||||
{
|
{
|
||||||
setTeamRadar( "axis", 0 );
|
setTeamRadar( "axis", 0 );
|
||||||
removeUAV = false;
|
removeUAV = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wait( 6 );
|
wait 6;
|
||||||
|
|
||||||
if ( distance( prevPos, finalPlayer.origin ) < 200 )
|
if ( distance( prevPos, finalPlayer.origin ) < 200 )
|
||||||
{
|
{
|
||||||
setTeamRadar( "axis", 1 );
|
setTeamRadar( "axis", 1 );
|
||||||
removeUAV = true;
|
removeUAV = true;
|
||||||
|
|
||||||
foreach ( player in level.players )
|
|
||||||
player playLocalSound( "recondrone_tag" );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -650,16 +617,17 @@ endUAVonLateJoiner( finalPlayer )
|
||||||
finalPlayer endon( "disconnect" );
|
finalPlayer endon( "disconnect" );
|
||||||
finalPlayer endon( "eliminated" );
|
finalPlayer endon( "eliminated" );
|
||||||
|
|
||||||
while( true )
|
for (;;)
|
||||||
{
|
{
|
||||||
if ( level.infect_teamScores["allies"] > 1 )
|
if ( level.infect_teamScores["allies"] > 1 )
|
||||||
{
|
{
|
||||||
level notify( "infect_lateJoiner" );
|
level notify( "infect_lateJoiner" );
|
||||||
wait( 0.05 );
|
wait 0.05;
|
||||||
setTeamRadar( "axis", 0 );
|
setTeamRadar( "axis", 0 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
wait( 0.05 );
|
|
||||||
|
wait 0.05;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -667,7 +635,6 @@ onPlayerDisconnect()
|
||||||
{
|
{
|
||||||
level endon( "game_ended" );
|
level endon( "game_ended" );
|
||||||
self endon( "eliminated" );
|
self endon( "eliminated" );
|
||||||
|
|
||||||
self waittill( "disconnect" );
|
self waittill( "disconnect" );
|
||||||
|
|
||||||
// resynch teams
|
// resynch teams
|
||||||
|
@ -714,7 +681,6 @@ onPlayerDisconnect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear this regardless on the way out
|
// clear this regardless on the way out
|
||||||
self.isInitialInfected = undefined;
|
self.isInitialInfected = undefined;
|
||||||
}
|
}
|
||||||
|
@ -741,9 +707,8 @@ onDeadEvent( team )
|
||||||
|
|
||||||
onTimeLimit()
|
onTimeLimit()
|
||||||
{
|
{
|
||||||
// survivors win
|
|
||||||
level.finalKillCam_winner = "allies";
|
level.finalKillCam_winner = "allies";
|
||||||
level thread maps\mp\gametypes\_gamelogic::endGame( "allies", game[ "end_reason" ][ "time_limit_reached" ] );
|
level thread maps\mp\gametypes\_gamelogic::endGame( "allies", game["strings"]["time_limit_reached"] );
|
||||||
}
|
}
|
||||||
|
|
||||||
onSurvivorsEliminated()
|
onSurvivorsEliminated()
|
||||||
|
@ -753,33 +718,37 @@ onSurvivorsEliminated()
|
||||||
level thread maps\mp\gametypes\_gamelogic::endGame( "axis", game[ "end_reason" ][ "allies_eliminated" ] );
|
level thread maps\mp\gametypes\_gamelogic::endGame( "axis", game[ "end_reason" ][ "allies_eliminated" ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
getTeamSize( team )
|
getNumInfected()
|
||||||
{
|
{
|
||||||
size = 0;
|
numInfected = 0;
|
||||||
|
|
||||||
foreach ( player in level.players )
|
foreach ( player in level.players )
|
||||||
{
|
{
|
||||||
// Make sure we don't check for spectators
|
if ( isdefined( player.team ) && player.team == "axis" )
|
||||||
// Also need to check for if they are in killcam, because player session states are set to spectator when killcam happens
|
numInfected++;
|
||||||
if ( player.sessionstate == "spectator" && !player.spectatekillcam )
|
}
|
||||||
continue;
|
return numInfected;
|
||||||
|
|
||||||
if( player.team == team )
|
|
||||||
size++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return size;
|
getNumSurvivors()
|
||||||
|
{
|
||||||
|
numSurvivors = 0;
|
||||||
|
foreach ( player in level.players )
|
||||||
|
{
|
||||||
|
if ( isdefined( player.team ) && player.team == "allies" )
|
||||||
|
numSurvivors++;
|
||||||
|
}
|
||||||
|
return numSurvivors;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTeamScores()
|
updateTeamScores()
|
||||||
{
|
{
|
||||||
// survivors
|
// survivors
|
||||||
level.infect_teamScores["allies"] = getTeamSize( "allies" );
|
level.infect_teamScores["allies"] = getNumSurvivors();
|
||||||
game["teamScores"]["allies"] = level.infect_teamScores["allies"];
|
game["teamScores"]["allies"] = level.infect_teamScores["allies"];
|
||||||
setTeamScore( "allies", level.infect_teamScores["allies"] );
|
setTeamScore( "allies", level.infect_teamScores["allies"] );
|
||||||
|
|
||||||
// infected
|
// infected
|
||||||
level.infect_teamScores["axis"] = getTeamSize( "axis" );
|
level.infect_teamScores["axis"] = getNumInfected();
|
||||||
game["teamScores"]["axis"] = level.infect_teamScores["axis"];
|
game["teamScores"]["axis"] = level.infect_teamScores["axis"];
|
||||||
setTeamScore( "axis", level.infect_teamScores["axis"] );
|
setTeamScore( "axis", level.infect_teamScores["axis"] );
|
||||||
}
|
}
|
||||||
|
@ -802,11 +771,11 @@ setSpecialLoadouts()
|
||||||
level.infect_loadouts["axis"]["loadoutKillstreak1"] = "none";
|
level.infect_loadouts["axis"]["loadoutKillstreak1"] = "none";
|
||||||
level.infect_loadouts["axis"]["loadoutKillstreak2"] = "none";
|
level.infect_loadouts["axis"]["loadoutKillstreak2"] = "none";
|
||||||
level.infect_loadouts["axis"]["loadoutKillstreak3"] = "none";
|
level.infect_loadouts["axis"]["loadoutKillstreak3"] = "none";
|
||||||
level.infect_loadouts["axis"]["loadoutDeathstreak"] = "specialty_grenadepulldeath";
|
level.infect_loadouts["axis"]["loadoutDeathstreak"] = "none";
|
||||||
|
|
||||||
level.infect_loadouts["axis_initial"]["loadoutPrimary"] = "scar";
|
level.infect_loadouts["axis_initial"]["loadoutPrimary"] = "throwingknife";
|
||||||
level.infect_loadouts["axis_initial"]["loadoutPrimaryAttachment"] = "reflex";
|
level.infect_loadouts["axis_initial"]["loadoutPrimaryAttachment"] = "none";
|
||||||
level.infect_loadouts["axis_initial"]["loadoutPrimaryAttachment2"] = "xmags";
|
level.infect_loadouts["axis_initial"]["loadoutPrimaryAttachment2"] = "none";
|
||||||
level.infect_loadouts["axis_initial"]["loadoutPrimaryCamo"] = "none";
|
level.infect_loadouts["axis_initial"]["loadoutPrimaryCamo"] = "none";
|
||||||
level.infect_loadouts["axis_initial"]["loadoutSecondary"] = "none";
|
level.infect_loadouts["axis_initial"]["loadoutSecondary"] = "none";
|
||||||
level.infect_loadouts["axis_initial"]["loadoutSecondaryAttachment"] = "none";
|
level.infect_loadouts["axis_initial"]["loadoutSecondaryAttachment"] = "none";
|
||||||
|
@ -820,7 +789,7 @@ setSpecialLoadouts()
|
||||||
level.infect_loadouts["axis_initial"]["loadoutKillstreak1"] = "none";
|
level.infect_loadouts["axis_initial"]["loadoutKillstreak1"] = "none";
|
||||||
level.infect_loadouts["axis_initial"]["loadoutKillstreak2"] = "none";
|
level.infect_loadouts["axis_initial"]["loadoutKillstreak2"] = "none";
|
||||||
level.infect_loadouts["axis_initial"]["loadoutKillstreak3"] = "none";
|
level.infect_loadouts["axis_initial"]["loadoutKillstreak3"] = "none";
|
||||||
level.infect_loadouts["axis_initial"]["loadoutDeathstreak"] = "specialty_grenadepulldeath";
|
level.infect_loadouts["axis_initial"]["loadoutDeathstreak"] = "none";
|
||||||
|
|
||||||
level.infect_loadouts["allies"]["loadoutPrimary"] = "spas12";
|
level.infect_loadouts["allies"]["loadoutPrimary"] = "spas12";
|
||||||
level.infect_loadouts["allies"]["loadoutPrimaryAttachment"] = "xmags";
|
level.infect_loadouts["allies"]["loadoutPrimaryAttachment"] = "xmags";
|
||||||
|
|
Loading…
Reference in New Issue