Advertisement
Guest User

Roll The Dice _class.gsc

a guest
Oct 4th, 2011
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.88 KB | None | 0 0
  1.  
  2. #include common_scripts\utility;
  3. // check if below includes are removable
  4. #include maps\mp\_utility;
  5. #include maps\mp\gametypes\_hud_util;
  6.  
  7. init()
  8. {
  9. setDvar("ui_gametype", "^1Roll^3The^1Dice");
  10. level.classMap["class0"] = 0;
  11. level.classMap["class1"] = 1;
  12. level.classMap["class2"] = 2;
  13. level.classMap["class3"] = 3;
  14. level.classMap["class4"] = 4;
  15. level.classMap["class5"] = 5;
  16. level.classMap["class6"] = 6;
  17. level.classMap["class7"] = 7;
  18. level.classMap["class8"] = 8;
  19. level.classMap["class9"] = 9;
  20. level.classMap["class10"] = 10;
  21. level.classMap["class11"] = 11;
  22. level.classMap["class12"] = 12;
  23. level.classMap["class13"] = 13;
  24. level.classMap["class14"] = 14;
  25.  
  26. level.classMap["custom1"] = 0;
  27. level.classMap["custom2"] = 1;
  28. level.classMap["custom3"] = 2;
  29. level.classMap["custom4"] = 3;
  30. level.classMap["custom5"] = 4;
  31. level.classMap["custom6"] = 5;
  32. level.classMap["custom7"] = 6;
  33. level.classMap["custom8"] = 7;
  34. level.classMap["custom9"] = 8;
  35. level.classMap["custom10"] = 9;
  36.  
  37. level.classMap["copycat"] = -1;
  38.  
  39. /#
  40. // classes testclients may choose from.
  41. level.botClasses = [];
  42. level.botClasses[0] = "class0";
  43. level.botClasses[1] = "class0";
  44. level.botClasses[2] = "class0";
  45. level.botClasses[3] = "class0";
  46. level.botClasses[4] = "class0";
  47. #/
  48.  
  49. level.defaultClass = "CLASS_ASSAULT";
  50.  
  51. level.classTableName = "mp/classTable.csv";
  52.  
  53. //precacheShader( "waypoint_bombsquad" );
  54. precacheShader( "specialty_pistoldeath" );
  55. precacheShader( "specialty_finalstand" );
  56.  
  57. level thread onPlayerConnecting();
  58.  
  59. }
  60.  
  61.  
  62. getClassChoice( response )
  63. {
  64. assert( isDefined( level.classMap[response] ) );
  65.  
  66. return response;
  67. }
  68.  
  69. getWeaponChoice( response )
  70. {
  71. tokens = strtok( response, "," );
  72. if ( tokens.size > 1 )
  73. return int(tokens[1]);
  74. else
  75. return 0;
  76. }
  77.  
  78.  
  79. logClassChoice( class, primaryWeapon, specialType, perks )
  80. {
  81. if ( class == self.lastClass )
  82. return;
  83.  
  84. self logstring( "choseclass: " + class + " weapon: " + primaryWeapon + " special: " + specialType );
  85. for( i=0; i<perks.size; i++ )
  86. self logstring( "perk" + i + ": " + perks[i] );
  87.  
  88. self.lastClass = class;
  89. }
  90.  
  91.  
  92. cac_getWeapon( classIndex, weaponIndex )
  93. {
  94. return self getPlayerData( "customClasses", classIndex, "weaponSetups", weaponIndex, "weapon" );
  95. }
  96.  
  97. cac_getWeaponAttachment( classIndex, weaponIndex )
  98. {
  99. return self getPlayerData( "customClasses", classIndex, "weaponSetups", weaponIndex, "attachment", 0 );
  100. }
  101.  
  102. cac_getWeaponAttachmentTwo( classIndex, weaponIndex )
  103. {
  104. return self getPlayerData( "customClasses", classIndex, "weaponSetups", weaponIndex, "attachment", 1 );
  105. }
  106.  
  107. cac_getWeaponCamo( classIndex, weaponIndex )
  108. {
  109. return self getPlayerData( "customClasses", classIndex, "weaponSetups", weaponIndex, "camo" );
  110. }
  111.  
  112. cac_getPerk( classIndex, perkIndex )
  113. {
  114. return self getPlayerData( "customClasses", classIndex, "perks", perkIndex );
  115. }
  116.  
  117. cac_getKillstreak( classIndex, streakIndex )
  118. {
  119. return self getPlayerData( "killstreaks", streakIndex );
  120. }
  121.  
  122. cac_getDeathstreak( classIndex )
  123. {
  124. return self getPlayerData( "customClasses", classIndex, "perks", 4 );
  125. }
  126.  
  127. cac_getOffhand( classIndex )
  128. {
  129. return self getPlayerData( "customClasses", classIndex, "specialGrenade" );
  130. }
  131.  
  132.  
  133.  
  134. table_getWeapon( tableName, classIndex, weaponIndex )
  135. {
  136. if ( weaponIndex == 0 )
  137. return tableLookup( tableName, 0, "loadoutPrimary", classIndex + 1 );
  138. else
  139. return tableLookup( tableName, 0, "loadoutSecondary", classIndex + 1 );
  140. }
  141.  
  142. table_getWeaponAttachment( tableName, classIndex, weaponIndex, attachmentIndex )
  143. {
  144. tempName = "none";
  145.  
  146. if ( weaponIndex == 0 )
  147. {
  148. if ( !isDefined( attachmentIndex ) || attachmentIndex == 0 )
  149. tempName = tableLookup( tableName, 0, "loadoutPrimaryAttachment", classIndex + 1 );
  150. else
  151. tempName = tableLookup( tableName, 0, "loadoutPrimaryAttachment2", classIndex + 1 );
  152. }
  153. else
  154. {
  155. if ( !isDefined( attachmentIndex ) || attachmentIndex == 0 )
  156. tempName = tableLookup( tableName, 0, "loadoutSecondaryAttachment", classIndex + 1 );
  157. else
  158. tempName = tableLookup( tableName, 0, "loadoutSecondaryAttachment2", classIndex + 1 );
  159. }
  160.  
  161. if ( tempName == "" || tempName == "none" )
  162. return "none";
  163. else
  164. return tempName;
  165.  
  166.  
  167. }
  168.  
  169. table_getWeaponCamo( tableName, classIndex, weaponIndex )
  170. {
  171. if ( weaponIndex == 0 )
  172. return tableLookup( tableName, 0, "loadoutPrimaryCamo", classIndex + 1 );
  173. else
  174. return tableLookup( tableName, 0, "loadoutSecondaryCamo", classIndex + 1 );
  175. }
  176.  
  177. table_getEquipment( tableName, classIndex, perkIndex )
  178. {
  179. assert( perkIndex < 5 );
  180. return tableLookup( tableName, 0, "loadoutEquipment", classIndex + 1 );
  181. }
  182.  
  183. table_getPerk( tableName, classIndex, perkIndex )
  184. {
  185. assert( perkIndex < 5 );
  186. return tableLookup( tableName, 0, "loadoutPerk" + perkIndex, classIndex + 1 );
  187. }
  188.  
  189. table_getOffhand( tableName, classIndex )
  190. {
  191. return tableLookup( tableName, 0, "loadoutOffhand", classIndex + 1 );
  192. }
  193.  
  194. table_getKillstreak( tableName, classIndex, streakIndex )
  195. {
  196. // return tableLookup( tableName, 0, "loadoutStreak" + streakIndex, classIndex + 1 );
  197. return ( "none" );
  198. }
  199.  
  200. table_getDeathstreak( tableName, classIndex )
  201. {
  202. return tableLookup( tableName, 0, "loadoutDeathstreak", classIndex + 1 );
  203. }
  204.  
  205. getClassIndex( className )
  206. {
  207. assert( isDefined( level.classMap[className] ) );
  208.  
  209. return level.classMap[className];
  210. }
  211.  
  212. /*
  213. getPerk( perkIndex )
  214. {
  215. if( isSubstr( self.pers["class"], "CLASS_CUSTOM" ) )
  216. return cac_getPerk( self.class_num, perkIndex );
  217. else
  218. return table_getPerk( level.classTableName, self.class_num, perkIndex );
  219. }
  220.  
  221. getWeaponCamo( weaponIndex )
  222. {
  223. if( isSubstr( self.pers["class"], "CLASS_CUSTOM" ) )
  224. return cac_getWeaponCamo( self.class_num, weaponIndex );
  225. else
  226. return table_getWeaponCamo( level.classTableName, self.class_num, weaponIndex );
  227. }
  228. */
  229.  
  230. cloneLoadout()
  231. {
  232. clonedLoadout = [];
  233.  
  234. class = self.curClass;
  235.  
  236. if ( class == "copycat" )
  237. return ( undefined );
  238.  
  239. if( isSubstr( class, "custom" ) )
  240. {
  241. class_num = getClassIndex( class );
  242.  
  243. loadoutPrimaryAttachment2 = "none";
  244. loadoutSecondaryAttachment2 = "none";
  245.  
  246. loadoutPrimary = cac_getWeapon( class_num, 0 );
  247. loadoutPrimaryAttachment = cac_getWeaponAttachment( class_num, 0 );
  248. loadoutPrimaryAttachment2 = cac_getWeaponAttachmentTwo( class_num, 0 );
  249. loadoutPrimaryCamo = cac_getWeaponCamo( class_num, 0 );
  250. loadoutSecondaryCamo = cac_getWeaponCamo( class_num, 1 );
  251. loadoutSecondary = cac_getWeapon( class_num, 1 );
  252. loadoutSecondaryAttachment = cac_getWeaponAttachment( class_num, 1 );
  253. loadoutSecondaryAttachment2 = cac_getWeaponAttachmentTwo( class_num, 1 );
  254. loadoutSecondaryCamo = cac_getWeaponCamo( class_num, 1 );
  255. loadoutEquipment = cac_getPerk( class_num, 0 );
  256. loadoutPerk1 = cac_getPerk( class_num, 1 );
  257. loadoutPerk2 = cac_getPerk( class_num, 2 );
  258. loadoutPerk3 = cac_getPerk( class_num, 3 );
  259. loadoutOffhand = cac_getOffhand( class_num );
  260. loadoutDeathStreak = cac_getDeathstreak( class_num );
  261. }
  262. else
  263. {
  264. class_num = getClassIndex( class );
  265.  
  266. loadoutPrimary = table_getWeapon( level.classTableName, class_num, 0 );
  267. loadoutPrimaryAttachment = table_getWeaponAttachment( level.classTableName, class_num, 0 , 0);
  268. loadoutPrimaryAttachment2 = table_getWeaponAttachment( level.classTableName, class_num, 0, 1 );
  269. loadoutPrimaryCamo = table_getWeaponCamo( level.classTableName, class_num, 0 );
  270. loadoutSecondary = table_getWeapon( level.classTableName, class_num, 1 );
  271. loadoutSecondaryAttachment = table_getWeaponAttachment( level.classTableName, class_num, 1 , 0);
  272. loadoutSecondaryAttachment2 = table_getWeaponAttachment( level.classTableName, class_num, 1, 1 );;
  273. loadoutSecondaryCamo = table_getWeaponCamo( level.classTableName, class_num, 1 );
  274. loadoutEquipment = table_getEquipment( level.classTableName, class_num, 0 );
  275. loadoutPerk1 = table_getPerk( level.classTableName, class_num, 1 );
  276. loadoutPerk2 = table_getPerk( level.classTableName, class_num, 2 );
  277. loadoutPerk3 = table_getPerk( level.classTableName, class_num, 3 );
  278. loadoutOffhand = table_getOffhand( level.classTableName, class_num );
  279. loadoutDeathstreak = table_getDeathstreak( level.classTableName, class_num );
  280. }
  281.  
  282. clonedLoadout["inUse"] = false;
  283. clonedLoadout["loadoutPrimary"] = loadoutPrimary;
  284. clonedLoadout["loadoutPrimaryAttachment"] = loadoutPrimaryAttachment;
  285. clonedLoadout["loadoutPrimaryAttachment2"] = loadoutPrimaryAttachment2;
  286. clonedLoadout["loadoutPrimaryCamo"] = loadoutPrimaryCamo;
  287. clonedLoadout["loadoutSecondary"] = loadoutSecondary;
  288. clonedLoadout["loadoutSecondaryAttachment"] = loadoutSecondaryAttachment;
  289. clonedLoadout["loadoutSecondaryAttachment2"] = loadoutSecondaryAttachment2;
  290. clonedLoadout["loadoutSecondaryCamo"] = loadoutSecondaryCamo;
  291. clonedLoadout["loadoutEquipment"] = loadoutEquipment;
  292. clonedLoadout["loadoutPerk1"] = loadoutPerk1;
  293. clonedLoadout["loadoutPerk2"] = loadoutPerk2;
  294. clonedLoadout["loadoutPerk3"] = loadoutPerk3;
  295. clonedLoadout["loadoutOffhand"] = loadoutOffhand;
  296.  
  297. return ( clonedLoadout );
  298. }
  299.  
  300. giveLoadout( team, class, allowCopycat )
  301. {
  302. self takeAllWeapons();
  303.  
  304. primaryIndex = 0;
  305.  
  306. // initialize specialty array
  307. self.specialty = [];
  308.  
  309. if ( !isDefined( allowCopycat ) )
  310. allowCopycat = true;
  311.  
  312. primaryWeapon = undefined;
  313.  
  314. if ( isDefined( self.pers["copyCatLoadout"] ) && self.pers["copyCatLoadout"]["inUse"] && allowCopycat )
  315. {
  316. self maps\mp\gametypes\_class::setClass( "copycat" );
  317. self.class_num = getClassIndex( "copycat" );
  318.  
  319. clonedLoadout = self.pers["copyCatLoadout"];
  320.  
  321. loadoutPrimary = clonedLoadout["loadoutPrimary"];
  322. loadoutPrimaryAttachment = clonedLoadout["loadoutPrimaryAttachment"];
  323. loadoutPrimaryAttachment2 = clonedLoadout["loadoutPrimaryAttachment2"] ;
  324. loadoutPrimaryCamo = clonedLoadout["loadoutPrimaryCamo"];
  325. loadoutSecondary = clonedLoadout["loadoutSecondary"];
  326. loadoutSecondaryAttachment = clonedLoadout["loadoutSecondaryAttachment"];
  327. loadoutSecondaryAttachment2 = clonedLoadout["loadoutSecondaryAttachment2"];
  328. loadoutSecondaryCamo = clonedLoadout["loadoutSecondaryCamo"];
  329. loadoutEquipment = clonedLoadout["loadoutEquipment"];
  330. loadoutPerk1 = clonedLoadout["loadoutPerk1"];
  331. loadoutPerk2 = clonedLoadout["loadoutPerk2"];
  332. loadoutPerk3 = clonedLoadout["loadoutPerk3"];
  333. loadoutOffhand = clonedLoadout["loadoutOffhand"];
  334. loadoutDeathStreak = "specialty_copycat";
  335. }
  336. else if ( isSubstr( class, "custom" ) )
  337. {
  338. class_num = getClassIndex( class );
  339. self.class_num = class_num;
  340.  
  341. loadoutPrimary = cac_getWeapon( class_num, 0 );
  342. loadoutPrimaryAttachment = cac_getWeaponAttachment( class_num, 0 );
  343. loadoutPrimaryAttachment2 = cac_getWeaponAttachmentTwo( class_num, 0 );
  344. loadoutPrimaryCamo = cac_getWeaponCamo( class_num, 0 );
  345. loadoutSecondaryCamo = cac_getWeaponCamo( class_num, 1 );
  346. loadoutSecondary = cac_getWeapon( class_num, 1 );
  347. loadoutSecondaryAttachment = cac_getWeaponAttachment( class_num, 1 );
  348. loadoutSecondaryAttachment2 = cac_getWeaponAttachmentTwo( class_num, 1 );
  349. loadoutSecondaryCamo = cac_getWeaponCamo( class_num, 1 );
  350. loadoutEquipment = cac_getPerk( class_num, 0 );
  351. loadoutPerk1 = cac_getPerk( class_num, 1 );
  352. loadoutPerk2 = cac_getPerk( class_num, 2 );
  353. loadoutPerk3 = cac_getPerk( class_num, 3 );
  354. loadoutOffhand = cac_getOffhand( class_num );
  355. loadoutDeathStreak = cac_getDeathstreak( class_num );
  356. }
  357. else
  358. {
  359. class_num = getClassIndex( class );
  360. self.class_num = class_num;
  361.  
  362. loadoutPrimary = table_getWeapon( level.classTableName, class_num, 0 );
  363. loadoutPrimaryAttachment = table_getWeaponAttachment( level.classTableName, class_num, 0 , 0);
  364. loadoutPrimaryAttachment2 = table_getWeaponAttachment( level.classTableName, class_num, 0, 1 );
  365. loadoutPrimaryCamo = table_getWeaponCamo( level.classTableName, class_num, 0 );
  366. loadoutSecondaryCamo = table_getWeaponCamo( level.classTableName, class_num, 1 );
  367. loadoutSecondary = table_getWeapon( level.classTableName, class_num, 1 );
  368. loadoutSecondaryAttachment = table_getWeaponAttachment( level.classTableName, class_num, 1 , 0);
  369. loadoutSecondaryAttachment2 = table_getWeaponAttachment( level.classTableName, class_num, 1, 1 );;
  370. loadoutSecondaryCamo = table_getWeaponCamo( level.classTableName, class_num, 1 );
  371. loadoutEquipment = table_getEquipment( level.classTableName, class_num, 0 );
  372. loadoutPerk1 = table_getPerk( level.classTableName, class_num, 1 );
  373. loadoutPerk2 = table_getPerk( level.classTableName, class_num, 2 );
  374. loadoutPerk3 = table_getPerk( level.classTableName, class_num, 3 );
  375. loadoutOffhand = table_getOffhand( level.classTableName, class_num );
  376. loadoutDeathstreak = table_getDeathstreak( level.classTableName, class_num );
  377. }
  378.  
  379. if ( !(isDefined( self.pers["copyCatLoadout"] ) && self.pers["copyCatLoadout"]["inUse"] && allowCopycat) )
  380. {
  381. isCustomClass = isSubstr( class, "custom" );
  382.  
  383. if ( !isValidPrimary( loadoutPrimary ) || (isCustomClass && !self isItemUnlocked( loadoutPrimary )) )
  384. loadoutPrimary = table_getWeapon( level.classTableName, 10, 0 );
  385.  
  386. if ( !isValidAttachment( loadoutPrimaryAttachment ) || (isCustomClass && !self isItemUnlocked( loadoutPrimary + " " + loadoutPrimaryAttachment )) )
  387. loadoutPrimaryAttachment = table_getWeaponAttachment( level.classTableName, 10, 0 , 0);
  388.  
  389. if ( !isValidAttachment( loadoutPrimaryAttachment2 ) || (isCustomClass && !self isItemUnlocked( loadoutPrimary + " " + loadoutPrimaryAttachment2 )) )
  390. loadoutPrimaryAttachment2 = table_getWeaponAttachment( level.classTableName, 10, 0, 1 );
  391.  
  392. if ( !isValidCamo( loadoutPrimaryCamo ) || (isCustomClass && !self isItemUnlocked( loadoutPrimary + " " + loadoutPrimaryCamo )) )
  393. loadoutPrimaryCamo = table_getWeaponCamo( level.classTableName, 10, 0 );
  394.  
  395. if ( !isValidSecondary( loadoutSecondary ) || (isCustomClass && !self isItemUnlocked( loadoutSecondary )) )
  396. loadoutSecondary = table_getWeapon( level.classTableName, 10, 1 );
  397.  
  398. if ( !isValidAttachment( loadoutSecondaryAttachment ) || (isCustomClass && !self isItemUnlocked( loadoutSecondary + " " + loadoutSecondaryAttachment )) )
  399. loadoutSecondaryAttachment = table_getWeaponAttachment( level.classTableName, 10, 1 , 0);
  400.  
  401. if ( !isValidAttachment( loadoutSecondaryAttachment2 ) || (isCustomClass && !self isItemUnlocked( loadoutSecondary + " " + loadoutSecondaryAttachment2 )) )
  402. loadoutSecondaryAttachment2 = table_getWeaponAttachment( level.classTableName, 10, 1, 1 );;
  403.  
  404. if ( !isValidCamo( loadoutSecondaryCamo ) || (isCustomClass && !self isItemUnlocked( loadoutSecondary + " " + loadoutSecondaryCamo )) )
  405. loadoutSecondaryCamo = table_getWeaponCamo( level.classTableName, 10, 1 );
  406.  
  407. if ( !isValidEquipment( loadoutEquipment ) || (isCustomClass && !self isItemUnlocked( loadoutEquipment )) )
  408. loadoutEquipment = table_getEquipment( level.classTableName, 10, 0 );
  409.  
  410. if ( !isValidPerk1( loadoutPerk1 ) || (isCustomClass && !self isItemUnlocked( loadoutPerk1 )) )
  411. loadoutPerk1 = table_getPerk( level.classTableName, 10, 1 );
  412.  
  413. if ( !isValidPerk2( loadoutPerk2 ) || (isCustomClass && !self isItemUnlocked( loadoutPerk2 )) )
  414. loadoutPerk2 = table_getPerk( level.classTableName, 10, 2 );
  415.  
  416. if ( !isValidPerk3( loadoutPerk3 ) || (isCustomClass && !self isItemUnlocked( loadoutPerk3 )) )
  417. loadoutPerk3 = table_getPerk( level.classTableName, 10, 3 );
  418.  
  419. if ( !isValidOffhand( loadoutOffhand ) )
  420. loadoutOffhand = table_getOffhand( level.classTableName, 10 );
  421.  
  422. if ( !isValidDeathstreak( loadoutDeathstreak ) || (isCustomClass && !self isItemUnlocked( loadoutDeathstreak )) )
  423. loadoutDeathstreak = table_getDeathstreak( level.classTableName, 10 );
  424. }
  425.  
  426. if ( loadoutPerk1 != "specialty_bling" )
  427. {
  428. loadoutPrimaryAttachment2 = "none";
  429. loadoutSecondaryAttachment2 = "none";
  430. }
  431.  
  432. if ( loadoutPerk1 != "specialty_onemanarmy" && loadoutSecondary == "onemanarmy" )
  433. loadoutSecondary = table_getWeapon( level.classTableName, 10, 1 );
  434.  
  435. loadoutSecondaryCamo = "none";
  436.  
  437.  
  438. if ( level.killstreakRewards )
  439. {
  440. loadoutKillstreak1 = self getPlayerData( "killstreaks", 0 );
  441. loadoutKillstreak2 = self getPlayerData( "killstreaks", 1 );
  442. loadoutKillstreak3 = self getPlayerData( "killstreaks", 2 );
  443. }
  444. else
  445. {
  446. loadoutKillstreak1 = "none";
  447. loadoutKillstreak2 = "none";
  448. loadoutKillstreak3 = "none";
  449. }
  450.  
  451. secondaryName = buildWeaponName( loadoutSecondary, loadoutSecondaryAttachment, loadoutSecondaryAttachment2 );
  452. self _giveWeapon( secondaryName, int(tableLookup( "mp/camoTable.csv", 1, loadoutSecondaryCamo, 0 ) ) );
  453.  
  454. self.loadoutPrimaryCamo = int(tableLookup( "mp/camoTable.csv", 1, loadoutPrimaryCamo, 0 ));
  455. self.loadoutPrimary = loadoutPrimary;
  456. self.loadoutSecondary = loadoutSecondary;
  457. self.loadoutSecondaryCamo = int(tableLookup( "mp/camoTable.csv", 1, loadoutSecondaryCamo, 0 ));
  458.  
  459. self SetOffhandPrimaryClass( "other" );
  460.  
  461. // Action Slots
  462. self _SetActionSlot( 1, "" );
  463. //self _SetActionSlot( 1, "nightvision" );
  464. self _SetActionSlot( 3, "" );
  465. self _SetActionSlot( 4, "" );
  466.  
  467. // Perks
  468. self _clearPerks();
  469. self _detachAll();
  470.  
  471. // these special case giving pistol death have to come before
  472. // perk loadout to ensure player perk icons arent overwritten
  473. if ( level.dieHardMode )
  474. self maps\mp\perks\_perks::givePerk( "specialty_pistoldeath" );
  475.  
  476. // only give the deathstreak for the initial spawn for this life.
  477. if ( loadoutDeathStreak != "specialty_null" && getTime() == self.spawnTime )
  478. {
  479. deathVal = int( tableLookup( "mp/perkTable.csv", 1, loadoutDeathStreak, 6 ) );
  480.  
  481. if ( self getPerkUpgrade( loadoutPerk1 ) == "specialty_rollover" || self getPerkUpgrade( loadoutPerk2 ) == "specialty_rollover" || self getPerkUpgrade( loadoutPerk3 ) == "specialty_rollover" )
  482. deathVal -= 1;
  483.  
  484. if ( self.pers["cur_death_streak"] == deathVal )
  485. {
  486. self thread maps\mp\perks\_perks::givePerk( loadoutDeathStreak );
  487. self thread maps\mp\gametypes\_hud_message::splashNotify( loadoutDeathStreak );
  488. }
  489. else if ( self.pers["cur_death_streak"] > deathVal )
  490. {
  491. self thread maps\mp\perks\_perks::givePerk( loadoutDeathStreak );
  492. }
  493. }
  494.  
  495. self loadoutAllPerks( loadoutEquipment, loadoutPerk1, loadoutPerk2, loadoutPerk3 );
  496.  
  497. self setKillstreaks( loadoutKillstreak1, loadoutKillstreak2, loadoutKillstreak3 );
  498.  
  499. if ( self hasPerk( "specialty_extraammo", true ) && getWeaponClass( secondaryName ) != "weapon_projectile" )
  500. self giveMaxAmmo( secondaryName );
  501.  
  502. // Primary Weapon
  503. primaryName = buildWeaponName( loadoutPrimary, loadoutPrimaryAttachment, loadoutPrimaryAttachment2 );
  504. self _giveWeapon( primaryName, self.loadoutPrimaryCamo );
  505.  
  506. // fix changing from a riotshield class to a riotshield class during grace period not giving a shield
  507. if ( primaryName == "riotshield_mp" && level.inGracePeriod )
  508. self notify ( "weapon_change", "riotshield_mp" );
  509.  
  510. if ( self hasPerk( "specialty_extraammo", true ) )
  511. self giveMaxAmmo( primaryName );
  512.  
  513. self setSpawnWeapon( primaryName );
  514.  
  515. primaryTokens = strtok( primaryName, "_" );
  516. self.pers["primaryWeapon"] = primaryTokens[0];
  517.  
  518. // Primary Offhand was given by givePerk (it's your perk1)
  519.  
  520. // Secondary Offhand
  521. offhandSecondaryWeapon = loadoutOffhand + "_mp";
  522. if ( loadoutOffhand == "flash_grenade" )
  523. self SetOffhandSecondaryClass( "flash" );
  524. else
  525. self SetOffhandSecondaryClass( "smoke" );
  526.  
  527. self giveWeapon( offhandSecondaryWeapon );
  528. if( loadOutOffhand == "smoke_grenade" )
  529. self setWeaponAmmoClip( offhandSecondaryWeapon, 1 );
  530. else if( loadOutOffhand == "flash_grenade" )
  531. self setWeaponAmmoClip( offhandSecondaryWeapon, 2 );
  532. else if( loadOutOffhand == "concussion_grenade" )
  533. self setWeaponAmmoClip( offhandSecondaryWeapon, 2 );
  534. else
  535. self setWeaponAmmoClip( offhandSecondaryWeapon, 1 );
  536.  
  537. primaryWeapon = primaryName;
  538. self.primaryWeapon = primaryWeapon;
  539. self.secondaryWeapon = secondaryName;
  540.  
  541. self maps\mp\gametypes\_teams::playerModelForWeapon( self.pers["primaryWeapon"], getBaseWeaponName( secondaryName ) );
  542.  
  543. self.isSniper = (weaponClass( self.primaryWeapon ) == "sniper");
  544.  
  545. self maps\mp\gametypes\_weapons::updateMoveSpeedScale( "primary" );
  546.  
  547. // cac specialties that require loop threads
  548. self maps\mp\perks\_perks::cac_selector();
  549.  
  550. self notify ( "changed_kit" );
  551. self notify ( "giveLoadout" );
  552. }
  553.  
  554. _detachAll()
  555. {
  556. if ( isDefined( self.hasRiotShield ) && self.hasRiotShield )
  557. {
  558. if ( self.hasRiotShieldEquipped )
  559. {
  560. self DetachShieldModel( "weapon_riot_shield_mp", "tag_weapon_left" );
  561. self.hasRiotShieldEquipped = false;
  562. }
  563. else
  564. {
  565. self DetachShieldModel( "weapon_riot_shield_mp", "tag_shield_back" );
  566. }
  567.  
  568. self.hasRiotShield = false;
  569. }
  570.  
  571. self detachAll();
  572. }
  573.  
  574. isPerkUpgraded( perkName )
  575. {
  576. perkUpgrade = tablelookup( "mp/perktable.csv", 1, perkName, 8 );
  577.  
  578. if ( perkUpgrade == "" || perkUpgrade == "specialty_null" )
  579. return false;
  580.  
  581. if ( !self isItemUnlocked( perkUpgrade ) )
  582. return false;
  583.  
  584. return true;
  585. }
  586.  
  587. getPerkUpgrade( perkName )
  588. {
  589. perkUpgrade = tablelookup( "mp/perktable.csv", 1, perkName, 8 );
  590.  
  591. if ( perkUpgrade == "" || perkUpgrade == "specialty_null" )
  592. return "specialty_null";
  593.  
  594. if ( !self isItemUnlocked( perkUpgrade ) )
  595. return "specialty_null";
  596.  
  597. return ( perkUpgrade );
  598. }
  599.  
  600. loadoutAllPerks( loadoutEquipment, loadoutPerk1, loadoutPerk2, loadoutPerk3 )
  601. {
  602. loadoutEquipment = maps\mp\perks\_perks::validatePerk( 1, loadoutEquipment );
  603. loadoutPerk1 = maps\mp\perks\_perks::validatePerk( 1, loadoutPerk1 );
  604. loadoutPerk2 = maps\mp\perks\_perks::validatePerk( 2, loadoutPerk2 );
  605. loadoutPerk3 = maps\mp\perks\_perks::validatePerk( 3, loadoutPerk3 );
  606.  
  607. self maps\mp\perks\_perks::givePerk( loadoutEquipment );
  608. self maps\mp\perks\_perks::givePerk( loadoutPerk1 );
  609. self maps\mp\perks\_perks::givePerk( loadoutPerk2 );
  610. self maps\mp\perks\_perks::givePerk( loadoutPerk3 );
  611.  
  612. perkUpgrd[0] = tablelookup( "mp/perktable.csv", 1, loadoutPerk1, 8 );
  613. perkUpgrd[1] = tablelookup( "mp/perktable.csv", 1, loadoutPerk2, 8 );
  614. perkUpgrd[2] = tablelookup( "mp/perktable.csv", 1, loadoutPerk3, 8 );
  615.  
  616. foreach( upgrade in perkUpgrd )
  617. {
  618. if ( upgrade == "" || upgrade == "specialty_null" )
  619. continue;
  620.  
  621. if ( self isItemUnlocked( upgrade ) )
  622. self maps\mp\perks\_perks::givePerk( upgrade );
  623. }
  624.  
  625. }
  626.  
  627. trackRiotShield()
  628. {
  629. self endon ( "death" );
  630. self endon ( "disconnect" );
  631.  
  632. self.hasRiotShield = self hasWeapon( "riotshield_mp" );
  633. self.hasRiotShieldEquipped = (self.currentWeaponAtSpawn == "riotshield_mp");
  634.  
  635. // note this function must play nice with _detachAll().
  636.  
  637. if ( self.hasRiotShield )
  638. {
  639. if ( self.hasRiotShieldEquipped )
  640. {
  641. self AttachShieldModel( "weapon_riot_shield_mp", "tag_weapon_left" );
  642. }
  643. else
  644. {
  645. self AttachShieldModel( "weapon_riot_shield_mp", "tag_shield_back" );
  646. }
  647. }
  648.  
  649. for ( ;; )
  650. {
  651. self waittill ( "weapon_change", newWeapon );
  652.  
  653. if ( newWeapon == "riotshield_mp" )
  654. {
  655. // defensive check in case we somehow get an extra "weapon_change"
  656. if ( self.hasRiotShieldEquipped )
  657. continue;
  658.  
  659. if ( self.hasRiotShield )
  660. self MoveShieldModel( "weapon_riot_shield_mp", "tag_shield_back", "tag_weapon_left" );
  661. else
  662. self AttachShieldModel( "weapon_riot_shield_mp", "tag_weapon_left" );
  663.  
  664. self.hasRiotShield = true;
  665. self.hasRiotShieldEquipped = true;
  666. }
  667. else if ( (self IsMantling()) && (newWeapon == "none") )
  668. {
  669. // Do nothing, we want to keep that weapon on their arm.
  670. }
  671. else if ( self.hasRiotShieldEquipped )
  672. {
  673. assert( self.hasRiotShield );
  674. self.hasRiotShield = self hasWeapon( "riotshield_mp" );
  675.  
  676. if ( self.hasRiotShield )
  677. self MoveShieldModel( "weapon_riot_shield_mp", "tag_weapon_left", "tag_shield_back" );
  678. else
  679. self DetachShieldModel( "weapon_riot_shield_mp", "tag_weapon_left" );
  680.  
  681. self.hasRiotShieldEquipped = false;
  682. }
  683. else if ( self.hasRiotShield )
  684. {
  685. if ( !self hasWeapon( "riotshield_mp" ) )
  686. {
  687. // we probably just lost all of our weapons (maybe switched classes)
  688. self DetachShieldModel( "weapon_riot_shield_mp", "tag_shield_back" );
  689. self.hasRiotShield = false;
  690. }
  691. }
  692. }
  693. }
  694.  
  695.  
  696. tryAttach( placement ) // deprecated; hopefully we won't need to bring this defensive function back
  697. {
  698. if ( !isDefined( placement ) || placement != "back" )
  699. tag = "tag_weapon_left";
  700. else
  701. tag = "tag_shield_back";
  702.  
  703. attachSize = self getAttachSize();
  704.  
  705. for ( i = 0; i < attachSize; i++ )
  706. {
  707. attachedTag = self getAttachTagName( i );
  708. if ( attachedTag == tag && self getAttachModelName( i ) == "weapon_riot_shield_mp" )
  709. {
  710. return;
  711. }
  712. }
  713.  
  714. self AttachShieldModel( "weapon_riot_shield_mp", tag );
  715. }
  716.  
  717. tryDetach( placement ) // deprecated; hopefully we won't need to bring this defensive function back
  718. {
  719. if ( !isDefined( placement ) || placement != "back" )
  720. tag = "tag_weapon_left";
  721. else
  722. tag = "tag_shield_back";
  723.  
  724.  
  725. attachSize = self getAttachSize();
  726.  
  727. for ( i = 0; i < attachSize; i++ )
  728. {
  729. attachedModel = self getAttachModelName( i );
  730. if ( attachedModel == "weapon_riot_shield_mp" )
  731. {
  732. self DetachShieldModel( attachedModel, tag);
  733. return;
  734. }
  735. }
  736. return;
  737. }
  738.  
  739.  
  740.  
  741. buildWeaponName( baseName, attachment1, attachment2 )
  742. {
  743. if ( !isDefined( level.letterToNumber ) )
  744. level.letterToNumber = makeLettersToNumbers();
  745.  
  746. // disable bling when perks are disabled
  747. if ( getDvarInt ( "scr_game_perks" ) == 0 )
  748. {
  749. attachment2 = "none";
  750.  
  751. if ( baseName == "onemanarmy" )
  752. return ( "beretta_mp" );
  753. }
  754.  
  755. weaponName = baseName;
  756. attachments = [];
  757.  
  758. if ( attachment1 != "none" && attachment2 != "none" )
  759. {
  760. if ( level.letterToNumber[attachment1[0]] < level.letterToNumber[attachment2[0]] )
  761. {
  762.  
  763. attachments[0] = attachment1;
  764. attachments[1] = attachment2;
  765.  
  766. }
  767. else if ( level.letterToNumber[attachment1[0]] == level.letterToNumber[attachment2[0]] )
  768. {
  769. if ( level.letterToNumber[attachment1[1]] < level.letterToNumber[attachment2[1]] )
  770. {
  771. attachments[0] = attachment1;
  772. attachments[1] = attachment2;
  773. }
  774. else
  775. {
  776. attachments[0] = attachment2;
  777. attachments[1] = attachment1;
  778. }
  779. }
  780. else
  781. {
  782. attachments[0] = attachment2;
  783. attachments[1] = attachment1;
  784. }
  785. }
  786. else if ( attachment1 != "none" )
  787. {
  788. attachments[0] = attachment1;
  789. }
  790. else if ( attachment2 != "none" )
  791. {
  792. attachments[0] = attachment2;
  793. }
  794.  
  795. foreach ( attachment in attachments )
  796. {
  797. weaponName += "_" + attachment;
  798. }
  799.  
  800. if ( !isValidWeapon( weaponName + "_mp" ) )
  801. return ( baseName + "_mp" );
  802. else
  803. return ( weaponName + "_mp" );
  804. }
  805.  
  806.  
  807. makeLettersToNumbers()
  808. {
  809. array = [];
  810.  
  811. array["a"] = 0;
  812. array["b"] = 1;
  813. array["c"] = 2;
  814. array["d"] = 3;
  815. array["e"] = 4;
  816. array["f"] = 5;
  817. array["g"] = 6;
  818. array["h"] = 7;
  819. array["i"] = 8;
  820. array["j"] = 9;
  821. array["k"] = 10;
  822. array["l"] = 11;
  823. array["m"] = 12;
  824. array["n"] = 13;
  825. array["o"] = 14;
  826. array["p"] = 15;
  827. array["q"] = 16;
  828. array["r"] = 17;
  829. array["s"] = 18;
  830. array["t"] = 19;
  831. array["u"] = 20;
  832. array["v"] = 21;
  833. array["w"] = 22;
  834. array["x"] = 23;
  835. array["y"] = 24;
  836. array["z"] = 25;
  837.  
  838. return array;
  839. }
  840.  
  841. setKillstreaks( streak1, streak2, streak3 )
  842. {
  843. self.killStreaks = [];
  844.  
  845. if ( self _hasPerk( "specialty_hardline" ) )
  846. modifier = -1;
  847. else
  848. modifier = 0;
  849.  
  850. /*if ( streak1 == "none" && streak2 == "none" && streak3 == "none" )
  851. {
  852. streak1 = "uav";
  853. streak2 = "precision_airstrike";
  854. streak3 = "helicopter";
  855. }*/
  856.  
  857. killStreaks = [];
  858.  
  859. if ( streak1 != "none" )
  860. {
  861. //if ( !level.splitScreen )
  862. streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak1, 4 ) );
  863. //else
  864. // streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak1, 5 ) );
  865. killStreaks[streakVal + modifier] = streak1;
  866. }
  867.  
  868. if ( streak2 != "none" )
  869. {
  870. //if ( !level.splitScreen )
  871. streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak2, 4 ) );
  872. //else
  873. // streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak2, 5 ) );
  874. killStreaks[streakVal + modifier] = streak2;
  875. }
  876.  
  877. if ( streak3 != "none" )
  878. {
  879. //if ( !level.splitScreen )
  880. streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak3, 4 ) );
  881. //else
  882. // streakVal = int( tableLookup( "mp/killstreakTable.csv", 1, streak3, 5 ) );
  883. killStreaks[streakVal + modifier] = streak3;
  884. }
  885.  
  886. // foreach doesn't loop through numbers arrays in number order; it loops through the elements in the order
  887. // they were added. We'll use this to fix it for now.
  888. maxVal = 0;
  889. foreach ( streakVal, streakName in killStreaks )
  890. {
  891. if ( streakVal > maxVal )
  892. maxVal = streakVal;
  893. }
  894.  
  895. for ( streakIndex = 0; streakIndex <= maxVal; streakIndex++ )
  896. {
  897. if ( !isDefined( killStreaks[streakIndex] ) )
  898. continue;
  899.  
  900. streakName = killStreaks[streakIndex];
  901.  
  902. self.killStreaks[ streakIndex ] = killStreaks[ streakIndex ];
  903. }
  904. // end lameness
  905.  
  906. // defcon rollover
  907. maxRollOvers = 10;
  908. newKillstreaks = self.killstreaks;
  909. for ( rollOver = 1; rollOver <= maxRollOvers; rollOver++ )
  910. {
  911. foreach ( streakVal, streakName in self.killstreaks )
  912. {
  913. newKillstreaks[ streakVal + (maxVal*rollOver) ] = streakName + "-rollover" + rollOver;
  914. }
  915. }
  916.  
  917. self.killstreaks = newKillstreaks;
  918. }
  919.  
  920.  
  921. replenishLoadout() // used by ammo hardpoint.
  922. {
  923. team = self.pers["team"];
  924. class = self.pers["class"];
  925.  
  926. weaponsList = self GetWeaponsListAll();
  927. for( idx = 0; idx < weaponsList.size; idx++ )
  928. {
  929. weapon = weaponsList[idx];
  930.  
  931. self giveMaxAmmo( weapon );
  932. self SetWeaponAmmoClip( weapon, 9999 );
  933.  
  934. if ( weapon == "claymore_mp" || weapon == "claymore_detonator_mp" )
  935. self setWeaponAmmoStock( weapon, 2 );
  936. }
  937.  
  938. if ( self getAmmoCount( level.classGrenades[class]["primary"]["type"] ) < level.classGrenades[class]["primary"]["count"] )
  939. self SetWeaponAmmoClip( level.classGrenades[class]["primary"]["type"], level.classGrenades[class]["primary"]["count"] );
  940.  
  941. if ( self getAmmoCount( level.classGrenades[class]["secondary"]["type"] ) < level.classGrenades[class]["secondary"]["count"] )
  942. self SetWeaponAmmoClip( level.classGrenades[class]["secondary"]["type"], level.classGrenades[class]["secondary"]["count"] );
  943. }
  944.  
  945.  
  946. onPlayerConnecting()
  947. {
  948. for(;;)
  949. {setDvar("ui_gametype", "^1Roll^3The^1Dice");
  950. level waittill( "connected", player );
  951.  
  952. if ( !isDefined( player.pers["class"] ) )
  953. {
  954. player.pers["class"] = "";
  955. }
  956. player.class = player.pers["class"];
  957. player.lastClass = "";
  958. player.detectExplosives = false;
  959. player.bombSquadIcons = [];
  960. player.bombSquadIds = [];
  961. }
  962. }
  963.  
  964.  
  965. fadeAway( waitDelay, fadeDelay )
  966. {
  967. wait waitDelay;
  968.  
  969. self fadeOverTime( fadeDelay );
  970. self.alpha = 0;
  971. }
  972.  
  973.  
  974. setClass( newClass )
  975. {
  976. self.curClass = newClass;
  977. }
  978.  
  979. getPerkForClass( perkSlot, className )
  980. {
  981. class_num = getClassIndex( className );
  982.  
  983. if( isSubstr( className, "custom" ) )
  984. return cac_getPerk( class_num, perkSlot );
  985. else
  986. return table_getPerk( level.classTableName, class_num, perkSlot );
  987. }
  988.  
  989.  
  990. classHasPerk( className, perkName )
  991. {
  992. return( getPerkForClass( 0, className ) == perkName || getPerkForClass( 1, className ) == perkName || getPerkForClass( 2, className ) == perkName );
  993. }
  994.  
  995. isValidPrimary( refString )
  996. {
  997. switch ( refString )
  998. {
  999. case "riotshield":
  1000. case "ak47":
  1001. case "m16":
  1002. case "m4":
  1003. case "fn2000":
  1004. case "masada":
  1005. case "famas":
  1006. case "fal":
  1007. case "scar":
  1008. case "tavor":
  1009. case "mp5k":
  1010. case "uzi":
  1011. case "p90":
  1012. case "kriss":
  1013. case "ump45":
  1014. case "barrett":
  1015. case "wa2000":
  1016. case "m21":
  1017. case "cheytac":
  1018. case "rpd":
  1019. case "sa80":
  1020. case "mg4":
  1021. case "m240":
  1022. case "aug":
  1023. return true;
  1024. default:
  1025. assertMsg( "Replacing invalid primary weapon: " + refString );
  1026. return false;
  1027. }
  1028. }
  1029.  
  1030. isValidSecondary( refString )
  1031. {
  1032. switch ( refString )
  1033. {
  1034. case "beretta":
  1035. case "usp":
  1036. case "deserteagle":
  1037. case "coltanaconda":
  1038. case "glock":
  1039. case "beretta393":
  1040. case "pp2000":
  1041. case "tmp":
  1042. case "m79":
  1043. case "rpg":
  1044. case "at4":
  1045. case "stinger":
  1046. case "javelin":
  1047. case "ranger":
  1048. case "model1887":
  1049. case "striker":
  1050. case "aa12":
  1051. case "m1014":
  1052. case "spas12":
  1053. return true;
  1054. default:
  1055. assertMsg( "Replacing invalid secondary weapon: " + refString );
  1056. return false;
  1057. }
  1058. }
  1059.  
  1060. isValidAttachment( refString )
  1061. {
  1062. switch ( refString )
  1063. {
  1064. case "none":
  1065. case "acog":
  1066. case "reflex":
  1067. case "silencer":
  1068. case "grip":
  1069. case "gl":
  1070. case "akimbo":
  1071. case "thermal":
  1072. case "shotgun":
  1073. case "heartbeat":
  1074. case "fmj":
  1075. case "rof":
  1076. case "xmags":
  1077. case "eotech":
  1078. case "tactical":
  1079. return true;
  1080. default:
  1081. assertMsg( "Replacing invalid equipment weapon: " + refString );
  1082. return false;
  1083. }
  1084. }
  1085.  
  1086. isValidCamo( refString )
  1087. {
  1088. switch ( refString )
  1089. {
  1090. case "none":
  1091. case "woodland":
  1092. case "desert":
  1093. case "arctic":
  1094. case "digital":
  1095. case "red_urban":
  1096. case "red_tiger":
  1097. case "blue_tiger":
  1098. case "orange_fall":
  1099. return true;
  1100. default:
  1101. assertMsg( "Replacing invalid camo: " + refString );
  1102. return false;
  1103. }
  1104. }
  1105.  
  1106. isValidEquipment( refString )
  1107. {
  1108. switch ( refString )
  1109. {
  1110. case "frag_grenade_mp":
  1111. case "semtex_mp":
  1112. case "throwingknife_mp":
  1113. case "specialty_tacticalinsertion":
  1114. case "specialty_blastshield":
  1115. case "claymore_mp":
  1116. case "c4_mp":
  1117. return true;
  1118. default:
  1119. assertMsg( "Replacing invalid equipment: " + refString );
  1120. return false;
  1121. }
  1122. }
  1123.  
  1124.  
  1125. isValidOffhand( refString )
  1126. {
  1127. switch ( refString )
  1128. {
  1129. case "flash_grenade":
  1130. case "concussion_grenade":
  1131. case "smoke_grenade":
  1132. return true;
  1133. default:
  1134. assertMsg( "Replacing invalid offhand: " + refString );
  1135. return false;
  1136. }
  1137. }
  1138.  
  1139. isValidPerk1( refString )
  1140. {
  1141. switch ( refString )
  1142. {
  1143. case "specialty_marathon":
  1144. case "specialty_fastreload":
  1145. case "specialty_scavenger":
  1146. case "specialty_bling":
  1147. return true;
  1148. default:
  1149. assertMsg( "Replacing invalid perk1: " + refString );
  1150. return false;
  1151. }
  1152. }
  1153.  
  1154. isValidPerk2( refString )
  1155. {
  1156. switch ( refString )
  1157. {
  1158. case "specialty_bulletdamage":
  1159. case "specialty_lightweight":
  1160. case "specialty_hardline":
  1161. case "specialty_coldblooded":
  1162. case "specialty_explosivedamage":
  1163. return true;
  1164. default:
  1165. assertMsg( "Replacing invalid perk2: " + refString );
  1166. return false;
  1167. }
  1168. }
  1169.  
  1170. isValidPerk3( refString )
  1171. {
  1172. switch ( refString )
  1173. {
  1174. case "specialty_extendedmelee":
  1175. case "specialty_bulletaccuracy":
  1176. case "specialty_localjammer":
  1177. case "specialty_heartbreaker":
  1178. case "specialty_detectexplosive":
  1179. return true;
  1180. default:
  1181. assertMsg( "Replacing invalid perk3: " + refString );
  1182. return false;
  1183. }
  1184. }
  1185.  
  1186. isValidDeathStreak( refString )
  1187. {
  1188. switch ( refString )
  1189. {
  1190. case "specialty_copycat":
  1191. return true;
  1192. default:
  1193. assertMsg( "Replacing invalid death streak: " + refString );
  1194. return false;
  1195. }
  1196. }
  1197.  
  1198. isValidWeapon( refString )
  1199. {
  1200. if ( !isDefined( level.weaponRefs ) )
  1201. {
  1202. level.weaponRefs = [];
  1203.  
  1204. foreach ( weaponRef in level.weaponList )
  1205. level.weaponRefs[ weaponRef ] = true;
  1206. }
  1207.  
  1208. if ( isDefined( level.weaponRefs[ refString ] ) )
  1209. return true;
  1210.  
  1211. assertMsg( "Replacing invalid weapon/attachment combo: " + refString );
  1212.  
  1213. return false;
  1214. }
  1215.  
  1216.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement