private void CompleteExecution() { this.PhaseTitle = LocaleTerms.Loc("COMPLETE"); this.PhaseSubtitle = "---"; this.State = DLCIntroExe.IntroState.Exiting; this.isExiting = true; this.os.traceCompleteOverrideAction = (Action)null; if (!this.os.Flags.HasFlag("KaguyaTrialComplete")) { this.os.Flags.AddFlag("KaguyaTrialComplete"); this.os.allFactions.setCurrentFaction("Bibliotheque", this.os); this.os.homeNodeID = "dhs"; this.os.homeAssetServerID = "dhsDrop"; MissionFunctions.runCommand(1, "addRankSilent"); this.os.currentMission = (ActiveMission)null; Computer computer = Programs.getComputer(this.os, "dhs"); (computer.getDaemon(typeof(DLCHubServer)) as DLCHubServer).AddAgent(this.os.defaultUser.name, "dnkA19ds", new Color(222, 153, 24)); for (int index = 0; index < computer.users.Count; ++index) { UserDetail user = computer.users[index]; if (user.name == this.os.defaultUser.name) { user.known = true; computer.users[index] = user; } } } this.os.runCommand("connect 69.58.186.114"); this.os.IsInDLCMode = true; this.os.DisableEmailIcon = false; this.isExiting = true; }
private void UpdateState(float t) { this.TimeInThisState += t; switch (this.State) { case DLCIntroExe.IntroState.SpinningUp: if ((double)this.TimeInThisState >= (double)DLCIntroExe.SpinUpTime) { this.PrepareForUIBreakdown(); this.State = DLCIntroExe.IntroState.Flickering; this.PhaseTitle = LocaleTerms.Loc("INITIALIZING"); this.PhaseSubtitle = "---"; this.TimeInThisState = 0.0f; this.os.execute("dc"); this.os.execute("clear"); this.os.warningFlash(); } this.percentageThroughThisState = this.TimeInThisState / DLCIntroExe.SpinUpTime; break; case DLCIntroExe.IntroState.Flickering: if ((double)this.TimeInThisState >= (double)DLCIntroExe.FlickeringTime) { this.State = DLCIntroExe.IntroState.MailIconPhasingOut; this.TimeInThisState = 0.0f; SFX.addCircle(this.os.mailicon.pos + new Vector2(20f, 6f), Utils.AddativeRed, 100f); this.os.execute("clear"); this.os.warningFlash(); } this.percentageThroughThisState = this.TimeInThisState / DLCIntroExe.FlickeringTime; break; case DLCIntroExe.IntroState.MailIconPhasingOut: if ((double)this.TimeInThisState >= (double)DLCIntroExe.MailIconFlickerOutTime) { this.CompleteMailPhaseOut(); this.State = DLCIntroExe.IntroState.AssignMission1; this.TimeInThisState = 0.0f; this.os.warningFlash(); } this.percentageThroughThisState = this.TimeInThisState / DLCIntroExe.MailIconFlickerOutTime; break; case DLCIntroExe.IntroState.AssignMission1: this.percentageThroughThisState = this.TimeInThisState / DLCIntroExe.AssignMission1Time; break; case DLCIntroExe.IntroState.OnMission1: case DLCIntroExe.IntroState.OnMission2: this.CheckProgressOfCurrentAssignment(); break; case DLCIntroExe.IntroState.AssignMission2: this.percentageThroughThisState = this.TimeInThisState / DLCIntroExe.AssignMission2Time; break; } this.explosion.Update(t); }
private void PlayerLostToTraceTimer() { this.os.runCommand("dc"); this.os.runCommand("clear"); this.os.delayer.Post(ActionDelayer.NextTick(), (Action)(() => { this.os.write("-----------------\n\nKT_OVERRIDE_RECOVERY: " + LocaleTerms.Loc("Critical Error - resetting.") + "\n\n----------------"); this.State = DLCIntroExe.IntroState.AssignMission1; this.TimeInThisState = 0.0f; })); }
private void StartAssignment() { if (!this.AllAssignmentsComplete) { if (this.IsOnAssignment1) { this.PhaseTitle = "74.125.23.121"; this.PhaseSubtitle = LocaleTerms.Loc("Download Tools") + "\n" + LocaleTerms.Loc("Delete System Files"); } else { this.PhaseTitle = "216.239.32.181"; this.PhaseSubtitle = LocaleTerms.Loc("Adapt") + "\n" + LocaleTerms.Loc("Advance"); } this.State = this.IsOnAssignment1 ? DLCIntroExe.IntroState.OnMission1 : DLCIntroExe.IntroState.OnMission2; this.TimeInThisState = 0.0f; this.LoadedMission = (ActiveMission)ComputerLoader.readMission(this.IsOnAssignment1 ? this.assignment1MissionPath : this.assignment2MissionPath); } else { this.CompleteExecution(); } }
private void MissionWasCompleted() { if (this.IsOnAssignment1) { this.State = DLCIntroExe.IntroState.AssignMission2; } else { this.State = DLCIntroExe.IntroState.Outro; this.AllAssignmentsComplete = true; this.GlowSound.Play(); MusicManager.transitionToSong("Music/Ambient/AmbientDrone_Clipped"); for (int index = 0; index < this.os.exes.Count; ++index) { if (this.os.exes[index] is ShellExe) { (this.os.exes[index] as ShellExe).Killed(); (this.os.exes[index] as ShellExe).isExiting = true; } } } this.charsRenderedSoFar = 0; this.TimeInThisState = 0.0f; this.MissionIsComplete = false; if (this.IsOnAssignment1) { this.IsOnAssignment1 = false; } for (int index = 0; index < this.os.exes.Count; ++index) { if (this.os.exes[index] != this) { this.os.exes[index].isExiting = true; } } this.os.execute("clear"); }
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); }