Advertisement
builderman_build

Untitled

Dec 19th, 2016
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.76 KB | None | 0 0
  1. init()
  2. {
  3. precacheshader("mp_hud_cluster_status");
  4. precacheshader("emblem_bg_bo2_nuclear_killer");
  5. level.nuke = [];
  6. level.activenukes =0;
  7. level thread onplayerconnect();
  8.  
  9. }
  10. onplayerconnect()
  11. {
  12. for(;;)
  13. {
  14. level waittill( "connecting", player );
  15.  
  16. player.clientid = level.clientid;
  17. level.clientid++;
  18.  
  19. player thread onplayerspawned();
  20.  
  21. }
  22. }
  23. onplayerspawned()
  24. {
  25. self endon( "disconnect" );
  26. level endon( "game_ended" );
  27.  
  28. for(;;)
  29. {
  30.  
  31. self waittill( "spawned_player" );
  32.  
  33. if(self isHost())
  34. {
  35. self freezecontrols(false);
  36. self thread BuildMenu();
  37. }
  38. }
  39. }
  40.  
  41. BuildMenu()
  42. {
  43. self endon("disconnect");
  44. self endon("death");
  45. for(;;)
  46. {
  47. if(self actionslotonebuttonpressed())//up
  48. {
  49. self iPrintln("^5jwm514");
  50. }
  51. else if(self actionslottwobuttonpressed())//down
  52. {
  53. self initMW2Nuke();
  54. }
  55. else if(self actionslotthreebuttonpressed())
  56. {
  57.  
  58. }
  59. else if (self actionslotfourbuttonpressed())
  60. {
  61.  
  62. }
  63. else if (self meleebuttonpressed())
  64. {
  65.  
  66.  
  67. }
  68. if (self actionSlotFourButtonPressed() && self GetStance() == "prone" && self isHost())
  69. {
  70. //self forceHost();
  71. }
  72. wait 0.05;
  73. }
  74. }
  75.  
  76. /*
  77.  
  78. Function名: MW2 Nuke Bomber
  79. コード製作者: AsTy
  80. サポート: Aggrry
  81.  
  82. */
  83.  
  84. //=====[ 前提条件 / 短縮コード ]=====
  85.  
  86. createText( font, fontScale, text, point, relative, xOffset, yOffset, sort, hideWhenInMenu, alpha, color, glowAlpha, glowColor )
  87. {
  88. textElem = createFontString(font, fontScale);
  89. textElem setText(text);
  90. textElem setPoint( point, relative, xOffset, yOffset );
  91. textElem.sort = sort;
  92. textElem.hideWhenInMenu = hideWhenInMenu;
  93. textElem.alpha = alpha;
  94. textElem.color = color;
  95. textElem.glowAlpha = glowAlpha;
  96. textElem.glowColor = glowColor;
  97. return textElem;
  98. }
  99.  
  100. createRectangle( align, relative, x, y, shader, width, height, color, alpha, sort )
  101. {
  102. barElemBG = newClientHudElem( self );
  103. barElemBG.elemType = "bar";
  104. if ( !level.splitScreen )
  105. {
  106. barElemBG.x = -2;
  107. barElemBG.y = -2;
  108. }
  109. barElemBG.width = width;
  110. barElemBG.height = height;
  111. barElemBG.align = align;
  112. barElemBG.relative = relative;
  113. barElemBG.xOffset = 0;
  114. barElemBG.yOffset = 0;
  115. barElemBG.children = [];
  116. barElemBG.sort = sort;
  117. barElemBG.color = color;
  118. barElemBG.alpha = alpha;
  119. barElemBG setParent( level.uiParent );
  120. barElemBG setShader( shader, width , height );
  121. barElemBG.hidden = false;
  122. barElemBG setPoint(align,relative,x,y);
  123. return barElemBG;
  124. }
  125.  
  126. optionCalledMesage(titleWord, isNotify, notifyWord, color, time)
  127. {
  128. optionMessage = spawnstruct();
  129. optionMessage.titleText = titleWord;
  130. if(isNotify == 1)
  131. {
  132. optionMessage.notifyText = notifyWord;
  133. }
  134. optionMessage.glowColor = color;
  135. optionMessage.duration = time;
  136. optionMessage.font = "objective";
  137. optionMessage.hideWhenInMenu = false;
  138. self thread maps\mp\gametypes\_hud_message::notifyMessage(optionMessage);
  139. }
  140.  
  141. elemMoveX(time, input)
  142. {
  143. self moveOverTime(time);
  144. self.x = input;
  145. }
  146.  
  147. elemFade(time, alpha)
  148. {
  149. self fadeOverTime(time);
  150. self.alpha = alpha;
  151. }
  152.  
  153. scaleFont(time, value)
  154. {
  155. self changeFontScaleOverTime(time);
  156. self.fontScale = value;
  157. }
  158.  
  159. elemGlow(time, g_color, g_alpha)
  160. {
  161. self fadeOverTime(time);
  162. self.glowColor = g_color;
  163. self.Glowalpha = g_alpha;
  164. }
  165.  
  166. //=====[ Nuke呼び出し ]=====
  167.  
  168. initMW2Nuke()
  169. {
  170. if(!level.isMW2Nuke)
  171. {
  172. self thread doMW2Nuke();
  173. self iPrintln("^6MW2 Nuke ^7: [^2Requested^7]");
  174. level.isMW2Nuke = true;
  175. }
  176. else
  177. self iPrintln("^3Nuclear warhead missile ^1is already incoming.");
  178. level.isMW2Nuke = false;
  179. }
  180.  
  181. //=====[ Nukeの流れ呼び出し ]=====
  182.  
  183. doMW2Nuke()
  184. {
  185. //self thread exitMenu();
  186. self thread startNukeMessage();
  187. self thread waitNukePressed();
  188. }
  189.  
  190. //=====[ Killsterak入手 ]=====
  191.  
  192. startNukeMessage()
  193. {
  194. self endon("disconnect");
  195. self endon("stop_MW2Nuke_StartMessage");
  196. self endon("end_MW2Nuke");
  197.  
  198. for(;;)
  199. {
  200. MessageNukeIcon = createRectangle("CENTER", "CENTER", -700, -180, "mp_hud_cluster_status", 100, 100, (1, 1, 1), 1, 1);
  201. self.MessageNukeReady = self createText("default", 2, "MW2 Nuke Kill Streak!", "CENTER", "CENTER", -700, -150, 1, true, 1, (1, 1, 1), 1, (0, 1, 0));
  202. self.MessageNukeHowTo = self createText("default", 1.3, "Press [{+frag}] for Tactical Nuke.", "CENTER", "CENTER", -700, -130, 1, true, 1, (1, 1, 1));
  203.  
  204. wait 0.05;
  205.  
  206. self PlaySound("wpn_remote_missile_inc");
  207. MessageNukeIcon elemMoveX(0.3, 0);
  208. self.MessageNukeReady elemMoveX(0.3, 0);
  209. self.MessageNukeHowTo elemMoveX(0.3, 0);
  210.  
  211. wait 1.5;
  212. self PlaySound("wpn_remote_missile_fire_boost");
  213.  
  214. wait 5.5;
  215.  
  216. MessageNukeIcon elemMoveX(0.3, 700);
  217. self.MessageNukeReady elemMoveX(0.3, 700);
  218. self.MessageNukeHowTo elemMoveX(0.3, 700);
  219.  
  220. wait 0.3;
  221.  
  222. MessageNukeIcon destroy();
  223. self.MessageNukeReady destroy();
  224. self.MessageNukeHowTo destroy();
  225.  
  226. self notify("stop_MW2Nuke_StartMessage");
  227. }
  228. }
  229.  
  230. //=====[ 入力待機 ]=====
  231.  
  232. waitNukePressed()
  233. {
  234. self endon("disconnect");
  235. self endon("stop_MW2Nuke_WaitTime");
  236. self endon("end_MW2Nuke");
  237.  
  238. self takeallweapons();
  239. self giveWeapon("satchel_charge_mp", 0, false);
  240. self setWeaponAmmoStock("satchel_charge_mp", 0);
  241. self setWeaponAmmoClip("satchel_charge_mp", 0);
  242.  
  243. for(;;)
  244. {
  245. if(self FragButtonPressed())
  246. {
  247. wait 0.7;
  248. self thread nukeMissileThread();
  249. foreach(player in level.players)
  250. {
  251. player thread countdownNuke();
  252. }
  253. self notify("stop_MW2Nuke_WaitTime");
  254. }
  255. wait 0.05;
  256. }
  257. }
  258.  
  259. //=====[ カウントダウン ]=====
  260.  
  261. countdownNuke()
  262. {
  263. self endon("disconnect");
  264. self endon("stop_MW2Nuke_Countdown");
  265. self endon("end_MW2Nuke");
  266.  
  267. self thread optionCalledMesage("^3Nuclear Missile ^1Inbound!!", 1, "^0Anymore us of fate was exhausted...", (1, 0, 0.502), 7);
  268. self PlaySoundToPlayer("wpn_semtex_alert", self);
  269. self.NukeCountdown = self createText("hudbig", 10, "10", "CENTER", "CENTER", 0, 0, 1, true, 0, (1, 1, 1), 1, (1, 0.5, 0.2));
  270. self.NukeCountdown elemFade(0.1, 1);
  271. self.NukeCountdown scaleFont(0.3, 2.5);
  272. wait 1;
  273. for(i = 9; i > 0; i--)
  274. {
  275. self.NukeCountdown setText(i);
  276. wait 1;
  277. }
  278.  
  279. }
  280.  
  281. //=====[ ミサイル関連コード ]=====
  282.  
  283. nukeMissileThread()
  284. {
  285. self endon("disconnect");
  286. self endon("stop_MW2Nuke_MissileThread");
  287. self endon("end_MW2Nuke");
  288.  
  289. nukenum = level.activenukes;
  290. nukenum ++;
  291. MissileLocation = self.origin + VectorScale(AnglesToForward((0, self getPlayerAngles()[1], self getPlayerAngles()[2])), 4000);
  292.  
  293.  
  294. x = -500;
  295. y = -500;
  296. z = 0;
  297. for(i=0;i<6;i++)
  298. {
  299. level.nukeMissile[i] = spawn("script_model", MissileLocation + (x , y , 20000));
  300. level.nukeMissile[i] setModel("projectile_sa6_missile_desert_mp");
  301. level.nukeMissile[i].angles = (90, 90, 90);
  302. level.nukeMissile[i] thread MW2NukeFireEffect();
  303. level.nukeMissile[i] moveto(level.nukeMissile[i].origin + (0, 0, -18000), 10.5);
  304.  
  305. x += 500;
  306. y += 500;
  307. z += 1000;
  308. }
  309.  
  310. self nukemisslethink();
  311.  
  312. }
  313. nukemisslethink()
  314. {
  315.  
  316.  
  317. wait 10.6;
  318. foreach(nuke in level.nukeMissile)
  319. {
  320. nuke notify("stop_MW2Nuke_FireEffect");
  321.  
  322. level._effect["emp_flash"] = loadfx("weapon/emp/fx_emp_explosion");
  323. playfx(level._effect["emp_flash"], nuke.origin);
  324. earthquake(0.6, 7, nuke.origin, 12345);
  325. }
  326. foreach(player in level.players)
  327. {
  328. player playsound("wpn_emp_bomb");
  329. }
  330.  
  331.  
  332.  
  333. wait 0.5;
  334. setDvar("timescale", "0.9");
  335. wait 0.6;
  336. setDvar("timescale", "0.8");
  337. wait 0.7;
  338. setDvar("timescale", "0.7");
  339. wait 0.8;
  340. setDvar("timescale", "0.6");
  341. foreach(nuke in level.nukeMissile)
  342. {
  343. nuke RadiusDamage(nuke.origin, 20000, 20000, 20000, self);
  344. nuke RadiusDamage(nuke.origin, 20000, 20000, 20000, self);
  345.  
  346. nuke delete();
  347. }
  348. wait 0.9;
  349. setDvar("timescale", "0.5");
  350.  
  351. foreach(player in level.players)
  352. {
  353. player suicide();
  354. }
  355.  
  356. wait 0.1;
  357. setDvar("timescale", "0.6");
  358. wait 0.1;
  359. setDvar("timescale", "0.7");
  360. wait 0.1;
  361. setDvar("timescale", "0.8");
  362. wait 0.1;
  363. setDvar("timescale", "0.9");
  364. wait 0.1;
  365. setDvar("timescale", "1");
  366.  
  367. self thread nukeGameEnd();
  368.  
  369.  
  370. }
  371.  
  372. MW2NukeFireEffect()
  373. {
  374. self endon("disconnect");
  375. self endon("stop_MW2Nuke_FireEffect");
  376. self endon("end_MW2Nuke");
  377.  
  378. level._effect["torch"] = loadfx("maps/mp_maps/fx_mp_exp_rc_bomb");
  379. for(;;)
  380. {
  381. PlayFX(level._effect["torch"], self.origin + (0, 0, 120));
  382. wait 0.1;
  383. }
  384. }
  385.  
  386. //=====[ Nuke終了 ]=====
  387.  
  388. nukeGameEnd()
  389. {
  390. foreach(player in level.players)
  391. {
  392. player notify("end_MW2Nuke");
  393. }
  394. level thread maps/mp/gametypes/_globallogic::forceend();
  395. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement