From 3be8389323d541c60a2cb7d355a9fa9e28b99b63 Mon Sep 17 00:00:00 2001 From: carverh Date: Thu, 21 Jul 2016 14:00:12 -0700 Subject: Cleaned Up --- source/WindowsFormsApplication1/Apps/Terminal.cs | 3943 +++++++++++----------- 1 file changed, 1973 insertions(+), 1970 deletions(-) (limited to 'source/WindowsFormsApplication1/Apps/Terminal.cs') diff --git a/source/WindowsFormsApplication1/Apps/Terminal.cs b/source/WindowsFormsApplication1/Apps/Terminal.cs index 0c78e4e..340cf23 100644 --- a/source/WindowsFormsApplication1/Apps/Terminal.cs +++ b/source/WindowsFormsApplication1/Apps/Terminal.cs @@ -623,1169 +623,1291 @@ namespace ShiftOS } } - public void cmd_dir(String[] args) + public void DoCommand() { - if (API.Upgrades["fileskimmer"]) - { - foreach (var d in Directory.GetDirectories(current_dir)) - { - WriteLine($"[DIR] {new DirectoryInfo(d).Name}"); - } - foreach (var d in Directory.GetFiles(current_dir)) - { - WriteLine($"{new FileInfo(d).Name}"); - } - } - else + API.LastRanCommand = command; + string[] args = command.ToLower().Split(' '); + switch (args[0]) { - wrongcommand(); + case "ls": + case "dir": + cmd_dir(args); + break; + case "cd": + cmd_cd(args); + break; + case "upg": + cmd_upg(args); + break; + case "endgame_test": + cmd_endgame_test(args); + break; + case "htutorial": + cmd_htutorial(args); + break; + case "fake_buy": + cmd_fake_buy(args); + break; + case "connections": + cmd_connections(args); + break; + case "story": + cmd_story(args); + break; + case "make": + cmd_make(args); + break; + case "devupg": + cmd_devupg(args); + break; + case "cheat": + cmd_cheat(args); + break; + case "netgen": + cmd_netgen(args); + break; + case "lua": + cmd_lua(args); + break; + case "hack": + cmd_hack(args); + break; + case "virusscanner": + case "vscan": + case "antivirus": + cmd_vscan(args); + break; + case "infections": + cmd_infections(args); + break; + case "binarywater": + cmd_binarywater(args); + break; + case "color": + cmd_color(args); + break; + case "encrypt": + cmd_encrypt(args); + break; + case "font": + cmd_font(args); + break; + case "colorlist": + cmd_colorlist(args); + break; + case "spkg": + cmd_spkg(args); + break; + case "alias": + cmd_alias(args); + break; + case "username": + cmd_username(args); + break; + case "osname": + cmd_osname(args); + break; + case "unity": + cmd_unity(args); + break; + case "time": + cmd_time(args); + break; + case "saa": + cmd_saa(args); + break; + case "help": + cmd_help(args); + break; + case "codepoints": + case "cp": + cmd_cp(args); + break; + case "shutdown": + cmd_shutdown(args); + break; + case "clear": + cmd_clear(args); + break; + case "close": + cmd_close(args); + break; + case "05tray": + cmd_05tray(args); + break; + case "debug": + cmd_debug(args); + break; + case "echo": + cmd_echo(args); + break; + case "year": + cmd_histacom_year(args); + break; + case "timedistorter": + cmd_histacom_timedistorter(args); + break; + default: + cmd_default(args); + break; } } - public void cmd_cd(String[] args) + private void StartChoice1EndStory() { - if (API.Upgrades["fileskimmer"]) + var t = new System.Windows.Forms.Timer(); + int i = 0; + t.Interval = 4000; + t.Tick += (object s, EventArgs a) => { - if (args[1] == "..") - { - if (GetPath(current_dir) != "/") - { - current_dir = GetParent(current_dir); - SetPrefix($"{API.Username}@{API.OSName} in {GetPath(current_dir)} $> "); - } - else - { - WriteLine("cd: Can't go up past the root."); - } - } - else + switch (i) { - string newdir = current_dir + OSInfo.DirectorySeparator; - foreach (var dir in Directory.GetDirectories(current_dir)) - { - if (new DirectoryInfo(dir).Name.ToLower() == args[1]) - newdir = dir; - } - current_dir = newdir; - SetPrefix($"{API.Username}@{API.OSName} in {GetPath(current_dir)} $> "); + case 0: + WriteLine("User '' connected as '???'"); + break; + case 1: + WriteLine($"???: {API.Username}! What are you doing!?"); + break; + case 2: + WriteLine("???: I went onto the Hacker Alliance room earlier and DevX was on there..."); + break; + case 3: + WriteLine("???: And he told me you SIDED WITH HIM."); + break; + case 4: + WriteLine("???: This is a HUGE mistake! Listen!"); + break; + case 5: + WriteLine("???: He's lying to you. Listen. DevX is not what you think he is."); + break; + case 6: + WriteLine("???: He isn't a human! He's an AI! We were all played!"); + break; + case 7: + WriteLine("???: I'm telling the truth, I swear!"); + break; + case 8: + WriteLine("???: You want proof? - holochat_cmd: ERROR: Remote host closed connection."); + WriteLine("But if he is an AI, who created him?"); + break; + case 9: + WriteLine("spkg: Rebooting system in 8 seconds."); + break; + case 11: + API.Upgrades["titlebar"] = false; + API.Upgrades["windowedterminal"] = false; //terminals must be fullscreen + var trm = new Terminal(); + this.Close(); + API.CreateForm(trm, "Terminal", API.GetIcon("Terminal")); + trm.StartReboot(); + break; } - } + i += 1; + }; + t.Start(); } - public void cmd_upg(String[] args) + public void StartReboot() { - if (API.DeveloperMode) + txtterm.Text = ""; + var t1 = new Thread(new ThreadStart(new Action(() => { - try + Thread.Sleep(500); + WriteLine("shift-init: Disconnecting From System Bus..."); + Thread.Sleep(1000); + this.Invoke(new Action(() => { - switch (args[1]) + txtterm.Text = ""; + })); + Thread.Sleep(1000); + WriteLine("Welcome to ShiftOS."); + Thread.Sleep(500); + WriteLine("Starting core..."); + API.Upgrades["windowedterminal"] = true; + Thread.Sleep(450); + WriteLine($"Your username is {API.Username}."); + Thread.Sleep(100); + WriteLine($"You have {API.Codepoints} Codepoints."); + WriteLine("Loading modules..."); + Thread.Sleep(750); + foreach (var upg in API.Upgrades) + { + if (upg.Value == true) { - case "get": - WriteLine(API.Upgrades[args[2]].ToString()); - break; + WriteLine($"Loaded module {upg.Key}..."); } + Thread.Sleep(100); } - catch + WriteLine("Starting desktop."); + this.Invoke(new Action(() => { - - } - } - else - { - wrongcommand(); - } - } - - public void cmd_endgame_test(String[] args) - { - if (API.DeveloperMode) - { - try - { - switch (args[1]) - { - case "choice_screen": - var cscreen = new ShiftOS.FinalMission.ChooseYourApproach(); - cscreen.WindowState = FormWindowState.Maximized; - //cscreen.TopMost = true; - cscreen.Show(); - break; - case "limitedmode": - API.LimitedMode = !API.LimitedMode; - WriteLine($"Limited mode set to {API.LimitedMode}."); - break; - } - } - catch + var s = new ShiftOSDesktop(); + s.Show(); + s.EndGame_AttachEvents(); + })); + Thread.Sleep(1000); + this.Invoke(new Action(() => { - WriteLine("Invalid arguments."); - } - } - else - { - wrongcommand(); - } - } - - public void cmd_htutorial(String[] args) - { - ShiftOS.Hacking.StartBattleTutorial(); + FinalMission.EndGameHandler.GoToNextObjective(); + })); + API.Upgrades["titlebar"] = true; + }))); + t1.Start(); } - public void cmd_fake_buy(String[] args) + public void Crash() { - if (API.DeveloperMode) + txtterm.Text = ""; + WriteLine(" *** SYSTEM PANIC *** "); + WriteLine(Environment.NewLine); + WriteLine("PANIC_ID: 750_15_4W3S0M3"); + WriteLine("PANIC_DESC: System became too unstable to function properly. In 5 seconds, your session will be resumed."); + var t = new System.Windows.Forms.Timer(); + t.Interval = 1000; + int p = 0; + t.Tick += (object s, EventArgs a) => { - try - { - if (API.Upgrades.ContainsKey(args[1])) - { - API.Upgrades[args[1]] = true; - WriteLine($"Bought upgrade {args[1]}."); - API.CurrentSession.SetupAppLauncher(); - API.UpdateWindows(); - SaveSystem.Utilities.saveGame(); - } - else - { - WriteLine("Upgrade not found."); - } - } - catch + if (p == 4) { - WriteLine("fake_buy: Bad arguments."); + t.Stop(); + this.Close(); } - } - else - { - wrongcommand(); - } + p += 1; + }; + t.Start(); } - public void cmd_connections(String[] args) + private void wrongcommand() { - try - { - switch (args[1]) - { - case "list": - foreach (var client in Package_Grabber.clients) - { - WriteLine($"Hostname: {client.Key}, Port: {client.Value.RemotePort}, Online: {client.Value.IsConnected}"); - } - break; - case "gui": - API.CreateForm(new ConnectionManager(), "Connections", API.GetIcon("Connections")); - break; - case "drop": - foreach (var client in Package_Grabber.clients) - { - Package_Grabber.Disconnect(client.Key); - } - break; - case "add": - string host = args[2]; - int port = 0; - int.TryParse(args[3], out port); - if (!Package_Grabber.clients.ContainsKey(host)) - { - Package_Grabber.ConnectToServer(host, port); - WriteLine("Connection to host established successfully."); - } - else - { - var c = Package_Grabber.clients[host]; - if (c.IsConnected == false) - { - c.Connect(host, port); - WriteLine("Re-established connection with host."); - } - else - { - WriteLine("This host has been connected to already."); - } - } - break; - } - } - catch - { - WriteLine("connections: Missing arguments."); - } + txtterm.Text = txtterm.Text + Environment.NewLine + "Command not recognized - Type 'help' for a list of commands!" + Environment.NewLine; } - public void cmd_story(String[] args) + bool Hacking = false; + + private Control objToWriteTo = null; + private string UpgradeToHack = null; + + public void StartHackingSession(string id) { - if (API.DeveloperMode == true && API.Upgrades["shiftnet"]) - { - try - { - switch (args[1]) - { - case "aidennirh": - StartAidenNirhStory(); - break; - case "devxfurious": - StartDevXFuriousStory(); - break; - case "battletut": - StartHackerBattleIntro(); - break; - case "otherplayer": - StartDevXFuriousStory(); - break; - case "hacker101": - StartHacker101Story(); - break; - } - } - catch - { - WriteLine("Missing arguments."); - } - } - else { wrongcommand(); } + UpgradeToHack = id; + objToWriteTo = txtterm; + Hacking = true; + txtterm.ReadOnly = true; + WriteLine("To continue, choose which way you "); + WriteLine("would like to go about this. "); + WriteLine(" "); + WriteLine("1. Go it alone. "); + WriteLine("2. Hire someone. "); + WriteLine(" "); + WriteLine("Press the key that corresponds to "); + WriteLine("the option you want. "); + } - public void cmd_make(String[] args) + public void showhackinghelp() { - try - { - string path = command.Replace("make ", ""); - string realpath = $"{Paths.SaveRoot}{path.Replace("/", OSInfo.DirectorySeparator)}"; - if (File.Exists(realpath + OSInfo.DirectorySeparator + "main.lua")) - { - WriteLine("Compiling to " + path + ".saa"); - ZipFile.CreateFromDirectory(realpath, realpath + ".saa"); - } - else - { - WriteLine($"make: *** No rule to make target \"{realpath}\". Stop."); - } - } - catch - { - WriteLine("make: Invalid arguments."); - } + WriteLine(" - Hacking - "); + WriteLine(Environment.NewLine + "Hacking allows you to gain more features and upgrades by unlocking more of the OS's capabilities."); + WriteLine(Environment.NewLine + "There are two ways you can execute a hack:"); + WriteLine(" - On your own: It'll take skill, and time, but if you have the correct tools you can do it on your own."); + WriteLine(" - With a more competent partner: You have the option of employing a partner from a list of various hackers. The speed and success of the hack depends on their skill, and how fast they can pull it off. You will need to pay them a fee of Codepoints however. They can also grant you tools to do it on your own."); + WriteLine(Environment.NewLine + "Some hacks are capable of:"); + WriteLine(" - Decreasing or increasing the price of Shiftorium Upgrades"); + WriteLine(" - Decreasing or increasing the amount of Codepoints earned by doing various tasks."); + WriteLine(" - Unlocking more upgrades."); + WriteLine(Environment.NewLine + "To start a hack, go to a locked or empty Shiftorium category and click the \"Hack It\" button."); + API.Upgrades["hacking"] = true; } - public void cmd_devupg(String[] args) + public void showhelp(string topic) { - if (API.DeveloperMode) - { - WriteLine("Upgrading your system..."); - foreach (var upg in Shiftorium.Utilities.GetAvailable()) - { - API.Upgrades[upg.id] = true; - WriteLine("Installed upgrade \"" + upg.Name + "\"..."); - } - API.UpdateWindows(); - API.CurrentSession.SetupDesktop(); - } - else + switch (topic) { - wrongcommand(); + case "hacking": + showhackinghelp(); + break; + default: + WriteLine("No help available for this topic. Try 'help' for general help."); + break; } } - public void cmd_cheat(String[] args) + public void showhelp() { - if (API.DeveloperMode) - { - WriteLine("Opening..."); - - //Apps.Cheats chts = new Apps.Cheats(); - //chts.Show(); - API.CreateForm(new Apps.Cheats(), "Cheats", API.GetIcon("Terminal")); - } - else - { - wrongcommand(); - } + listinfo(); + WriteLine(" "); + listcommands(); + listprograms(); } - public void cmd_netgen(String[] args) + private void listprograms() { - WriteLine("Starting netgen..."); - API.CreateForm(new NetGen(), "Network Generator", API.GetIcon("Terminal")); + WriteLine("Programs installed: " + Environment.NewLine); + WriteLine(" - terminal: A command-line application that lets you run programs in ShiftOS"); + WriteLine(" - shiftorium: An application where you can buy upgrades and new apps using codepoints."); + /* TEMP-REMOVED - I just can't get it to work. + WriteLine(" - jumper: A simple 'jump over the obstacle' game."); + */ + WriteLine(" - knowledge_input: Test your knowledge, and gain some Codepoints too."); + if (API.Upgrades["shifter"] == true) + WriteLine(" - shifter: Allows you to customize ShiftOS."); + if (API.Upgrades["skinning"] == true) + WriteLine(" - skinloader: Load and save ShiftOS skins."); + if (API.Upgrades["pong"] == true) + WriteLine(" - pong: A good ole' game of Pong."); + if (API.Upgrades["fileskimmer"] == true) + WriteLine(" - fileskimmer: Browse the files on your computer."); + if (API.Upgrades["textpad"] == true) + WriteLine(" - textpad: \"Write, save, and open a text document.\" - Philip Adams"); + if (API.Upgrades["artpad"] == true) + WriteLine(" - artpad: A simple, but useful drawing application."); + if (API.Upgrades["shiftnet"] == true) + WriteLine("Also, more apps can be run by opening .saa files. Apps can also be installed using spkg or by double clicking .pkg or .stp files."); } - public void cmd_lua(String[] args) + public void listcommands() { - if (API.DeveloperMode == true) + WriteLine(" == Commands == " + Environment.NewLine); + WriteLine(" - clear: Clears the screen."); + WriteLine(" - shutdown: Shuts down your PC."); + WriteLine(" - codepoints: Shows how many codepoints you have."); + WriteLine(" - help: Shows this screen."); + if (API.Upgrades["secondssincemidnight"] == true) { - try - { - string f = args[1]; - WriteLine(f); - f = command.Remove(0, 4); - WriteLine(f); - string real = $"{Paths.SaveRoot}{f.Replace("/", OSInfo.DirectorySeparator)}"; - WriteLine(real); - if (File.Exists(real)) - { - WriteLine("Running Lua script at " + f + "."); - var l = new LuaInterpreter(real); - } - else - { - WriteLine("Lua script file not found."); - } - } - catch - { - this.LuaMode = true; - this.Interpreter = new LuaInterpreter(); - this.Interpreter.mod.print = new Action((text) => WriteLine(text)); - this.Interpreter.mod.exit = new Action(() => - { - this.LuaMode = false; - this.Interpreter = null; - WriteLine($"{API.CurrentSave.username}@{API.CurrentSave.osname} $> "); - }); - WriteLine("ShiftOS Lua Interpreter - v1.0"); - WriteLine("Created by Michael VanOverbeek"); - WriteLine(Environment.NewLine + "How to use: Simply type some Lua code and watch it come to life. Code can be executed on one line, and unlike most interpreters, you can access code from one line in another."); - WriteLine(Environment.NewLine + "When you're done, simply press the Enter key to execute the code." + Environment.NewLine); - } + WriteLine(" - time: Shows the current time."); } - else + if (API.Upgrades["unitymode"] == true) + WriteLine(" - unity: Toggles Unity Mode."); + if (API.Upgrades["customusername"] == true) { - wrongcommand(); + WriteLine(" - username : Changes your username."); + WriteLine(" - osname : Changes the operating system name."); + } + if (API.Upgrades["shiftnet"] == true) + { + WriteLine(" - saa: Runs a specified .saa file."); + WriteLine(" - spkg: Shiftnet Package Manager (more info at shiftnet://main/spkg"); } } - public void cmd_hack(String[] args) + public void listinfo() { - if (API.Upgrades["hacking"] == true) + WriteLine(SaveSystem.Utilities.LoadedSave.osname + " - Version " + SaveSystem.Utilities.LoadedSave.ingameversion); + WriteLine("==========================" + Environment.NewLine); + WriteLine(" == Info == " + Environment.NewLine); + if (API.Upgrades["applaunchermenu"] == true) { - StartHackingSession("random"); + WriteLine(" - Apps can be run using the App Launcher on the desktop."); } else { - wrongcommand(); + WriteLine(" - Apps can be run by typing their name in the Terminal."); } - } - - public void cmd_vscan(String[] args) - { - if (API.Upgrades["virusscanner"] == true) + if (API.Upgrades["windowedterminal"] == true) { - WriteLine("Scanning for infected files..."); - var goodList = new Dictionary(); - foreach (KeyValuePair kv in Viruses.Infections) - { - if (kv.Value.Contains(";")) - { - foreach (string file in kv.Value.Split(';')) - { - if (goodList.ContainsKey(file)) - { - goodList[file] += ", " + kv.Key; - } - else - { - goodList.Add(file, kv.Key); - } - } - } - else - { - if (goodList.ContainsKey(kv.Value)) - { - goodList[kv.Value] += ", " + kv.Key; - } - else - { - goodList.Add(kv.Value, kv.Key); - } - } - } - WriteLine("Scan complete."); - if (goodList.Count > 0) - { - foreach (KeyValuePair kv in goodList) - { - WriteLine("File " + kv.Key + " is infected with " + kv.Value + ". Disinfecting..."); - Viruses.DisInfect(kv.Key); - } - WriteLine("Disinfection complete."); - } - else - { - WriteLine("No infections found. You are safe."); - } + WriteLine(" - The Terminal runs in a window."); } - } - - public void cmd_infections(String[] args) - { - if (API.DeveloperMode == true) + else { - foreach (KeyValuePair kv in Viruses.Infections) - { - WriteLine(kv.Key + " @ " + kv.Value); - } + WriteLine(" - The Terminal runs fullscreen at all times."); } - else + if (API.Upgrades["titlebar"] == true) { - wrongcommand(); + WriteLine(" - Applications have a titlebar to help distinguish between other apps."); } - } - - public void cmd_binarywater(String[] args) - { - if (API.DeveloperMode) + if (API.Upgrades["windowborders"] == true) { - ShiftOS.Hacking.AddCharacter(new Character("Philip Adams", "Hello, and welcome to another episode of OSFirstTimer.", 100, 100, 0)); - WriteLine("Philip Adams is now in the list of hirable hackers."); - WriteLine("\" I Don't Think This is Canon \" -Carver"); + WriteLine(" - Applications have a window border to help distinguish between other apps."); } - else + if (API.Upgrades["multitasking"] == true) { - WriteLine("I see you went in the ShiftOS source code... ummm yeah... this isn't a developer mode release so I can't just give you a full-skilled hacker even if you beg."); + WriteLine(" - Multiple apps can be run at the same time, and you can even run more than one of the same app!"); } - } - - public void cmd_color(String[] args) - { - try + if (API.Upgrades["movablewindows"] == true) { - if (API.Upgrades["setterminalcolors"] == true) - { - - Color bcol = SetColor(args[1]); - Color tcol = SetColor(args[2]); - API.CurrentSkin.TerminalTextColor = tcol; - API.CurrentSkin.TerminalBackColor = bcol; - - } + WriteLine(" - Applications can be moved using CTRL+W,A,S,D."); } - catch (Exception) + if (API.Upgrades["draggablewindows"] == true) { - WriteLine("color: Missing arguments."); + WriteLine(" - You can drag apps around the screen by dragging their titlebars."); } - } - - public void cmd_encrypt(String[] args) - { - if (API.DeveloperMode == true) + if (API.Upgrades["resizablewindows"] == true) { - string messageToEncrypt = command.Replace("encrypt ", ""); - string encryptedMessage = API.Encryption.Encrypt(messageToEncrypt); - WriteLine("Encrypted Message: " + encryptedMessage); + WriteLine(" - You can resize windows by dragging their borders."); } - else + if (API.Upgrades["panelbuttons"] == true) { - wrongcommand(); + WriteLine($" - A list of open apps is shown at the {API.CurrentSkin.desktoppanelposition.ToLower()} of the screen."); } - } - - public void cmd_font(String[] args) - { - if (API.Upgrades["setterminalfont"] == true) + if (API.Upgrades["usefulpanelbuttons"] == true) { - var fname = command.Replace("font ", ""); - if (GetFonts().Contains(fname)) - { - API.CurrentSkin.TerminalFontStyle = fname; - } - else - { - WriteLine("font: Unrecognized font name \"" + fname + "\". Note: Font names are case sensitive."); - } + WriteLine(" - You can minimize and restore apps using the panel buttons."); } - else + if (API.Upgrades["titletext"] == true) { - wrongcommand(); + WriteLine(" - Apps display their names on the titlebar."); } - } - - public void cmd_colorlist(String[] args) - { - if (API.Upgrades["setterminalcolors"] == true) + if (API.Upgrades["appicons"] == true) { - foreach (string itm in GetColorList()) - { - WriteLine(itm); - } + WriteLine(" - Apps display their icons, and they are displayed in their titlebars."); } - else + if (API.Upgrades["autoscrollterminal"] == true) { - wrongcommand(); + WriteLine(" - The Terminal will automatically scroll to the bottom."); + } + if (API.Upgrades["terminalscrollbar"] == true) + { + WriteLine(" - You can scroll up and down the Terminal's buffer."); + } + if (API.Upgrades["zoomableterminal"] == true) + { + WriteLine(" - You can zoom the Terminal in and out by holding CTRL and scrolling up or down."); } } - public void cmd_spkg(String[] args) + + // ERROR: Handles clauses are not supported in C# + private void tmrfirstrun_Tick(object sender, EventArgs e) { - if (!API.LimitedMode) + switch (firstrun) { - if (API.Upgrades["shiftnet"] == true) - { - try - { - switch (args[1].ToLower()) - { - case "install": - if (args[2] != null && args[2] != "") - { - string pkgname = args[2].ToLower().Replace(".pkg", ""); - if (Package_Grabber.GetPackage(pkgname) == true) - { - WriteLine("Downloaded package '" + pkgname + "' from shiftnet://main/spkg/ successfully. Installing now."); - string r = Package_Grabber.ExtractPackage(); - if (r == "fail") - { - WriteLine("[FATAL] Could not install package."); - WriteLine("spkg: Killed."); - } - else - { - WriteLine("Extracted " + pkgname + " to " + r + "..."); - var res2 = Package_Grabber.InstallPackage(r + "\\"); - if (res2 != "success") - { - WriteLine("[FATAL] Could not install package. " + res2); - WriteLine("spkg: Killed."); - } - else - { - WriteLine("[DONE] Package installed."); - } - } - } - else - { - WriteLine("spkg: Package '" + args[2] + "' not found."); - } - } - break; - default: - WriteLine("spkg: Invalid argument: " + args[1]); - break; - } - } - catch (Exception ex) - { - WriteLine("spkg: " + ex.Message); - } + case 1: + txtterm.Text = txtterm.Text + "Installation Successfull" + Environment.NewLine; + blockctrlt = true; + break; + case 2: + txtterm.Text = txtterm.Text + "IP 199.108.232.1 Connecting..." + Environment.NewLine + "User@" + SaveSystem.Utilities.LoadedSave.osname + " $> "; + API.PlaySound(Properties.Resources.dial_up_modem_02); + break; + case 12: + txtterm.Text = txtterm.Text + "IP 199.108.232.1 Connected!" + Environment.NewLine + "User@" + SaveSystem.Utilities.LoadedSave.osname + " $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 15: + txtterm.Text = txtterm.Text + "DevX: Hi, my name is DevX and you are now using an early version of my operating system \"ShiftOS\"." + Environment.NewLine + "User@ShiftOS $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 22: + txtterm.Text = txtterm.Text + "DevX: Currently the terminal is open and I am using it to communicate with you remotely." + Environment.NewLine + "User@ShiftOS $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 28: + txtterm.Text = txtterm.Text + "DevX: ShiftOS is going to be the most revolutionary operating system in the world that will run on every electronic device you can think of." + Environment.NewLine + "User@ShiftOS $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 36: + txtterm.Text = txtterm.Text + "DevX: I can't tell you much about my future plans right now but if you can help me then I may tell you more in future" + Environment.NewLine + "User@ShiftOS $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 44: + txtterm.Text = txtterm.Text + "DevX: ShiftOS is barely usable in it's current state so I need you to help me evolve it using codepoints" + Environment.NewLine + "User@ShiftOS $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 50: + txtterm.Text = txtterm.Text + "DevX: Once you acquire codepoints you can use them to upgrade certain components of ShiftOS or add new software" + Environment.NewLine + "User@ShiftOS $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 59: + txtterm.Text = txtterm.Text + "DevX: I'll close the terminal now and send you to the blank ShiftOS desktop" + Environment.NewLine + "User@ShiftOS $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 65: + txtterm.Text = txtterm.Text + "DevX: You can open and close the terminal at any time by pressing CTRL + T" + Environment.NewLine + "User@ShiftOS $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 70: + txtterm.Text = txtterm.Text + "DevX: Once you are on the desktop open the terminal, type \"help\" and then press enter for a guide on using ShiftOS" + Environment.NewLine + "User@ShiftOS $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 80: + txtterm.Text = txtterm.Text + "DevX: Gotta run now but I'll contact you soon to see how you are going with evolving ShiftOS for me while I... Work on something else" + Environment.NewLine + "User@ShiftOS $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 89: + txtterm.Text = txtterm.Text + "DevX: Remember to always click the black desktop first and then press press CTRL + T to open the terminal otherwise the terminal won't open!" + Environment.NewLine + "User@ShiftOS $> "; + API.PlaySound(Properties.Resources.writesound); + break; + case 94: + API.PlaySound(Properties.Resources.typesound); + txtterm.Text = "User@" + SaveSystem.Utilities.LoadedSave.osname + " $> "; + tmrfirstrun.Stop(); + this.Close(); + blockctrlt = false; + SaveSystem.Utilities.saveGame(); + break; + } + firstrun = firstrun + 1; + txtterm.SelectionStart = txtterm.TextLength; + } + + public void runterminalfile(string path) + { + if (File.Exists(path)) + { + string[] cmds = File.ReadAllLines(path); + foreach (string cmd in cmds) + { + command = cmd; + DoCommand(); + } + } + } + + // ERROR: Handles clauses are not supported in C# + private void tmrshutdown_Tick(object sender, EventArgs e) + { + Application.Exit(); + } + + public void WriteLine(string text) + { + API.CurrentSession.Invoke(new Action(() => + { + if (txtterm.Text.Length > 0) + { + txtterm.Text += Environment.NewLine + text; } else { - wrongcommand(); + txtterm.Text += text; } + txtterm.Select(txtterm.TextLength, 0); + txtterm.ScrollToCaret(); + })); + } + private bool Zooming = false; + + private void ScrollDeactivate(object sender, KeyEventArgs e) + { + if (Zooming == true) + { + Zooming = false; + } + } + + private int ZoomMultiplier = 1; + + private void ResetTerminalFont() + { + string fname = "Font"; + if (API.Upgrades["setterminalfont"] == true) + { + fname = API.CurrentSkin.TerminalFontStyle; } else { - try - { - if (args[2] == "god_utils") - { - if (FinalMission.EndGameHandler.GodModeInstallEnabled == true) - { - var t = new Thread(new ThreadStart(new Action(() => - { - WriteLine("Downloading package 'god_utils'... Please wait."); - Thread.Sleep(10000); - WriteLine("Download complete."); - Thread.Sleep(100); - WriteLine("Beginning installation."); - Thread.Sleep(1000); - WriteLine(@" == GOD MODE == + fname = OSInfo.GetMonospaceFont(); + } + int fsize = 9 * ZoomMultiplier; + try + { + txtterm.Font = new Font(fname, fsize); + } + catch + { + txtterm.Font = new Font(fname, 9); + } + } -God Mode gives you FULL control of ShiftOS. You can add/remove Codepoints, buy or unbuy Shiftorium upgrades, and can do whatever you want. + private void Zoom(object sender, ScrollEventArgs e) + { -Installing core applications..."); - Thread.Sleep(250); - WriteLine("Installing subpackage 'json_edit'..."); - Thread.Sleep(250); - WriteLine("Installing subpackage 'upgrade_mod'..."); - Thread.Sleep(100); - WriteLine("Installing subpackage 'hijacker'..."); - Thread.Sleep(500); - WriteLine(@" == HIJACKER by DevX == + } -HIJACKER is a utility that allows you to hijack any system and install ShiftOS on it during a hacker battle."); - Thread.Sleep(100); - WriteLine("[hijacker] Injecting HIJACKER code into hbattleui.sft..."); - Thread.Sleep(150); - WriteLine("[hijacker] Done."); - this.Invoke(new Action(() => - { - StartChoice1EndStory(); - })); - }))); - t.Start(); - } - else - { - WriteLine("spkg: Package '" + args[2] + "' not found."); - } - } - else - { - WriteLine("spkg: Package '" + args[2] + "' not found."); - } - } - catch + private void ScrollTerm(object sender, MouseEventArgs e) + { + if (Zooming == true) + { + + } + else + { + if (API.Upgrades["terminalscrollbar"] == true) { - WriteLine("spkg: Missing arguments."); + txtterm.ScrollBars = ScrollBars.Vertical; } } } - public void cmd_alias(String[] args) + private void tmrsetfont_Tick(object sender, EventArgs e) + { + ResetTerminalFont(); + if (API.Upgrades["setterminalcolors"] == true) + { + txtterm.BackColor = API.CurrentSkin.TerminalBackColor; + txtterm.ForeColor = API.CurrentSkin.TerminalTextColor; + } + } + + public void ShowTools() { + txtterm.Text = ""; try { - switch (args[1]) - { - case "-?": - case "--help": - WriteLine("Aliases Help" + Environment.NewLine); - WriteLine("Alias is a command that lets you create aliases for other commands. You could make a command 'upgrade' alias 'shiftorium' if you wanted." + Environment.NewLine); - WriteLine("Arguments:"); - WriteLine(" -h, --help: Displays this screen."); - WriteLine("-a, --add : Adds a new alias."); - WriteLine("-d, --delete : Deletes an alias."); - WriteLine("-l, --list: Shows all available aliases."); - break; - case "--add": - case "-a": - if (API.AddAlias(args[2], command.Replace("alias " + args[1] + " " + args[2] + " ", ""))) - { - WriteLine("Alias added successfully."); - API.SaveAliases(); - } - else - { - WriteLine("That alias already exists."); - } - break; - case "--delete": - case "-d": - if (API.RemoveAlias(args[2]) == true) - { - WriteLine("Alias \"" + args[2] + "\" removed successfully."); - API.SaveAliases(); - } - else - { - WriteLine("That alias doesn't exist."); - } - break; - case "-l": - case "--list": - WriteLine("Aliases:"); - foreach (KeyValuePair kv in API.CommandAliases) - { - WriteLine(kv.Key + " => " + kv.Value); - } - break; - default: - WriteLine("alias: Invalid argument. Try alias --help for help with the Alias command."); - break; - } + var h = ShiftOS.Hacking.Tools[SelectedCharacter]; + WriteLine(" == Attack Select =="); + WriteLine($"Attack: {SelectedCharacter + 1}/{ShiftOS.Hacking.Tools.Count}"); + WriteLine($"Name: {h.Name}"); + WriteLine($"Effectiveness: {h.Effectiveness}"); + WriteLine($"Description: {h.Description}"); + WriteLine(Environment.NewLine + "LEFT: Previous Attack, RIGHT: Next Attack, ENTER: Confirm"); } catch { - WriteLine("alias: Missing arguments. Try alias --help for help with the Alias command."); + WriteLine("There are no entries to display in this list."); } } - public void cmd_username(String[] args) + private void Hack_ShowCharacters() { - if (API.Upgrades["customusername"] == true) - { - try - { - API.CurrentSave.username = args[1]; - } - catch - { - WriteLine("username: Missing arguments."); - } - } - else + switch (SelectedMode) { - wrongcommand(); + case 1: + ShiftOS.Hacking.GetCharacters(); + SelectedCharacter = 0; + ShowTools(); + break; + case 2: + ShiftOS.Hacking.GetCharacters(); + SelectedCharacter = 0; + ShowChar(); + break; } } - public void cmd_osname(String[] args) + private void InstallMidGameDesktop() { - if (API.Upgrades["customusername"] == true) - { - try - { - API.CurrentSave.osname = args[1]; - } - catch - { - WriteLine("osname: Missing arguments."); - } - } - else - { - wrongcommand(); - } + //throw new NotImplementedException(); } - public void cmd_unity(String[] args) + int SelectedMode = 0; + int SelectedCharacter = 0; + + public void ShowChar() { - if (API.Upgrades["unitymode"] == true) - { - API.CurrentSession.SetUnityMode(); - API.CurrentSession.SetupDesktop(); - txtterm.Focus(); - } - else - { - wrongcommand(); - } + txtterm.Text = ""; + var h = ShiftOS.Hacking.Characters[SelectedCharacter]; + WriteLine(" == Partner Select =="); + WriteLine($"Partner: {SelectedCharacter + 1}/{ShiftOS.Hacking.Characters.Count}"); + WriteLine($"Name: {h.Name}"); + WriteLine($"Skill: {h.Skill}/100"); + WriteLine($"Speed: {h.Speed}/100"); + WriteLine($"Cost: {h.Cost}"); + WriteLine($"Bio: {h.Bio}"); + WriteLine(Environment.NewLine + "LEFT: Previous Partner, RIGHT: Next Partner, ENTER: Confirm"); } - public void cmd_time(String[] args) + public void StartShellShock() { - if (API.Upgrades["pmandam"] == false) + var t = new Thread(new ThreadStart(new Action(() => { - if (API.Upgrades["hourssincemidnight"] == false) + Thread.Sleep(300); + WriteLine("Sending false packet to shiftnet://devx/tracker..."); + Thread.Sleep(100); + WriteLine("Awaiting reply from server..."); + Thread.Sleep(5000); + WriteLine("Got reply with header \"SOS_TRK_GET\"."); + Thread.Sleep(50); + WriteLine("[kernel] Sending usage log to server..."); + WriteLine("Intercepting outgoing request..."); + Thread.Sleep(200); + WriteLine("Got packet contents..."); + Thread.Sleep(25); + WriteLine("Sifting..."); + Thread.Sleep(500); + WriteLine("Found connection data for shiftnet://devx/tracker."); + Thread.Sleep(100); + WriteLine(@"Username: devx +Password: z7fjsd3"); + Thread.Sleep(100); + WriteLine("Authenticating with SSH server on shiftnet://devx/tracker running Ubuntu 666..."); + Thread.Sleep(1000); + WriteLine("[SSH] Access granted."); + Thread.Sleep(100); + WriteLine($"[Message] ???: We're in. In about 75 seconds DevX's server will go down. It'll be quite cool actually, Don't know if you've ever seen a forkbomb in action, but because you're in an SSH session with DevX's server and I'm also controlling the same session you're gonna see one. Oh, yeah, this server's the only one of his that doesn't actually run ShiftOS."); + Thread.Sleep(25000); + this.Invoke(new Action(() => { - if (API.Upgrades["minutessincemidnight"] == false) + txtterm.Text = ""; + })); + int i = 60; + while (i >= 1) + { + Thread.Sleep(1000); + WriteLine($"Beginning attack on server in {i} seconds."); + i -= 1; + } + WriteLine("[devx@tracker ~]$ "); + string cmd = ":`(`)`{` `:`|`:` `&` `}`;`:"; // yep. I'm pretending to use a forkbomb on DevX's server. This'll be FUN to code. + foreach (string c in cmd.Split('`')) + { + Thread.Sleep(100); + this.Invoke(new Action(() => { - if (API.Upgrades["secondssincemidnight"] == true) - { - WriteLine("Since midnight, " + API.GetTime() + " seconds have passed."); - } - else - { - wrongcommand(); - } - } - else + txtterm.Text += c; + })); + } + WriteLine("[devx@tracker ~]$ "); + WriteLine("[Message] ???: Alright. I entered the command for you. Looks like it did nothing. DevX wouldn't even know what's happening... but keep your terminal open for 30 seconds."); + Thread.Sleep(30000); + this.Invoke(new Action(() => + { + FinalMission.EndGameHandler.GoToNextObjective(); + })); + int progress = 0; + while (progress <= 10000) + { + int r = new Random().Next(0, 1); + switch (r) { - WriteLine("Since midnight, " + API.GetTime() + " minutes have passed."); + case 0: + WriteLine("-bash: fork: Resource temporarily unavailable"); + break; + case 1: + WriteLine("-bash: fork: retry: Resource temporarily unavailable"); + break; } + Thread.Sleep(progress / 10); + progress++; } - else + WriteLine("[SSH] Connection to server dropped."); + this.Invoke(new Action(() => { - WriteLine("Since Midnight, " + API.GetTime() + " hours have passed."); - } - } - else - { - WriteLine("Current time: " + API.GetTime()); - } + FinalMission.EndGameHandler.GoToNextObjective(); + })); + this.Invoke(new Action(() => { this.Close(); })); + }))); + t.Start(); } - public void cmd_saa(String[] args) + internal void StartBridgeToMidGame() { - if (API.Upgrades["shiftnet"]) + var t2 = new System.Windows.Forms.Timer(); + t2.Interval = 4000; + int i2 = 0; + t2.Tick += (object s, EventArgs e) => { - var f = command.Replace("saa ", ""); - if (f.StartsWith("/")) + switch (i2) { - var withoutslash = f.Remove(0, 1); - var dirsep = OSInfo.DirectorySeparator; - var rightdir = $"{Paths.SaveRoot}{dirsep}{f.Replace("/", dirsep)}"; - if (File.Exists(rightdir)) - { - var finf = new FileInfo(rightdir); - if (finf.Extension == ".saa") + case 0: + if (API.Upgrades["hacker101"] == true) { - API.LaunchMod(finf.FullName); + WriteLine("Hacker101: Hello. We meet again. The Other Player told me about your situation."); } else { - WriteLine("saa: Cannot launch the file '" + finf.FullName + " because it isn't a valid stand-alone app."); + API.Upgrades["hacker101"] = true; + WriteLine("Hacker101: The Other Player told me about your situation."); } - } - else - { - WriteLine("saa: Cannot launch the file '" + f + "' because it doesn't exist."); - } - } - else - { - WriteLine("saa: Cannot launch the file '" + f + "' because it doesn't exist."); - } - } - else - { - wrongcommand(); - } - } - - public void cmd_help(String[] args) - { - try - { - showhelp(args[1]); - } - catch - { - showhelp(); - } - } + break; + case 1: + WriteLine("Hacker101: Lemme guess. DevX found out about you having the Shiftnet, didn't he..."); + break; + case 2: + WriteLine("Hacker101: Well I guess we'll have to fight fire with fire. You remember that person who told you about Hacker Battles?"); + break; + case 3: + WriteLine("Hacker101: It's time you know who he is. He is, in fact, me, and to continue on about Hacker Battles..."); + break; + case 4: + WriteLine("Hacker101: I can help you take down DevX, but we'll need to take down his defenses and get into his network."); + break; + case 5: + WriteLine("Hacker101: DevX's network of servers is larger than any datacenter on Earth, and it'll take time to plan the perfect attack."); + break; + case 6: + WriteLine("Hacker101: Think of it this way. DevX has a network of networks, each with their own leader."); + break; + case 7: + WriteLine("Hacker101: I can help you find these networks, but it's up to you to take 'em down."); + break; + case 8: + WriteLine("Hacker101: Of course, it's hard to hack a network if you don't know how to start a battle."); + break; + case 9: + WriteLine("Hacker101: Introducing the Battle Preparation Screen."); + break; + case 10: + WriteLine("Hacker101: It'll show you any network I've found, and it'll tell you some useful info about it."); + break; + case 11: + WriteLine("Hacker101: However the spkg package for this thing is HUGE, and will require lots of tweaks to the ShiftOS desktop. spkg will hopefully administer the tweaks for you, but here's a rundown of what'll happen."); + break; + case 12: + WriteLine("Hacker101: For one, you'll be able to have multiple desktop panels to fit more widgets on them."); + break; + case 13: + WriteLine("Hacker101: And if you have the App Launcher, it will get sorted so it doesn't take up the entire screen when you get so many applications installed."); + break; + case 14: + WriteLine("Hacker101: And the rest is a surprise. I'll initiate the install sequence."); + break; + case 15: + InstallMidGameDesktop(); + break; + } + i2 += 1; + }; - public void cmd_cp(String[] args) - { - WriteLine("You have " + API.Codepoints.ToString() + " Codepoints."); - } + var t = new System.Windows.Forms.Timer(); + t.Interval = 4000; + int i = 0; - public void cmd_shutdown(String[] args) - { - API.ShutDownShiftOS(); - } + t.Tick += (object s, EventArgs a) => + { - public void cmd_clear(String[] args) - { - txtterm.Text = ""; - } - public void cmd_close(String[] args) - { - if (command.Contains("close ")) - { - var pid = command.Replace("close ", ""); - if (API.CloseProgram(pid) == true) - { - WriteLine("Closed all running " + pid + "s."); - } - else + switch (i) { - WriteLine("No processes with id '" + pid + "' were found!"); + case 0: + WriteLine("IP connecting as Hacker101..."); + break; + case 1: + WriteLine("Hacker101: Hello, ShiftOS user. I am a hacker."); + break; + case 2: + if (API.BitnoteAddress != null) + { + WriteLine($"Hacker101: I can prove it. You have {API.Codepoints} Codepoints, your Bitnote Address is {API.BitnoteAddress.Address}, and you have {API.BitnoteAddress.Bitnotes}. That's your private address, by the way."); + } + else + { + WriteLine($"Hacker101: I can prove it. You have {API.Codepoints} Codepoints, and you do not have a Bitnote Address."); + } + break; + case 3: + WriteLine("Hacker101: Enough fun in games. Listen. There are two things you need to know."); + break; + case 4: + WriteLine("Hacker101: Thing #1. DevX isn't real."); + break; + case 5: + WriteLine("Hacker101: I've decompiled parts of ShiftOS. And you know what I found?"); + break; + case 6: + WriteLine("Hacker101: Everything DevX says. Everything he does. Everything he THINKS. It's all hardcoded directly into ShiftOS's core."); + break; + case 7: + WriteLine("Hacker101: Want proof? Here. I'll run a quick Lua script for you."); + string DecompiledCode = Properties.Resources.DecompiledCode; + var l = new LuaInterpreter(); + Form win = l.mod.create_window("Decompiled Code", null, 720, 480); + TextBox txt = new TextBox(); + txt.Multiline = true; + txt.Text = Properties.Resources.DecompiledCode; + txt.BorderStyle = BorderStyle.None; + txt.BackColor = Color.Black; + txt.ForeColor = Color.White; + txt.Font = new Font(OSInfo.GetMonospaceFont(), 9); + l.mod.set_dock(txt, "fill"); + l.mod.add_widget_to_window(win, txt); + break; + case 8: + WriteLine("Hacker101: Not only is that some nice, smokin' fresh C# code directly from ShiftOS, but that's a nice steaming pile of bird poop on DevX's doorstep."); + break; + case 9: + WriteLine("Hacker101: Thing #2. The Shiftnet holds some secrets."); + break; + case 10: + WriteLine("Hacker101: What kind of secrets, I hear you ask through your microphone (jesus, do you seriously talk to us with your voice? Are you that bored?)"); + break; + case 11: + WriteLine("Hacker101: Well. I'm talking, pieces of a Lua script that could help stop DevX dead in his digital tracks."); + break; + case 12: + WriteLine("Hacker101: All you gotta do is use my decryption utilities to find the pieces of this encrypted script, download them, decrypt them, and the utility will automatically piece them together for you."); + break; + case 13: + WriteLine("Hacker101: Shiftnet pages ending with .enc are your best bet."); + break; + case 14: + WriteLine("Hacker101: You can install the utilities using spkg install secret."); + break; + case 15: + WriteLine("Hacker101: Then, when the application installs, run it, and use the password 'binary_hell' to install the REAL utilities."); + break; + case 16: + WriteLine("Hacker101: Anyways, that wraps that up. But hang on. One more thing..."); + t.Stop(); + ShiftOS.Hacking.AddCharacter(new Character("Hacker101", "Let's get the job done.", 75, 45, 5)); + t2.Start(); + break; } + i += 1; + }; + if (API.Upgrades["hacker101"] == true) + { + t2.Start(); } else { - WriteLine("Insufficient arguments."); + t.Start(); } + + } - public void cmd_05tray(String[] args) + internal void StartAidenNirhStory() { - if (API.DeveloperMode == true) - { - API.AddCodepoints(500); - WriteLine("You've been granted 500 Codepoints."); - } - else + var t = new System.Windows.Forms.Timer(); + t.Interval = 4000; + int i = 0; + t.Tick += (object s, EventArgs a) => { - wrongcommand(); - } + switch (i) + { + case 0: + WriteLine("User 151.43.85.33 connecting as \"Aiden\"..."); + break; + case 2: + WriteLine($"Aiden: Hey there, {API.Username}1 I'm Aiden Nirh."); + break; + case 3: + WriteLine("Aiden: Have you seen Appscape?"); + break; + case 4: + WriteLine("Aiden: It's my package manager for ShiftOS. It's pretty neat."); + break; + case 5: + WriteLine("Aiden: You should check it out, it's on the Shiftnet at shiftnet://main/appscape!"); + break; + case 6: + WriteLine("Aiden: But remember, when browsing the Shiftnet try not to venture from the main server!"); + break; + case 7: + API.Upgrades["aidennirh"] = true; + t.Stop(); + this.Close(); + break; + } + i += 1; + }; + t.Start(); } - public void cmd_debug(String[] args) + internal void StartHacker101Story() { - if (API.DeveloperMode == true) - { - try - { - switch (args[1].ToLower()) - { - case "shiftnet-story": - WriteLine("Debugging Shiftnet Story..."); - StartShiftnetStory(); - break; - case "devmode": - API.DeveloperMode = false; - WriteLine("Turned off developer mode. Use the passcode to turn it back on."); - break; - default: - WriteLine("Invalid argument: " + args[1] + ". Debug can only debug the following: 'shiftnet-story'."); - break; - } + var t = new System.Windows.Forms.Timer(); + t.Interval = 4000; + int i = 0; - } - catch (Exception ex) - { - WriteLine("debug: " + ex.Message); - } - } - else + t.Tick += (object s, EventArgs a) => { - try + switch (i) { - switch (args[1].ToLower()) - { - case "developers123": - WriteLine("Turned Developer Mode on!"); - API.DeveloperMode = true; - break; - default: - WriteLine("debug: lp0 is on fire"); // Keeps Cheaters from Flooding The Fourms With "The Debug Mode Doesn't Work" - break; - } - } - catch - { - WriteLine("debug: lp0 is on fire"); // Keeps Cheaters from Flooding The Fourms With "The Debug Mode Doesn't Work" + case 0: + WriteLine("IP connecting as Hacker101..."); + break; + case 1: + WriteLine("Hacker101: Hello, ShiftOS user. I am a hacker."); + break; + case 2: + if (API.BitnoteAddress != null) + { + WriteLine($"Hacker101: I can prove it. You have {API.Codepoints} Codepoints, your Bitnote Address is {API.BitnoteAddress.Address}, and you have {API.BitnoteAddress.Bitnotes}. That's your private address, by the way."); + } + else + { + WriteLine($"Hacker101: I can prove it. You have {API.Codepoints} Codepoints, and you do not have a Bitnote Address."); + } + break; + case 3: + WriteLine("Hacker101: Enough fun in games. Listen. There are two things you need to know."); + break; + case 4: + WriteLine("Hacker101: Thing #1. DevX isn't real."); + break; + case 5: + WriteLine("Hacker101: I've decompiled parts of ShiftOS. And you know what I found?"); + break; + case 6: + WriteLine("Hacker101: Everything DevX says. Everything he does. Everything he THINKS. It's all hardcoded directly into ShiftOS's core."); + break; + case 7: + WriteLine("Hacker101: Want proof? Here. I'll run a quick Lua script for you."); + string DecompiledCode = Properties.Resources.DecompiledCode; + var l = new LuaInterpreter(); + Form win = l.mod.create_window("Decompiled Code", null, 720, 480); + TextBox txt = new TextBox(); + txt.Multiline = true; + txt.Text = Properties.Resources.DecompiledCode; + txt.BorderStyle = BorderStyle.None; + txt.BackColor = Color.Black; + txt.ForeColor = Color.White; + txt.Font = new Font(OSInfo.GetMonospaceFont(), 9); + l.mod.set_dock(txt, "fill"); + l.mod.add_widget_to_window(win, txt); + break; + case 8: + WriteLine("Hacker101: Not only is that some nice, smokin' fresh C# code directly from ShiftOS, but that's a nice steaming pile of bird poop on DevX's doorstep."); + break; + case 9: + WriteLine("Hacker101: Thing #2. The Shiftnet holds some secrets."); + break; + case 10: + WriteLine("Hacker101: What kind of secrets, I hear you ask through your microphone (jesus, do you seriously talk to us with your voice? Are you that bored?)"); + break; + case 11: + WriteLine("Hacker101: Well. I'm talking, pieces of a Lua script that could help stop DevX dead in his digital tracks."); + break; + case 12: + WriteLine("Hacker101: All you gotta do is use my decryption utilities to find the pieces of this encrypted script, download them, decrypt them, and the utility will automatically piece them together for you."); + break; + case 13: + WriteLine("Hacker101: Shiftnet pages ending with .enc are your best bet."); + break; + case 14: + WriteLine("Hacker101: You can install the utilities using spkg install secret."); + break; + case 15: + WriteLine("Hacker101: Then, when the application installs, run it, and use the password 'binary_hell' to install the REAL utilities."); + break; + case 16: + WriteLine("Hacker101: Now go. We need that script. I know a friend who will help you get your hard drive back from DevX if you can do this."); + t.Stop(); + ShiftOS.Hacking.AddCharacter(new Character("Hacker101", "Let's get the job done.", 75, 45, 5)); + API.Upgrades["hacker101"] = true; + this.Close(); + break; } - } - } - - public void cmd_echo(String[] args) - { - if (command.Contains("echo ")) - { - WriteLine(command.Replace("echo ", "")); - } - else - { - WriteLine("echo: Insufficient Parameters."); - } + i += 1; + }; + t.Start(); } - public void cmd_default(String[] args) + internal void StartOtherPlayerSysFix() { - if (API.OpenProgram(args[0]) == false) + var t = new System.Windows.Forms.Timer(); + t.Interval = 4000; + int i = 0; + t.Tick += (object s, EventArgs a) => { - if (API.Upgrades["trmfiles"] == false) + switch (i) { - bool done = false; - foreach (KeyValuePair kv in API.CommandAliases) - { - if (kv.Key == command) + case 0: + WriteLine("User connected as ???."); + break; + case 1: + if (API.Upgrades["otherplayerstory"] == true) { - command = kv.Value; - done = true; - DoCommand(); + WriteLine($"???: {API.Username}! Did he find out? Oh God, I hope he can see this..."); } - - } - if (done == false) - { - wrongcommand(); - } - } - else - { - var f = command.Replace("\\", "/"); - if (f.StartsWith("/")) - { - var withoutslash = f.Remove(0, 1); - var dirsep = OSInfo.DirectorySeparator; - var proper = $"{Paths.SaveRoot}{dirsep}{withoutslash.Replace("/", dirsep)}"; - if (File.Exists(proper)) + else { - runterminalfile(proper); + WriteLine("???: Hello? Uhhhh, is this stupid thing working?"); + } + break; + case 2: + if (API.Upgrades["otherplayerstory"] == true) + { + WriteLine("???: Ahh. Good. You can read this. It's me, the other player."); } else { - wrongcommand(); + WriteLine("???: Thank heaven. You can hear me. Don't ask who I am."); } - } - else - { - bool done = false; - foreach (KeyValuePair kv in API.CommandAliases) + break; + case 3: + WriteLine("???: Looks like DevX hit you hard. Guess he found out you had the Shiftnet."); + break; + case 4: + WriteLine("???: Relax. It's not your fault."); + break; + case 5: + WriteLine("???: Actually, the Shiftnet regularly sends data about it's usage, unencrypted, directly to DevX."); + break; + case 6: + WriteLine("???: This code seems to be embedded into all .saa files. It's actually how I found out about you."); + break; + case 7: + WriteLine("???: It seems weird, I know, but everytime you run a .saa file, an uplink is made to DevX's servers"); + break; + case 8: + if (API.Upgrades["otherplayerstory"] == true) { - if (kv.Key == command) - { - command = kv.Value; - done = true; - DoCommand(); - } - + WriteLine("???: And, well, I think we could use this. I'll see if Hacker101 can track this uplink. If he can, you will know it the next time you run a .saa."); } - if (done == false) + else { - wrongcommand(); + WriteLine("???: And, well, I think we could use this. I have a friend who's good with his hacking skills. I'll see if he can help you stop DevX dead. If he can, he will contact you next time you run a .saa."); } - } + break; + case 9: + WriteLine("???: Anyways, connected to your system, I can see your desktop. Looks pretty messed up, huh?"); + break; + case 10: + WriteLine("???: You're lucky you don't have the Windows Everywhere virus."); + break; + case 11: + Viruses.InfectFile(Paths.Drivers + "Keyboard.dri", Viruses.VirusID.WindowsEverywhere); + Viruses.CheckForInfected(); + WriteLine("???: Crap! I spoke too soon."); + break; + case 12: + WriteLine("???: Alright. I'll see if I can hijack your Shiftorium Registry, install a virus scanner, and get rid of the viruses."); + break; + case 13: + API.Upgrades["virusscanner"] = true; + var trm = new Terminal(); + API.CreateForm(trm, API.LoadedNames.TerminalName, Properties.Resources.iconTerminal); + trm.command = "vscan"; + trm.DoCommand(); + break; + case 14: + WriteLine("???: All better. I hope. As for those random files on your desktop, well, it seems DevX dropped some sort of secret message onto your system."); + break; + case 15: + WriteLine("???: Go ahead and try to decrypt it. The Shiftnet Lua API is very useful."); + break; + case 16: + if (API.Upgrades["otherplayerstory"] == true) + { + WriteLine("???: Anyways, I'm gonna go work with Hacker101, discuss those .saa uplinks, and see if we can come up with a suitable attack plan."); + } + else + { + WriteLine("???: Well, your system is all better. You don't have to thank me. Just, when you open a .saa file, I'll try to contact you if I'm not busy."); + } + break; + case 17: + WriteLine("???: Talk to you soon. And, remember. ShiftOS is like a forest. DevX is the predator, you are the prey. Watch your back."); + break; + case 18: + t.Stop(); + this.Close(); + API.Upgrades["otherplayerrescue"] = true; + break; } - } - } - - // HISTACOM REFERENCES, DO NOT REMOVE, CRUCIAL FOR SECRET STORY ARC - public void cmd_histacom_year(String[] args) - { - WriteLine("Year: 2002"); - } - - public void cmd_histacom_timedistorter(String[] args) - { - WriteLine("Install 'timedistorter' by going to shiftnet://12padams"); + i += 1; + }; + t.Start(); } - public void DoCommand() + internal void StartHackerBattleIntro() { - API.LastRanCommand = command; - string[] args = command.ToLower().Split(' '); - switch (args[0]) - { - case "ls": - case "dir": - cmd_dir(args); - break; - case "cd": - cmd_cd(args); - break; - case "upg": - cmd_upg(args); - break; - case "endgame_test": - cmd_endgame_test(args); - break; - case "htutorial": - cmd_htutorial(args); - break; - case "fake_buy": - cmd_fake_buy(args); - break; - case "connections": - cmd_connections(args); - break; - case "story": - cmd_story(args); - break; - case "make": - cmd_make(args); - break; - case "devupg": - cmd_devupg(args); - break; - case "cheat": - cmd_cheat(args); - break; - case "netgen": - cmd_netgen(args); - break; - case "lua": - cmd_lua(args); - break; - case "hack": - cmd_hack(args); - break; - case "virusscanner": - case "vscan": - case "antivirus": - cmd_vscan(args); - break; - case "infections": - cmd_infections(args); - break; - case "binarywater": - cmd_binarywater(args); - break; - case "color": - cmd_color(args); - break; - case "encrypt": - cmd_encrypt(args); - break; - case "font": - cmd_font(args); - break; - case "colorlist": - cmd_colorlist(args); - break; - case "spkg": - cmd_spkg(args); - break; - case "alias": - cmd_alias(args); - break; - case "username": - cmd_username(args); - break; - case "osname": - cmd_osname(args); - break; - case "unity": - cmd_unity(args); - break; - case "time": - cmd_time(args); - break; - case "saa": - cmd_saa(args); - break; - case "help": - cmd_help(args); - break; - case "codepoints": - case "cp": - cmd_cp(args); - break; - case "shutdown": - cmd_shutdown(args); - break; - case "clear": - cmd_clear(args); - break; - case "close": - cmd_close(args); - break; - case "05tray": - cmd_05tray(args); - break; - case "debug": - cmd_debug(args); - break; - case "echo": - cmd_echo(args); - break; - case "year": - cmd_histacom_year(args); - break; - case "timedistorter": - cmd_histacom_timedistorter(args); - break; - default: - cmd_default(args); - break; - } - } - - private void StartChoice1EndStory() - { - var t = new System.Windows.Forms.Timer(); - int i = 0; - t.Interval = 4000; - t.Tick += (object s, EventArgs a) => + var t = new System.Windows.Forms.Timer(); + t.Interval = 4000; + int i = 0; + t.Tick += (object s, EventArgs a) => { switch (i) { case 0: - WriteLine("User '' connected as '???'"); + API.Upgrades["hackerbattles"] = true; + API.Upgrades["hackcommand"] = true; + WriteLine("IP address connecting with no identity..."); break; case 1: - WriteLine($"???: {API.Username}! What are you doing!?"); + WriteLine("Hey there. So I see you're into hacking."); break; case 2: - WriteLine("???: I went onto the Hacker Alliance room earlier and DevX was on there..."); + WriteLine("Oh, how rude of me. You don't know if I'm DevX or not."); break; case 3: - WriteLine("???: And he told me you SIDED WITH HIM."); + WriteLine("Well now you do. I will not show my identity, but I am not DevX."); break; case 4: - WriteLine("???: This is a HUGE mistake! Listen!"); + WriteLine("Anyways. There are two things you must know about hacking within ShiftOS."); break; case 5: - WriteLine("???: He's lying to you. Listen. DevX is not what you think he is."); + WriteLine("1. You can hack more than just the Shiftorium. Look around the user interface for any 'Hack it' buttons."); break; case 6: - WriteLine("???: He isn't a human! He's an AI! We were all played!"); + WriteLine("Also, running 'hack' in the Terminal will let you do even more damage to DevX's security systems as well as give you some advantages."); break; case 7: - WriteLine("???: I'm telling the truth, I swear!"); + WriteLine("Ever wanted to make the Shiftorium have a bit of a sale, or even better, make all applications pay out more Codepoints than DevX intends?"); break; case 8: - WriteLine("???: You want proof? - holochat_cmd: ERROR: Remote host closed connection."); - WriteLine("But if he is an AI, who created him?"); + WriteLine("Well that 'hack' command is useful then. Go ahead. Try it in another Terminal window. But good God do not close this one."); break; case 9: - WriteLine("spkg: Rebooting system in 8 seconds."); + WriteLine("Because there's one more thing you need to know."); + break; + case 10: + WriteLine("You are not the only person DevX has contacted with ShiftOS."); break; case 11: - API.Upgrades["titlebar"] = false; - API.Upgrades["windowedterminal"] = false; //terminals must be fullscreen - var trm = new Terminal(); + WriteLine("There are others. Some of them, friendly. Some of them, knowledgable enough to help you."); + break; + case 12: + WriteLine("ShiftOS is like a private community. Anyone can contact anyone provided they have the skill to get in."); + break; + case 13: + WriteLine("Meaning, you may meet some very cool people."); + break; + case 14: + WriteLine("But some of us are... how do you say it... hostile."); + break; + case 15: + WriteLine("Enter the era of Hacker Battles."); + break; + case 16: + WriteLine("It's a network-vs-network every-man-for-himself affair. You'll meet criminals, hackers, agencies and much more."); + break; + case 17: + WriteLine("All offering a little surprise if you can take their network down."); + break; + case 18: + WriteLine("And it's best you get trained, for at any time, anyone could challenge you to one."); + break; + case 19: + WriteLine("And the amount of networks devastated due to untrained users picking a fight with the wrong person is alarmingly huge."); + break; + case 20: + WriteLine("I'll launch a practice program which will teach you the Hacker Battle interface and the fundamentals."); + break; + case 21: + WriteLine("And if you can complete the entire training session, you will be able to defend against anyone who dare battle you."); + break; + case 22: + WriteLine("Starting training session #53D8G in 5 seconds...."); + break; + case 23: + WriteLine("Don't worry. It shouldn't be too difficult for you."); + t.Stop(); + ShiftOS.Hacking.StartBattleTutorial(); + break; + } + i += 1; + }; + t.Start(); + } + + internal void StartDevXFuriousStory() + { + var t = new System.Windows.Forms.Timer(); + t.Interval = 4000; + int i = 0; + t.Tick += (object s, EventArgs a) => + { + switch (i) + { + case 0: + WriteLine("IP 199.108.232.1 Connecting..."); + break; + case 1: + WriteLine("DevX: WHAT HAVE YOU DONE?"); + break; + case 2: + WriteLine("DevX: How the HELL did you get the Shiftnet?"); + break; + case 3: + WriteLine("DevX: What sites have you seen? TALK TO ME."); + break; + case 4: + WriteLine("DevX: Alright, got nothing to say? Fine. You will pay for this..."); + break; + case 5: + WriteLine("DevX: I don't know what I'll do... I don't know when I'll do it... but you will wish you never touched a computer in your life..."); + break; + case 6: + t.Stop(); + Viruses.DropDevXPayload(); this.Close(); - API.CreateForm(trm, "Terminal", API.GetIcon("Terminal")); - trm.StartReboot(); + var trm = new Terminal(); + API.CreateForm(trm, API.LoadedNames.TerminalName, API.GetIcon("Terminal")); + trm.StartDevXFuriousStory2(); break; } i += 1; @@ -1793,1215 +1915,1096 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o t.Start(); } - public void StartReboot() + private void StartDevXFuriousStory2() { - txtterm.Text = ""; - var t1 = new Thread(new ThreadStart(new Action(() => + var t = new Thread(new ThreadStart(new Action(() => { - Thread.Sleep(500); - WriteLine("shift-init: Disconnecting From System Bus..."); - Thread.Sleep(1000); + WriteLine("User '???' connecting..."); + API.PlaySound(Properties.Resources.dial_up_modem_02); + WriteLine("???: Hello? Ummm... this is awkward..."); + BeepSleep(3000); + WriteLine("???: Listen - I'm a hacker. Well, not really. I'm friends with one."); + BeepSleep(3000); + WriteLine("???: Seems like DevX completely obliterated your system with one of his viruses."); + BeepSleep(2500); + WriteLine("???: I'll fix that for you."); + API.Upgrades["virusscanner"] = true; this.Invoke(new Action(() => { - txtterm.Text = ""; + this.command = "vscan"; + this.DoCommand(); })); - Thread.Sleep(1000); - WriteLine("Welcome to ShiftOS."); - Thread.Sleep(500); - WriteLine("Starting core..."); - API.Upgrades["windowedterminal"] = true; - Thread.Sleep(450); - WriteLine($"Your username is {API.Username}."); + BeepSleep(1000); + WriteLine("???: Better? Cool. Now, I need your help."); + BeepSleep(1250); + WriteLine("???: I can't reveal my identity yet - but I co-own this chat-room..."); + BeepSleep(1175); + WriteLine("???: It's called the 'Hacker Alliance'."); + BeepSleep(1000); + WriteLine("???: I'm going to install something called 'HoloChat' on your system. It'll be quick."); + BeepSleep(2000); + WriteLine("Installing HoloChat..."); + API.Upgrades["holochat"] = true; Thread.Sleep(100); - WriteLine($"You have {API.Codepoints} Codepoints."); - WriteLine("Loading modules..."); - Thread.Sleep(750); - foreach (var upg in API.Upgrades) - { - if (upg.Value == true) - { - WriteLine($"Loaded module {upg.Key}..."); - } - Thread.Sleep(100); - } - WriteLine("Starting desktop."); - this.Invoke(new Action(() => - { - var s = new ShiftOSDesktop(); - s.Show(); - s.EndGame_AttachEvents(); - })); - Thread.Sleep(1000); + WriteLine("Done. Resetting desktop..."); + this.Invoke(new Action(() => { API.CurrentSession.SetupDesktop(); })); + WriteLine("Done."); + Thread.Sleep(3000); + WriteLine("???: Alright - I'll talk to you soon. Just join that chat room when you're ready."); + BeepSleep(1000); this.Invoke(new Action(() => { - FinalMission.EndGameHandler.GoToNextObjective(); + this.Close(); })); - API.Upgrades["titlebar"] = true; }))); - t1.Start(); + t.Start(); } - - public void Crash() + public void StartOtherPlayerStory() { - txtterm.Text = ""; - WriteLine(" *** SYSTEM PANIC *** "); - WriteLine(Environment.NewLine); - WriteLine("PANIC_ID: 750_15_4W3S0M3"); - WriteLine("PANIC_DESC: System became too unstable to function properly. In 5 seconds, your session will be resumed."); var t = new System.Windows.Forms.Timer(); - t.Interval = 1000; - int p = 0; + t.Interval = 4000; + int i = 0; t.Tick += (object s, EventArgs a) => { - if (p == 4) + switch (i) { - t.Stop(); - this.Close(); + case 0: + WriteLine("IP Address is connecting as '???'..."); + break; + case 1: + WriteLine("Connection established."); + break; + case 2: + WriteLine("???: Hi, ShiftOS user. I have something to tell you."); + break; + case 3: + WriteLine("???: I'm not a hacker. I'm not a programmer. I am just like you."); + break; + case 4: + WriteLine("???: I am... the Other Player."); + break; + case 5: + WriteLine("???: I too have heard DevX's story about ShiftOS being an experimental operating system."); + break; + case 6: + WriteLine("???: I have also met another user. We'll call him... I don't know... Robert."); + break; + case 7: + WriteLine("???: And this Robert guy, well, he knows a lot about ShiftOS, and DevX."); + break; + case 8: + WriteLine("???: Robert is a fake name I'm calling him. You might know him as Hacker101."); + break; + case 9: + WriteLine("???: Anyways, He told me about you, so I figured I would help you get out of this mess."); + break; + case 10: + WriteLine("???: He said he'll help me get my hard drive back, and get ShiftOS off my system. Once he does, I'll tell you."); + break; + case 11: + WriteLine("???: In the meantime, I have one word for you. Survive. Do NOT let DevX get to you. Do not fall for his tricks. Just play along until I contact you."); + break; + case 12: + WriteLine("???: I'll talk to you about this soon."); + break; + case 13: + t.Stop(); + this.Close(); + API.Upgrades["otherplayerstory1"] = true; + break; } - p += 1; + i += 1; }; t.Start(); } - - private void wrongcommand() + public void cmd_dir(String[] args) { - txtterm.Text = txtterm.Text + Environment.NewLine + "Command not recognized - Type 'help' for a list of commands!" + Environment.NewLine; + if (API.Upgrades["fileskimmer"]) + { + foreach (var d in Directory.GetDirectories(current_dir)) + { + WriteLine($"[DIR] {new DirectoryInfo(d).Name}"); + } + foreach (var d in Directory.GetFiles(current_dir)) + { + WriteLine($"{new FileInfo(d).Name}"); + } + } + else + { + wrongcommand(); + } } - bool Hacking = false; - - private Control objToWriteTo = null; - private string UpgradeToHack = null; - - public void StartHackingSession(string id) + public void cmd_cd(String[] args) { - UpgradeToHack = id; - objToWriteTo = txtterm; - Hacking = true; - txtterm.ReadOnly = true; - WriteLine("To continue, choose which way you "); - WriteLine("would like to go about this. "); - WriteLine(" "); - WriteLine("1. Go it alone. "); - WriteLine("2. Hire someone. "); - WriteLine(" "); - WriteLine("Press the key that corresponds to "); - WriteLine("the option you want. "); - + if (API.Upgrades["fileskimmer"]) + { + if (args[1] == "..") + { + if (GetPath(current_dir) != "/") + { + current_dir = GetParent(current_dir); + SetPrefix($"{API.Username}@{API.OSName} in {GetPath(current_dir)} $> "); + } + else + { + WriteLine("cd: Can't go up past the root."); + } + } + else + { + string newdir = current_dir + OSInfo.DirectorySeparator; + foreach (var dir in Directory.GetDirectories(current_dir)) + { + if (new DirectoryInfo(dir).Name.ToLower() == args[1]) + newdir = dir; + } + current_dir = newdir; + SetPrefix($"{API.Username}@{API.OSName} in {GetPath(current_dir)} $> "); + } + } } - public void showhackinghelp() + public void cmd_upg(String[] args) { - WriteLine(" - Hacking - "); - WriteLine(Environment.NewLine + "Hacking allows you to gain more features and upgrades by unlocking more of the OS's capabilities."); - WriteLine(Environment.NewLine + "There are two ways you can execute a hack:"); - WriteLine(" - On your own: It'll take skill, and time, but if you have the correct tools you can do it on your own."); - WriteLine(" - With a more competent partner: You have the option of employing a partner from a list of various hackers. The speed and success of the hack depends on their skill, and how fast they can pull it off. You will need to pay them a fee of Codepoints however. They can also grant you tools to do it on your own."); - WriteLine(Environment.NewLine + "Some hacks are capable of:"); - WriteLine(" - Decreasing or increasing the price of Shiftorium Upgrades"); - WriteLine(" - Decreasing or increasing the amount of Codepoints earned by doing various tasks."); - WriteLine(" - Unlocking more upgrades."); - WriteLine(Environment.NewLine + "To start a hack, go to a locked or empty Shiftorium category and click the \"Hack It\" button."); - API.Upgrades["hacking"] = true; + if (API.DeveloperMode) + { + try + { + switch (args[1]) + { + case "get": + WriteLine(API.Upgrades[args[2]].ToString()); + break; + } + } + catch + { + + } + } + else + { + wrongcommand(); + } } - public void showhelp(string topic) + public void cmd_endgame_test(String[] args) { - switch (topic) + if (API.DeveloperMode) { - case "hacking": - showhackinghelp(); - break; - default: - WriteLine("No help available for this topic. Try 'help' for general help."); - break; + try + { + switch (args[1]) + { + case "choice_screen": + var cscreen = new ShiftOS.FinalMission.ChooseYourApproach(); + cscreen.WindowState = FormWindowState.Maximized; + //cscreen.TopMost = true; + cscreen.Show(); + break; + case "limitedmode": + API.LimitedMode = !API.LimitedMode; + WriteLine($"Limited mode set to {API.LimitedMode}."); + break; + } + } + catch + { + WriteLine("Invalid arguments."); + } + } + else + { + wrongcommand(); } } - public void showhelp() + public void cmd_htutorial(String[] args) { - listinfo(); - WriteLine(" "); - listcommands(); - listprograms(); + ShiftOS.Hacking.StartBattleTutorial(); } - private void listprograms() + public void cmd_fake_buy(String[] args) { - WriteLine("Programs installed: " + Environment.NewLine); - WriteLine(" - terminal: A command-line application that lets you run programs in ShiftOS"); - WriteLine(" - shiftorium: An application where you can buy upgrades and new apps using codepoints."); - /* TEMP-REMOVED - I just can't get it to work. - WriteLine(" - jumper: A simple 'jump over the obstacle' game."); - */ - WriteLine(" - knowledge_input: Test your knowledge, and gain some Codepoints too."); - if (API.Upgrades["shifter"] == true) - WriteLine(" - shifter: Allows you to customize ShiftOS."); - if (API.Upgrades["skinning"] == true) - WriteLine(" - skinloader: Load and save ShiftOS skins."); - if (API.Upgrades["pong"] == true) - WriteLine(" - pong: A good ole' game of Pong."); - if (API.Upgrades["fileskimmer"] == true) - WriteLine(" - fileskimmer: Browse the files on your computer."); - if (API.Upgrades["textpad"] == true) - WriteLine(" - textpad: \"Write, save, and open a text document.\" - Philip Adams"); - if (API.Upgrades["artpad"] == true) - WriteLine(" - artpad: A simple, but useful drawing application."); - if (API.Upgrades["shiftnet"] == true) - WriteLine("Also, more apps can be run by opening .saa files. Apps can also be installed using spkg or by double clicking .pkg or .stp files."); + if (API.DeveloperMode) + { + try + { + if (API.Upgrades.ContainsKey(args[1])) + { + API.Upgrades[args[1]] = true; + WriteLine($"Bought upgrade {args[1]}."); + API.CurrentSession.SetupAppLauncher(); + API.UpdateWindows(); + SaveSystem.Utilities.saveGame(); + } + else + { + WriteLine("Upgrade not found."); + } + } + catch + { + WriteLine("fake_buy: Bad arguments."); + } + } + else + { + wrongcommand(); + } } - public void listcommands() + public void cmd_connections(String[] args) { - WriteLine(" == Commands == " + Environment.NewLine); - WriteLine(" - clear: Clears the screen."); - WriteLine(" - shutdown: Shuts down your PC."); - WriteLine(" - codepoints: Shows how many codepoints you have."); - WriteLine(" - help: Shows this screen."); - if (API.Upgrades["secondssincemidnight"] == true) + try { - WriteLine(" - time: Shows the current time."); + switch (args[1]) + { + case "list": + foreach (var client in Package_Grabber.clients) + { + WriteLine($"Hostname: {client.Key}, Port: {client.Value.RemotePort}, Online: {client.Value.IsConnected}"); + } + break; + case "gui": + API.CreateForm(new ConnectionManager(), "Connections", API.GetIcon("Connections")); + break; + case "drop": + foreach (var client in Package_Grabber.clients) + { + Package_Grabber.Disconnect(client.Key); + } + break; + case "add": + string host = args[2]; + int port = 0; + int.TryParse(args[3], out port); + if (!Package_Grabber.clients.ContainsKey(host)) + { + Package_Grabber.ConnectToServer(host, port); + WriteLine("Connection to host established successfully."); + } + else + { + var c = Package_Grabber.clients[host]; + if (c.IsConnected == false) + { + c.Connect(host, port); + WriteLine("Re-established connection with host."); + } + else + { + WriteLine("This host has been connected to already."); + } + } + break; + } } - if (API.Upgrades["unitymode"] == true) - WriteLine(" - unity: Toggles Unity Mode."); - if (API.Upgrades["customusername"] == true) + catch { - WriteLine(" - username : Changes your username."); - WriteLine(" - osname : Changes the operating system name."); + WriteLine("connections: Missing arguments."); } - if (API.Upgrades["shiftnet"] == true) + } + + public void cmd_story(String[] args) + { + if (API.DeveloperMode == true && API.Upgrades["shiftnet"]) { - WriteLine(" - saa: Runs a specified .saa file."); - WriteLine(" - spkg: Shiftnet Package Manager (more info at shiftnet://main/spkg"); + try + { + switch (args[1]) + { + case "aidennirh": + StartAidenNirhStory(); + break; + case "devxfurious": + StartDevXFuriousStory(); + break; + case "battletut": + StartHackerBattleIntro(); + break; + case "otherplayer": + StartDevXFuriousStory(); + break; + case "hacker101": + StartHacker101Story(); + break; + } + } + catch + { + WriteLine("Missing arguments."); + } } + else { wrongcommand(); } } - public void listinfo() + public void cmd_make(String[] args) { - WriteLine(SaveSystem.Utilities.LoadedSave.osname + " - Version " + SaveSystem.Utilities.LoadedSave.ingameversion); - WriteLine("==========================" + Environment.NewLine); - WriteLine(" == Info == " + Environment.NewLine); - if (API.Upgrades["applaunchermenu"] == true) + try { - WriteLine(" - Apps can be run using the App Launcher on the desktop."); + string path = command.Replace("make ", ""); + string realpath = $"{Paths.SaveRoot}{path.Replace("/", OSInfo.DirectorySeparator)}"; + if (File.Exists(realpath + OSInfo.DirectorySeparator + "main.lua")) + { + WriteLine("Compiling to " + path + ".saa"); + ZipFile.CreateFromDirectory(realpath, realpath + ".saa"); + } + else + { + WriteLine($"make: *** No rule to make target \"{realpath}\". Stop."); + } } - else + catch { - WriteLine(" - Apps can be run by typing their name in the Terminal."); + WriteLine("make: Invalid arguments."); } - if (API.Upgrades["windowedterminal"] == true) + } + + public void cmd_devupg(String[] args) + { + if (API.DeveloperMode) { - WriteLine(" - The Terminal runs in a window."); + WriteLine("Upgrading your system..."); + foreach (var upg in Shiftorium.Utilities.GetAvailable()) + { + API.Upgrades[upg.id] = true; + WriteLine("Installed upgrade \"" + upg.Name + "\"..."); + } + API.UpdateWindows(); + API.CurrentSession.SetupDesktop(); } else { - WriteLine(" - The Terminal runs fullscreen at all times."); + wrongcommand(); } - if (API.Upgrades["titlebar"] == true) + } + + public void cmd_cheat(String[] args) + { + if (API.DeveloperMode) { - WriteLine(" - Applications have a titlebar to help distinguish between other apps."); + WriteLine("Opening..."); + + //Apps.Cheats chts = new Apps.Cheats(); + //chts.Show(); + API.CreateForm(new Apps.Cheats(), "Cheats", API.GetIcon("Terminal")); } - if (API.Upgrades["windowborders"] == true) + else { - WriteLine(" - Applications have a window border to help distinguish between other apps."); + wrongcommand(); } - if (API.Upgrades["multitasking"] == true) + } + + public void cmd_netgen(String[] args) + { + WriteLine("Starting netgen..."); + API.CreateForm(new NetGen(), "Network Generator", API.GetIcon("Terminal")); + } + + public void cmd_lua(String[] args) + { + if (API.DeveloperMode == true) { - WriteLine(" - Multiple apps can be run at the same time, and you can even run more than one of the same app!"); + try + { + string f = args[1]; + WriteLine(f); + f = command.Remove(0, 4); + WriteLine(f); + string real = $"{Paths.SaveRoot}{f.Replace("/", OSInfo.DirectorySeparator)}"; + WriteLine(real); + if (File.Exists(real)) + { + WriteLine("Running Lua script at " + f + "."); + var l = new LuaInterpreter(real); + } + else + { + WriteLine("Lua script file not found."); + } + } + catch + { + this.LuaMode = true; + this.Interpreter = new LuaInterpreter(); + this.Interpreter.mod.print = new Action((text) => WriteLine(text)); + this.Interpreter.mod.exit = new Action(() => + { + this.LuaMode = false; + this.Interpreter = null; + WriteLine($"{API.CurrentSave.username}@{API.CurrentSave.osname} $> "); + }); + WriteLine("ShiftOS Lua Interpreter - v1.0"); + WriteLine("Created by Michael VanOverbeek"); + WriteLine(Environment.NewLine + "How to use: Simply type some Lua code and watch it come to life. Code can be executed on one line, and unlike most interpreters, you can access code from one line in another."); + WriteLine(Environment.NewLine + "When you're done, simply press the Enter key to execute the code." + Environment.NewLine); + } } - if (API.Upgrades["movablewindows"] == true) + else { - WriteLine(" - Applications can be moved using CTRL+W,A,S,D."); + wrongcommand(); } - if (API.Upgrades["draggablewindows"] == true) + } + + public void cmd_hack(String[] args) + { + if (API.Upgrades["hacking"] == true) { - WriteLine(" - You can drag apps around the screen by dragging their titlebars."); + StartHackingSession("random"); } - if (API.Upgrades["resizablewindows"] == true) + else { - WriteLine(" - You can resize windows by dragging their borders."); + wrongcommand(); } - if (API.Upgrades["panelbuttons"] == true) - { - WriteLine($" - A list of open apps is shown at the {API.CurrentSkin.desktoppanelposition.ToLower()} of the screen."); - } - if (API.Upgrades["usefulpanelbuttons"] == true) - { - WriteLine(" - You can minimize and restore apps using the panel buttons."); - } - if (API.Upgrades["titletext"] == true) - { - WriteLine(" - Apps display their names on the titlebar."); - } - if (API.Upgrades["appicons"] == true) - { - WriteLine(" - Apps display their icons, and they are displayed in their titlebars."); - } - if (API.Upgrades["autoscrollterminal"] == true) - { - WriteLine(" - The Terminal will automatically scroll to the bottom."); - } - if (API.Upgrades["terminalscrollbar"] == true) - { - WriteLine(" - You can scroll up and down the Terminal's buffer."); - } - if (API.Upgrades["zoomableterminal"] == true) - { - WriteLine(" - You can zoom the Terminal in and out by holding CTRL and scrolling up or down."); - } - } - - - // ERROR: Handles clauses are not supported in C# - private void tmrfirstrun_Tick(object sender, EventArgs e) - { - switch (firstrun) - { - case 1: - txtterm.Text = txtterm.Text + "Installation Successfull" + Environment.NewLine; - blockctrlt = true; - break; - case 2: - txtterm.Text = txtterm.Text + "IP 199.108.232.1 Connecting..." + Environment.NewLine + "User@" + SaveSystem.Utilities.LoadedSave.osname + " $> "; - API.PlaySound(Properties.Resources.dial_up_modem_02); - break; - case 12: - txtterm.Text = txtterm.Text + "IP 199.108.232.1 Connected!" + Environment.NewLine + "User@" + SaveSystem.Utilities.LoadedSave.osname + " $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 15: - txtterm.Text = txtterm.Text + "DevX: Hi, my name is DevX and you are now using an early version of my operating system \"ShiftOS\"." + Environment.NewLine + "User@ShiftOS $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 22: - txtterm.Text = txtterm.Text + "DevX: Currently the terminal is open and I am using it to communicate with you remotely." + Environment.NewLine + "User@ShiftOS $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 28: - txtterm.Text = txtterm.Text + "DevX: ShiftOS is going to be the most revolutionary operating system in the world that will run on every electronic device you can think of." + Environment.NewLine + "User@ShiftOS $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 36: - txtterm.Text = txtterm.Text + "DevX: I can't tell you much about my future plans right now but if you can help me then I may tell you more in future" + Environment.NewLine + "User@ShiftOS $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 44: - txtterm.Text = txtterm.Text + "DevX: ShiftOS is barely usable in it's current state so I need you to help me evolve it using codepoints" + Environment.NewLine + "User@ShiftOS $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 50: - txtterm.Text = txtterm.Text + "DevX: Once you acquire codepoints you can use them to upgrade certain components of ShiftOS or add new software" + Environment.NewLine + "User@ShiftOS $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 59: - txtterm.Text = txtterm.Text + "DevX: I'll close the terminal now and send you to the blank ShiftOS desktop" + Environment.NewLine + "User@ShiftOS $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 65: - txtterm.Text = txtterm.Text + "DevX: You can open and close the terminal at any time by pressing CTRL + T" + Environment.NewLine + "User@ShiftOS $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 70: - txtterm.Text = txtterm.Text + "DevX: Once you are on the desktop open the terminal, type \"help\" and then press enter for a guide on using ShiftOS" + Environment.NewLine + "User@ShiftOS $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 80: - txtterm.Text = txtterm.Text + "DevX: Gotta run now but I'll contact you soon to see how you are going with evolving ShiftOS for me while I... Work on something else" + Environment.NewLine + "User@ShiftOS $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 89: - txtterm.Text = txtterm.Text + "DevX: Remember to always click the black desktop first and then press press CTRL + T to open the terminal otherwise the terminal won't open!" + Environment.NewLine + "User@ShiftOS $> "; - API.PlaySound(Properties.Resources.writesound); - break; - case 94: - API.PlaySound(Properties.Resources.typesound); - txtterm.Text = "User@" + SaveSystem.Utilities.LoadedSave.osname + " $> "; - tmrfirstrun.Stop(); - this.Close(); - blockctrlt = false; - SaveSystem.Utilities.saveGame(); - break; - } - firstrun = firstrun + 1; - txtterm.SelectionStart = txtterm.TextLength; } - public void runterminalfile(string path) + public void cmd_vscan(String[] args) { - if (File.Exists(path)) + if (API.Upgrades["virusscanner"] == true) { - string[] cmds = File.ReadAllLines(path); - foreach (string cmd in cmds) + WriteLine("Scanning for infected files..."); + var goodList = new Dictionary(); + foreach (KeyValuePair kv in Viruses.Infections) { - command = cmd; - DoCommand(); + if (kv.Value.Contains(";")) + { + foreach (string file in kv.Value.Split(';')) + { + if (goodList.ContainsKey(file)) + { + goodList[file] += ", " + kv.Key; + } + else + { + goodList.Add(file, kv.Key); + } + } + } + else + { + if (goodList.ContainsKey(kv.Value)) + { + goodList[kv.Value] += ", " + kv.Key; + } + else + { + goodList.Add(kv.Value, kv.Key); + } + } } - } - } - - // ERROR: Handles clauses are not supported in C# - private void tmrshutdown_Tick(object sender, EventArgs e) - { - Application.Exit(); - } - - public void WriteLine(string text) - { - API.CurrentSession.Invoke(new Action(() => - { - if (txtterm.Text.Length > 0) + WriteLine("Scan complete."); + if (goodList.Count > 0) { - txtterm.Text += Environment.NewLine + text; + foreach (KeyValuePair kv in goodList) + { + WriteLine("File " + kv.Key + " is infected with " + kv.Value + ". Disinfecting..."); + Viruses.DisInfect(kv.Key); + } + WriteLine("Disinfection complete."); } else { - txtterm.Text += text; + WriteLine("No infections found. You are safe."); } - txtterm.Select(txtterm.TextLength, 0); - txtterm.ScrollToCaret(); - })); + } } - private bool Zooming = false; - private void ScrollDeactivate(object sender, KeyEventArgs e) + public void cmd_infections(String[] args) { - if (Zooming == true) + if (API.DeveloperMode == true) { - Zooming = false; + foreach (KeyValuePair kv in Viruses.Infections) + { + WriteLine(kv.Key + " @ " + kv.Value); + } + } + else + { + wrongcommand(); } } - private int ZoomMultiplier = 1; - - private void ResetTerminalFont() + public void cmd_binarywater(String[] args) { - string fname = "Font"; - if (API.Upgrades["setterminalfont"] == true) + if (API.DeveloperMode) { - fname = API.CurrentSkin.TerminalFontStyle; + ShiftOS.Hacking.AddCharacter(new Character("Philip Adams", "Hello, and welcome to another episode of OSFirstTimer.", 100, 100, 0)); + WriteLine("Philip Adams is now in the list of hirable hackers."); + WriteLine("\" I Don't Think This is Canon \" -Carver"); } else { - fname = OSInfo.GetMonospaceFont(); + WriteLine("I see you went in the ShiftOS source code... ummm yeah... this isn't a developer mode release so I can't just give you a full-skilled hacker even if you beg."); } - int fsize = 9 * ZoomMultiplier; + } + + public void cmd_color(String[] args) + { try { - txtterm.Font = new Font(fname, fsize); + if (API.Upgrades["setterminalcolors"] == true) + { + + Color bcol = SetColor(args[1]); + Color tcol = SetColor(args[2]); + API.CurrentSkin.TerminalTextColor = tcol; + API.CurrentSkin.TerminalBackColor = bcol; + + } } - catch + catch (Exception) { - txtterm.Font = new Font(fname, 9); + WriteLine("color: Missing arguments."); } } - private void Zoom(object sender, ScrollEventArgs e) + public void cmd_encrypt(String[] args) { - + if (API.DeveloperMode == true) + { + string messageToEncrypt = command.Replace("encrypt ", ""); + string encryptedMessage = API.Encryption.Encrypt(messageToEncrypt); + WriteLine("Encrypted Message: " + encryptedMessage); + } + else + { + wrongcommand(); + } } - private void ScrollTerm(object sender, MouseEventArgs e) + public void cmd_font(String[] args) { - if (Zooming == true) + if (API.Upgrades["setterminalfont"] == true) { - + var fname = command.Replace("font ", ""); + if (GetFonts().Contains(fname)) + { + API.CurrentSkin.TerminalFontStyle = fname; + } + else + { + WriteLine("font: Unrecognized font name \"" + fname + "\". Note: Font names are case sensitive."); + } } else { - if (API.Upgrades["terminalscrollbar"] == true) - { - txtterm.ScrollBars = ScrollBars.Vertical; - } + wrongcommand(); } } - private void tmrsetfont_Tick(object sender, EventArgs e) + public void cmd_colorlist(String[] args) { - ResetTerminalFont(); if (API.Upgrades["setterminalcolors"] == true) { - txtterm.BackColor = API.CurrentSkin.TerminalBackColor; - txtterm.ForeColor = API.CurrentSkin.TerminalTextColor; + foreach (string itm in GetColorList()) + { + WriteLine(itm); + } } - } + else + { + wrongcommand(); + } + } - public void ShowTools() + public void cmd_spkg(String[] args) + { + if (!API.LimitedMode) + { + if (API.Upgrades["shiftnet"] == true) + { + try + { + switch (args[1].ToLower()) + { + case "install": + if (args[2] != null && args[2] != "") + { + string pkgname = args[2].ToLower().Replace(".pkg", ""); + if (Package_Grabber.GetPackage(pkgname) == true) + { + WriteLine("Downloaded package '" + pkgname + "' from shiftnet://main/spkg/ successfully. Installing now."); + string r = Package_Grabber.ExtractPackage(); + if (r == "fail") + { + WriteLine("[FATAL] Could not install package."); + WriteLine("spkg: Killed."); + } + else + { + WriteLine("Extracted " + pkgname + " to " + r + "..."); + var res2 = Package_Grabber.InstallPackage(r + "\\"); + if (res2 != "success") + { + WriteLine("[FATAL] Could not install package. " + res2); + WriteLine("spkg: Killed."); + } + else + { + WriteLine("[DONE] Package installed."); + } + } + } + else + { + WriteLine("spkg: Package '" + args[2] + "' not found."); + } + } + break; + default: + WriteLine("spkg: Invalid argument: " + args[1]); + break; + } + } + catch (Exception ex) + { + WriteLine("spkg: " + ex.Message); + } + } + else + { + wrongcommand(); + } + } + else + { + try + { + if (args[2] == "god_utils") + { + if (FinalMission.EndGameHandler.GodModeInstallEnabled == true) + { + var t = new Thread(new ThreadStart(new Action(() => + { + WriteLine("Downloading package 'god_utils'... Please wait."); + Thread.Sleep(10000); + WriteLine("Download complete."); + Thread.Sleep(100); + WriteLine("Beginning installation."); + Thread.Sleep(1000); + WriteLine(@" == GOD MODE == + +God Mode gives you FULL control of ShiftOS. You can add/remove Codepoints, buy or unbuy Shiftorium upgrades, and can do whatever you want. + +Installing core applications..."); + Thread.Sleep(250); + WriteLine("Installing subpackage 'json_edit'..."); + Thread.Sleep(250); + WriteLine("Installing subpackage 'upgrade_mod'..."); + Thread.Sleep(100); + WriteLine("Installing subpackage 'hijacker'..."); + Thread.Sleep(500); + WriteLine(@" == HIJACKER by DevX == + +HIJACKER is a utility that allows you to hijack any system and install ShiftOS on it during a hacker battle."); + Thread.Sleep(100); + WriteLine("[hijacker] Injecting HIJACKER code into hbattleui.sft..."); + Thread.Sleep(150); + WriteLine("[hijacker] Done."); + this.Invoke(new Action(() => + { + StartChoice1EndStory(); + })); + }))); + t.Start(); + } + else + { + WriteLine("spkg: Package '" + args[2] + "' not found."); + } + } + else + { + WriteLine("spkg: Package '" + args[2] + "' not found."); + } + } + catch + { + WriteLine("spkg: Missing arguments."); + } + } + } + + /// + /// Command Functions, to Be Used For ShiftBatch + /// + /// String[] args + public void cmd_alias(String[] args) { - txtterm.Text = ""; try { - var h = ShiftOS.Hacking.Tools[SelectedCharacter]; - WriteLine(" == Attack Select =="); - WriteLine($"Attack: {SelectedCharacter + 1}/{ShiftOS.Hacking.Tools.Count}"); - WriteLine($"Name: {h.Name}"); - WriteLine($"Effectiveness: {h.Effectiveness}"); - WriteLine($"Description: {h.Description}"); - WriteLine(Environment.NewLine + "LEFT: Previous Attack, RIGHT: Next Attack, ENTER: Confirm"); + switch (args[1]) + { + case "-?": + case "--help": + WriteLine("Aliases Help" + Environment.NewLine); + WriteLine("Alias is a command that lets you create aliases for other commands. You could make a command 'upgrade' alias 'shiftorium' if you wanted." + Environment.NewLine); + WriteLine("Arguments:"); + WriteLine(" -h, --help: Displays this screen."); + WriteLine("-a, --add : Adds a new alias."); + WriteLine("-d, --delete : Deletes an alias."); + WriteLine("-l, --list: Shows all available aliases."); + break; + case "--add": + case "-a": + if (API.AddAlias(args[2], command.Replace("alias " + args[1] + " " + args[2] + " ", ""))) + { + WriteLine("Alias added successfully."); + API.SaveAliases(); + } + else + { + WriteLine("That alias already exists."); + } + break; + case "--delete": + case "-d": + if (API.RemoveAlias(args[2]) == true) + { + WriteLine("Alias \"" + args[2] + "\" removed successfully."); + API.SaveAliases(); + } + else + { + WriteLine("That alias doesn't exist."); + } + break; + case "-l": + case "--list": + WriteLine("Aliases:"); + foreach (KeyValuePair kv in API.CommandAliases) + { + WriteLine(kv.Key + " => " + kv.Value); + } + break; + default: + WriteLine("alias: Invalid argument. Try alias --help for help with the Alias command."); + break; + } } catch { - WriteLine("There are no entries to display in this list."); + WriteLine("alias: Missing arguments. Try alias --help for help with the Alias command."); } } - private void Hack_ShowCharacters() + public void cmd_username(String[] args) { - switch (SelectedMode) + if (API.Upgrades["customusername"] == true) { - case 1: - ShiftOS.Hacking.GetCharacters(); - SelectedCharacter = 0; - ShowTools(); - break; - case 2: - ShiftOS.Hacking.GetCharacters(); - SelectedCharacter = 0; - ShowChar(); - break; + try + { + API.CurrentSave.username = args[1]; + } + catch + { + WriteLine("username: Missing arguments."); + } + } + else + { + wrongcommand(); } } - private void InstallMidGameDesktop() + public void cmd_osname(String[] args) { - //throw new NotImplementedException(); + if (API.Upgrades["customusername"] == true) + { + try + { + API.CurrentSave.osname = args[1]; + } + catch + { + WriteLine("osname: Missing arguments."); + } + } + else + { + wrongcommand(); + } } - int SelectedMode = 0; - int SelectedCharacter = 0; - - public void ShowChar() + public void cmd_unity(String[] args) { - txtterm.Text = ""; - var h = ShiftOS.Hacking.Characters[SelectedCharacter]; - WriteLine(" == Partner Select =="); - WriteLine($"Partner: {SelectedCharacter + 1}/{ShiftOS.Hacking.Characters.Count}"); - WriteLine($"Name: {h.Name}"); - WriteLine($"Skill: {h.Skill}/100"); - WriteLine($"Speed: {h.Speed}/100"); - WriteLine($"Cost: {h.Cost}"); - WriteLine($"Bio: {h.Bio}"); - WriteLine(Environment.NewLine + "LEFT: Previous Partner, RIGHT: Next Partner, ENTER: Confirm"); + if (API.Upgrades["unitymode"] == true) + { + API.CurrentSession.SetUnityMode(); + API.CurrentSession.SetupDesktop(); + txtterm.Focus(); + } + else + { + wrongcommand(); + } } - public void StartShellShock() + public void cmd_time(String[] args) { - var t = new Thread(new ThreadStart(new Action(() => + if (API.Upgrades["pmandam"] == false) { - Thread.Sleep(300); - WriteLine("Sending false packet to shiftnet://devx/tracker..."); - Thread.Sleep(100); - WriteLine("Awaiting reply from server..."); - Thread.Sleep(5000); - WriteLine("Got reply with header \"SOS_TRK_GET\"."); - Thread.Sleep(50); - WriteLine("[kernel] Sending usage log to server..."); - WriteLine("Intercepting outgoing request..."); - Thread.Sleep(200); - WriteLine("Got packet contents..."); - Thread.Sleep(25); - WriteLine("Sifting..."); - Thread.Sleep(500); - WriteLine("Found connection data for shiftnet://devx/tracker."); - Thread.Sleep(100); - WriteLine(@"Username: devx -Password: z7fjsd3"); - Thread.Sleep(100); - WriteLine("Authenticating with SSH server on shiftnet://devx/tracker running Ubuntu 666..."); - Thread.Sleep(1000); - WriteLine("[SSH] Access granted."); - Thread.Sleep(100); - WriteLine($"[Message] ???: We're in. In about 75 seconds DevX's server will go down. It'll be quite cool actually, Don't know if you've ever seen a forkbomb in action, but because you're in an SSH session with DevX's server and I'm also controlling the same session you're gonna see one. Oh, yeah, this server's the only one of his that doesn't actually run ShiftOS."); - Thread.Sleep(25000); - this.Invoke(new Action(() => - { - txtterm.Text = ""; - })); - int i = 60; - while (i >= 1) - { - Thread.Sleep(1000); - WriteLine($"Beginning attack on server in {i} seconds."); - i -= 1; - } - WriteLine("[devx@tracker ~]$ "); - string cmd = ":`(`)`{` `:`|`:` `&` `}`;`:"; // yep. I'm pretending to use a forkbomb on DevX's server. This'll be FUN to code. - foreach (string c in cmd.Split('`')) + if (API.Upgrades["hourssincemidnight"] == false) { - Thread.Sleep(100); - this.Invoke(new Action(() => + if (API.Upgrades["minutessincemidnight"] == false) { - txtterm.Text += c; - })); - } - WriteLine("[devx@tracker ~]$ "); - WriteLine("[Message] ???: Alright. I entered the command for you. Looks like it did nothing. DevX wouldn't even know what's happening... but keep your terminal open for 30 seconds."); - Thread.Sleep(30000); - this.Invoke(new Action(() => - { - FinalMission.EndGameHandler.GoToNextObjective(); - })); - int progress = 0; - while (progress <= 10000) - { - int r = new Random().Next(0, 1); - switch (r) + if (API.Upgrades["secondssincemidnight"] == true) + { + WriteLine("Since midnight, " + API.GetTime() + " seconds have passed."); + } + else + { + wrongcommand(); + } + } + else { - case 0: - WriteLine("-bash: fork: Resource temporarily unavailable"); - break; - case 1: - WriteLine("-bash: fork: retry: Resource temporarily unavailable"); - break; + WriteLine("Since midnight, " + API.GetTime() + " minutes have passed."); } - Thread.Sleep(progress / 10); - progress++; } - WriteLine("[SSH] Connection to server dropped."); - this.Invoke(new Action(() => + else { - FinalMission.EndGameHandler.GoToNextObjective(); - })); - this.Invoke(new Action(() => { this.Close(); })); - }))); - t.Start(); + WriteLine("Since Midnight, " + API.GetTime() + " hours have passed."); + } + } + else + { + WriteLine("Current time: " + API.GetTime()); + } } - internal void StartBridgeToMidGame() + public void cmd_saa(String[] args) { - var t2 = new System.Windows.Forms.Timer(); - t2.Interval = 4000; - int i2 = 0; - t2.Tick += (object s, EventArgs e) => + if (API.Upgrades["shiftnet"]) { - switch (i2) + var f = command.Replace("saa ", ""); + if (f.StartsWith("/")) { - case 0: - if (API.Upgrades["hacker101"] == true) + var withoutslash = f.Remove(0, 1); + var dirsep = OSInfo.DirectorySeparator; + var rightdir = $"{Paths.SaveRoot}{dirsep}{f.Replace("/", dirsep)}"; + if (File.Exists(rightdir)) + { + var finf = new FileInfo(rightdir); + if (finf.Extension == ".saa") { - WriteLine("Hacker101: Hello. We meet again. The Other Player told me about your situation."); + API.LaunchMod(finf.FullName); } else { - API.Upgrades["hacker101"] = true; - WriteLine("Hacker101: The Other Player told me about your situation."); + WriteLine("saa: Cannot launch the file '" + finf.FullName + " because it isn't a valid stand-alone app."); } - break; - case 1: - WriteLine("Hacker101: Lemme guess. DevX found out about you having the Shiftnet, didn't he..."); - break; - case 2: - WriteLine("Hacker101: Well I guess we'll have to fight fire with fire. You remember that person who told you about Hacker Battles?"); - break; - case 3: - WriteLine("Hacker101: It's time you know who he is. He is, in fact, me, and to continue on about Hacker Battles..."); - break; - case 4: - WriteLine("Hacker101: I can help you take down DevX, but we'll need to take down his defenses and get into his network."); - break; - case 5: - WriteLine("Hacker101: DevX's network of servers is larger than any datacenter on Earth, and it'll take time to plan the perfect attack."); - break; - case 6: - WriteLine("Hacker101: Think of it this way. DevX has a network of networks, each with their own leader."); - break; - case 7: - WriteLine("Hacker101: I can help you find these networks, but it's up to you to take 'em down."); - break; - case 8: - WriteLine("Hacker101: Of course, it's hard to hack a network if you don't know how to start a battle."); - break; - case 9: - WriteLine("Hacker101: Introducing the Battle Preparation Screen."); - break; - case 10: - WriteLine("Hacker101: It'll show you any network I've found, and it'll tell you some useful info about it."); - break; - case 11: - WriteLine("Hacker101: However the spkg package for this thing is HUGE, and will require lots of tweaks to the ShiftOS desktop. spkg will hopefully administer the tweaks for you, but here's a rundown of what'll happen."); - break; - case 12: - WriteLine("Hacker101: For one, you'll be able to have multiple desktop panels to fit more widgets on them."); - break; - case 13: - WriteLine("Hacker101: And if you have the App Launcher, it will get sorted so it doesn't take up the entire screen when you get so many applications installed."); - break; - case 14: - WriteLine("Hacker101: And the rest is a surprise. I'll initiate the install sequence."); - break; - case 15: - InstallMidGameDesktop(); - break; + } + else + { + WriteLine("saa: Cannot launch the file '" + f + "' because it doesn't exist."); + } } - i2 += 1; - }; + else + { + WriteLine("saa: Cannot launch the file '" + f + "' because it doesn't exist."); + } + } + else + { + wrongcommand(); + } + } - var t = new System.Windows.Forms.Timer(); - t.Interval = 4000; - int i = 0; + public void cmd_help(String[] args) + { + try + { + showhelp(args[1]); + } + catch + { + showhelp(); + } + } - t.Tick += (object s, EventArgs a) => + public void cmd_cp(String[] args) + { + WriteLine("You have " + API.Codepoints.ToString() + " Codepoints."); + } + + public void cmd_shutdown(String[] args) + { + API.ShutDownShiftOS(); + } + + public void cmd_clear(String[] args) + { + txtterm.Text = ""; + } + + public void cmd_close(String[] args) + { + if (command.Contains("close ")) + { + var pid = command.Replace("close ", ""); + if (API.CloseProgram(pid) == true) + { + WriteLine("Closed all running " + pid + "s."); + } + else + { + WriteLine("No processes with id '" + pid + "' were found!"); + } + } + else { + WriteLine("Insufficient arguments."); + } + } + public void cmd_05tray(String[] args) + { + if (API.DeveloperMode == true) + { + API.AddCodepoints(500); + WriteLine("You've been granted 500 Codepoints."); + } + else + { + wrongcommand(); + } + } - switch (i) + public void cmd_debug(String[] args) + { + if (API.DeveloperMode == true) + { + try { - case 0: - WriteLine("IP connecting as Hacker101..."); - break; - case 1: - WriteLine("Hacker101: Hello, ShiftOS user. I am a hacker."); - break; - case 2: - if (API.BitnoteAddress != null) - { - WriteLine($"Hacker101: I can prove it. You have {API.Codepoints} Codepoints, your Bitnote Address is {API.BitnoteAddress.Address}, and you have {API.BitnoteAddress.Bitnotes}. That's your private address, by the way."); - } - else - { - WriteLine($"Hacker101: I can prove it. You have {API.Codepoints} Codepoints, and you do not have a Bitnote Address."); - } - break; - case 3: - WriteLine("Hacker101: Enough fun in games. Listen. There are two things you need to know."); - break; - case 4: - WriteLine("Hacker101: Thing #1. DevX isn't real."); - break; - case 5: - WriteLine("Hacker101: I've decompiled parts of ShiftOS. And you know what I found?"); - break; - case 6: - WriteLine("Hacker101: Everything DevX says. Everything he does. Everything he THINKS. It's all hardcoded directly into ShiftOS's core."); - break; - case 7: - WriteLine("Hacker101: Want proof? Here. I'll run a quick Lua script for you."); - string DecompiledCode = Properties.Resources.DecompiledCode; - var l = new LuaInterpreter(); - Form win = l.mod.create_window("Decompiled Code", null, 720, 480); - TextBox txt = new TextBox(); - txt.Multiline = true; - txt.Text = Properties.Resources.DecompiledCode; - txt.BorderStyle = BorderStyle.None; - txt.BackColor = Color.Black; - txt.ForeColor = Color.White; - txt.Font = new Font(OSInfo.GetMonospaceFont(), 9); - l.mod.set_dock(txt, "fill"); - l.mod.add_widget_to_window(win, txt); - break; - case 8: - WriteLine("Hacker101: Not only is that some nice, smokin' fresh C# code directly from ShiftOS, but that's a nice steaming pile of bird poop on DevX's doorstep."); - break; - case 9: - WriteLine("Hacker101: Thing #2. The Shiftnet holds some secrets."); - break; - case 10: - WriteLine("Hacker101: What kind of secrets, I hear you ask through your microphone (jesus, do you seriously talk to us with your voice? Are you that bored?)"); - break; - case 11: - WriteLine("Hacker101: Well. I'm talking, pieces of a Lua script that could help stop DevX dead in his digital tracks."); - break; - case 12: - WriteLine("Hacker101: All you gotta do is use my decryption utilities to find the pieces of this encrypted script, download them, decrypt them, and the utility will automatically piece them together for you."); - break; - case 13: - WriteLine("Hacker101: Shiftnet pages ending with .enc are your best bet."); - break; - case 14: - WriteLine("Hacker101: You can install the utilities using spkg install secret."); - break; - case 15: - WriteLine("Hacker101: Then, when the application installs, run it, and use the password 'binary_hell' to install the REAL utilities."); - break; - case 16: - WriteLine("Hacker101: Anyways, that wraps that up. But hang on. One more thing..."); - t.Stop(); - ShiftOS.Hacking.AddCharacter(new Character("Hacker101", "Let's get the job done.", 75, 45, 5)); - t2.Start(); - break; + switch (args[1].ToLower()) + { + case "shiftnet-story": + WriteLine("Debugging Shiftnet Story..."); + StartShiftnetStory(); + break; + case "devmode": + API.DeveloperMode = false; + WriteLine("Turned off developer mode. Use the passcode to turn it back on."); + break; + default: + WriteLine("Invalid argument: " + args[1] + ". Debug can only debug the following: 'shiftnet-story'."); + break; + } + + } + catch (Exception ex) + { + WriteLine("debug: " + ex.Message); } - i += 1; - }; - if (API.Upgrades["hacker101"] == true) - { - t2.Start(); } else { - t.Start(); + try + { + switch (args[1].ToLower()) + { + case "developers123": + WriteLine("Turned Developer Mode on!"); + API.DeveloperMode = true; + break; + default: + WriteLine("debug: lp0 is on fire"); // Keeps Cheaters from Flooding The Fourms With "The Debug Mode Doesn't Work" + break; + } + } + catch + { + WriteLine("debug: lp0 is on fire"); // Keeps Cheaters from Flooding The Fourms With "The Debug Mode Doesn't Work" + } } - - } - internal void StartAidenNirhStory() + public void cmd_echo(String[] args) { - var t = new System.Windows.Forms.Timer(); - t.Interval = 4000; - int i = 0; - t.Tick += (object s, EventArgs a) => + if (command.Contains("echo ")) { - switch (i) - { - case 0: - WriteLine("User 151.43.85.33 connecting as \"Aiden\"..."); - break; - case 2: - WriteLine($"Aiden: Hey there, {API.Username}1 I'm Aiden Nirh."); - break; - case 3: - WriteLine("Aiden: Have you seen Appscape?"); - break; - case 4: - WriteLine("Aiden: It's my package manager for ShiftOS. It's pretty neat."); - break; - case 5: - WriteLine("Aiden: You should check it out, it's on the Shiftnet at shiftnet://main/appscape!"); - break; - case 6: - WriteLine("Aiden: But remember, when browsing the Shiftnet try not to venture from the main server!"); - break; - case 7: - API.Upgrades["aidennirh"] = true; - t.Stop(); - this.Close(); - break; - } - i += 1; - }; - t.Start(); + WriteLine(command.Replace("echo ", "")); + } + else + { + WriteLine("echo: Insufficient Parameters."); + } } - internal void StartHacker101Story() + public void cmd_default(String[] args) { - var t = new System.Windows.Forms.Timer(); - t.Interval = 4000; - int i = 0; - - t.Tick += (object s, EventArgs a) => + if (API.OpenProgram(args[0]) == false) { - switch (i) + if (API.Upgrades["trmfiles"] == false) { - case 0: - WriteLine("IP connecting as Hacker101..."); - break; - case 1: - WriteLine("Hacker101: Hello, ShiftOS user. I am a hacker."); - break; - case 2: - if (API.BitnoteAddress != null) + bool done = false; + foreach (KeyValuePair kv in API.CommandAliases) + { + if (kv.Key == command) { - WriteLine($"Hacker101: I can prove it. You have {API.Codepoints} Codepoints, your Bitnote Address is {API.BitnoteAddress.Address}, and you have {API.BitnoteAddress.Bitnotes}. That's your private address, by the way."); + command = kv.Value; + done = true; + DoCommand(); + } + + } + if (done == false) + { + wrongcommand(); + } + } + else + { + var f = command.Replace("\\", "/"); + if (f.StartsWith("/")) + { + var withoutslash = f.Remove(0, 1); + var dirsep = OSInfo.DirectorySeparator; + var proper = $"{Paths.SaveRoot}{dirsep}{withoutslash.Replace("/", dirsep)}"; + if (File.Exists(proper)) + { + runterminalfile(proper); } else { - WriteLine($"Hacker101: I can prove it. You have {API.Codepoints} Codepoints, and you do not have a Bitnote Address."); + wrongcommand(); } - break; - case 3: - WriteLine("Hacker101: Enough fun in games. Listen. There are two things you need to know."); - break; - case 4: - WriteLine("Hacker101: Thing #1. DevX isn't real."); - break; - case 5: - WriteLine("Hacker101: I've decompiled parts of ShiftOS. And you know what I found?"); - break; - case 6: - WriteLine("Hacker101: Everything DevX says. Everything he does. Everything he THINKS. It's all hardcoded directly into ShiftOS's core."); - break; - case 7: - WriteLine("Hacker101: Want proof? Here. I'll run a quick Lua script for you."); - string DecompiledCode = Properties.Resources.DecompiledCode; - var l = new LuaInterpreter(); - Form win = l.mod.create_window("Decompiled Code", null, 720, 480); - TextBox txt = new TextBox(); - txt.Multiline = true; - txt.Text = Properties.Resources.DecompiledCode; - txt.BorderStyle = BorderStyle.None; - txt.BackColor = Color.Black; - txt.ForeColor = Color.White; - txt.Font = new Font(OSInfo.GetMonospaceFont(), 9); - l.mod.set_dock(txt, "fill"); - l.mod.add_widget_to_window(win, txt); - break; - case 8: - WriteLine("Hacker101: Not only is that some nice, smokin' fresh C# code directly from ShiftOS, but that's a nice steaming pile of bird poop on DevX's doorstep."); - break; - case 9: - WriteLine("Hacker101: Thing #2. The Shiftnet holds some secrets."); - break; - case 10: - WriteLine("Hacker101: What kind of secrets, I hear you ask through your microphone (jesus, do you seriously talk to us with your voice? Are you that bored?)"); - break; - case 11: - WriteLine("Hacker101: Well. I'm talking, pieces of a Lua script that could help stop DevX dead in his digital tracks."); - break; - case 12: - WriteLine("Hacker101: All you gotta do is use my decryption utilities to find the pieces of this encrypted script, download them, decrypt them, and the utility will automatically piece them together for you."); - break; - case 13: - WriteLine("Hacker101: Shiftnet pages ending with .enc are your best bet."); - break; - case 14: - WriteLine("Hacker101: You can install the utilities using spkg install secret."); - break; - case 15: - WriteLine("Hacker101: Then, when the application installs, run it, and use the password 'binary_hell' to install the REAL utilities."); - break; - case 16: - WriteLine("Hacker101: Now go. We need that script. I know a friend who will help you get your hard drive back from DevX if you can do this."); - t.Stop(); - ShiftOS.Hacking.AddCharacter(new Character("Hacker101", "Let's get the job done.", 75, 45, 5)); - API.Upgrades["hacker101"] = true; - this.Close(); - break; - } - i += 1; - }; - t.Start(); - } - - internal void StartOtherPlayerSysFix() - { - var t = new System.Windows.Forms.Timer(); - t.Interval = 4000; - int i = 0; - t.Tick += (object s, EventArgs a) => - { - switch (i) - { - case 0: - WriteLine("User connected as ???."); - break; - case 1: - if (API.Upgrades["otherplayerstory"] == true) - { - WriteLine($"???: {API.Username}! Did he find out? Oh God, I hope he can see this..."); - } - else - { - WriteLine("???: Hello? Uhhhh, is this stupid thing working?"); - } - break; - case 2: - if (API.Upgrades["otherplayerstory"] == true) - { - WriteLine("???: Ahh. Good. You can read this. It's me, the other player."); - } - else - { - WriteLine("???: Thank heaven. You can hear me. Don't ask who I am."); - } - break; - case 3: - WriteLine("???: Looks like DevX hit you hard. Guess he found out you had the Shiftnet."); - break; - case 4: - WriteLine("???: Relax. It's not your fault."); - break; - case 5: - WriteLine("???: Actually, the Shiftnet regularly sends data about it's usage, unencrypted, directly to DevX."); - break; - case 6: - WriteLine("???: This code seems to be embedded into all .saa files. It's actually how I found out about you."); - break; - case 7: - WriteLine("???: It seems weird, I know, but everytime you run a .saa file, an uplink is made to DevX's servers"); - break; - case 8: - if (API.Upgrades["otherplayerstory"] == true) - { - WriteLine("???: And, well, I think we could use this. I'll see if Hacker101 can track this uplink. If he can, you will know it the next time you run a .saa."); - } - else - { - WriteLine("???: And, well, I think we could use this. I have a friend who's good with his hacking skills. I'll see if he can help you stop DevX dead. If he can, he will contact you next time you run a .saa."); - } - break; - case 9: - WriteLine("???: Anyways, connected to your system, I can see your desktop. Looks pretty messed up, huh?"); - break; - case 10: - WriteLine("???: You're lucky you don't have the Windows Everywhere virus."); - break; - case 11: - Viruses.InfectFile(Paths.Drivers + "Keyboard.dri", Viruses.VirusID.WindowsEverywhere); - Viruses.CheckForInfected(); - WriteLine("???: Crap! I spoke too soon."); - break; - case 12: - WriteLine("???: Alright. I'll see if I can hijack your Shiftorium Registry, install a virus scanner, and get rid of the viruses."); - break; - case 13: - API.Upgrades["virusscanner"] = true; - var trm = new Terminal(); - API.CreateForm(trm, API.LoadedNames.TerminalName, Properties.Resources.iconTerminal); - trm.command = "vscan"; - trm.DoCommand(); - break; - case 14: - WriteLine("???: All better. I hope. As for those random files on your desktop, well, it seems DevX dropped some sort of secret message onto your system."); - break; - case 15: - WriteLine("???: Go ahead and try to decrypt it. The Shiftnet Lua API is very useful."); - break; - case 16: - if (API.Upgrades["otherplayerstory"] == true) + } + else + { + bool done = false; + foreach (KeyValuePair kv in API.CommandAliases) { - WriteLine("???: Anyways, I'm gonna go work with Hacker101, discuss those .saa uplinks, and see if we can come up with a suitable attack plan."); + if (kv.Key == command) + { + command = kv.Value; + done = true; + DoCommand(); + } + } - else + if (done == false) { - WriteLine("???: Well, your system is all better. You don't have to thank me. Just, when you open a .saa file, I'll try to contact you if I'm not busy."); + wrongcommand(); } - break; - case 17: - WriteLine("???: Talk to you soon. And, remember. ShiftOS is like a forest. DevX is the predator, you are the prey. Watch your back."); - break; - case 18: - t.Stop(); - this.Close(); - API.Upgrades["otherplayerrescue"] = true; - break; - } - i += 1; - }; - t.Start(); - } - - internal void StartHackerBattleIntro() - { - var t = new System.Windows.Forms.Timer(); - t.Interval = 4000; - int i = 0; - t.Tick += (object s, EventArgs a) => - { - switch (i) - { - case 0: - API.Upgrades["hackerbattles"] = true; - API.Upgrades["hackcommand"] = true; - WriteLine("IP address connecting with no identity..."); - break; - case 1: - WriteLine("Hey there. So I see you're into hacking."); - break; - case 2: - WriteLine("Oh, how rude of me. You don't know if I'm DevX or not."); - break; - case 3: - WriteLine("Well now you do. I will not show my identity, but I am not DevX."); - break; - case 4: - WriteLine("Anyways. There are two things you must know about hacking within ShiftOS."); - break; - case 5: - WriteLine("1. You can hack more than just the Shiftorium. Look around the user interface for any 'Hack it' buttons."); - break; - case 6: - WriteLine("Also, running 'hack' in the Terminal will let you do even more damage to DevX's security systems as well as give you some advantages."); - break; - case 7: - WriteLine("Ever wanted to make the Shiftorium have a bit of a sale, or even better, make all applications pay out more Codepoints than DevX intends?"); - break; - case 8: - WriteLine("Well that 'hack' command is useful then. Go ahead. Try it in another Terminal window. But good God do not close this one."); - break; - case 9: - WriteLine("Because there's one more thing you need to know."); - break; - case 10: - WriteLine("You are not the only person DevX has contacted with ShiftOS."); - break; - case 11: - WriteLine("There are others. Some of them, friendly. Some of them, knowledgable enough to help you."); - break; - case 12: - WriteLine("ShiftOS is like a private community. Anyone can contact anyone provided they have the skill to get in."); - break; - case 13: - WriteLine("Meaning, you may meet some very cool people."); - break; - case 14: - WriteLine("But some of us are... how do you say it... hostile."); - break; - case 15: - WriteLine("Enter the era of Hacker Battles."); - break; - case 16: - WriteLine("It's a network-vs-network every-man-for-himself affair. You'll meet criminals, hackers, agencies and much more."); - break; - case 17: - WriteLine("All offering a little surprise if you can take their network down."); - break; - case 18: - WriteLine("And it's best you get trained, for at any time, anyone could challenge you to one."); - break; - case 19: - WriteLine("And the amount of networks devastated due to untrained users picking a fight with the wrong person is alarmingly huge."); - break; - case 20: - WriteLine("I'll launch a practice program which will teach you the Hacker Battle interface and the fundamentals."); - break; - case 21: - WriteLine("And if you can complete the entire training session, you will be able to defend against anyone who dare battle you."); - break; - case 22: - WriteLine("Starting training session #53D8G in 5 seconds...."); - break; - case 23: - WriteLine("Don't worry. It shouldn't be too difficult for you."); - t.Stop(); - ShiftOS.Hacking.StartBattleTutorial(); - break; + } } - i += 1; - }; - t.Start(); + } } - internal void StartDevXFuriousStory() + // HISTACOM REFERENCES, DO NOT REMOVE, CRUCIAL FOR SECRET STORY ARC + public void cmd_histacom_year(String[] args) { - var t = new System.Windows.Forms.Timer(); - t.Interval = 4000; - int i = 0; - t.Tick += (object s, EventArgs a) => - { - switch (i) - { - case 0: - WriteLine("IP 199.108.232.1 Connecting..."); - break; - case 1: - WriteLine("DevX: WHAT HAVE YOU DONE?"); - break; - case 2: - WriteLine("DevX: How the HELL did you get the Shiftnet?"); - break; - case 3: - WriteLine("DevX: What sites have you seen? TALK TO ME."); - break; - case 4: - WriteLine("DevX: Alright, got nothing to say? Fine. You will pay for this..."); - break; - case 5: - WriteLine("DevX: I don't know what I'll do... I don't know when I'll do it... but you will wish you never touched a computer in your life..."); - break; - case 6: - t.Stop(); - Viruses.DropDevXPayload(); - this.Close(); - var trm = new Terminal(); - API.CreateForm(trm, API.LoadedNames.TerminalName, API.GetIcon("Terminal")); - trm.StartDevXFuriousStory2(); - break; - } - i += 1; - }; - t.Start(); + WriteLine("Year: 2002"); } - private void StartDevXFuriousStory2() - { - var t = new Thread(new ThreadStart(new Action(() => - { - WriteLine("User '???' connecting..."); - API.PlaySound(Properties.Resources.dial_up_modem_02); - WriteLine("???: Hello? Ummm... this is awkward..."); - BeepSleep(3000); - WriteLine("???: Listen - I'm a hacker. Well, not really. I'm friends with one."); - BeepSleep(3000); - WriteLine("???: Seems like DevX completely obliterated your system with one of his viruses."); - BeepSleep(2500); - WriteLine("???: I'll fix that for you."); - API.Upgrades["virusscanner"] = true; - this.Invoke(new Action(() => - { - this.command = "vscan"; - this.DoCommand(); - })); - BeepSleep(1000); - WriteLine("???: Better? Cool. Now, I need your help."); - BeepSleep(1250); - WriteLine("???: I can't reveal my identity yet - but I co-own this chat-room..."); - BeepSleep(1175); - WriteLine("???: It's called the 'Hacker Alliance'."); - BeepSleep(1000); - WriteLine("???: I'm going to install something called 'HoloChat' on your system. It'll be quick."); - BeepSleep(2000); - WriteLine("Installing HoloChat..."); - API.Upgrades["holochat"] = true; - Thread.Sleep(100); - WriteLine("Done. Resetting desktop..."); - this.Invoke(new Action(() => { API.CurrentSession.SetupDesktop(); })); - WriteLine("Done."); - Thread.Sleep(3000); - WriteLine("???: Alright - I'll talk to you soon. Just join that chat room when you're ready."); - BeepSleep(1000); - this.Invoke(new Action(() => - { - this.Close(); - })); - }))); - t.Start(); - } - public void StartOtherPlayerStory() + public void cmd_histacom_timedistorter(String[] args) { - var t = new System.Windows.Forms.Timer(); - t.Interval = 4000; - int i = 0; - t.Tick += (object s, EventArgs a) => - { - switch (i) - { - case 0: - WriteLine("IP Address is connecting as '???'..."); - break; - case 1: - WriteLine("Connection established."); - break; - case 2: - WriteLine("???: Hi, ShiftOS user. I have something to tell you."); - break; - case 3: - WriteLine("???: I'm not a hacker. I'm not a programmer. I am just like you."); - break; - case 4: - WriteLine("???: I am... the Other Player."); - break; - case 5: - WriteLine("???: I too have heard DevX's story about ShiftOS being an experimental operating system."); - break; - case 6: - WriteLine("???: I have also met another user. We'll call him... I don't know... Robert."); - break; - case 7: - WriteLine("???: And this Robert guy, well, he knows a lot about ShiftOS, and DevX."); - break; - case 8: - WriteLine("???: Robert is a fake name I'm calling him. You might know him as Hacker101."); - break; - case 9: - WriteLine("???: Anyways, He told me about you, so I figured I would help you get out of this mess."); - break; - case 10: - WriteLine("???: He said he'll help me get my hard drive back, and get ShiftOS off my system. Once he does, I'll tell you."); - break; - case 11: - WriteLine("???: In the meantime, I have one word for you. Survive. Do NOT let DevX get to you. Do not fall for his tricks. Just play along until I contact you."); - break; - case 12: - WriteLine("???: I'll talk to you about this soon."); - break; - case 13: - t.Stop(); - this.Close(); - API.Upgrades["otherplayerstory1"] = true; - break; - } - i += 1; - }; - t.Start(); + WriteLine("Install 'timedistorter' by going to shiftnet://12padams"); } } } -- cgit v1.2.3