private void CompleteAndReturnToMenu() { this.os.Flags.AddFlag("Victory"); Programs.disconnect(new string[0], this.os); Computer computer = Programs.getComputer(this.os, "porthackHeart"); this.os.netMap.visibleNodes.Remove(this.os.netMap.nodes.IndexOf(computer)); computer.disabled = true; computer.daemons.Clear(); computer.ip = NetworkMap.generateRandomIP(); this.os.terminal.inputLocked = false; this.os.ram.inputLocked = false; this.os.netMap.inputLocked = false; this.os.DisableTopBarButtons = false; this.os.canRunContent = true; this.IsActive = false; ComputerLoader.loadMission("Content/Missions/CreditsMission.xml", false); this.os.threadedSaveExecute(false); MediaPlayer.IsRepeating = true; MusicManager.playSongImmediatley("Music\\Bit(Ending)"); if (Settings.isPirateBuild) { this.os.delayer.Post(ActionDelayer.Wait(15.0), (Action)(() => { try { ComputerLoader.loadMission("Content/Missions/CreditsMission_p.xml", false); } catch (Exception ex) { } })); } if (!Settings.sendsDLC1PromoEmailAtEnd) { return; } this.os.delayer.Post(ActionDelayer.Wait(30.0), (Action)(() => { try { string body = Utils.readEntireFile("Content/LocPost/DLCMessage.txt"); string subject = "Labyrinths"; string sender = "Matt Trobbiani"; string email = MailServer.generateEmail(subject, body, sender); MailServer daemon = this.os.netMap.mailServer.getDaemon(typeof(MailServer)) as MailServer; if (daemon == null) { return; } daemon.addMail(email, this.os.defaultUser.name); } catch (Exception ex) { } })); }
private void RollCredits() { IsInCredits = true; speechinstance.Stop(); Settings.soundDisabled = false; elapsedTime = 0.0f; os.delayer.Post(ActionDelayer.Wait(1.0), () => { MusicManager.playSongImmediatley("Music\\Bit(Ending)"); MediaPlayer.IsRepeating = false; AchievementsManager.Unlock("progress_complete", false); }); }
private void ActivateSong(string song) { if (!this.SongOptions.Contains(MusicManager.currentSongName)) { this.oldPlayingSong = MusicManager.currentSongName; } try { MusicManager.playSongImmediatley(song); } catch (Exception ex) { this.os.write("Tuneswap.exe :: ERROR PLAYING SONG " + song + "\n -- EXITING\n"); this.isExiting = true; } }
private void ActiveStateUpdate(float t) { PostProcessor.dangerModeEnabled = true; double num = (double)this.stateTimer; if (MediaPlayer.State == MediaState.Playing && !Settings.soundDisabled) { num = MediaPlayer.PlayPosition.TotalSeconds; } PostProcessor.dangerModePercentComplete = (float)((num - (double)SequencerExe.SPIN_UP_TIME) / (SequencerExe.Song_Length - (double)SequencerExe.SPIN_UP_TIME)); if ((double)PostProcessor.dangerModePercentComplete >= 1.0) { if (Settings.isDemoMode) { MissionFunctions.runCommand(0, "demoFinalMissionEnd"); } else { MusicManager.playSongImmediatley("Music/Ambient/AmbientDrone_Clipped"); this.os.netMap.visibleNodes.Remove(this.os.netMap.nodes.IndexOf(this.targetComp)); PostProcessor.dangerModeEnabled = false; PostProcessor.dangerModePercentComplete = 0.0f; this.os.thisComputer.crash(this.os.thisComputer.ip); } } if (this.os.connectedComp == null && (double)this.stateTimer > 1.0 && !Settings.isDemoMode) { this.isExiting = true; if (this.oldSongName != null) { MusicManager.transitionToSong("Music/Ambient/AmbientDrone_Clipped"); MediaPlayer.IsRepeating = true; } this.os.netMap.visibleNodes.Remove(this.os.netMap.nodes.IndexOf(this.targetComp)); PostProcessor.dangerModeEnabled = false; PostProcessor.dangerModePercentComplete = 0.0f; } if ((num - this.beatDropTime) % (double)SequencerExe.TimeBetweenBeats >= (double)t) { return; } this.os.warningFlash(); }
private void CompleteAndReturnToMenu() { os.Flags.AddFlag("Victory"); Programs.disconnect(new string[0], os); var computer = Programs.getComputer(os, "porthackHeart"); os.netMap.visibleNodes.Remove(os.netMap.nodes.IndexOf(computer)); computer.disabled = true; computer.daemons.Clear(); computer.ip = NetworkMap.generateRandomIP(); os.terminal.inputLocked = false; os.ram.inputLocked = false; os.netMap.inputLocked = false; os.DisableTopBarButtons = false; os.canRunContent = true; IsActive = false; ComputerLoader.loadMission("Content/Missions/CreditsMission.xml"); os.threadedSaveExecute(); MediaPlayer.IsRepeating = true; MusicManager.playSongImmediatley("Music\\Bit(Ending)"); }
private void RollCredits() { if (this.os.TraceDangerSequence.IsActive) { this.os.TraceDangerSequence.CancelTraceDangerSequence(); } this.IsInCredits = true; if (this.speechinstance != null) { this.speechinstance.Stop(); } Settings.soundDisabled = false; this.elapsedTime = 0.0f; this.os.delayer.Post(ActionDelayer.Wait(1.0), (Action)(() => { MusicManager.playSongImmediatley("Music\\Bit(Ending)"); MediaPlayer.IsRepeating = false; AchievementsManager.Unlock("progress_complete", false); })); PostProcessor.dangerModeEnabled = false; PostProcessor.dangerModePercentComplete = 0.0f; }
public override void draw(Rectangle bounds, SpriteBatch sb) { base.draw(bounds, sb); bounds = Utils.InsetRectangle(bounds, 1); int num1 = 90; int height1 = 30; TextItem.doCenteredFontLabel(new Rectangle(bounds.X, bounds.Y + height1, bounds.Width, num1 - height1), this.OverrideTitle == null ? LocaleTerms.Loc("Labyrinths Project") : this.OverrideTitle, GuiData.font, Color.White, false); Rectangle rectangle = new Rectangle(bounds.X, bounds.Y + num1 + height1, bounds.Width, bounds.Height - (num1 + 2 * height1)); if (this.showingCredits) { this.timeInCredits += (float)this.os.lastGameTime.ElapsedGameTime.TotalSeconds; float timeInCredits = this.timeInCredits; float num2 = ((double)timeInCredits > 5.0 ? timeInCredits - 4f : Utils.CubicInCurve(timeInCredits / 5f)) % 165f; Utils.FillEverywhereExcept(rectangle, Utils.GetFullscreen(), sb, Color.Black * 0.5f); float num3 = 20f; float num4 = (float)(rectangle.Y - height1 + rectangle.Height) - num2 * num3; for (int index = 0; index < this.CreditsData.Length; ++index) { int height2 = 22; SpriteFont font = GuiData.smallfont; Color color = Color.LightGray * 0.9f; string text = this.CreditsData[index]; if (text.StartsWith("%")) { text = text.Substring(1); height2 = 45; font = GuiData.font; color = Utils.AddativeWhite * 0.9f; } else if (text.StartsWith("^")) { text = text.Substring(1); height2 = 30; font = GuiData.font; color = Color.White; } if ((double)num4 >= (double)(rectangle.Y - height1)) { TextItem.doCenteredFontLabel(new Rectangle(rectangle.X, (int)num4, rectangle.Width, height2), text, font, color, false); } num4 += (float)(height2 + 2); if ((double)num4 > (double)(rectangle.Y + rectangle.Height)) { break; } } if ((double)this.timeInCredits > 40.0 && Button.doButton(18394902, rectangle.X + rectangle.Width / 4, rectangle.Y + rectangle.Height - 23, rectangle.Width / 2, 20, LocaleTerms.Loc("Proceed"), new Color?((double)this.timeInCredits > 65.0 ? this.os.highlightColor : Color.Black))) { this.os.display.command = "connect"; } } else if (this.isInResetSequence) { this.timeInReset += (float)this.os.lastGameTime.ElapsedGameTime.TotalSeconds; if ((double)this.timeInReset >= 5.0) { this.showingCredits = true; PostProcessor.EndingSequenceFlashOutActive = false; PostProcessor.EndingSequenceFlashOutPercentageComplete = 0.0f; if (!Settings.IsInExtensionMode) { this.EndDLC(); if (!this.hasCuedFinaleSong) { this.os.delayer.Post(ActionDelayer.Wait(2.0), (Action)(() => MusicManager.playSongImmediatley("DLC\\Music\\DreamHead"))); this.hasCuedFinaleSong = true; } MediaPlayer.IsRepeating = true; for (int index = 0; index < 9; ++index) { this.os.delayer.Post(ActionDelayer.Wait((double)index / 7.0), (Action)(() => SFX.addCircle(this.os.mailicon.pos + new Vector2(20f, 6f), Utils.AddativeWhite * 0.8f, 400f))); } } } else { float num2 = Math.Min(this.timeInReset, 1f); Utils.FillEverywhereExcept(rectangle, Utils.GetFullscreen(), sb, Color.Black * 0.5f * num2); PatternDrawer.draw(rectangle, 0.3f, Color.Transparent, Color.Black * 0.7f, sb, PatternDrawer.binaryTile); this.AddRadialMailLine(); PostProcessor.EndingSequenceFlashOutActive = true; PostProcessor.EndingSequenceFlashOutPercentageComplete = num2; if (!this.hasCuedBuildup && (double)this.timeInReset > 2.8) { this.buildup.Play(); this.hasCuedBuildup = true; } TextItem.doCenteredFontLabel(rectangle, LocaleTerms.Loc("Disabling..."), GuiData.font, Color.White, false); } } else { PatternDrawer.draw(rectangle, 0.3f, Color.Transparent, Color.Black * 0.7f, sb, PatternDrawer.binaryTile); string text = this.OverrideButtonText == null?LocaleTerms.Loc("Disable Agent Monitoring") : this.OverrideButtonText; bool flag = this.OverrideButtonText != null; if (Button.doButton(38101920, rectangle.X + 50, rectangle.Y + rectangle.Height / 2 - 13, rectangle.Width - 100, 26, text, new Color?(this.os.highlightColor))) { if (!flag) { this.isInResetSequence = true; this.timeInReset = 0.0f; if (MusicManager.currentSongName == "DLC/Music/RemiDrone") { MusicManager.stop(); } this.spindownImpact.Play(); if (this.spindown != null) { this.os.delayer.Post(ActionDelayer.Wait(1.1), (Action)(() => this.spindown.Play())); } DLC1SessionUpgrader.ReDsicoverAllVisibleNodesInOSCache((object)this.os); } else { this.isInResetSequence = false; this.showingCredits = true; if (this.ConditionalActionsToLoadOnButtonPress != null) { RunnableConditionalActions.LoadIntoOS(this.ConditionalActionsToLoadOnButtonPress, (object)this.os); } } } } Rectangle destinationRectangle = new Rectangle(bounds.X, bounds.Y + num1, bounds.Width, height1); sb.Draw(Utils.white, destinationRectangle, Utils.VeryDarkGray); destinationRectangle.Y = bounds.Y + num1 + height1 + rectangle.Height; sb.Draw(Utils.white, destinationRectangle, Utils.VeryDarkGray); }
public override void Draw(float t) { base.Draw(t); this.drawOutline(); this.drawTarget("app:"); this.UpdateState(t); Rectangle dest1 = new Rectangle(this.bounds.X + 2, this.bounds.Y + Module.PANEL_HEIGHT + 2, this.bounds.Width - 4, this.bounds.Height - (Module.PANEL_HEIGHT + 4)); Rectangle dest2 = new Rectangle(this.bounds.X + 2, this.bounds.Y + Module.PANEL_HEIGHT + 10, this.bounds.Width - 4, this.bounds.Height - (Module.PANEL_HEIGHT + 6)); switch (this.State) { case DLCIntroExe.IntroState.NotStarted: this.BackgroundEffect.Update(t); this.BackgroundEffect.Draw(dest2, this.spriteBatch, Color.Black, this.themeColor * 0.2f, HexGridBackground.ColoringAlgorithm.CorrectedSinWash, 0.0f); int height1 = 30; this.spriteBatch.Draw(Utils.white, new Rectangle(this.bounds.X + 10, this.bounds.Y + this.bounds.Height / 2 - height1 / 2, this.bounds.Width - 20, height1), Color.Black); if (!this.os.Flags.HasFlag("KaguyaTrialComplete")) { if (Button.doButton(8310101 + this.PID, this.bounds.X + 10, this.bounds.Y + this.bounds.Height / 2 - height1 / 2, this.bounds.Width - 20, height1, LocaleTerms.Loc("BEGIN TRIAL"), new Color?(this.os.highlightColor))) { this.State = DLCIntroExe.IntroState.SpinningUp; this.TimeInThisState = 0.0f; MusicManager.stop(); MusicManager.playSongImmediatley("DLC\\Music\\snidelyWhiplash"); this.os.mailicon.isEnabled = false; this.os.thisComputer.links.Clear(); this.os.traceCompleteOverrideAction += new Action(this.PlayerLostToTraceTimer); this.OSTraceTimerOverrideActive = true; break; } break; } TextItem.doCenteredFontLabel(dest1, LocaleTerms.Loc("Trials Locked"), GuiData.font, Color.White, false); if (Button.doButton(8310101 + this.PID, dest1.X + 10, dest1.Y + dest1.Height - 22, dest1.Width - 20, 18, "Exit", new Color?(this.os.lockedColor))) { this.isExiting = true; } break; case DLCIntroExe.IntroState.SpinningUp: Utils.LCG.reSeed(this.PID); Rectangle destinationRectangle = new Rectangle(dest1.X, dest1.Y, dest1.Width, 1); for (int index = 0; index < dest1.Height; ++index) { float point = Math.Min(1f, this.TimeInThisState / (Utils.LCG.NextFloatScaled() * DLCIntroExe.SpinUpTime)); float num1; if ((double)Utils.LCG.NextFloatScaled() > 0.5) { float num2 = 0.8f; float num3 = point * (1f - num2); if ((double)point > (double)num2) { float num4 = 1f - num3; float num5 = Utils.QuadraticOutCurve((float)(((double)point - (double)num2) / (1.0 - (double)num2))); num1 = num3 + num4 * num5; } else { num1 = num3; } } else { num1 = Utils.QuadraticOutCurve(point); } destinationRectangle.Y = dest1.Y + index; destinationRectangle.Width = (int)((double)num1 * (double)dest1.Width); Color color = Color.Lerp(Utils.AddativeWhite * 0.1f, this.themeColor, Utils.LCG.NextFloatScaled()); this.spriteBatch.Draw(Utils.white, destinationRectangle, color); } break; case DLCIntroExe.IntroState.Flickering: this.UpdateUIFlickerIn(); this.UpdateUIBreaking(t); this.DrawPhaseTitle(t, dest2); break; case DLCIntroExe.IntroState.MailIconPhasingOut: this.DrawPhaseTitle(t, dest2); this.UpdateMailePhaseOut(t); break; case DLCIntroExe.IntroState.AssignMission1: case DLCIntroExe.IntroState.AssignMission2: case DLCIntroExe.IntroState.Outro: this.DrawPhaseTitle(t, dest2); this.DrawAssignmentPhase(t); break; case DLCIntroExe.IntroState.OnMission1: case DLCIntroExe.IntroState.OnMission2: this.DrawPhaseTitle(t, dest2); if (Settings.forceCompleteEnabled) { int height2 = 19; if (Button.doButton(8310102, this.bounds.X + 10, this.bounds.Y + height2 + 4, this.bounds.Width - 20, height2, LocaleTerms.Loc("DEBUG: Skip"), new Color?(this.os.highlightColor))) { this.os.thisComputer.files.root.searchForFolder("bin").files.Add(new FileEntry(PortExploits.crackExeData[6881], PortExploits.cracks[6881])); this.CompleteExecution(); } break; } break; case DLCIntroExe.IntroState.Exiting: this.DrawPhaseTitle(t, dest2); Utils.FillEverywhereExcept(Utils.InsetRectangle(this.os.terminal.Bounds, 1), Utils.GetFullscreen(), this.spriteBatch, Color.Black * 0.8f * (1f - Math.Min(1f, this.TimeInThisState))); break; } this.UpdateImpactEffects(t); this.DrawImpactEffects(this.ImpactEffects); this.explosion.Render(this.spriteBatch); }
public static void runCommand(int value, string name) { MissionFunctions.assertOS(); if (name.ToLower().Trim() == "none") { return; } if (name.Equals("addRank")) { if (!OS.TestingPassOnly || MissionFunctions.os.currentFaction != null) { MissionFunctions.os.currentFaction.addValue(value, (object)MissionFunctions.os); string email = MailServer.generateEmail(LocaleTerms.Loc("Contract Successful"), string.Format(Utils.readEntireFile("Content/LocPost/MissionCompleteEmail.txt"), (object)MissionFunctions.os.currentFaction.getRank(), (object)MissionFunctions.os.currentFaction.getMaxRank(), (object)MissionFunctions.os.currentFaction.name), MissionFunctions.os.currentFaction.name + " ReplyBot"); ((MailServer)MissionFunctions.os.netMap.mailServer.getDaemon(typeof(MailServer))).addMail(email, MissionFunctions.os.defaultUser.name); } else if (OS.DEBUG_COMMANDS && MissionFunctions.os.currentFaction == null) { MissionFunctions.os.write("----------"); MissionFunctions.os.write("----------"); MissionFunctions.os.write("ERROR IN FUNCTION 'addRank'"); MissionFunctions.os.write("Player is not assigned to a faction, so rank cannot be added!"); MissionFunctions.os.write("Make sure you have assigned a player a faction with the 'SetFaction' function before using this!"); MissionFunctions.os.write("----------"); MissionFunctions.os.write("----------"); } } else if (name.Equals("addRankSilent")) { if (OS.TestingPassOnly && MissionFunctions.os.currentFaction == null) { return; } MissionFunctions.os.currentFaction.addValue(value, (object)MissionFunctions.os); } else if (name.StartsWith("addFlags:")) { foreach (string flag in name.Substring("addFlags:".Length).Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries)) { MissionFunctions.os.Flags.AddFlag(flag); } CustomFaction currentFaction = MissionFunctions.os.currentFaction as CustomFaction; if (currentFaction == null) { return; } currentFaction.CheckForAllCustomActionsToRun((object)MissionFunctions.os); } else if (name.StartsWith("removeFlags:")) { string[] strArray = name.Substring("removeFlags:".Length).Split(Utils.commaDelim, StringSplitOptions.RemoveEmptyEntries); for (int index = 0; index < strArray.Length; ++index) { if (MissionFunctions.os.Flags.HasFlag(strArray[index])) { MissionFunctions.os.Flags.RemoveFlag(strArray[index]); } } CustomFaction currentFaction = MissionFunctions.os.currentFaction as CustomFaction; if (currentFaction == null) { return; } currentFaction.CheckForAllCustomActionsToRun((object)MissionFunctions.os); } else if (name.StartsWith("setFaction:")) { string newFaction = name.Substring("setFaction:".Length); bool flag = false; foreach (KeyValuePair <string, Faction> faction in MissionFunctions.os.allFactions.factions) { if (faction.Value.idName.ToLower() == newFaction.ToLower()) { MissionFunctions.os.allFactions.setCurrentFaction(newFaction, MissionFunctions.os); flag = true; break; } } if (!flag && OS.TestingPassOnly) { throw new NullReferenceException("Faction " + newFaction + "not found for setFaction action!"); } } else if (name.StartsWith("loadConditionalActions:")) { RunnableConditionalActions.LoadIntoOS(name.Substring("loadConditionalActions:".Length), (object)MissionFunctions.os); } else if (name.Equals("triggerThemeHackRevenge")) { MissionFunctions.os.delayer.Post(ActionDelayer.Wait(5.0), (Action)(() => { string email = MailServer.generateEmail(LocaleTerms.Loc("Are you Kidding me?"), Utils.readEntireFile("Content/LocPost/NaixEmail.txt"), "*****@*****.**"); ((MailServer)MissionFunctions.os.netMap.mailServer.getDaemon(typeof(MailServer))).addMail(email, MissionFunctions.os.defaultUser.name); MissionFunctions.os.delayer.Post(ActionDelayer.Wait(24.0), (Action)(() => { try { HackerScriptExecuter.runScript("HackerScripts/ThemeHack.txt", (object)MissionFunctions.os, (string)null, (string)null); } catch (Exception ex) { if (!Settings.recoverFromErrorsSilently) { throw ex; } MissionFunctions.os.write("CAUTION: UNSYNDICATED OUTSIDE CONNECTION ATTEMPT"); MissionFunctions.os.write("RECOVERED FROM CONNECTION SUBTERFUGE SUCCESSFULLY"); Console.WriteLine("Critical error loading hacker script - aborting"); } })); })); } else if (name.Equals("changeSong")) { switch (value) { case 2: MusicManager.transitionToSong("Music\\The_Quickening"); break; case 3: MusicManager.transitionToSong("Music\\TheAlgorithm"); break; case 4: MusicManager.transitionToSong("Music\\Ryan3"); break; case 5: MusicManager.transitionToSong("Music\\Bit(Ending)"); break; case 6: MusicManager.transitionToSong("Music\\Rico_Puestel-Roja_Drifts_By"); break; case 7: MusicManager.transitionToSong("Music\\out_run_the_wolves"); break; case 8: MusicManager.transitionToSong("Music\\Irritations"); break; case 9: MusicManager.transitionToSong("Music\\Broken_Boy"); break; case 10: MusicManager.transitionToSong("Music\\Ryan10"); break; case 11: MusicManager.transitionToSong("Music\\tetrameth"); break; default: MusicManager.transitionToSong("Music\\Revolve"); break; } } else if (name.Equals("entropyEndMissionSetup")) { MissionFunctions.runCommand(3, "changeSong"); Computer comp1 = MissionFunctions.findComp("corp0#IS"); Computer comp2 = MissionFunctions.findComp("corp0#MF"); Computer comp3 = MissionFunctions.findComp("corp0#BU"); FileEntry fileEntry1 = new FileEntry(Computer.generateBinaryString(5000), "HacknetOS.rar"); FileEntry fileEntry2 = new FileEntry(Computer.generateBinaryString(4000), "HacknetOS_Data.xnb"); FileEntry fileEntry3 = new FileEntry(Computer.generateBinaryString(4000), "HacknetOS_Content.xnb"); Folder folder1 = comp1.files.root.folders[2]; folder1.files.Add(fileEntry1); folder1.files.Add(fileEntry2); folder1.files.Add(fileEntry3); Folder folder2 = comp2.files.root.folders[2]; folder2.files.Add(fileEntry1); folder2.files.Add(fileEntry2); folder2.files.Add(fileEntry3); FileEntry fileEntry4 = new FileEntry(fileEntry1.data, fileEntry1.name + "_backup"); FileEntry fileEntry5 = new FileEntry(fileEntry2.data, fileEntry2.name + "_backup"); FileEntry fileEntry6 = new FileEntry(fileEntry3.data, fileEntry3.name + "_backup"); Folder folder3 = comp3.files.root.folders[2]; folder3.files.Add(fileEntry4); folder3.files.Add(fileEntry5); folder3.files.Add(fileEntry6); comp1.traceTime = Computer.BASE_TRACE_TIME * 7.5f; comp3.traceTime = Computer.BASE_TRACE_TIME * 7.5f; comp2.traceTime = Computer.BASE_TRACE_TIME * 7.5f; comp2.portsNeededForCrack = 3; comp1.portsNeededForCrack = 2; comp3.portsNeededForCrack = 2; Folder folder4 = MissionFunctions.findComp("entropy01").files.root.folders[2]; folder4.files.Add(new FileEntry(PortExploits.crackExeData[25], "SMTPoverflow.exe")); folder4.files.Add(new FileEntry(PortExploits.crackExeData[80], "WebServerWorm.exe")); } else if (name.Equals("entropyAddSMTPCrack")) { Folder folder = MissionFunctions.findComp("entropy01").files.root.folders[2]; bool flag = false; for (int index = 0; index < folder.files.Count; ++index) { if (folder.files[index].data == PortExploits.crackExeData[25] || folder.files[index].name == "SMTPoverflow.exe") { flag = true; } } if (!flag) { folder.files.Add(new FileEntry(PortExploits.crackExeData[25], Utils.GetNonRepeatingFilename("SMTPoverflow", ".exe", folder))); } MissionFunctions.os.Flags.AddFlag("ThemeHackTransitionAssetsAdded"); } else if (name.Equals("transitionToBitMissions")) { if (Settings.isDemoMode) { MissionFunctions.runCommand(6, "changeSong"); if (Settings.isPressBuildDemo) { ComputerLoader.loadMission("Content/Missions/Demo/PressBuild/DemoMission01.xml", false); } else { ComputerLoader.loadMission("Content/Missions/Demo/AvconDemo.xml", false); } } else { ComputerLoader.loadMission("Content/Missions/BitMission0.xml", false); } } else if (name.Equals("entropySendCSECInvite")) { MissionFunctions.os.delayer.Post(ActionDelayer.Wait(6.0), (Action)(() => ComputerLoader.loadMission("Content/Missions/MainHub/Intro/Intro01.xml", false))); } else if (name.Equals("hubBitSetComplete01")) { MissionFunctions.os.delayer.Post(ActionDelayer.Wait(4.0), (Action)(() => MissionFunctions.runCommand(1, "addRank"))); MissionFunctions.runCommand(3, "changeSong"); MissionFunctions.os.Flags.AddFlag("csecBitSet01Complete"); } else if (name.Equals("enTechEnableOfflineBackup")) { Programs.getComputer(MissionFunctions.os, "EnTechOfflineBackup"); MissionFunctions.os.Flags.AddFlag("VaporSequencerEnabled"); Folder folder1 = MissionFunctions.findComp("mainHubAssets").files.root.searchForFolder("bin"); Folder folder2 = folder1.searchForFolder("Sequencer"); if (folder2 == null) { folder2 = new Folder("Sequencer"); folder1.folders.Add(folder2); } if (folder2.searchForFile("Sequencer.exe") != null) { return; } folder2.files.Add(new FileEntry(PortExploits.crackExeData[17], "Sequencer.exe")); } else if (name.Equals("rudeNaixResponse")) { AchievementsManager.Unlock("rude_response", false); } else if (name.Equals("assignPlayerToHubServerFaction")) { MissionFunctions.os.allFactions.setCurrentFaction("hub", MissionFunctions.os); Computer computer = Programs.getComputer(MissionFunctions.os, "mainHub"); MissionHubServer daemon = (MissionHubServer)computer.getDaemon(typeof(MissionHubServer)); UserDetail userDetail = new UserDetail(MissionFunctions.os.defaultUser.name, "reptile", (byte)3); computer.addNewUser(computer.ip, userDetail); daemon.addUser(userDetail); MissionFunctions.os.homeNodeID = "mainHub"; MissionFunctions.os.homeAssetServerID = "mainHubAssets"; MissionFunctions.runCommand(3, "changeSong"); MissionFunctions.os.Flags.AddFlag("CSEC_Member"); AchievementsManager.Unlock("progress_csec", false); if (!MissionFunctions.os.HasLoadedDLCContent || !Settings.EnableDLC || MissionFunctions.os.Flags.HasFlag("dlc_complete")) { return; } daemon.AddMissionToListings("Content/DLC/Missions/BaseGameConnectors/Missions/CSEC_DLCConnectorIntro.xml", 1); } else if (name.Equals("assignPlayerToEntropyFaction")) { MissionFunctions.runCommand(6, "changeSong"); MissionFunctions.os.homeNodeID = "entropy00"; MissionFunctions.os.homeAssetServerID = "entropy01"; AchievementsManager.Unlock("progress_entropy", false); } else if (name.Equals("assignPlayerToLelzSec")) { MissionFunctions.os.homeNodeID = "lelzSecHub"; MissionFunctions.os.homeAssetServerID = "lelzSecHub"; MissionFunctions.os.Flags.AddFlag("LelzSec_Member"); AchievementsManager.Unlock("progress_lelz", false); } else if (name.Equals("lelzSecVictory")) { AchievementsManager.Unlock("secret_path_complete", false); } else if (name.Equals("demoFinalMissionEnd")) { MissionFunctions.os.exes.Clear(); PostProcessor.EndingSequenceFlashOutActive = true; PostProcessor.EndingSequenceFlashOutPercentageComplete = 1f; MusicManager.stop(); MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() => MissionFunctions.os.content.Load <SoundEffect>("Music/Ambient/spiral_gauge_down").Play())); MissionFunctions.os.delayer.Post(ActionDelayer.Wait(3.0), (Action)(() => { PostProcessor.dangerModeEnabled = false; PostProcessor.dangerModePercentComplete = 0.0f; MissionFunctions.os.ExitScreen(); MissionFunctions.os.ScreenManager.AddScreen((GameScreen) new DemoEndScreen()); })); } else if (name.Equals("demoFinalMissionEndDLC")) { if (!Settings.isDemoMode) { return; } MissionFunctions.os.exes.Clear(); PostProcessor.EndingSequenceFlashOutActive = true; PostProcessor.EndingSequenceFlashOutPercentageComplete = 1f; MusicManager.stop(); MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.0), (Action)(() => MissionFunctions.os.content.Load <SoundEffect>("SFX/BrightFlash").Play())); MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.4), (Action)(() => MissionFunctions.os.content.Load <SoundEffect>("SFX/TraceKill").Play())); MissionFunctions.os.delayer.Post(ActionDelayer.Wait(1.6), (Action)(() => { MusicManager.playSongImmediatley("DLC/Music/DreamHead"); PostProcessor.dangerModeEnabled = false; PostProcessor.dangerModePercentComplete = 0.0f; MissionFunctions.os.ScreenManager.AddScreen((GameScreen) new DemoEndScreen() { StopsMusic = false, IsDLCDemoScreen = true }); MissionFunctions.os.ExitScreen(); })); } else if (name.Equals("demoFinalMissionStart")) { MissionFunctions.os.Flags.AddFlag("DemoSequencerEnabled"); MusicManager.transitionToSong("Music/Ambient/dark_drone_008"); } else if (name.Equals("CSECTesterGameWorldSetup")) { for (int index = 0; index < PortExploits.services.Count && index < 4; ++index) { MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[PortExploits.portNums[index]], PortExploits.cracks[PortExploits.portNums[index]])); } for (int index = 0; index < 4; ++index) { Computer c = new Computer("DebugShell" + (object)index, NetworkMap.generateRandomIP(), MissionFunctions.os.netMap.getRandomPosition(), 0, (byte)2, MissionFunctions.os); c.adminIP = MissionFunctions.os.thisComputer.adminIP; MissionFunctions.os.netMap.nodes.Add(c); MissionFunctions.os.netMap.discoverNode(c); } MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() => { MissionFunctions.os.allFactions.setCurrentFaction("entropy", MissionFunctions.os); MissionFunctions.os.currentMission = (ActiveMission)null; MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy00")); MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy01")); })); } else if (name.Equals("EntropyFastFowardSetup")) { MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[22], PortExploits.cracks[22])); MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[21], PortExploits.cracks[21])); for (int index = 0; index < 3; ++index) { Computer c = new Computer("DebugShell" + (object)index, NetworkMap.generateRandomIP(), MissionFunctions.os.netMap.getRandomPosition(), 0, (byte)2, MissionFunctions.os); c.adminIP = MissionFunctions.os.thisComputer.adminIP; MissionFunctions.os.netMap.nodes.Add(c); MissionFunctions.os.netMap.discoverNode(c); } MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() => { MissionFunctions.os.allFactions.setCurrentFaction("entropy", MissionFunctions.os); MissionFunctions.os.currentMission = (ActiveMission)null; MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy00")); MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "entropy01")); Computer computer = Programs.getComputer(MissionFunctions.os, "entropy01"); UserDetail user = computer.users[0]; user.known = true; computer.users[0] = user; MissionFunctions.os.allFactions.factions[MissionFunctions.os.allFactions.currentFaction].playerValue = 2; MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() => { MissionFunctions.os.Flags.AddFlag("eosPathStarted"); ComputerLoader.loadMission("Content/Missions/Entropy/StartingSet/eosMissions/eosIntroDelayer.xml", false); })); })); } else if (name.Equals("CSECFastFowardSetup")) { MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[22], PortExploits.cracks[22])); MissionFunctions.os.thisComputer.files.root.folders[2].files.Add(new FileEntry(PortExploits.crackExeData[21], PortExploits.cracks[21])); for (int index = 0; index < 3; ++index) { Computer c = new Computer("DebugShell" + (object)index, NetworkMap.generateRandomIP(), MissionFunctions.os.netMap.getRandomPosition(), 0, (byte)2, MissionFunctions.os); c.adminIP = MissionFunctions.os.thisComputer.adminIP; MissionFunctions.os.netMap.nodes.Add(c); MissionFunctions.os.netMap.discoverNode(c); } MissionFunctions.os.delayer.Post(ActionDelayer.Wait(0.2), (Action)(() => { MissionFunctions.runCommand(0, "assignPlayerToHubServerFaction"); MissionFunctions.os.currentMission = (ActiveMission)null; MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "mainHub")); MissionFunctions.os.netMap.discoverNode(Programs.getComputer(MissionFunctions.os, "mainHubAssets")); Computer computer = Programs.getComputer(MissionFunctions.os, "mainHubAssets"); UserDetail user = computer.users[0]; user.known = true; computer.users[0] = user; })); } else if (name.Equals("csecAddTraceKill")) { Folder folder = MissionFunctions.findComp("mainHubAssets").files.root.searchForFolder("bin"); Folder f = folder.searchForFolder("TK"); if (f == null) { f = new Folder("TK"); folder.folders.Add(f); } f.files.Add(new FileEntry(FileEncrypter.EncryptString(PortExploits.crackExeData[12], "Vapor Trick Enc.", "NULL", "dx122DX", ".exe"), Utils.GetNonRepeatingFilename("TraceKill", ".dec", f))); MissionFunctions.os.Flags.AddFlag("bitPathStarted"); MissionFunctions.runCommand(10, "changeSong"); } else if (name.Equals("junebugComplete")) { Computer computer = Programs.getComputer(MissionFunctions.os, "pacemaker01"); if (computer != null) { HeartMonitorDaemon daemon = (HeartMonitorDaemon)computer.getDaemon(typeof(HeartMonitorDaemon)); if (daemon != null) { daemon.ForceStopBeepSustainSound(); } } MissionFunctions.runCommand(1, "addRank"); } else if (name.Equals("eosIntroMissionSetup")) { MissionFunctions.findComp("entropy01").files.root.searchForFolder("bin").files.Add(new FileEntry(PortExploits.crackExeData[13], "eosDeviceScan.exe")); MissionFunctions.os.delayer.Post(ActionDelayer.Wait(8.0), (Action)(() => { string email = MailServer.generateEmail("Fwd: eOS Stuff", Utils.readEntireFile("Content/Post/eosScannerMail.txt"), "vtfx", new List <string>((IEnumerable <string>) new string[1] { "note#%#" + LocaleTerms.Loc("eOS Security Basics") + "#%#" + Utils.readEntireFile("Content/LocPost/eOSNote.txt") })); ((MailServer)MissionFunctions.os.netMap.mailServer.getDaemon(typeof(MailServer))).addMail(email, MissionFunctions.os.defaultUser.name); MissionFunctions.os.saveGame(); })); MissionFunctions.runCommand(4, "changeSong"); MissionFunctions.os.saveGame(); } else if (name.Equals("eosIntroEndFunc")) { MissionFunctions.runCommand(1, "addRank"); MissionListingServer daemon = (MissionListingServer)MissionFunctions.findComp("entropy00").getDaemon(typeof(MissionListingServer)); List <ActiveMission> branchMissions = MissionFunctions.os.branchMissions; ActiveMission m = (ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/StartingSet/eosMissions/eosAddedMission.xml"); daemon.addMisison(m, false); MissionFunctions.os.branchMissions = branchMissions; } else if (name.Equals("changeSongDLC")) { switch (value) { case 2: MusicManager.transitionToSong("DLC\\Music\\snidelyWhiplash"); break; case 3: MusicManager.transitionToSong("DLC\\Music\\Slow_Motion"); break; case 4: MusicManager.transitionToSong("DLC\\Music\\World_Chase"); break; case 5: MusicManager.transitionToSong("DLC\\Music\\HOME_Resonance"); break; case 6: MusicManager.transitionToSong("DLC\\Music\\Remi_Finale"); break; case 7: MusicManager.transitionToSong("DLC\\Music\\RemiDrone"); break; case 8: MusicManager.transitionToSong("DLC\\Music\\DreamHead"); break; case 9: MusicManager.transitionToSong("DLC\\Music\\Userspacelike"); break; case 10: MusicManager.transitionToSong("DLC\\Music\\CrashTrack"); break; default: MusicManager.transitionToSong("DLC\\Music\\Remi2"); break; } } else if (name.Equals("scanAndStartDLCVenganceHack")) { Computer comp = MissionFunctions.findComp("dAttackTarget"); if (comp == null) { return; } Folder folder = comp.files.root.searchForFolder("log"); bool flag = false; for (int index = 0; index < folder.files.Count; ++index) { if (folder.files[index].data.Contains(MissionFunctions.os.thisComputer.ip)) { SARunFunction saRunFunction = new SARunFunction() { DelayHost = "dhs", FunctionName = "triggerDLCHackRevenge", FunctionValue = 1 }; ((DLCHubServer)Programs.getComputer(MissionFunctions.os, "dhs").getDaemon(typeof(DLCHubServer))).DelayedActions.AddAction((SerializableAction)saRunFunction, 16f); break; } } if (!flag) { MissionFunctions.runCommand(4, "changeSongDLC"); } } else if (name.Equals("triggerDLCHackRevenge")) { try { HackerScriptExecuter.runScript("DLC/ActionScripts/Hackers/SystemHack.txt", (object)MissionFunctions.os, (string)null, (string)null); } catch (Exception ex) { if (!Settings.recoverFromErrorsSilently) { throw ex; } MissionFunctions.os.write("CAUTION: UNSYNDICATED OUTSIDE CONNECTION ATTEMPT"); MissionFunctions.os.write("RECOVERED FROM CONNECTION SUBTERFUGE SUCCESSFULLY"); Console.WriteLine("Critical error loading hacker script - aborting\r\n" + Utils.GenerateReportFromException(ex)); } } else if (name.Equals("activateAircraftStatusOverlay")) { MissionFunctions.os.AircraftInfoOverlay.Activate(); MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = true; } else if (name.Equals("activateAircraftStatusOverlayLabyrinthsMonitoring")) { MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = true; } else if (name.Equals("deActivateAircraftStatusOverlay")) { MissionFunctions.os.AircraftInfoOverlay.IsActive = false; MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = false; MissionFunctions.os.Flags.AddFlag("AircraftInfoOverlayDeactivated"); } else if (name.Equals("defAttackAircraft")) { Computer computer = Programs.getComputer(MissionFunctions.os, "dair_crash"); Folder folder = computer.files.root.searchForFolder("FlightSystems"); for (int index = 0; index < folder.files.Count; ++index) { if (folder.files[index].name == "747FlightOps.dll") { folder.files.RemoveAt(index); break; } } ((AircraftDaemon)computer.getDaemon(typeof(AircraftDaemon))).StartReloadFirmware(); if (MissionFunctions.os.AircraftInfoOverlay.IsActive) { return; } MissionFunctions.os.AircraftInfoOverlay.Activate(); MissionFunctions.os.AircraftInfoOverlay.IsMonitoringDLCEndingCases = true; } else if (name.Equals("playAirlineCrashSongSequence")) { MusicManager.playSongImmediatley("DLC\\Music\\Remi_Finale"); MediaPlayer.IsRepeating = false; } else if (name.Equals("flashUI")) { MissionFunctions.os.warningFlash(); } else if (name.Equals("addRankSilent")) { MissionFunctions.os.currentFaction.addValue(value, (object)MissionFunctions.os); } else if (name.StartsWith("addRankFaction:")) { string str = name.Substring("addRankFaction:".Length); foreach (KeyValuePair <string, Faction> faction in MissionFunctions.os.allFactions.factions) { if (faction.Value.idName.ToLower() == str.ToLower()) { faction.Value.addValue(value, (object)MissionFunctions.os); break; } } } else if (name.StartsWith("setHubServer:")) { string str = name.Substring("setHubServer:".Length); MissionFunctions.os.homeNodeID = str; } else if (name.StartsWith("setAssetServer:")) { string str = name.Substring("setAssetServer:".Length); MissionFunctions.os.homeAssetServerID = str; } else if (name.StartsWith("playCustomSong:")) { string songName = Utils.GetFileLoadPrefix() + name.Substring("playCustomSong:".Length); if (songName.EndsWith(".ogg")) { songName = songName.Substring(0, songName.Length - ".ogg".Length); } if (songName.StartsWith("Content")) { songName = songName.Substring("Content/".Length); } else if (songName.StartsWith("Extensions")) { songName = "../" + songName; } MusicManager.transitionToSong(songName); } else if (name.StartsWith("playCustomSongImmediatley:")) { string songname = Utils.GetFileLoadPrefix() + name.Substring("playCustomSongImmediatley:".Length); if (songname.EndsWith(".ogg")) { songname = songname.Substring(0, songname.Length - ".ogg".Length); } if (songname.StartsWith("Content")) { songname = songname.Substring("Content/".Length); } else if (songname.StartsWith("Extensions")) { songname = "../" + songname; } MusicManager.playSongImmediatley(songname); } else { if (OS.TestingPassOnly && !string.IsNullOrWhiteSpace(name)) { throw new FormatException("No Command Function " + name); } if (MissionFunctions.ReportErrorInCommand != null) { MissionFunctions.ReportErrorInCommand("No command found for \"" + name + "\" with value \"" + (object)value + "\""); } } }