More GSC fixes for Gun Game and Infected
Backport setOverrideWatchDvar from IW5pull/4/head
parent
71cd4dfe48
commit
d14eca4f21
|
@ -1415,9 +1415,22 @@ registerWatchDvar( nameString, defaultValue )
|
|||
}
|
||||
|
||||
|
||||
setOverrideWatchDvar( dvarString, value )
|
||||
{
|
||||
dvarString = "scr_" + level.gameType + "_" + dvarString;
|
||||
level.overrideWatchDvars[dvarString] = value;
|
||||
}
|
||||
|
||||
|
||||
getWatchedDvar( dvarString )
|
||||
{
|
||||
dvarString = "scr_" + level.gameType + "_" + dvarString;
|
||||
|
||||
if ( isDefined( level.overrideWatchDvars ) && isDefined( level.overrideWatchDvars[dvarString] ) )
|
||||
{
|
||||
return level.overrideWatchDvars[dvarString];
|
||||
}
|
||||
|
||||
return( level.watchDvars[ dvarString ].value );
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,6 @@ init()
|
|||
level thread onPlayerConnecting();
|
||||
}
|
||||
|
||||
|
||||
getClassChoice( response )
|
||||
{
|
||||
assert( isDefined( level.classMap[response] ) );
|
||||
|
@ -77,7 +76,6 @@ getWeaponChoice( response )
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
logClassChoice( class, primaryWeapon, specialType, perks )
|
||||
{
|
||||
if ( class == self.lastClass )
|
||||
|
@ -90,7 +88,6 @@ logClassChoice( class, primaryWeapon, specialType, perks )
|
|||
self.lastClass = class;
|
||||
}
|
||||
|
||||
|
||||
cac_getWeapon( classIndex, weaponIndex )
|
||||
{
|
||||
return self getPlayerData( "customClasses", classIndex, "weaponSetups", weaponIndex, "weapon" );
|
||||
|
@ -131,8 +128,6 @@ cac_getOffhand( classIndex )
|
|||
return self getPlayerData( "customClasses", classIndex, "specialGrenade" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
table_getWeapon( tableName, classIndex, weaponIndex )
|
||||
{
|
||||
if ( weaponIndex == 0 )
|
||||
|
@ -506,6 +501,31 @@ giveLoadout( team, class, allowCopycat )
|
|||
|
||||
//loadoutSecondaryCamo = "none";
|
||||
|
||||
self.loadoutPrimaryCamo = int(tableLookup( "mp/camoTable.csv", 1, loadoutPrimaryCamo, 0 ));
|
||||
self.loadoutPrimary = loadoutPrimary;
|
||||
self.loadoutSecondary = loadoutSecondary;
|
||||
self.loadoutSecondaryCamo = int(tableLookup( "mp/camoTable.csv", 1, loadoutSecondaryCamo, 0 ));
|
||||
|
||||
if ( loadoutSecondary == "none" )
|
||||
secondaryName = "none";
|
||||
else
|
||||
{
|
||||
|
||||
secondaryName = buildWeaponName( loadoutSecondary, loadoutSecondaryAttachment, loadoutSecondaryAttachment2 );
|
||||
self _giveWeapon( secondaryName, int(tableLookup( "mp/camoTable.csv", 1, loadoutSecondaryCamo, 0 ) ) );
|
||||
}
|
||||
|
||||
self SetOffhandPrimaryClass( "other" );
|
||||
|
||||
// Action Slots
|
||||
//self _SetActionSlot( 1, "" );
|
||||
self _SetActionSlot( 1, "nightvision" );
|
||||
self _SetActionSlot( 3, "altMode" );
|
||||
self _SetActionSlot( 4, "" );
|
||||
|
||||
// Perks
|
||||
self _clearPerks();
|
||||
self _detachAll();
|
||||
|
||||
if ( level.killstreakRewards )
|
||||
{
|
||||
|
@ -529,33 +549,22 @@ giveLoadout( team, class, allowCopycat )
|
|||
loadoutKillstreak3 = "none";
|
||||
}
|
||||
|
||||
secondaryName = buildWeaponName( loadoutSecondary, loadoutSecondaryAttachment, loadoutSecondaryAttachment2 );
|
||||
self _giveWeapon( secondaryName, int(tableLookup( "mp/camoTable.csv", 1, loadoutSecondaryCamo, 0 ) ) );
|
||||
|
||||
self.loadoutPrimaryCamo = int(tableLookup( "mp/camoTable.csv", 1, loadoutPrimaryCamo, 0 ));
|
||||
self.loadoutPrimary = loadoutPrimary;
|
||||
self.loadoutSecondary = loadoutSecondary;
|
||||
self.loadoutSecondaryCamo = int(tableLookup( "mp/camoTable.csv", 1, loadoutSecondaryCamo, 0 ));
|
||||
|
||||
self SetOffhandPrimaryClass( "other" );
|
||||
|
||||
// Action Slots
|
||||
//self _SetActionSlot( 1, "" );
|
||||
self _SetActionSlot( 1, "nightvision" );
|
||||
self _SetActionSlot( 3, "altMode" );
|
||||
self _SetActionSlot( 4, "" );
|
||||
|
||||
// Perks
|
||||
self _clearPerks();
|
||||
self _detachAll();
|
||||
|
||||
// these special case giving pistol death have to come before
|
||||
// perk loadout to ensure player perk icons arent overwritten
|
||||
if ( level.dieHardMode )
|
||||
self maps\mp\perks\_perks::givePerk( "specialty_pistoldeath" );
|
||||
|
||||
self loadoutAllPerks( loadoutEquipment, loadoutPerk1, loadoutPerk2, loadoutPerk3 );
|
||||
|
||||
self setKillstreaks( loadoutKillstreak1, loadoutKillstreak2, loadoutKillstreak3 );
|
||||
|
||||
if ( self hasPerk( "specialty_extraammo", true ) && getWeaponClass( secondaryName ) != "weapon_projectile" )
|
||||
self giveMaxAmmo( secondaryName );
|
||||
|
||||
// only give the deathstreak for the initial spawn for this life.
|
||||
if ( loadoutDeathStreak != "specialty_null" && getTime() == self.spawnTime )
|
||||
if( self.pers["cur_death_streak"] > 0 )
|
||||
{
|
||||
if ( loadoutDeathStreak != "specialty_null" )
|
||||
{
|
||||
deathVal = int( tableLookup( "mp/perkTable.csv", 1, loadoutDeathStreak, 6 ) );
|
||||
|
||||
|
@ -572,13 +581,7 @@ giveLoadout( team, class, allowCopycat )
|
|||
self thread maps\mp\perks\_perks::givePerk( loadoutDeathStreak );
|
||||
}
|
||||
}
|
||||
|
||||
self loadoutAllPerks( loadoutEquipment, loadoutPerk1, loadoutPerk2, loadoutPerk3 );
|
||||
|
||||
self setKillstreaks( loadoutKillstreak1, loadoutKillstreak2, loadoutKillstreak3 );
|
||||
|
||||
if ( self hasPerk( "specialty_extraammo", true ) && getWeaponClass( secondaryName ) != "weapon_projectile" )
|
||||
self giveMaxAmmo( secondaryName );
|
||||
}
|
||||
|
||||
// Primary Weapon
|
||||
primaryName = buildWeaponName( loadoutPrimary, loadoutPrimaryAttachment, loadoutPrimaryAttachment2 );
|
||||
|
@ -599,13 +602,24 @@ giveLoadout( team, class, allowCopycat )
|
|||
// Primary Offhand was given by givePerk (it's your perk1)
|
||||
|
||||
// Secondary Offhand
|
||||
offhandSecondaryWeapon = loadoutOffhand + "_mp";
|
||||
if ( loadoutOffhand == "flash_grenade" )
|
||||
self SetOffhandSecondaryClass( "flash" );
|
||||
else
|
||||
self SetOffhandSecondaryClass( "smoke" );
|
||||
offhandSecondaryWeapon = loadoutOffhand;
|
||||
|
||||
if ( loadoutOffhand == "none" )
|
||||
self SetOffhandSecondaryClass( "none" );
|
||||
else if ( loadoutOffhand == "flash_grenade_mp" )
|
||||
self SetOffhandSecondaryClass( "flash" );
|
||||
else if ( loadoutOffhand == "smoke_grenade_mp" || loadoutOffhand == "concussion_grenade_mp" )
|
||||
self SetOffhandSecondaryClass( "smoke" );
|
||||
else
|
||||
self SetOffhandSecondaryClass( "flash" );
|
||||
|
||||
switch( offhandSecondaryWeapon )
|
||||
{
|
||||
case "none":
|
||||
break;
|
||||
default:
|
||||
self giveWeapon( offhandSecondaryWeapon );
|
||||
|
||||
if( loadOutOffhand == "smoke_grenade" )
|
||||
self setWeaponAmmoClip( offhandSecondaryWeapon, 1 );
|
||||
else if( loadOutOffhand == "flash_grenade" )
|
||||
|
@ -614,6 +628,8 @@ giveLoadout( team, class, allowCopycat )
|
|||
self setWeaponAmmoClip( offhandSecondaryWeapon, 2 );
|
||||
else
|
||||
self setWeaponAmmoClip( offhandSecondaryWeapon, 1 );
|
||||
break;
|
||||
}
|
||||
|
||||
primaryWeapon = primaryName;
|
||||
self.primaryWeapon = primaryWeapon;
|
||||
|
@ -780,7 +796,6 @@ trackRiotShield()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
tryAttach( placement ) // deprecated; hopefully we won't need to bring this defensive function back
|
||||
{
|
||||
if ( !isDefined( placement ) || placement != "back" )
|
||||
|
@ -824,8 +839,6 @@ tryDetach( placement ) // deprecated; hopefully we won't need to bring this defe
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
buildWeaponName( baseName, attachment1, attachment2 )
|
||||
{
|
||||
if ( !isDefined( level.letterToNumber ) )
|
||||
|
@ -891,7 +904,6 @@ buildWeaponName( baseName, attachment1, attachment2 )
|
|||
return ( weaponName + "_mp" );
|
||||
}
|
||||
|
||||
|
||||
makeLettersToNumbers()
|
||||
{
|
||||
array = [];
|
||||
|
@ -1011,7 +1023,6 @@ setKillstreaks( streak1, streak2, streak3 )
|
|||
self.killstreaks = newKillstreaks;
|
||||
}
|
||||
|
||||
|
||||
replenishLoadout() // used by ammo hardpoint.
|
||||
{
|
||||
team = self.pers["team"];
|
||||
|
@ -1036,7 +1047,6 @@ replenishLoadout() // used by ammo hardpoint.
|
|||
self SetWeaponAmmoClip( level.classGrenades[class]["secondary"]["type"], level.classGrenades[class]["secondary"]["count"] );
|
||||
}
|
||||
|
||||
|
||||
onPlayerConnecting()
|
||||
{
|
||||
for(;;)
|
||||
|
@ -1047,14 +1057,18 @@ onPlayerConnecting()
|
|||
{
|
||||
player.pers["class"] = "";
|
||||
}
|
||||
if ( !isDefined( player.pers["lastClass"] ) )
|
||||
{
|
||||
player.pers["lastClass"] = "";
|
||||
}
|
||||
player.class = player.pers["class"];
|
||||
player.lastClass = "";
|
||||
player.lastClass = player.pers["lastClass"];
|
||||
player.detectExplosives = false;
|
||||
player.bombSquadIcons = [];
|
||||
player.bombSquadIds = [];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fadeAway( waitDelay, fadeDelay )
|
||||
{
|
||||
|
@ -1064,7 +1078,6 @@ fadeAway( waitDelay, fadeDelay )
|
|||
self.alpha = 0;
|
||||
}
|
||||
|
||||
|
||||
setClass( newClass )
|
||||
{
|
||||
self.curClass = newClass;
|
||||
|
@ -1080,7 +1093,6 @@ getPerkForClass( perkSlot, className )
|
|||
return table_getPerk( level.classTableName, class_num, perkSlot );
|
||||
}
|
||||
|
||||
|
||||
classHasPerk( className, perkName )
|
||||
{
|
||||
return( getPerkForClass( 0, className ) == perkName || getPerkForClass( 1, className ) == perkName || getPerkForClass( 2, className ) == perkName );
|
||||
|
|
|
@ -510,13 +510,16 @@ tiValidationCheck()
|
|||
return true;
|
||||
}
|
||||
|
||||
spawnPlayer()
|
||||
spawnPlayer( fauxSpawn )
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "joined_spectators" );
|
||||
self notify( "spawned" );
|
||||
self notify( "end_respawn" );
|
||||
|
||||
if ( !isDefined( fauxSpawn ) )
|
||||
fauxSpawn = false;
|
||||
|
||||
if ( isDefined( self.setSpawnPoint ) && self tiValidationCheck() )
|
||||
{
|
||||
spawnPoint = self.setSpawnPoint;
|
||||
|
@ -565,6 +568,8 @@ spawnPlayer()
|
|||
|
||||
self.fauxDead = undefined;
|
||||
|
||||
if ( !fauxSpawn )
|
||||
{
|
||||
self.killsThisLife = [];
|
||||
|
||||
self updateSessionState( "playing", "" );
|
||||
|
@ -594,12 +599,16 @@ spawnPlayer()
|
|||
self.shieldDamage = 0;
|
||||
self.shieldBulletHits = 0;
|
||||
self.recentShieldXP = 0;
|
||||
}
|
||||
|
||||
self.disabledWeapon = 0;
|
||||
self.disabledWeaponSwitch = 0;
|
||||
self.disabledOffhandWeapons = 0;
|
||||
self resetUsability();
|
||||
|
||||
if ( !fauxSpawn )
|
||||
{
|
||||
|
||||
if ( self.pers["lives"] == getGametypeNumLives() )
|
||||
{
|
||||
maps\mp\gametypes\_playerlogic::addToLivesCount();
|
||||
|
@ -622,6 +631,7 @@ spawnPlayer()
|
|||
if ( level.inGracePeriod || getTimePassed() < acceptablePassedTime * 1000 )
|
||||
self.wasAliveAtMatchStart = true;
|
||||
}
|
||||
}
|
||||
|
||||
self setClientDvar( "cg_thirdPerson", "0" );
|
||||
self setDepthOfField( 0, 0, 512, 512, 4, 0 );
|
||||
|
@ -642,6 +652,14 @@ spawnPlayer()
|
|||
self.spawnPos = spawnOrigin;
|
||||
|
||||
self spawn( spawnOrigin, spawnAngles );
|
||||
|
||||
// immediately fix our stance if we were spawned in place so we don't get stuck in geo
|
||||
if ( fauxSpawn && isDefined( self.faux_spawn_stance ) )
|
||||
{
|
||||
self setStance( self.faux_spawn_stance );
|
||||
self.faux_spawn_stance = undefined;
|
||||
}
|
||||
|
||||
[[level.onSpawnPlayer]]();
|
||||
|
||||
// Don't do this stuff for TI spawn points
|
||||
|
@ -1272,15 +1290,11 @@ Callback_PlayerConnect()
|
|||
if ( self.pers["team"] == "spectator" )
|
||||
{
|
||||
if ( allowTeamChoice() )
|
||||
{
|
||||
self maps\mp\gametypes\_menus::beginTeamChoice();
|
||||
return;
|
||||
}
|
||||
|
||||
else
|
||||
self [[level.autoassign]]();
|
||||
return;
|
||||
}
|
||||
|
||||
else
|
||||
self maps\mp\gametypes\_menus::beginClassChoice();
|
||||
}
|
||||
|
||||
|
|
|
@ -36,14 +36,12 @@ main()
|
|||
setGuns();
|
||||
|
||||
scoreLimit = level.gun_guns.size;
|
||||
SetDvar( "scr_gun_scorelimit", scoreLimit );
|
||||
registerTimeLimitDvar( level.gameType, 10, 0, 20 );
|
||||
registerScoreLimitDvar( level.gameType, scoreLimit );
|
||||
SetDvar( "scr_gun_winlimit", 1 );
|
||||
registerWinLimitDvar( "gun", 1 );
|
||||
SetDvar( "scr_gun_roundlimit", 1 );
|
||||
registerRoundLimitDvar( "gun", 1 );
|
||||
SetDvar( "scr_gun_halftime", 0 );
|
||||
registerHalfTimeDvar( "gun", 0 );
|
||||
registerRoundLimitDvar( level.gameType, 1, 0, 10 );
|
||||
registerWinLimitDvar( level.gameType, 1, 0, 10 );
|
||||
registerNumLivesDvar( level.gameType, 0, 0, 10 );
|
||||
registerHalfTimeDvar( level.gameType, 0, 0, 1 );
|
||||
|
||||
setSpecialLoadout();
|
||||
|
||||
|
@ -192,7 +190,7 @@ waitLoadoutDone()
|
|||
|
||||
self waittill( "spawned_player" );
|
||||
|
||||
self _setPerk( "specialty_bling", false );
|
||||
self _setPerk( "specialty_bling" );
|
||||
self giveNextGun( true );
|
||||
}
|
||||
|
||||
|
|
|
@ -8,9 +8,8 @@ main()
|
|||
maps\mp\gametypes\_callbacksetup::SetupCallbacks();
|
||||
maps\mp\gametypes\_globallogic::SetupCallbacks();
|
||||
|
||||
|
||||
registerTimeLimitDvar( level.gameType, 10 );
|
||||
setDvar( "scorelimit", 0 );
|
||||
setOverrideWatchDvar( "scorelimit", 0 );
|
||||
registerRoundLimitDvar( level.gameType, 1 );
|
||||
registerWinLimitDvar( level.gameType, 1 );
|
||||
registerNumLivesDvar( level.gameType, 0 );
|
||||
|
|
Loading…
Reference in New Issue