Advertisement
Guest User

MW3 GunGame gun.gsc

a guest
Apr 7th, 2015
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 21.91 KB | None | 0 0
  1. #include maps\mp\_utility;
  2. #include maps\mp\gametypes\_hud_util;
  3. #include maps\mp\gametypes\_class;
  4. #include common_scripts\utility;
  5.  
  6. main()
  7. {
  8.     maps\mp\gametypes\_globallogic::init();
  9.     maps\mp\gametypes\_callbacksetup::SetupCallbacks();
  10.     maps\mp\gametypes\_globallogic::SetupCallbacks();
  11.    
  12.     //  must be done before scorelimit is set
  13.     setGuns();
  14.  
  15.     if ( isUsingMatchRulesData() )
  16.     {
  17.         level.initializeMatchRules = ::initializeMatchRules;
  18.         [[level.initializeMatchRules]]();
  19.         level thread reInitializeMatchRulesOnMigration();  
  20.     }
  21.     else
  22.     {
  23.         registerTimeLimitDvar( level.gameType, 10 );
  24.         SetDynamicDvar( "scr_gun_scorelimit", level.gun_guns.size );
  25.         registerScoreLimitDvar( level.gameType, level.gun_guns.size );
  26.         level thread reInitializeScoreLimitOnMigration();
  27.         registerRoundLimitDvar( level.gameType, 1 );
  28.         registerWinLimitDvar( level.gameType, 0 );
  29.         registerNumLivesDvar( level.gameType, 0 );
  30.         registerHalfTimeDvar( level.gameType, 0 );
  31.        
  32.         level.matchRules_randomize = 0;
  33.         level.matchRules_damageMultiplier = 0;
  34.         level.matchRules_vampirism = 0;
  35.     }
  36.     setSpecialLoadout();   
  37.    
  38.     level.teamBased = false;
  39.     level.doPrematch = true;
  40.     level.killstreakRewards = false;
  41.     level.onPrecacheGameType = ::onPrecacheGameType;
  42.     level.onStartGameType = ::onStartGameType;
  43.     level.onSpawnPlayer = ::onSpawnPlayer;
  44.     level.getSpawnPoint = ::getSpawnPoint;
  45.     level.onPlayerKilled = ::onPlayerKilled;
  46.     level.onTimeLimit = ::onTimeLimit;
  47.    
  48.     if ( level.matchRules_damageMultiplier || level.matchRules_vampirism )
  49.         level.modifyPlayerDamage = maps\mp\gametypes\_damage::gamemodeModifyPlayerDamage;
  50. }
  51.  
  52.  
  53. initializeMatchRules()
  54. {
  55.     //  set common values
  56.     setCommonRulesFromMatchRulesData( true );
  57.    
  58.     //  set everything else (private match options, default .cfg file values, and what normally is registered in the 'else' below)         
  59.     level.matchRules_randomize = GetMatchRulesData( "gunData", "randomize" );
  60.    
  61.     SetDynamicDvar( "scr_gun_scorelimit", level.gun_guns.size );
  62.     registerScoreLimitDvar( level.gameType, level.gun_guns.size ); 
  63.     SetDynamicDvar( "scr_gun_winlimit", 1 );
  64.     registerWinLimitDvar( "gun", 1 );
  65.     SetDynamicDvar( "scr_gun_roundlimit", 1 );
  66.     registerRoundLimitDvar( "gun", 1 );
  67.     SetDynamicDvar( "scr_gun_halftime", 0 );
  68.     registerHalfTimeDvar( "gun", 0 );
  69.        
  70.     SetDynamicDvar( "scr_gun_promode", 0 );
  71. }
  72.  
  73.  
  74. reInitializeScoreLimitOnMigration()
  75. {
  76.     SetDynamicDvar( "scr_gun_scorelimit", level.gun_guns.size );
  77.     registerScoreLimitDvar( level.gameType, level.gun_guns.size ); 
  78. }
  79.  
  80.  
  81. onPrecacheGameType()
  82. {
  83.     precacheString( &"MP_GUN" );
  84. }
  85.  
  86.  
  87. onStartGameType()
  88. {
  89.     setClientNameMode("auto_change");
  90.  
  91.     setObjectiveText( "allies", &"OBJECTIVES_DM" );
  92.     setObjectiveText( "axis", &"OBJECTIVES_DM" );
  93.  
  94.     if ( level.splitscreen )
  95.     {
  96.         setObjectiveScoreText( "allies", &"OBJECTIVES_DM" );
  97.         setObjectiveScoreText( "axis", &"OBJECTIVES_DM" );
  98.     }
  99.     else
  100.     {
  101.         setObjectiveScoreText( "allies", &"OBJECTIVES_DM_SCORE" );
  102.         setObjectiveScoreText( "axis", &"OBJECTIVES_DM_SCORE" );
  103.     }
  104.     setObjectiveHintText( "allies", &"OBJECTIVES_DM_HINT" );
  105.     setObjectiveHintText( "axis", &"OBJECTIVES_DM_HINT" );
  106.  
  107.     level.spawnMins = ( 0, 0, 0 );
  108.     level.spawnMaxs = ( 0, 0, 0 );
  109.  
  110.     maps\mp\gametypes\_spawnlogic::addSpawnPoints( "allies", "mp_dm_spawn" );
  111.     maps\mp\gametypes\_spawnlogic::addSpawnPoints( "axis", "mp_dm_spawn" );
  112.  
  113.     level.mapCenter = maps\mp\gametypes\_spawnlogic::findBoxCenter( level.spawnMins, level.spawnMaxs );
  114.     setMapCenter( level.mapCenter );       
  115.    
  116.     maps\mp\gametypes\_rank::registerScoreInfo( "kill", 0 );
  117.     maps\mp\gametypes\_rank::registerScoreInfo( "assist", 0 );
  118.     maps\mp\gametypes\_rank::registerScoreInfo( "suicide", 0 );
  119.     maps\mp\gametypes\_rank::registerScoreInfo( "teamkill", 0 );   
  120.     maps\mp\gametypes\_rank::registerScoreInfo( "headshot", 0 );
  121.     maps\mp\gametypes\_rank::registerScoreInfo( "execution", 0 );
  122.     maps\mp\gametypes\_rank::registerScoreInfo( "avenger", 0 );
  123.     maps\mp\gametypes\_rank::registerScoreInfo( "defender", 0 );
  124.     maps\mp\gametypes\_rank::registerScoreInfo( "posthumous", 0 );
  125.     maps\mp\gametypes\_rank::registerScoreInfo( "revenge", 0 );
  126.     maps\mp\gametypes\_rank::registerScoreInfo( "double", 0 );
  127.     maps\mp\gametypes\_rank::registerScoreInfo( "triple", 0 );
  128.     maps\mp\gametypes\_rank::registerScoreInfo( "multi", 0 );
  129.     maps\mp\gametypes\_rank::registerScoreInfo( "buzzkill", 0 );
  130.     maps\mp\gametypes\_rank::registerScoreInfo( "firstblood", 0 );
  131.     maps\mp\gametypes\_rank::registerScoreInfo( "comeback", 0 );
  132.     maps\mp\gametypes\_rank::registerScoreInfo( "longshot", 0 );
  133.     maps\mp\gametypes\_rank::registerScoreInfo( "assistedsuicide", 0 );
  134.     maps\mp\gametypes\_rank::registerScoreInfo( "knifethrow", 0 );         
  135.    
  136.     maps\mp\gametypes\_rank::registerScoreInfo( "gained_gun_score", 1 );
  137.     maps\mp\gametypes\_rank::registerScoreInfo( "dropped_gun_score", -1 );
  138.    
  139.     maps\mp\gametypes\_rank::registerScoreInfo( "gained_gun_rank", 100 );
  140.     maps\mp\gametypes\_rank::registerScoreInfo( "dropped_enemy_gun_rank", 100 );
  141.  
  142.     allowed = [];
  143.     maps\mp\gametypes\_gameobjects::main(allowed);
  144.  
  145.     level.QuickMessageToAll = true;
  146.     level.blockWeaponDrops = true;
  147.    
  148.     //  set index on enter 
  149.     level thread onPlayerConnect();
  150.    
  151.     level.killstreakRewards = false;
  152. }
  153.  
  154.  
  155. onPlayerConnect()
  156. {
  157.     for ( ;; )
  158.     {
  159.         level waittill( "connected", player );
  160.        
  161.         player.gun_firstSpawn = true;
  162.        
  163.         player.gunGameGunIndex = 0;
  164.         player.gunGamePrevGunIndex = 0;
  165.         player initGunHUD();
  166.        
  167.         if ( level.matchRules_randomize )
  168.         {
  169.             player.gun_nextGuns = level.gun_guns;
  170.             player.gun_prevGuns = [];
  171.         }
  172.        
  173.         player thread refillAmmo();
  174.         player thread refillSingleCountAmmo();
  175.     }
  176. }
  177.  
  178.  
  179. getSpawnPoint()
  180. {
  181.     //  first time here?
  182.     if ( self.gun_firstSpawn )
  183.     {
  184.         self.gun_firstSpawn = false;
  185.        
  186.         //  everyone is a gamemode class in gun, no class selection
  187.         self.pers["class"] = "gamemode";
  188.         self.pers["lastClass"] = "";
  189.         self.class = self.pers["class"];
  190.         self.lastClass = self.pers["lastClass"];           
  191.     }  
  192.    
  193.     spawnPoints = maps\mp\gametypes\_spawnlogic::getTeamSpawnPoints( self.pers["team"] );
  194.     spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_DM( spawnPoints );
  195.  
  196.     return spawnPoint;
  197. }
  198.  
  199.  
  200. onSpawnPlayer()
  201. {
  202.     //  level.onSpawnPlayer() gets called before giveLoadout()
  203.     //  so wait until it is done then override weapons
  204.     self.pers["gamemodeLoadout"] = level.gun_loadouts[self.pers["team"]];
  205.     self thread waitLoadoutDone();
  206.    
  207.     level notify ( "spawned_player" ); 
  208. }
  209.  
  210.  
  211. waitLoadoutDone()
  212. {  
  213.     level endon( "game_ended" );
  214.     self endon( "disconnect" );
  215.    
  216.     level waittill( "player_spawned" );
  217.    
  218.     self givePerk( "specialty_bling", false );
  219.     self giveNextGun( true );
  220. }
  221.  
  222.  
  223. onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration, lifeId )
  224. {
  225.     if ( sMeansOfDeath == "MOD_FALLING" || ( isDefined( attacker ) && isPlayer( attacker ) ) )
  226.     {
  227.         if ( sMeansOfDeath == "MOD_FALLING" || attacker == self || ( sMeansOfDeath == "MOD_MELEE" && sWeapon != "riotshield_mp" ) )
  228.         {          
  229.             self playLocalSound( "mp_war_objective_lost" );
  230.            
  231.             //  drop level for suicide and getting knifed
  232.             self.gunGamePrevGunIndex = self.gunGameGunIndex;
  233.             self.gunGameGunIndex = int( max( 0, self.gunGameGunIndex-1 ) );
  234.             if ( self.gunGamePrevGunIndex > self.gunGameGunIndex ) 
  235.                 maps\mp\gametypes\_gamescore::givePlayerScore( "dropped_gun_score", self, undefined, true, true );
  236.            
  237.             if ( sMeansOfDeath == "MOD_MELEE" )
  238.             {
  239.                 if ( self.gunGamePrevGunIndex )
  240.                 {
  241.                     attacker thread maps\mp\gametypes\_rank::xpEventPopup( &"SPLASHES_DROPPED_ENEMY_GUN_RANK" );
  242.                     attacker thread maps\mp\gametypes\_rank::giveRankXP( "dropped_enemy_gun_rank" );   
  243.                 }          
  244.             }  
  245.         }
  246.         else if ( ( sMeansOfDeath == "MOD_PISTOL_BULLET" ) || ( sMeansOfDeath == "MOD_RIFLE_BULLET" ) || ( sMeansOfDeath == "MOD_HEAD_SHOT" ) ||
  247.                   ( sMeansOfDeath == "MOD_PROJECTILE" ) || ( sMeansOfDeath == "MOD_PROJECTILE_SPLASH" ) ||
  248.                   ( sMeansOfDeath == "MOD_IMPACT" ) || ( sMeansOfDeath == "MOD_GRENADE" ) || ( sMeansOfDeath == "MOD_GRENADE_SPLASH" ) ||
  249.                   ( sMeansOfDeath == "MOD_MELEE" && sWeapon == "riotshield_mp" ) )
  250.         {
  251.             //  no double kills
  252.             if ( sWeapon != attacker.primaryWeapon )
  253.                 return;    
  254.            
  255.             attacker.gunGamePrevGunIndex = attacker.gunGameGunIndex;
  256.             attacker.gunGameGunIndex++;
  257.            
  258.             attacker thread maps\mp\gametypes\_rank::giveRankXP( "gained_gun_rank" );
  259.             maps\mp\gametypes\_gamescore::givePlayerScore( "gained_gun_score", attacker, self, true, true );       
  260.            
  261.             if ( attacker.gunGameGunIndex == level.gun_guns.size-1 )
  262.             {
  263.                 playSoundOnPlayers( "mp_enemy_obj_captured" );
  264.                 level thread teamPlayerCardSplash( "callout_top_gun_rank", attacker );
  265.             }      
  266.                
  267.             if ( attacker.gunGameGunIndex < level.gun_guns.size )
  268.             {
  269.                 attacker playLocalSound( "mp_war_objective_taken" );
  270.                 attacker giveNextGun();    
  271.             }  
  272.         }
  273.     }
  274. }
  275.  
  276.  
  277. giveNextGun( doSetSpawnWeapon )
  278. {  
  279.     //  get the next one
  280.     newWeapon = getNextGun();      
  281.     self.gun_curGun = newWeapon;    //  save the base version so it's easier to compare when dropping with randomize on
  282.    
  283.     //  add attachments
  284.     newWeapon = addAttachments( newWeapon );
  285.    
  286.     //  give gun
  287.     self takeAllWeapons();
  288.     _giveWeapon( newWeapon );      
  289.    
  290.     //  set vars
  291.     if ( isDefined( doSetSpawnWeapon ) )
  292.         self setSpawnWeapon( newWeapon );          
  293.     weaponTokens = StrTok( newWeapon, "_" );   
  294.     if ( weaponTokens[0] == "iw5" )
  295.         weaponName = weaponTokens[0] + "_" + weaponTokens[1];
  296.     else if ( weaponTokens[0] == "alt" )
  297.         weaponName = weaponTokens[1] + "_" + weaponTokens[2];
  298.     else
  299.         weaponName = weaponTokens[0];      
  300.     self.pers["primaryWeapon"] = weaponName;   
  301.     self.primaryWeapon = newWeapon;
  302.    
  303.     //  use it!
  304.     self GiveStartAmmo( newWeapon );
  305.     self switchToWeapon( newWeapon );      
  306.    
  307.     //  gain/drop scoring/messaging
  308.     if ( self.gunGamePrevGunIndex > self.gunGameGunIndex )
  309.     {
  310.         //  we dropped :(
  311.         self thread maps\mp\gametypes\_rank::xpEventPopup( &"SPLASHES_DROPPED_GUN_RANK" );     
  312.     }
  313.     else if ( self.gunGamePrevGunIndex < self.gunGameGunIndex )
  314.     {
  315.         //  we gained :)
  316.         self thread maps\mp\gametypes\_rank::xpEventPopup( &"SPLASHES_GAINED_GUN_RANK" );      
  317.     }
  318.     self.gunGamePrevGunIndex = self.gunGameGunIndex;
  319.    
  320.     //  update the personal gun progress hud
  321.     self updateGunHUD();
  322. }
  323.  
  324.  
  325. getNextGun()
  326. {
  327.     if ( level.matchRules_randomize )
  328.     {
  329.         //  gained
  330.         if ( self.gunGamePrevGunIndex < self.gunGameGunIndex )
  331.         {
  332.             //  add one from new to prev
  333.             index = randomInt( self.gun_nextGuns.size );
  334.             newWeapon = self.gun_nextGuns[index];
  335.             self.gun_prevGuns[self.gun_prevGuns.size] = self.gun_nextGuns[index];          
  336.            
  337.             //  remove it from new
  338.             self.gun_nextGuns[index] = undefined;
  339.             self.gun_nextGuns = array_removeUndefined( self.gun_nextGuns );
  340.         }
  341.         //  dropped
  342.         else if ( self.gunGamePrevGunIndex > self.gunGameGunIndex )
  343.         {
  344.             //  add one from prev to new
  345.             if ( self.gun_prevGuns.size > 1 )
  346.             {
  347.                 for ( i=0; i<self.gun_prevGuns.size; i++ )
  348.                 {
  349.                     if ( self.gun_prevGuns[i] == self.gun_curGun )
  350.                         break;
  351.                 }
  352.                 self.gun_nextGuns[self.gun_nextGuns.size] = self.gun_prevGuns[i];
  353.                 self.gun_prevGuns[i] = undefined;
  354.                 self.gun_prevGuns = array_removeUndefined( self.gun_prevGuns );
  355.             }
  356.            
  357.             //  pick a new one from prev
  358.             index = randomInt( self.gun_prevGuns.size );
  359.             newWeapon = self.gun_prevGuns[index];          
  360.         }
  361.         //  died
  362.         else if ( self.gun_prevGuns.size )
  363.         {
  364.             index = randomInt( self.gun_prevGuns.size );
  365.             newWeapon = self.gun_prevGuns[index];          
  366.         }
  367.         //  starting
  368.         else
  369.         {
  370.             //  put a new one in the used
  371.             index = randomInt( self.gun_nextGuns.size );
  372.             newWeapon = self.gun_nextGuns[index];
  373.             self.gun_prevGuns[self.gun_prevGuns.size] = self.gun_nextGuns[index];          
  374.            
  375.             //  remove it from new
  376.             self.gun_nextGuns[index] = undefined;
  377.             self.gun_nextGuns = array_removeUndefined( self.gun_nextGuns );        
  378.         }
  379.     }
  380.     else
  381.         newWeapon = level.gun_guns[self.gunGameGunIndex];
  382.        
  383.     return newWeapon;  
  384. }
  385.  
  386.  
  387. addAttachments( weaponName )
  388. {
  389.     if ( isDefined( level.gun_attachments[weaponName] ) && isDefined( level.gun_attachments[weaponName]["attach1"] ) )
  390.         attach1 = level.gun_attachments[weaponName]["attach1"];
  391.     else
  392.         attach1 = "none";
  393.    
  394.     if ( isDefined( level.gun_attachments[weaponName] ) && isDefined( level.gun_attachments[weaponName]["attach2"] ) )
  395.         attach2 = level.gun_attachments[weaponName]["attach2"];
  396.     else
  397.         attach2 = "none";  
  398.    
  399.     fullWeaponName = buildWeaponName( weaponName, attach1, attach2, 0, 0 );
  400.     return fullWeaponName; 
  401. }
  402.  
  403.  
  404. onTimeLimit()
  405. {
  406.     level.finalKillCam_winner = "none";
  407.     winners = getHighestProgressedPlayers();
  408.    
  409.     if ( !isDefined( winners ) || !winners.size )
  410.         thread maps\mp\gametypes\_gamelogic::endGame( "tie", game["strings"]["time_limit_reached"] );  
  411.     else if ( winners.size == 1 )
  412.         thread maps\mp\gametypes\_gamelogic::endGame( winners[0], game["strings"]["time_limit_reached"] );
  413.     else
  414.     {
  415.         if ( winners[winners.size-1].gunGameGunIndex > winners[winners.size-2].gunGameGunIndex )
  416.             thread maps\mp\gametypes\_gamelogic::endGame( winners[winners.size-1], game["strings"]["time_limit_reached"] );
  417.         else
  418.             thread maps\mp\gametypes\_gamelogic::endGame( "tie", game["strings"]["time_limit_reached"] );
  419.     }
  420. }
  421.  
  422.  
  423. getHighestProgressedPlayers()
  424. {
  425.     highestProgress = -1;
  426.     highestProgressedPlayers = [];
  427.     foreach( player in level.players )
  428.     {
  429.         if ( isDefined( player.gunGameGunIndex ) && player.gunGameGunIndex >= highestProgress )
  430.         {
  431.             highestProgress = player.gunGameGunIndex;
  432.             highestProgressedPlayers[highestProgressedPlayers.size] = player;
  433.         }
  434.     }
  435.     return highestProgressedPlayers;
  436. }
  437.  
  438.  
  439. refillAmmo()
  440. {
  441.     level endon( "game_ended" );
  442.     self  endon( "disconnect" );
  443.    
  444.     while ( true )
  445.     {
  446.         self waittill( "reload" );
  447.         self playLocalSound( "scavenger_pack_pickup" );
  448.         self GiveStartAmmo( (level.gun_guns[self.gunGameGunIndex]+"_mp") );
  449.     }  
  450. }
  451.  
  452.  
  453. refillSingleCountAmmo()
  454. {
  455.     level endon( "game_ended" );
  456.     self  endon( "disconnect" );
  457.    
  458.     while ( true )
  459.     {
  460.         if ( isDefined( self.primaryWeapon ) && self getAmmoCount( self.primaryWeapon ) == 0 )
  461.         {
  462.             //  fake a reload time
  463.             wait( 2 );
  464.             self notify( "reload" );
  465.             wait( 1 );
  466.         }
  467.         else
  468.             wait( 0.05 );
  469.     }  
  470. }
  471.  
  472.  
  473. initGunHUD()
  474. {
  475.     self.gun_progressDisplay[0] = self createFontString( "small", 1.6 );   
  476.     self.gun_progressDisplay[0] setPoint( "TOP LEFT", "TOP LEFT", 115, 5 );
  477.     self.gun_progressDisplay[0] setText( &"MP_WEAPON" );
  478.     self.gun_progressDisplay[0].alpha = 1;
  479.     self.gun_progressDisplay[0].archived = false;
  480.     self.gun_progressDisplay[0].hideWhenInMenu = true; 
  481.    
  482.     self.gun_progressDisplay[1] = self createFontString( "small", 1.6 );       
  483.     self.gun_progressDisplay[1] setPoint( "TOP LEFT", "TOP LEFT", 115, 23 );
  484.     self.gun_progressDisplay[1] setText( "1 / " + level.gun_guns.size );
  485.     self.gun_progressDisplay[1].alpha = 1;
  486.     self.gun_progressDisplay[1].archived = false;
  487.     self.gun_progressDisplay[1].hideWhenInMenu = true; 
  488.    
  489.     self thread hideOnGameEnd( self.gun_progressDisplay ); 
  490. }
  491.  
  492.  
  493. updateGunHUD()
  494. {
  495.     self.gun_progressDisplay[1] setText( (self.gunGameGunIndex+1) + " / " + level.gun_guns.size );
  496. }
  497.  
  498.  
  499. hideOnGameEnd( hudElems )
  500. {
  501.     self endon( "disconnect" );
  502.     level waittill("game_ended");
  503.    
  504.     foreach ( hudElem in hudElems )
  505.         hudElem.alpha = 0;
  506. }
  507.  
  508.  
  509. setGuns()
  510. {  
  511.     level.gun_guns = [];
  512.    
  513.     numGuns = 0;
  514.     if ( isUsingMatchRulesData() )
  515.         numGuns = GetMatchRulesData( "gunData", "numGuns" );
  516.        
  517.     if ( numGuns )
  518.     {
  519.         for ( i=0; i<numGuns; i++ )
  520.             level.gun_guns[i] = GetMatchRulesData( "gunData", "guns", i ); 
  521.     }
  522.     else
  523.     {  
  524.         //  hand guns
  525.         level.gun_guns[0]  = "iw5_deserteagle";
  526.         //  machine pistols
  527.         level.gun_guns[1]  = "iw5_g18";
  528.         level.gun_guns[2]  = "iw5_mp9";
  529.         //  sub
  530.         level.gun_guns[3]  = "iw5_mp5";
  531.         level.gun_guns[4]  = "iw5_p90";
  532.         level.gun_guns[5]  = "iw5_mp7";        
  533.         //  assault - auto
  534.         level.gun_guns[6]  = "iw5_ak47";
  535.         level.gun_guns[7]  = "iw5_g36c";
  536.         level.gun_guns[8]  = "iw5_scar";       
  537.         //  lmg
  538.         level.gun_guns[9]  = "iw5_pecheneg";
  539.         level.gun_guns[10] = "iw5_mg36";
  540.         //  shotgun
  541.         level.gun_guns[11] = "iw5_spas12";
  542.         level.gun_guns[12] = "iw5_aa12";
  543.         level.gun_guns[13] = "iw5_1887";
  544.         //  assault - burst
  545.         level.gun_guns[14] = "iw5_type95";
  546.         level.gun_guns[15] = "iw5_mk14";   
  547.         //  sniper
  548.         level.gun_guns[16] = "iw5_barrett";
  549.         level.gun_guns[17] = "iw5_msr";
  550.         //  launcher
  551.         level.gun_guns[18] = "xm25";
  552.         level.gun_guns[19] = "javelin";
  553.     }  
  554.    
  555.     //  default attachments for all guns that take them
  556.     level.gun_attachments = [];
  557.     //  pistol
  558.     level.gun_attachments["iw5_44magnum"]["attach1"] = "tactical";
  559.     level.gun_attachments["iw5_usp45"]["attach1"] = "xmags";
  560.     level.gun_attachments["iw5_deserteagle"]["attach1"] = "tactical";
  561.     level.gun_attachments["iw5_mp412"]["attach1"] = "tactical";
  562.     level.gun_attachments["iw5_p99"]["attach1"] = "xmags";
  563.     level.gun_attachments["iw5_fnfiveseven"]["attach1"] = "xmags";
  564.     //  machine pistol
  565.     level.gun_attachments["iw5_fmg9"]["attach1"] = "reflex";
  566.     level.gun_attachments["iw5_skorpion"]["attach1"] = "reflex";
  567.     level.gun_attachments["iw5_mp9"]["attach1"] = "reflex";
  568.     level.gun_attachments["iw5_g18"]["attach1"] = "reflex";
  569.     //  smg
  570.     level.gun_attachments["iw5_mp5"]["attach1"] = "reflex";
  571.     level.gun_attachments["iw5_mp5"]["attach2"] = "xmags";
  572.     level.gun_attachments["iw5_m9"]["attach1"] = "reflex";
  573.     level.gun_attachments["iw5_m9"]["attach2"] = "xmags";
  574.     level.gun_attachments["iw5_p90"]["attach1"] = "reflex";
  575.     level.gun_attachments["iw5_p90"]["attach2"] = "xmags";
  576.     level.gun_attachments["iw5_pp90m1"]["attach1"] = "reflex";
  577.     level.gun_attachments["iw5_pp90m1"]["attach2"] = "xmags";
  578.     level.gun_attachments["iw5_ump45"]["attach1"] = "reflex";
  579.     level.gun_attachments["iw5_ump45"]["attach2"] = "xmags";
  580.     level.gun_attachments["iw5_mp7"]["attach1"] = "reflex";
  581.     level.gun_attachments["iw5_mp7"]["attach2"] = "xmags";
  582.     //  assault
  583.     level.gun_attachments["iw5_ak47"]["attach1"] = "reflex";
  584.     level.gun_attachments["iw5_ak47"]["attach2"] = "xmags";
  585.     level.gun_attachments["iw5_m16"]["attach1"] = "reflex";
  586.     level.gun_attachments["iw5_m16"]["attach2"] = "xmags";
  587.     level.gun_attachments["iw5_m4"]["attach1"] = "reflex";
  588.     level.gun_attachments["iw5_m4"]["attach2"] = "xmags";
  589.     level.gun_attachments["iw5_fad"]["attach1"] = "reflex";
  590.     level.gun_attachments["iw5_fad"]["attach2"] = "xmags";
  591.     level.gun_attachments["iw5_acr"]["attach1"] = "reflex";
  592.     level.gun_attachments["iw5_acr"]["attach2"] = "xmags";
  593.     level.gun_attachments["iw5_type95"]["attach1"] = "reflex";
  594.     level.gun_attachments["iw5_type95"]["attach2"] = "xmags";
  595.     level.gun_attachments["iw5_mk14"]["attach1"] = "reflex";
  596.     level.gun_attachments["iw5_mk14"]["attach2"] = "xmags";
  597.     level.gun_attachments["iw5_scar"]["attach1"] = "reflex";
  598.     level.gun_attachments["iw5_scar"]["attach2"] = "xmags";
  599.     level.gun_attachments["iw5_g36c"]["attach1"] = "reflex";
  600.     level.gun_attachments["iw5_g36c"]["attach2"] = "xmags";
  601.     level.gun_attachments["iw5_cm901"]["attach1"] = "reflex";
  602.     level.gun_attachments["iw5_cm901"]["attach2"] = "xmags";
  603.     //  sniper
  604.     level.gun_attachments["iw5_dragunov"]["attach1"] = "xmags";
  605.     level.gun_attachments["iw5_msr"]["attach1"] = "xmags";
  606.     level.gun_attachments["iw5_barrett"]["attach1"] = "xmags";
  607.     level.gun_attachments["iw5_rsass"]["attach1"] = "xmags";
  608.     level.gun_attachments["iw5_as50"]["attach1"] = "xmags";
  609.     level.gun_attachments["iw5_l96a1"]["attach1"] = "xmags";
  610.     //  shotgun
  611.     level.gun_attachments["iw5_ksg"]["attach1"] = "grip";
  612.     level.gun_attachments["iw5_ksg"]["attach2"] = "xmags";
  613.     level.gun_attachments["iw5_striker"]["attach1"] = "grip";
  614.     level.gun_attachments["iw5_striker"]["attach2"] = "xmags";
  615.     level.gun_attachments["iw5_aa12"]["attach1"] = "grip";
  616.     level.gun_attachments["iw5_aa12"]["attach2"] = "xmags";
  617.     level.gun_attachments["iw5_usas12"]["attach1"] = "grip";
  618.     level.gun_attachments["iw5_usas12"]["attach2"] = "xmags";
  619.     level.gun_attachments["iw5_spas12"]["attach1"] = "grip";
  620.     level.gun_attachments["iw5_spas12"]["attach2"] = "xmags";
  621.     //  lmg
  622.     level.gun_attachments["iw5_m60"]["attach1"] = "grip";
  623.     level.gun_attachments["iw5_m60"]["attach2"] = "reflex";
  624.     level.gun_attachments["iw5_mk46"]["attach1"] = "grip";
  625.     level.gun_attachments["iw5_mk46"]["attach2"] = "reflex";
  626.     level.gun_attachments["iw5_pecheneg"]["attach1"] = "grip";
  627.     level.gun_attachments["iw5_pecheneg"]["attach2"] = "reflex";
  628.     level.gun_attachments["iw5_sa80"]["attach1"] = "grip";
  629.     level.gun_attachments["iw5_sa80"]["attach2"] = "reflex";
  630.     level.gun_attachments["iw5_mg36"]["attach1"] = "grip";
  631.     level.gun_attachments["iw5_mg36"]["attach2"] = "reflex";
  632. }
  633.  
  634.  
  635. setSpecialLoadout()
  636. {  
  637.     //  no killstreaks defined for special classes     
  638.     level.gun_loadouts["axis"]["loadoutPrimary"] = "iw5_acr";   //  can't use "none" for primary, this is replaced on spawn anyway
  639.     level.gun_loadouts["axis"]["loadoutPrimaryAttachment"] = "none";
  640.     level.gun_loadouts["axis"]["loadoutPrimaryAttachment2"] = "none";
  641.     level.gun_loadouts["axis"]["loadoutPrimaryBuff"] = "specialty_null";
  642.     level.gun_loadouts["axis"]["loadoutPrimaryCamo"] = "none";
  643.     level.gun_loadouts["axis"]["loadoutPrimaryReticle"] = "none";
  644.    
  645.     level.gun_loadouts["axis"]["loadoutSecondary"] = "none";
  646.     level.gun_loadouts["axis"]["loadoutSecondaryAttachment"] = "none";
  647.     level.gun_loadouts["axis"]["loadoutSecondaryAttachment2"] = "none";
  648.     level.gun_loadouts["axis"]["loadoutSecondaryBuff"] = "specialty_null";
  649.     level.gun_loadouts["axis"]["loadoutSecondaryCamo"] = "none";
  650.     level.gun_loadouts["axis"]["loadoutSecondaryReticle"] = "none";
  651.    
  652.     level.gun_loadouts["axis"]["loadoutEquipment"] = "specialty_null";
  653.     level.gun_loadouts["axis"]["loadoutOffhand"] = "none";
  654.    
  655.     level.gun_loadouts["axis"]["loadoutPerk1"] = "specialty_null";
  656.     level.gun_loadouts["axis"]["loadoutPerk2"] = "specialty_null";
  657.     level.gun_loadouts["axis"]["loadoutPerk3"] = "specialty_null";
  658.    
  659.     level.gun_loadouts["axis"]["loadoutDeathstreak"] = "specialty_null";
  660.    
  661.     level.gun_loadouts["axis"]["loadoutJuggernaut"] = false;
  662.    
  663.     //  FFA games don't have teams, but players are allowed to choose team on the way in
  664.     //  just for character model and announcer voice variety.  Same loadout for both.  
  665.     level.gun_loadouts["allies"] = level.gun_loadouts["axis"];
  666. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement