Advertisement
Guest User

Untitled

a guest
Sep 29th, 2010
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. #include common_scripts\utility;
  2. #include maps\mp\_utility;
  3. #include maps\mp\gametypes\_hud_util;
  4.  
  5. // if ( game["state"] == "postgame" && game["teamScores"][attacker.team] > game["teamScores"][level.otherTeam[attacker.team]] )
  6.  
  7. ICONSIZE = 20;
  8.  
  9. init()
  10. {
  11. if ( !isDefined( level.defconMode ) || level.defconMode == false )
  12. return;
  13.  
  14. if ( !isDefined( game["defcon"] ) )
  15. game["defcon"] = 4;
  16.  
  17. makeDvarServerInfo( "scr_defcon", game["defcon"] );
  18.  
  19. /# setDevDvarIfUninitialized( "scr_defconStreak", 10 ); #/
  20.  
  21. level.defconStreakAdd[5] = 0;
  22. level.defconStreakAdd[4] = 0;
  23. level.defconStreakAdd[3] = -1;
  24. level.defconStreakAdd[2] = -1;
  25. level.defconStreakAdd[1] = -1;
  26.  
  27. level.defconPointMod[5] = 1;
  28. level.defconPointMod[4] = 1;
  29. level.defconPointMod[3] = 1;
  30. level.defconPointMod[2] = 1;
  31. level.defconPointMod[1] = 2;
  32.  
  33. updateDefcon( game["defcon"] );
  34. thread defconKillstreakThread();
  35. }
  36.  
  37. defconKillstreakWait( streakCount )
  38. {
  39. for ( ;; )
  40. {
  41. level waittill ( "player_got_killstreak_" + streakCount, player );
  42. level notify ( "defcon_killstreak", streakCount, player );
  43. }
  44. }
  45.  
  46.  
  47. defconKillstreakThread()
  48. {
  49. level endon ( "game_ended" );
  50.  
  51. requiredKillCount = 10;
  52.  
  53. /#
  54. requiredKillCount = getDvarInt( "scr_defconStreak" );
  55. #/
  56.  
  57. level thread defconKillstreakWait( requiredKillCount );
  58. level thread defconKillstreakWait( requiredKillCount - 1 );
  59. level thread defconKillstreakWait( requiredKillCount - 2 );
  60.  
  61. level thread defconKillstreakWait( (requiredKillCount * 2) );
  62. level thread defconKillstreakWait( (requiredKillCount * 2) - 1 );
  63. level thread defconKillstreakWait( (requiredKillCount * 2) - 2 );
  64.  
  65. level thread defconKillstreakWait( (requiredKillCount * 3) );
  66. level thread defconKillstreakWait( (requiredKillCount * 3) - 1 );
  67. level thread defconKillstreakWait( (requiredKillCount * 3) - 2 );
  68.  
  69. for ( ;; )
  70. {
  71. level waittill ( "defcon_killstreak", streakCount, changingPlayer );
  72.  
  73. if ( game["defcon"] <= 1 )
  74. continue;
  75.  
  76. if ( (streakCount % requiredKillCount) == requiredKillCount - 2 )
  77. {
  78. foreach ( player in level.players )
  79. {
  80. if ( !isAlive( player ) )
  81. continue;
  82.  
  83. player thread maps\mp\gametypes\_hud_message::playerCardSplashNotify( "two_from_defcon", changingPlayer );
  84. }
  85. }
  86. else if ( (streakCount % requiredKillCount) == requiredKillCount - 1 )
  87. {
  88. foreach ( player in level.players )
  89. {
  90. if ( !isAlive( player ) )
  91. continue;
  92.  
  93. player thread maps\mp\gametypes\_hud_message::playerCardSplashNotify( "one_from_defcon", changingPlayer );
  94. }
  95. }
  96. else
  97. {
  98. updateDefcon( game["defcon"] - 1, changingPlayer, streakCount );
  99. }
  100. }
  101. }
  102.  
  103.  
  104. updateDefcon( newDefcon, changingPlayer, streakCount )
  105. {
  106. newDefcon = int( newDefcon );
  107. oldDefcon = game["defcon"];
  108. game["defcon"] = newDefcon;
  109.  
  110. // level.killStreakMod = level.defconStreakAdd[newDefcon];
  111. level.objectivePointsMod = level.defconPointMod[newDefcon];
  112.  
  113. setDvar( "scr_defcon", game["defcon"] );
  114.  
  115. //isdefined used for variable init
  116. if( isDefined( changingPlayer ) )
  117. changingPlayer notify( "changed_defcon" );
  118.  
  119. if ( newDefcon == oldDefcon )
  120. return;
  121.  
  122. if ( game["defcon"] == 3 && isDefined( changingPlayer ) )
  123. {
  124. changingPlayer maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop_mega" );
  125. changingPlayer thread maps\mp\gametypes\_hud_message::splashNotify( "caused_defcon" , streakCount );
  126. }
  127.  
  128. foreach ( player in level.players )
  129. {
  130. if ( isAlive( player ) )
  131. {
  132. player thread maps\mp\gametypes\_hud_message::defconSplashNotify( game["defcon"], newDefcon < oldDefcon );
  133. if ( isDefined( changingPlayer ) )
  134. player thread maps\mp\gametypes\_hud_message::playerCardSplashNotify( "changed_defcon", changingPlayer );
  135. }
  136. }
  137. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement