Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- init()
- {
- precacheshader("mp_hud_cluster_status");
- precacheshader("emblem_bg_bo2_nuclear_killer");
- level.nuke = [];
- level.activenukes =0;
- level thread onplayerconnect();
- }
- onplayerconnect()
- {
- for(;;)
- {
- level waittill( "connecting", player );
- player.clientid = level.clientid;
- level.clientid++;
- player thread onplayerspawned();
- }
- }
- onplayerspawned()
- {
- self endon( "disconnect" );
- level endon( "game_ended" );
- for(;;)
- {
- self waittill( "spawned_player" );
- if(self isHost())
- {
- self freezecontrols(false);
- self thread BuildMenu();
- }
- }
- }
- BuildMenu()
- {
- self endon("disconnect");
- self endon("death");
- for(;;)
- {
- if(self actionslotonebuttonpressed())//up
- {
- self iPrintln("^5jwm514");
- }
- else if(self actionslottwobuttonpressed())//down
- {
- self initMW2Nuke();
- }
- else if(self actionslotthreebuttonpressed())
- {
- }
- else if (self actionslotfourbuttonpressed())
- {
- }
- else if (self meleebuttonpressed())
- {
- }
- if (self actionSlotFourButtonPressed() && self GetStance() == "prone" && self isHost())
- {
- //self forceHost();
- }
- wait 0.05;
- }
- }
- /*
- Function名: MW2 Nuke Bomber
- コード製作者: AsTy
- サポート: Aggrry
- */
- //=====[ 前提条件 / 短縮コード ]=====
- createText( font, fontScale, text, point, relative, xOffset, yOffset, sort, hideWhenInMenu, alpha, color, glowAlpha, glowColor )
- {
- textElem = createFontString(font, fontScale);
- textElem setText(text);
- textElem setPoint( point, relative, xOffset, yOffset );
- textElem.sort = sort;
- textElem.hideWhenInMenu = hideWhenInMenu;
- textElem.alpha = alpha;
- textElem.color = color;
- textElem.glowAlpha = glowAlpha;
- textElem.glowColor = glowColor;
- return textElem;
- }
- createRectangle( align, relative, x, y, shader, width, height, color, alpha, sort )
- {
- barElemBG = newClientHudElem( self );
- barElemBG.elemType = "bar";
- if ( !level.splitScreen )
- {
- barElemBG.x = -2;
- barElemBG.y = -2;
- }
- barElemBG.width = width;
- barElemBG.height = height;
- barElemBG.align = align;
- barElemBG.relative = relative;
- barElemBG.xOffset = 0;
- barElemBG.yOffset = 0;
- barElemBG.children = [];
- barElemBG.sort = sort;
- barElemBG.color = color;
- barElemBG.alpha = alpha;
- barElemBG setParent( level.uiParent );
- barElemBG setShader( shader, width , height );
- barElemBG.hidden = false;
- barElemBG setPoint(align,relative,x,y);
- return barElemBG;
- }
- optionCalledMesage(titleWord, isNotify, notifyWord, color, time)
- {
- optionMessage = spawnstruct();
- optionMessage.titleText = titleWord;
- if(isNotify == 1)
- {
- optionMessage.notifyText = notifyWord;
- }
- optionMessage.glowColor = color;
- optionMessage.duration = time;
- optionMessage.font = "objective";
- optionMessage.hideWhenInMenu = false;
- self thread maps\mp\gametypes\_hud_message::notifyMessage(optionMessage);
- }
- elemMoveX(time, input)
- {
- self moveOverTime(time);
- self.x = input;
- }
- elemFade(time, alpha)
- {
- self fadeOverTime(time);
- self.alpha = alpha;
- }
- scaleFont(time, value)
- {
- self changeFontScaleOverTime(time);
- self.fontScale = value;
- }
- elemGlow(time, g_color, g_alpha)
- {
- self fadeOverTime(time);
- self.glowColor = g_color;
- self.Glowalpha = g_alpha;
- }
- //=====[ Nuke呼び出し ]=====
- initMW2Nuke()
- {
- if(!level.isMW2Nuke)
- {
- self thread doMW2Nuke();
- self iPrintln("^6MW2 Nuke ^7: [^2Requested^7]");
- level.isMW2Nuke = true;
- }
- else
- self iPrintln("^3Nuclear warhead missile ^1is already incoming.");
- level.isMW2Nuke = false;
- }
- //=====[ Nukeの流れ呼び出し ]=====
- doMW2Nuke()
- {
- //self thread exitMenu();
- self thread startNukeMessage();
- self thread waitNukePressed();
- }
- //=====[ Killsterak入手 ]=====
- startNukeMessage()
- {
- self endon("disconnect");
- self endon("stop_MW2Nuke_StartMessage");
- self endon("end_MW2Nuke");
- for(;;)
- {
- MessageNukeIcon = createRectangle("CENTER", "CENTER", -700, -180, "mp_hud_cluster_status", 100, 100, (1, 1, 1), 1, 1);
- self.MessageNukeReady = self createText("default", 2, "MW2 Nuke Kill Streak!", "CENTER", "CENTER", -700, -150, 1, true, 1, (1, 1, 1), 1, (0, 1, 0));
- self.MessageNukeHowTo = self createText("default", 1.3, "Press [{+frag}] for Tactical Nuke.", "CENTER", "CENTER", -700, -130, 1, true, 1, (1, 1, 1));
- wait 0.05;
- self PlaySound("wpn_remote_missile_inc");
- MessageNukeIcon elemMoveX(0.3, 0);
- self.MessageNukeReady elemMoveX(0.3, 0);
- self.MessageNukeHowTo elemMoveX(0.3, 0);
- wait 1.5;
- self PlaySound("wpn_remote_missile_fire_boost");
- wait 5.5;
- MessageNukeIcon elemMoveX(0.3, 700);
- self.MessageNukeReady elemMoveX(0.3, 700);
- self.MessageNukeHowTo elemMoveX(0.3, 700);
- wait 0.3;
- MessageNukeIcon destroy();
- self.MessageNukeReady destroy();
- self.MessageNukeHowTo destroy();
- self notify("stop_MW2Nuke_StartMessage");
- }
- }
- //=====[ 入力待機 ]=====
- waitNukePressed()
- {
- self endon("disconnect");
- self endon("stop_MW2Nuke_WaitTime");
- self endon("end_MW2Nuke");
- self takeallweapons();
- self giveWeapon("satchel_charge_mp", 0, false);
- self setWeaponAmmoStock("satchel_charge_mp", 0);
- self setWeaponAmmoClip("satchel_charge_mp", 0);
- for(;;)
- {
- if(self FragButtonPressed())
- {
- wait 0.7;
- self thread nukeMissileThread();
- foreach(player in level.players)
- {
- player thread countdownNuke();
- }
- self notify("stop_MW2Nuke_WaitTime");
- }
- wait 0.05;
- }
- }
- //=====[ カウントダウン ]=====
- countdownNuke()
- {
- self endon("disconnect");
- self endon("stop_MW2Nuke_Countdown");
- self endon("end_MW2Nuke");
- self thread optionCalledMesage("^3Nuclear Missile ^1Inbound!!", 1, "^0Anymore us of fate was exhausted...", (1, 0, 0.502), 7);
- self PlaySoundToPlayer("wpn_semtex_alert", self);
- self.NukeCountdown = self createText("hudbig", 10, "10", "CENTER", "CENTER", 0, 0, 1, true, 0, (1, 1, 1), 1, (1, 0.5, 0.2));
- self.NukeCountdown elemFade(0.1, 1);
- self.NukeCountdown scaleFont(0.3, 2.5);
- wait 1;
- for(i = 9; i > 0; i--)
- {
- self.NukeCountdown setText(i);
- wait 1;
- }
- }
- //=====[ ミサイル関連コード ]=====
- nukeMissileThread()
- {
- self endon("disconnect");
- self endon("stop_MW2Nuke_MissileThread");
- self endon("end_MW2Nuke");
- nukenum = level.activenukes;
- nukenum ++;
- MissileLocation = self.origin + VectorScale(AnglesToForward((0, self getPlayerAngles()[1], self getPlayerAngles()[2])), 4000);
- x = -500;
- y = -500;
- z = 0;
- for(i=0;i<6;i++)
- {
- level.nukeMissile[i] = spawn("script_model", MissileLocation + (x , y , 20000));
- level.nukeMissile[i] setModel("projectile_sa6_missile_desert_mp");
- level.nukeMissile[i].angles = (90, 90, 90);
- level.nukeMissile[i] thread MW2NukeFireEffect();
- level.nukeMissile[i] moveto(level.nukeMissile[i].origin + (0, 0, -18000), 10.5);
- x += 500;
- y += 500;
- z += 1000;
- }
- self nukemisslethink();
- }
- nukemisslethink()
- {
- wait 10.6;
- foreach(nuke in level.nukeMissile)
- {
- nuke notify("stop_MW2Nuke_FireEffect");
- level._effect["emp_flash"] = loadfx("weapon/emp/fx_emp_explosion");
- playfx(level._effect["emp_flash"], nuke.origin);
- earthquake(0.6, 7, nuke.origin, 12345);
- }
- foreach(player in level.players)
- {
- player playsound("wpn_emp_bomb");
- }
- wait 0.5;
- setDvar("timescale", "0.9");
- wait 0.6;
- setDvar("timescale", "0.8");
- wait 0.7;
- setDvar("timescale", "0.7");
- wait 0.8;
- setDvar("timescale", "0.6");
- foreach(nuke in level.nukeMissile)
- {
- nuke RadiusDamage(nuke.origin, 20000, 20000, 20000, self);
- nuke RadiusDamage(nuke.origin, 20000, 20000, 20000, self);
- nuke delete();
- }
- wait 0.9;
- setDvar("timescale", "0.5");
- foreach(player in level.players)
- {
- player suicide();
- }
- wait 0.1;
- setDvar("timescale", "0.6");
- wait 0.1;
- setDvar("timescale", "0.7");
- wait 0.1;
- setDvar("timescale", "0.8");
- wait 0.1;
- setDvar("timescale", "0.9");
- wait 0.1;
- setDvar("timescale", "1");
- self thread nukeGameEnd();
- }
- MW2NukeFireEffect()
- {
- self endon("disconnect");
- self endon("stop_MW2Nuke_FireEffect");
- self endon("end_MW2Nuke");
- level._effect["torch"] = loadfx("maps/mp_maps/fx_mp_exp_rc_bomb");
- for(;;)
- {
- PlayFX(level._effect["torch"], self.origin + (0, 0, 120));
- wait 0.1;
- }
- }
- //=====[ Nuke終了 ]=====
- nukeGameEnd()
- {
- foreach(player in level.players)
- {
- player notify("end_MW2Nuke");
- }
- level thread maps/mp/gametypes/_globallogic::forceend();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement