aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarverh <[email protected]>2016-07-21 09:17:25 -0700
committercarverh <[email protected]>2016-07-21 09:17:25 -0700
commitce774a20fe6c8bbb1044b4fe1dfa460a10d7edad (patch)
treebf009c952c9c955ea40e9ed3f2947495f96809a1
parent65c21382729af819f6172b70870d78eebb788ec2 (diff)
downloadshiftos-c-_theultimatehacker-ce774a20fe6c8bbb1044b4fe1dfa460a10d7edad.tar.gz
shiftos-c-_theultimatehacker-ce774a20fe6c8bbb1044b4fe1dfa460a10d7edad.tar.bz2
shiftos-c-_theultimatehacker-ce774a20fe6c8bbb1044b4fe1dfa460a10d7edad.zip
Fixed Bugs and Organized Items
-rw-r--r--source/WindowsFormsApplication1/Apps/Shiftnet.Designer.cs1
-rw-r--r--source/WindowsFormsApplication1/Apps/Shiftnet.cs10
-rw-r--r--source/WindowsFormsApplication1/Apps/Terminal.cs1821
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HackUI.Designer.cs785
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HackUI.cs2112
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HackUI.resx177
-rw-r--r--source/WindowsFormsApplication1/Gameplay/Hacking.cs810
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HijackScreen.Designer.cs116
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HijackScreen.cs723
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HijackScreen.resx132
-rw-r--r--source/WindowsFormsApplication1/ShiftOS.csproj14
11 files changed, 941 insertions, 5760 deletions
diff --git a/source/WindowsFormsApplication1/Apps/Shiftnet.Designer.cs b/source/WindowsFormsApplication1/Apps/Shiftnet.Designer.cs
index 5d20f14..cafae5f 100644
--- a/source/WindowsFormsApplication1/Apps/Shiftnet.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/Shiftnet.Designer.cs
@@ -90,6 +90,7 @@
this.txtaddress.Size = new System.Drawing.Size(640, 20);
this.txtaddress.TabIndex = 0;
this.txtaddress.Text = "shiftnet://main";
+ this.txtaddress.TextChanged += new System.EventHandler(this.txtaddress_TextChanged);
//
// wbshiftnet
//
diff --git a/source/WindowsFormsApplication1/Apps/Shiftnet.cs b/source/WindowsFormsApplication1/Apps/Shiftnet.cs
index cbcab1b..017377c 100644
--- a/source/WindowsFormsApplication1/Apps/Shiftnet.cs
+++ b/source/WindowsFormsApplication1/Apps/Shiftnet.cs
@@ -60,11 +60,17 @@ namespace ShiftOS
wbshiftnet.DocumentText = WebLayer.VisitSite("shiftnet://main");
txtaddress.Text = WebLayer.LastUrl;
}
+
+ private void txtaddress_TextChanged(object sender, EventArgs e)
+ {
+
+ }
}
public class WebLayer
{
- private static string HtmlTemplate = "<html><head><title>Shiftnet Page</title><link rel=\"stylesheet\" href=\"http://playshiftos.ml/shiftnet.css\"/></head><body>#BODY#</body></html>";
+ public static String serverurl = "http://playshiftos.ml";
+ private static string HtmlTemplate = "<html><head><title>Shiftnet Page</title><link rel=\"stylesheet\" href=\"" + serverurl + "/shiftnet.css\"/></head><body>#BODY#</body></html>";
public static string LastUrl = null;
public static string VisitSite(string url)
@@ -74,7 +80,7 @@ namespace ShiftOS
{
try
{
- string content = wc.DownloadString(url.Replace("shiftnet://", "http://www.playshiftos.ml/shiftnet/www/"));
+ string content = wc.DownloadString(url.Replace("shiftnet://", serverurl + "/shiftnet/www/"));
if (content.StartsWith("<!STML>"))
{
LastUrl = url;
diff --git a/source/WindowsFormsApplication1/Apps/Terminal.cs b/source/WindowsFormsApplication1/Apps/Terminal.cs
index 1d39f70..6e9828b 100644
--- a/source/WindowsFormsApplication1/Apps/Terminal.cs
+++ b/source/WindowsFormsApplication1/Apps/Terminal.cs
@@ -36,64 +36,6 @@ namespace ShiftOS
current_dir = Paths.SaveRoot;
}
- public void StartOtherPlayerStory()
- {
- 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 <hidden> 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();
- }
public bool ModLogger = false;
@@ -101,14 +43,15 @@ namespace ShiftOS
{
objToWriteTo = this.txtterm;
SaveSystem.Utilities.LoadedSave.newgame = false;
- if(API.Upgrades["windowedterminal"] == true)
+ if (API.Upgrades["windowedterminal"] == true)
{
this.WindowState = FormWindowState.Normal;
- } else
+ }
+ else
{
this.WindowState = FormWindowState.Maximized;
}
-
+
txtterm.KeyDown += new KeyEventHandler(txtterm_KeyPress);
txtterm.Click += new EventHandler(txtterm_Click);
tmrfirstrun.Tick += new EventHandler(tmrfirstrun_Tick);
@@ -137,7 +80,8 @@ namespace ShiftOS
if (a.Delta > 0)
{
ZoomMultiplier += 1;
- } else
+ }
+ else
{
ZoomMultiplier -= 1;
}
@@ -152,14 +96,14 @@ namespace ShiftOS
ResetTerminalFont();
StartLogCheck();
tmrsetfont.Start();
-
+
}
-
+
private void StartLogCheck()
{
- if(ModLogger == true)
+ if (ModLogger == true)
{
var tmrlog = new System.Windows.Forms.Timer();
tmrlog.Interval = 500;
@@ -245,8 +189,9 @@ namespace ShiftOS
// ERROR: Handles clauses are not supported in C#
private void txtterm_KeyPress(object sender, System.Windows.Forms.KeyEventArgs e)
{
- if(e.Control) {
- if(API.Upgrades["zoomableterminal"] == true)
+ if (e.Control)
+ {
+ if (API.Upgrades["zoomableterminal"] == true)
{
Zooming = true;
}
@@ -315,13 +260,14 @@ namespace ShiftOS
e.SuppressKeyPress = true;
trackpos = trackpos - 1;
}
- else {
+ else
+ {
trackpos = trackpos - 2;
}
}
else
{
- switch(SelectedMode)
+ switch (SelectedMode)
{
case 1:
if (SelectedCharacter > 0)
@@ -351,7 +297,8 @@ namespace ShiftOS
trackpos += API.LastRanCommand.Length;
txtterm.Select(txtterm.TextLength, 0);
}
- else {
+ else
+ {
trackpos = trackpos - 1;
}
break;
@@ -412,7 +359,7 @@ namespace ShiftOS
}
else
{
- switch(SelectedMode)
+ switch (SelectedMode)
{
case 1:
ShiftOS.Hacking.StartHack(SelectedCharacter, UpgradeToHack);
@@ -420,7 +367,7 @@ namespace ShiftOS
break;
case 2:
var c = ShiftOS.Hacking.Characters[SelectedCharacter].Cost;
- if(API.Codepoints >= c)
+ if (API.Codepoints >= c)
{
API.RemoveCodepoints(c);
ShiftOS.Hacking.StartHackWithCharacter(SelectedCharacter, UpgradeToHack);
@@ -438,10 +385,11 @@ namespace ShiftOS
{
trackpos = 0;
var lua = txtterm.Lines[txtterm.Lines.Length - 1];
- try {
+ try
+ {
Interpreter.mod(lua);
}
- catch(Exception ex)
+ catch (Exception ex)
{
WriteLine(ex.Message);
}
@@ -452,14 +400,17 @@ namespace ShiftOS
txtterm.Select(txtterm.TextLength, 0);
}
}
- else {
+ else
+ {
if (e.KeyCode == Keys.Back)
{
}
- else {
- if (Viruses.InfectedWith("keyboardfucker")) {
+ else
+ {
+ if (Viruses.InfectedWith("keyboardfucker"))
+ {
var rnd = new Random();
- if(rnd.Next(0, 20) == 10)
+ if (rnd.Next(0, 20) == 10)
{
e.Handled = true;
txtterm.Text += Viruses.KeyboardInceptor.Intercept();
@@ -470,7 +421,8 @@ namespace ShiftOS
trackpos += 1;
}
}
- else {
+ else
+ {
trackpos = trackpos + 1;
}
}
@@ -482,12 +434,14 @@ namespace ShiftOS
{
e.SuppressKeyPress = true;
}
- else {
+ else
+ {
if (txtterm.SelectedText.Length < 1)
{
trackpos = trackpos - 1;
}
- else {
+ else
+ {
e.SuppressKeyPress = true;
}
}
@@ -501,734 +455,11 @@ namespace ShiftOS
}
- internal void StartShellShock()
- {
- var t = new Thread(new ThreadStart(new Action(() =>
- {
- 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 Arch Linux x86_64...");
- 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. </sarcasm>
- foreach(string c in cmd.Split('`'))
- {
- Thread.Sleep(100);
- this.Invoke(new Action(() =>
- {
- 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)
- {
- case 0:
- WriteLine("-bash: fork: Resource temporarily unavailable");
- break;
- case 1:
- WriteLine("-bash: fork: retry: Resource temporarily unavailable");
- break;
- }
- Thread.Sleep(progress / 10);
- progress++;
- }
- WriteLine("[SSH] Connection to server dropped.");
- this.Invoke(new Action(() =>
- {
- FinalMission.EndGameHandler.GoToNextObjective();
- }));
- this.Invoke(new Action(() => { this.Close(); }));
- })));
- t.Start();
- }
-
public void SetPrefix(string _prefix)
{
- prefix = _prefix;
+ prefix = _prefix;
}
- internal void StartBridgeToMidGame()
- {
- var t2 = new System.Windows.Forms.Timer();
- t2.Interval = 4000;
- int i2 = 0;
- t2.Tick += (object s, EventArgs e) =>
- {
- switch (i2)
- {
- case 0:
- if(API.Upgrades["hacker101"] == true)
- {
- WriteLine("Hacker101: Hello. We meet again. The Other Player told me about your situation.");
- }
- else
- {
- API.Upgrades["hacker101"] = true;
- WriteLine("Hacker101: The Other Player told me about your situation.");
- }
- 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;
- };
-
- 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 <hidden> 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
- {
- t.Start();
- }
-
-
- }
-
- private void InstallMidGameDesktop()
- {
- //throw new NotImplementedException();
- }
-
- int SelectedMode = 0;
- int SelectedCharacter = 0;
-
- public void ShowChar()
- {
- 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 ShowTools()
- {
- 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");
- }
- catch
- {
- WriteLine("There are no entries to display in this list.");
- }
- }
-
- private void Hack_ShowCharacters()
- {
- switch(SelectedMode)
- {
- case 1:
- ShiftOS.Hacking.GetCharacters();
- SelectedCharacter = 0;
- ShowTools();
- break;
- case 2:
- ShiftOS.Hacking.GetCharacters();
- SelectedCharacter = 0;
- ShowChar();
- break;
- }
- }
-
- internal void StartAidenNirhStory()
- {
- 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 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();
- }
-
- internal void StartHacker101Story()
- {
- 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 <hidden> 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;
- }
- 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 <hidden> 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)
- {
- 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;
- }
- 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 <unidentified> 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()
- {
- 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();
- }
-
- 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();
- }
-
- private LuaInterpreter Interpreter = null;
- private bool blockctrlt = false;
/// <summary>
/// Call after creating a Terminal to let Maureen Fenn talk
@@ -1285,6 +516,9 @@ Password: z7fjsd3");
Thread.Sleep(time);
}
+ private LuaInterpreter Interpreter = null;
+ private bool blockctrlt = false;
+
private List<string> GetFonts()
{
var lst = new List<string>();
@@ -1307,7 +541,7 @@ Password: z7fjsd3");
public List<string> GetColorList()
{
var lst = new List<string>();
- if(API.Upgrades["red"] == true)
+ if (API.Upgrades["red"] == true)
lst.Add("red");
if (API.Upgrades["green"] == true)
lst.Add("green");
@@ -1333,7 +567,7 @@ Password: z7fjsd3");
public Color SetColor(string name)
{
Color col = Color.White;
- switch(name)
+ switch (name)
{
case "black":
col = Color.Black;
@@ -1397,9 +631,9 @@ Password: z7fjsd3");
{
case "ls":
case "dir":
- if(API.Upgrades["fileskimmer"])
+ if (API.Upgrades["fileskimmer"])
{
- foreach(var d in Directory.GetDirectories(current_dir))
+ foreach (var d in Directory.GetDirectories(current_dir))
{
WriteLine($"[DIR] {new DirectoryInfo(d).Name}");
}
@@ -1442,11 +676,11 @@ Password: z7fjsd3");
}
break;
case "upg":
- if(API.DeveloperMode)
+ if (API.DeveloperMode)
{
try
{
- switch(args[1])
+ switch (args[1])
{
case "get":
WriteLine(API.Upgrades[args[2]].ToString());
@@ -1526,10 +760,10 @@ Password: z7fjsd3");
case "connections":
try
{
- switch(args[1])
+ switch (args[1])
{
case "list":
- foreach(var client in Package_Grabber.clients)
+ foreach (var client in Package_Grabber.clients)
{
WriteLine($"Hostname: {client.Key}, Port: {client.Value.RemotePort}, Online: {client.Value.IsConnected}");
}
@@ -1538,7 +772,7 @@ Password: z7fjsd3");
API.CreateForm(new ConnectionManager(), "Connections", API.GetIcon("Connections"));
break;
case "drop":
- foreach(var client in Package_Grabber.clients)
+ foreach (var client in Package_Grabber.clients)
{
Package_Grabber.Disconnect(client.Key);
}
@@ -1560,7 +794,8 @@ Password: z7fjsd3");
c.Connect(host, port);
WriteLine("Re-established connection with host.");
}
- else {
+ else
+ {
WriteLine("This host has been connected to already.");
}
}
@@ -1573,11 +808,11 @@ Password: z7fjsd3");
}
break;
case "story":
- if(API.DeveloperMode == true && API.Upgrades["shiftnet"])
+ if (API.DeveloperMode == true && API.Upgrades["shiftnet"])
{
try
{
- switch(args[1])
+ switch (args[1])
{
case "aidennirh":
StartAidenNirhStory();
@@ -1624,10 +859,10 @@ Password: z7fjsd3");
}
break;
case "linux":
- if(API.DeveloperMode)
+ if (API.DeveloperMode)
{
WriteLine("Upgrading your system...");
- foreach(var upg in Shiftorium.Utilities.GetAvailable())
+ foreach (var upg in Shiftorium.Utilities.GetAvailable())
{
API.Upgrades[upg.id] = true;
WriteLine("Installed upgrade \"" + upg.Name + "\"...");
@@ -1644,7 +879,7 @@ Password: z7fjsd3");
if (API.DeveloperMode)
{
WriteLine("Opening...");
-
+
//Apps.Cheats chts = new Apps.Cheats();
//chts.Show();
API.CreateForm(new Apps.Cheats(), "Cheats", API.GetIcon("Terminal"));
@@ -1659,7 +894,7 @@ Password: z7fjsd3");
API.CreateForm(new NetGen(), "Network Generator", API.GetIcon("Terminal"));
break;
case "lua":
- if(API.DeveloperMode == true)
+ if (API.DeveloperMode == true)
{
try
{
@@ -1679,7 +914,7 @@ Password: z7fjsd3");
WriteLine("Lua script file not found.");
}
}
- catch
+ catch
{
this.LuaMode = true;
this.Interpreter = new LuaInterpreter();
@@ -1702,7 +937,7 @@ Password: z7fjsd3");
}
break;
case "hack":
- if(API.Upgrades["hacking"] == true)
+ if (API.Upgrades["hacking"] == true)
{
StartHackingSession("random");
}
@@ -1713,21 +948,22 @@ Password: z7fjsd3");
break;
case "virusscanner":
case "vscan":
- if(API.Upgrades["virusscanner"] == true)
+ if (API.Upgrades["virusscanner"] == true)
{
WriteLine("Scanning for infected files...");
var goodList = new Dictionary<string, string>();
foreach (KeyValuePair<string, string> kv in Viruses.Infections)
{
- if(kv.Value.Contains(";"))
+ if (kv.Value.Contains(";"))
{
- foreach(string file in kv.Value.Split(';'))
+ foreach (string file in kv.Value.Split(';'))
{
if (goodList.ContainsKey(file))
{
goodList[file] += ", " + kv.Key;
}
- else {
+ else
+ {
goodList.Add(file, kv.Key);
}
}
@@ -1738,7 +974,8 @@ Password: z7fjsd3");
{
goodList[kv.Value] += ", " + kv.Key;
}
- else {
+ else
+ {
goodList.Add(kv.Value, kv.Key);
}
}
@@ -1786,17 +1023,17 @@ Password: z7fjsd3");
case "color":
try
{
- if(API.Upgrades["setterminalcolors"] == true)
+ if (API.Upgrades["setterminalcolors"] == true)
{
Color bcol = SetColor(args[1]);
Color tcol = SetColor(args[2]);
API.CurrentSkin.TerminalTextColor = tcol;
API.CurrentSkin.TerminalBackColor = bcol;
-
+
}
}
- catch(Exception)
+ catch (Exception)
{
WriteLine("color: Missing arguments.");
}
@@ -1812,12 +1049,12 @@ Password: z7fjsd3");
{
wrongcommand();
}
- break;
+ break;
case "font":
- if(API.Upgrades["setterminalfont"] == true)
+ if (API.Upgrades["setterminalfont"] == true)
{
var fname = command.Replace("font ", "");
- if(GetFonts().Contains(fname))
+ if (GetFonts().Contains(fname))
{
API.CurrentSkin.TerminalFontStyle = fname;
}
@@ -1832,9 +1069,9 @@ Password: z7fjsd3");
}
break;
case "colorlist":
- if(API.Upgrades["setterminalcolors"] == true)
+ if (API.Upgrades["setterminalcolors"] == true)
{
- foreach(string itm in GetColorList())
+ foreach (string itm in GetColorList())
{
WriteLine(itm);
}
@@ -1906,9 +1143,9 @@ Password: z7fjsd3");
{
try
{
- if(args[2] == "god_utils")
+ if (args[2] == "god_utils")
{
- if(FinalMission.EndGameHandler.GodModeInstallEnabled == true)
+ if (FinalMission.EndGameHandler.GodModeInstallEnabled == true)
{
var t = new Thread(new ThreadStart(new Action(() =>
{
@@ -1943,7 +1180,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
}));
})));
t.Start();
- }
+ }
else
{
WriteLine("spkg: Package '" + args[2] + "' not found.");
@@ -1963,7 +1200,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
case "alias":
try
{
- switch(args[1])
+ switch (args[1])
{
case "-?":
case "--help":
@@ -1977,7 +1214,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
break;
case "--add":
case "-a":
- if(API.AddAlias(args[2], command.Replace("alias " + args[1] + " " + args[2] + " ", "")))
+ if (API.AddAlias(args[2], command.Replace("alias " + args[1] + " " + args[2] + " ", "")))
{
WriteLine("Alias added successfully.");
API.SaveAliases();
@@ -1989,7 +1226,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
break;
case "--delete":
case "-d":
- if(API.RemoveAlias(args[2]) == true)
+ if (API.RemoveAlias(args[2]) == true)
{
WriteLine("Alias \"" + args[2] + "\" removed successfully.");
API.SaveAliases();
@@ -2002,7 +1239,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
case "-l":
case "--list":
WriteLine("Aliases:");
- foreach(KeyValuePair<string, string> kv in API.CommandAliases)
+ foreach (KeyValuePair<string, string> kv in API.CommandAliases)
{
WriteLine(kv.Key + " => " + kv.Value);
}
@@ -2018,7 +1255,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
}
break;
case "username":
- if(API.Upgrades["customusername"] == true)
+ if (API.Upgrades["customusername"] == true)
{
try
{
@@ -2041,7 +1278,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
{
API.CurrentSave.osname = args[1];
}
- catch
+ catch
{
WriteLine("osname: Missing arguments.");
}
@@ -2058,7 +1295,8 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
API.CurrentSession.SetUnityMode();
API.CurrentSession.SetupDesktop();
txtterm.Focus();
- } else
+ }
+ else
{
wrongcommand();
}
@@ -2070,12 +1308,16 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
{
if (API.Upgrades["minutessincemidnight"] == false)
{
- if (API.Upgrades["secondssincemidnight"] == true) {
+ if (API.Upgrades["secondssincemidnight"] == true)
+ {
WriteLine("Since midnight, " + API.GetTime() + " seconds have passed.");
- } else {
+ }
+ else
+ {
wrongcommand();
}
- } else
+ }
+ else
{
WriteLine("Since midnight, " + API.GetTime() + " minutes have passed.");
}
@@ -2084,13 +1326,15 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
{
WriteLine("Since Midnight, " + API.GetTime() + " hours have passed.");
}
- } else
+ }
+ else
{
WriteLine("Current time: " + API.GetTime());
}
break;
case "saa":
- if (API.Upgrades["shiftnet"]) {
+ if (API.Upgrades["shiftnet"])
+ {
var f = command.Replace("saa ", "");
if (f.StartsWith("/"))
{
@@ -2167,7 +1411,8 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
{
API.AddCodepoints(500);
WriteLine("You've been granted 500 Codepoints.");
- } else
+ }
+ else
{
wrongcommand();
}
@@ -2198,7 +1443,9 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
{
WriteLine("debug: " + ex.Message);
}
- } else {
+ }
+ else
+ {
try
{
switch (args[1].ToLower())
@@ -2211,14 +1458,15 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
wrongcommand();
break;
}
- } catch
+ }
+ catch
{
wrongcommand(); //Debug command pretends to be an invalid command if an exception is thrown.
}
}
break;
case "echo":
- if(command.Contains("echo "))
+ if (command.Contains("echo "))
{
WriteLine(command.Replace("echo ", ""));
}
@@ -2230,24 +1478,24 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
case "syncsave":
WriteLine("Command removed.");
break;
-
+
default:
if (API.OpenProgram(args[0]) == false)
{
if (API.Upgrades["trmfiles"] == false)
{
bool done = false;
- foreach(KeyValuePair<string, string> kv in API.CommandAliases)
+ foreach (KeyValuePair<string, string> kv in API.CommandAliases)
{
- if(kv.Key == command)
+ if (kv.Key == command)
{
command = kv.Value;
done = true;
DoCommand();
}
-
+
}
- if(done == false)
+ if (done == false)
{
wrongcommand();
}
@@ -2300,7 +1548,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
t.Interval = 4000;
t.Tick += (object s, EventArgs a) =>
{
- switch(i)
+ switch (i)
{
case 0:
WriteLine("User '<unknown>' connected as '???'");
@@ -2345,7 +1593,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
};
t.Start();
}
-
+
public void StartReboot()
{
txtterm.Text = "";
@@ -2369,9 +1617,9 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
WriteLine($"You have {API.Codepoints} Codepoints.");
WriteLine("Loading modules...");
Thread.Sleep(750);
- foreach(var upg in API.Upgrades)
+ foreach (var upg in API.Upgrades)
{
- if(upg.Value == true)
+ if (upg.Value == true)
{
WriteLine($"Loaded module {upg.Key}...");
}
@@ -2406,7 +1654,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
int p = 0;
t.Tick += (object s, EventArgs a) =>
{
- if(p == 4)
+ if (p == 4)
{
t.Stop();
this.Close();
@@ -2440,7 +1688,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
WriteLine(" ");
WriteLine("Press the key that corresponds to ");
WriteLine("the option you want. ");
-
+
}
public void showhackinghelp()
@@ -2460,7 +1708,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
public void showhelp(string topic)
{
- switch(topic)
+ switch (topic)
{
case "hacking":
showhackinghelp();
@@ -2511,7 +1759,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
WriteLine(" - shutdown: Shuts down your PC.");
WriteLine(" - codepoints: Shows how many codepoints you have.");
WriteLine(" - help: Shows this screen.");
- if(API.Upgrades["secondssincemidnight"] == true)
+ if (API.Upgrades["secondssincemidnight"] == true)
{
WriteLine(" - time: Shows the current time.");
}
@@ -2522,7 +1770,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
WriteLine(" - username <new_name>: Changes your username.");
WriteLine(" - osname <newname>: Changes the operating system name.");
}
- if(API.Upgrades["shiftnet"] == true)
+ if (API.Upgrades["shiftnet"] == true)
{
WriteLine(" - saa: Runs a specified .saa file.");
WriteLine(" - spkg: Shiftnet Package Manager (more info at shiftnet://main/spkg");
@@ -2534,10 +1782,11 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
WriteLine(SaveSystem.Utilities.LoadedSave.osname + " - Version " + SaveSystem.Utilities.LoadedSave.ingameversion);
WriteLine("==========================" + Environment.NewLine);
WriteLine(" == Info == " + Environment.NewLine);
- if(API.Upgrades["applaunchermenu"] == true)
+ if (API.Upgrades["applaunchermenu"] == true)
{
WriteLine(" - Apps can be run using the App Launcher on the desktop.");
- } else
+ }
+ else
{
WriteLine(" - Apps can be run by typing their name in the Terminal.");
}
@@ -2549,55 +1798,55 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
{
WriteLine(" - The Terminal runs fullscreen at all times.");
}
- if(API.Upgrades["titlebar"] == true)
+ if (API.Upgrades["titlebar"] == true)
{
WriteLine(" - Applications have a titlebar to help distinguish between other apps.");
}
- if(API.Upgrades["windowborders"] == true)
+ if (API.Upgrades["windowborders"] == true)
{
WriteLine(" - Applications have a window border to help distinguish between other apps.");
}
- if(API.Upgrades["multitasking"] == true)
+ if (API.Upgrades["multitasking"] == true)
{
WriteLine(" - Multiple apps can be run at the same time, and you can even run more than one of the same app!");
}
- if(API.Upgrades["movablewindows"] == true)
+ if (API.Upgrades["movablewindows"] == true)
{
WriteLine(" - Applications can be moved using CTRL+W,A,S,D.");
}
- if(API.Upgrades["draggablewindows"] == true)
+ if (API.Upgrades["draggablewindows"] == true)
{
WriteLine(" - You can drag apps around the screen by dragging their titlebars.");
}
- if(API.Upgrades["resizablewindows"] == true)
+ if (API.Upgrades["resizablewindows"] == true)
{
WriteLine(" - You can resize windows by dragging their borders.");
}
- if(API.Upgrades["panelbuttons"] == true)
+ 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)
+ if (API.Upgrades["usefulpanelbuttons"] == true)
{
WriteLine(" - You can minimize and restore apps using the panel buttons.");
}
- if(API.Upgrades["titletext"] == true)
+ if (API.Upgrades["titletext"] == true)
{
WriteLine(" - Apps display their names on the titlebar.");
}
- if(API.Upgrades["appicons"] == true)
+ if (API.Upgrades["appicons"] == true)
{
WriteLine(" - Apps display their icons, and they are displayed in their titlebars.");
}
- if(API.Upgrades["autoscrollterminal"] == true)
+ if (API.Upgrades["autoscrollterminal"] == true)
{
WriteLine(" - The Terminal will automatically scroll to the bottom.");
}
- if(API.Upgrades["terminalscrollbar"] == true)
+ if (API.Upgrades["terminalscrollbar"] == true)
{
WriteLine(" - You can scroll up and down the Terminal's buffer.");
}
- if(API.Upgrades["zoomableterminal"] == true)
+ if (API.Upgrades["zoomableterminal"] == true)
{
WriteLine(" - You can zoom the Terminal in and out by holding CTRL and scrolling up or down.");
}
@@ -2680,10 +1929,10 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
public void runterminalfile(string path)
{
- if(File.Exists(path))
+ if (File.Exists(path))
{
string[] cmds = File.ReadAllLines(path);
- foreach(string cmd in cmds)
+ foreach (string cmd in cmds)
{
command = cmd;
DoCommand();
@@ -2717,7 +1966,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
private void ScrollDeactivate(object sender, KeyEventArgs e)
{
- if(Zooming == true)
+ if (Zooming == true)
{
Zooming = false;
}
@@ -2728,7 +1977,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
private void ResetTerminalFont()
{
string fname = "Font";
- if(API.Upgrades["setterminalfont"] == true)
+ if (API.Upgrades["setterminalfont"] == true)
{
fname = API.CurrentSkin.TerminalFontStyle;
}
@@ -2737,7 +1986,8 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
fname = OSInfo.GetMonospaceFont();
}
int fsize = 9 * ZoomMultiplier;
- try {
+ try
+ {
txtterm.Font = new Font(fname, fsize);
}
catch
@@ -2748,17 +1998,18 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
private void Zoom(object sender, ScrollEventArgs e)
{
-
+
}
private void ScrollTerm(object sender, MouseEventArgs e)
{
- if(Zooming == true)
+ if (Zooming == true)
{
-
- } else
+
+ }
+ else
{
- if(API.Upgrades["terminalscrollbar"] == true)
+ if (API.Upgrades["terminalscrollbar"] == true)
{
txtterm.ScrollBars = ScrollBars.Vertical;
}
@@ -2768,12 +2019,790 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
private void tmrsetfont_Tick(object sender, EventArgs e)
{
ResetTerminalFont();
- if(API.Upgrades["setterminalcolors"] == true)
+ if (API.Upgrades["setterminalcolors"] == true)
{
txtterm.BackColor = API.CurrentSkin.TerminalBackColor;
txtterm.ForeColor = API.CurrentSkin.TerminalTextColor;
}
}
+
+ public void ShowTools()
+ {
+ 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");
+ }
+ catch
+ {
+ WriteLine("There are no entries to display in this list.");
+ }
+ }
+
+ private void Hack_ShowCharacters()
+ {
+ switch (SelectedMode)
+ {
+ case 1:
+ ShiftOS.Hacking.GetCharacters();
+ SelectedCharacter = 0;
+ ShowTools();
+ break;
+ case 2:
+ ShiftOS.Hacking.GetCharacters();
+ SelectedCharacter = 0;
+ ShowChar();
+ break;
+ }
+ }
+
+ private void InstallMidGameDesktop()
+ {
+ //throw new NotImplementedException();
+ }
+
+ int SelectedMode = 0;
+ int SelectedCharacter = 0;
+
+ public void ShowChar()
+ {
+ 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 StartShellShock()
+ {
+ var t = new Thread(new ThreadStart(new Action(() =>
+ {
+ 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 = ":`(`)`{` `:`|`:` `&` `}`;`:"; // <sarcasm> yep. I'm pretending to use a forkbomb on DevX's server. This'll be FUN to code. </sarcasm>
+ foreach (string c in cmd.Split('`'))
+ {
+ Thread.Sleep(100);
+ this.Invoke(new Action(() =>
+ {
+ 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)
+ {
+ case 0:
+ WriteLine("-bash: fork: Resource temporarily unavailable");
+ break;
+ case 1:
+ WriteLine("-bash: fork: retry: Resource temporarily unavailable");
+ break;
+ }
+ Thread.Sleep(progress / 10);
+ progress++;
+ }
+ WriteLine("[SSH] Connection to server dropped.");
+ this.Invoke(new Action(() =>
+ {
+ FinalMission.EndGameHandler.GoToNextObjective();
+ }));
+ this.Invoke(new Action(() => { this.Close(); }));
+ })));
+ t.Start();
+ }
+
+ internal void StartBridgeToMidGame()
+ {
+ var t2 = new System.Windows.Forms.Timer();
+ t2.Interval = 4000;
+ int i2 = 0;
+ t2.Tick += (object s, EventArgs e) =>
+ {
+ switch (i2)
+ {
+ case 0:
+ if (API.Upgrades["hacker101"] == true)
+ {
+ WriteLine("Hacker101: Hello. We meet again. The Other Player told me about your situation.");
+ }
+ else
+ {
+ API.Upgrades["hacker101"] = true;
+ WriteLine("Hacker101: The Other Player told me about your situation.");
+ }
+ 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;
+ };
+
+ 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 <hidden> 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
+ {
+ t.Start();
+ }
+
+
+ }
+
+ internal void StartAidenNirhStory()
+ {
+ 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 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();
+ }
+
+ internal void StartHacker101Story()
+ {
+ 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 <hidden> 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;
+ }
+ 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 <hidden> 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)
+ {
+ 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;
+ }
+ 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 <unidentified> 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()
+ {
+ 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();
+ }
+
+ 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()
+ {
+ 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 <hidden> 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();
+ }
}
-
}
diff --git a/source/WindowsFormsApplication1/Gameplay/HackUI.Designer.cs b/source/WindowsFormsApplication1/Gameplay/HackUI.Designer.cs
deleted file mode 100644
index 6db5640..0000000
--- a/source/WindowsFormsApplication1/Gameplay/HackUI.Designer.cs
+++ /dev/null
@@ -1,785 +0,0 @@
-namespace ShiftOS
-{
- partial class HackUI
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HackUI));
- this.tbui = new System.Windows.Forms.TableLayoutPanel();
- this.pnlenemy = new System.Windows.Forms.Panel();
- this.lbenemycompromised = new System.Windows.Forms.Label();
- this.lbenemystats = new System.Windows.Forms.Label();
- this.txtyourconsole = new System.Windows.Forms.TextBox();
- this.pnlyou = new System.Windows.Forms.Panel();
- this.lbcompromised = new System.Windows.Forms.Label();
- this.lbstats = new System.Windows.Forms.Label();
- this.txtenemyconsole = new System.Windows.Forms.TextBox();
- this.btnnext = new System.Windows.Forms.Button();
- this.pnlbuy = new System.Windows.Forms.Panel();
- this.txthostname = new System.Windows.Forms.TextBox();
- this.lbhostname = new System.Windows.Forms.Label();
- this.txtgrade = new System.Windows.Forms.TextBox();
- this.lbgrade = new System.Windows.Forms.Label();
- this.lbmoduleinfo = new System.Windows.Forms.Label();
- this.cmbbuyable = new System.Windows.Forms.ComboBox();
- this.label4 = new System.Windows.Forms.Label();
- this.btndonebuying = new System.Windows.Forms.Button();
- this.pnldefensemanager = new System.Windows.Forms.Panel();
- this.btnbuy = new System.Windows.Forms.Button();
- this.label3 = new System.Windows.Forms.Label();
- this.cmbmodules = new System.Windows.Forms.ComboBox();
- this.label1 = new System.Windows.Forms.Label();
- this.button1 = new System.Windows.Forms.Button();
- this.pnlpcinfo = new System.Windows.Forms.Panel();
- this.lbtargets = new System.Windows.Forms.Label();
- this.btnpoweroff = new System.Windows.Forms.Button();
- this.btnupgrade = new System.Windows.Forms.Button();
- this.lbpcinfo = new System.Windows.Forms.Label();
- this.lbmoduletitle = new System.Windows.Forms.Label();
- this.btncloseinfo = new System.Windows.Forms.Button();
- this.flcontrols = new System.Windows.Forms.FlowLayoutPanel();
- this.btnaddmodule = new System.Windows.Forms.Button();
- this.lbcodepoints = new System.Windows.Forms.Label();
- this.btntogglemusic = new System.Windows.Forms.Button();
- this.lbsong = new System.Windows.Forms.Label();
- this.panel2 = new System.Windows.Forms.Panel();
- this.pgpong = new System.Windows.Forms.Panel();
- this.lblcountdown = new System.Windows.Forms.Label();
- this.ball = new System.Windows.Forms.Panel();
- this.paddleHuman = new System.Windows.Forms.PictureBox();
- this.paddleComputer = new System.Windows.Forms.Panel();
- this.lbllevelandtime = new System.Windows.Forms.Label();
- this.lblstatsY = new System.Windows.Forms.Label();
- this.lblstatsX = new System.Windows.Forms.Label();
- this.pnltutorial = new System.Windows.Forms.Panel();
- this.lbtutorial = new System.Windows.Forms.Label();
- this.tmrplayerhealthdetect = new System.Windows.Forms.Timer(this.components);
- this.tmrenemyhealthdetect = new System.Windows.Forms.Timer(this.components);
- this.tmrredraw = new System.Windows.Forms.Timer(this.components);
- this.tmrvisualizer = new System.Windows.Forms.Timer(this.components);
- this.pongGameTimer = new System.Windows.Forms.Timer(this.components);
- this.counter = new System.Windows.Forms.Timer(this.components);
- this.tmrcountdown = new System.Windows.Forms.Timer(this.components);
- this.tbui.SuspendLayout();
- this.pnlenemy.SuspendLayout();
- this.pnlyou.SuspendLayout();
- this.pnlbuy.SuspendLayout();
- this.pnldefensemanager.SuspendLayout();
- this.pnlpcinfo.SuspendLayout();
- this.flcontrols.SuspendLayout();
- this.panel2.SuspendLayout();
- this.pgpong.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.paddleHuman)).BeginInit();
- this.pnltutorial.SuspendLayout();
- this.SuspendLayout();
- //
- // tbui
- //
- this.tbui.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
- this.tbui.ColumnCount = 2;
- this.tbui.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tbui.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tbui.Controls.Add(this.pnlenemy, 1, 1);
- this.tbui.Controls.Add(this.txtyourconsole, 0, 1);
- this.tbui.Controls.Add(this.pnlyou, 0, 0);
- this.tbui.Controls.Add(this.txtenemyconsole, 1, 0);
- this.tbui.Dock = System.Windows.Forms.DockStyle.Fill;
- this.tbui.Location = new System.Drawing.Point(0, 0);
- this.tbui.Name = "tbui";
- this.tbui.RowCount = 2;
- this.tbui.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tbui.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tbui.Size = new System.Drawing.Size(1339, 710);
- this.tbui.TabIndex = 0;
- //
- // pnlenemy
- //
- this.pnlenemy.BackColor = System.Drawing.Color.Black;
- this.pnlenemy.Controls.Add(this.lbenemycompromised);
- this.pnlenemy.Controls.Add(this.lbenemystats);
- this.pnlenemy.Dock = System.Windows.Forms.DockStyle.Fill;
- this.pnlenemy.Font = new System.Drawing.Font("Lucida Console", 8.25F);
- this.pnlenemy.ForeColor = System.Drawing.Color.White;
- this.pnlenemy.Location = new System.Drawing.Point(673, 358);
- this.pnlenemy.Name = "pnlenemy";
- this.pnlenemy.Size = new System.Drawing.Size(662, 348);
- this.pnlenemy.TabIndex = 4;
- //
- // lbenemycompromised
- //
- this.lbenemycompromised.AutoSize = true;
- this.lbenemycompromised.Location = new System.Drawing.Point(161, 90);
- this.lbenemycompromised.Name = "lbenemycompromised";
- this.lbenemycompromised.Size = new System.Drawing.Size(47, 11);
- this.lbenemycompromised.TabIndex = 1;
- this.lbenemycompromised.Text = "label1";
- this.lbenemycompromised.Visible = false;
- //
- // lbenemystats
- //
- this.lbenemystats.AutoSize = true;
- this.lbenemystats.Location = new System.Drawing.Point(13, 13);
- this.lbenemystats.Name = "lbenemystats";
- this.lbenemystats.Size = new System.Drawing.Size(131, 11);
- this.lbenemystats.TabIndex = 0;
- this.lbenemystats.Text = "Enemy Health: 100%";
- //
- // txtyourconsole
- //
- this.txtyourconsole.BackColor = System.Drawing.Color.Black;
- this.txtyourconsole.BorderStyle = System.Windows.Forms.BorderStyle.None;
- this.txtyourconsole.Dock = System.Windows.Forms.DockStyle.Fill;
- this.txtyourconsole.ForeColor = System.Drawing.Color.LightGreen;
- this.txtyourconsole.Location = new System.Drawing.Point(4, 358);
- this.txtyourconsole.Multiline = true;
- this.txtyourconsole.Name = "txtyourconsole";
- this.txtyourconsole.Size = new System.Drawing.Size(662, 348);
- this.txtyourconsole.TabIndex = 3;
- //
- // pnlyou
- //
- this.pnlyou.BackColor = System.Drawing.Color.Black;
- this.pnlyou.Controls.Add(this.lbcompromised);
- this.pnlyou.Controls.Add(this.lbstats);
- this.pnlyou.Dock = System.Windows.Forms.DockStyle.Fill;
- this.pnlyou.Font = new System.Drawing.Font("Lucida Console", 8.25F);
- this.pnlyou.ForeColor = System.Drawing.Color.White;
- this.pnlyou.Location = new System.Drawing.Point(4, 4);
- this.pnlyou.Name = "pnlyou";
- this.pnlyou.Size = new System.Drawing.Size(662, 347);
- this.pnlyou.TabIndex = 1;
- this.pnlyou.MouseDown += new System.Windows.Forms.MouseEventHandler(this.playfield_MouseDown);
- //
- // lbcompromised
- //
- this.lbcompromised.AutoSize = true;
- this.lbcompromised.Location = new System.Drawing.Point(66, 88);
- this.lbcompromised.Name = "lbcompromised";
- this.lbcompromised.Size = new System.Drawing.Size(103, 11);
- this.lbcompromised.TabIndex = 3;
- this.lbcompromised.Text = "SYSTEM DAMAGED";
- this.lbcompromised.Visible = false;
- //
- // lbstats
- //
- this.lbstats.AutoSize = true;
- this.lbstats.Location = new System.Drawing.Point(13, 13);
- this.lbstats.Name = "lbstats";
- this.lbstats.Size = new System.Drawing.Size(138, 11);
- this.lbstats.TabIndex = 0;
- this.lbstats.Text = "System Health: 100%";
- //
- // txtenemyconsole
- //
- this.txtenemyconsole.BackColor = System.Drawing.Color.Black;
- this.txtenemyconsole.BorderStyle = System.Windows.Forms.BorderStyle.None;
- this.txtenemyconsole.Dock = System.Windows.Forms.DockStyle.Fill;
- this.txtenemyconsole.ForeColor = System.Drawing.Color.LightGreen;
- this.txtenemyconsole.Location = new System.Drawing.Point(673, 4);
- this.txtenemyconsole.Multiline = true;
- this.txtenemyconsole.Name = "txtenemyconsole";
- this.txtenemyconsole.Size = new System.Drawing.Size(662, 347);
- this.txtenemyconsole.TabIndex = 2;
- //
- // btnnext
- //
- this.btnnext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btnnext.AutoSize = true;
- this.btnnext.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btnnext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnnext.Location = new System.Drawing.Point(294, 161);
- this.btnnext.Name = "btnnext";
- this.btnnext.Size = new System.Drawing.Size(66, 23);
- this.btnnext.TabIndex = 9;
- this.btnnext.Text = "Next >>";
- this.btnnext.UseVisualStyleBackColor = true;
- this.btnnext.Visible = false;
- this.btnnext.Click += new System.EventHandler(this.btnnext_Click);
- //
- // pnlbuy
- //
- this.pnlbuy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.pnlbuy.Controls.Add(this.txthostname);
- this.pnlbuy.Controls.Add(this.lbhostname);
- this.pnlbuy.Controls.Add(this.txtgrade);
- this.pnlbuy.Controls.Add(this.lbgrade);
- this.pnlbuy.Controls.Add(this.lbmoduleinfo);
- this.pnlbuy.Controls.Add(this.cmbbuyable);
- this.pnlbuy.Controls.Add(this.label4);
- this.pnlbuy.Controls.Add(this.btndonebuying);
- this.pnlbuy.Location = new System.Drawing.Point(7, 405);
- this.pnlbuy.Name = "pnlbuy";
- this.pnlbuy.Size = new System.Drawing.Size(382, 299);
- this.pnlbuy.TabIndex = 6;
- this.pnlbuy.Visible = false;
- //
- // txthostname
- //
- this.txthostname.BackColor = System.Drawing.Color.Black;
- this.txthostname.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.txthostname.ForeColor = System.Drawing.Color.White;
- this.txthostname.Location = new System.Drawing.Point(186, 236);
- this.txthostname.Name = "txthostname";
- this.txthostname.Size = new System.Drawing.Size(186, 18);
- this.txthostname.TabIndex = 10;
- //
- // lbhostname
- //
- this.lbhostname.AutoSize = true;
- this.lbhostname.Location = new System.Drawing.Point(112, 240);
- this.lbhostname.Name = "lbhostname";
- this.lbhostname.Size = new System.Drawing.Size(68, 11);
- this.lbhostname.TabIndex = 9;
- this.lbhostname.Text = "Hostname:";
- //
- // txtgrade
- //
- this.txtgrade.BackColor = System.Drawing.Color.Black;
- this.txtgrade.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.txtgrade.ForeColor = System.Drawing.Color.White;
- this.txtgrade.Location = new System.Drawing.Point(65, 236);
- this.txtgrade.Name = "txtgrade";
- this.txtgrade.Size = new System.Drawing.Size(40, 18);
- this.txtgrade.TabIndex = 8;
- this.txtgrade.TextChanged += new System.EventHandler(this.txtgrade_TextChanged);
- //
- // lbgrade
- //
- this.lbgrade.AutoSize = true;
- this.lbgrade.Location = new System.Drawing.Point(12, 240);
- this.lbgrade.Name = "lbgrade";
- this.lbgrade.Size = new System.Drawing.Size(47, 11);
- this.lbgrade.TabIndex = 7;
- this.lbgrade.Text = "Grade:";
- //
- // lbmoduleinfo
- //
- this.lbmoduleinfo.Location = new System.Drawing.Point(10, 63);
- this.lbmoduleinfo.Name = "lbmoduleinfo";
- this.lbmoduleinfo.Size = new System.Drawing.Size(367, 156);
- this.lbmoduleinfo.TabIndex = 6;
- this.lbmoduleinfo.Text = resources.GetString("lbmoduleinfo.Text");
- //
- // cmbbuyable
- //
- this.cmbbuyable.BackColor = System.Drawing.Color.Black;
- this.cmbbuyable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cmbbuyable.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.cmbbuyable.ForeColor = System.Drawing.Color.White;
- this.cmbbuyable.FormattingEnabled = true;
- this.cmbbuyable.Location = new System.Drawing.Point(12, 38);
- this.cmbbuyable.Name = "cmbbuyable";
- this.cmbbuyable.Size = new System.Drawing.Size(360, 19);
- this.cmbbuyable.TabIndex = 3;
- this.cmbbuyable.SelectedIndexChanged += new System.EventHandler(this.cmbbuyable_SelectedIndexChanged);
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(10, 12);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(75, 11);
- this.label4.TabIndex = 2;
- this.label4.Text = "Buy Module";
- //
- // btndonebuying
- //
- this.btndonebuying.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btndonebuying.AutoSize = true;
- this.btndonebuying.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btndonebuying.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btndonebuying.Location = new System.Drawing.Point(341, 273);
- this.btndonebuying.Name = "btndonebuying";
- this.btndonebuying.Size = new System.Drawing.Size(38, 23);
- this.btndonebuying.TabIndex = 1;
- this.btndonebuying.Text = "Buy";
- this.btndonebuying.UseVisualStyleBackColor = true;
- this.btndonebuying.Click += new System.EventHandler(this.btndonebuying_Click);
- //
- // pnldefensemanager
- //
- this.pnldefensemanager.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.pnldefensemanager.Controls.Add(this.btnbuy);
- this.pnldefensemanager.Controls.Add(this.label3);
- this.pnldefensemanager.Controls.Add(this.cmbmodules);
- this.pnldefensemanager.Controls.Add(this.label1);
- this.pnldefensemanager.Controls.Add(this.button1);
- this.pnldefensemanager.Location = new System.Drawing.Point(395, 424);
- this.pnldefensemanager.Name = "pnldefensemanager";
- this.pnldefensemanager.Size = new System.Drawing.Size(382, 280);
- this.pnldefensemanager.TabIndex = 5;
- this.pnldefensemanager.Visible = false;
- //
- // btnbuy
- //
- this.btnbuy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnbuy.AutoSize = true;
- this.btnbuy.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btnbuy.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnbuy.Location = new System.Drawing.Point(199, 254);
- this.btnbuy.Name = "btnbuy";
- this.btnbuy.Size = new System.Drawing.Size(122, 23);
- this.btnbuy.TabIndex = 7;
- this.btnbuy.Text = "Buy new module.";
- this.btnbuy.UseVisualStyleBackColor = true;
- this.btnbuy.Click += new System.EventHandler(this.btnbuy_Click);
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(12, 95);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(367, 156);
- this.label3.TabIndex = 6;
- this.label3.Text = resources.GetString("label3.Text");
- //
- // cmbmodules
- //
- this.cmbmodules.BackColor = System.Drawing.Color.Black;
- this.cmbmodules.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cmbmodules.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.cmbmodules.ForeColor = System.Drawing.Color.White;
- this.cmbmodules.FormattingEnabled = true;
- this.cmbmodules.Location = new System.Drawing.Point(12, 38);
- this.cmbmodules.Name = "cmbmodules";
- this.cmbmodules.Size = new System.Drawing.Size(360, 19);
- this.cmbmodules.TabIndex = 3;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(10, 12);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(75, 11);
- this.label1.TabIndex = 2;
- this.label1.Text = "Add Module";
- //
- // button1
- //
- this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.button1.AutoSize = true;
- this.button1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.button1.Location = new System.Drawing.Point(327, 254);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(52, 23);
- this.button1.TabIndex = 1;
- this.button1.Text = "Done.";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click_1);
- //
- // pnlpcinfo
- //
- this.pnlpcinfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.pnlpcinfo.Controls.Add(this.lbtargets);
- this.pnlpcinfo.Controls.Add(this.btnpoweroff);
- this.pnlpcinfo.Controls.Add(this.btnupgrade);
- this.pnlpcinfo.Controls.Add(this.lbpcinfo);
- this.pnlpcinfo.Controls.Add(this.lbmoduletitle);
- this.pnlpcinfo.Controls.Add(this.btncloseinfo);
- this.pnlpcinfo.Location = new System.Drawing.Point(783, 424);
- this.pnlpcinfo.Name = "pnlpcinfo";
- this.pnlpcinfo.Size = new System.Drawing.Size(382, 280);
- this.pnlpcinfo.TabIndex = 7;
- this.pnlpcinfo.Visible = false;
- //
- // lbtargets
- //
- this.lbtargets.Location = new System.Drawing.Point(12, 165);
- this.lbtargets.Name = "lbtargets";
- this.lbtargets.Size = new System.Drawing.Size(367, 86);
- this.lbtargets.TabIndex = 9;
- this.lbtargets.Text = "Targets";
- //
- // btnpoweroff
- //
- this.btnpoweroff.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnpoweroff.AutoSize = true;
- this.btnpoweroff.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btnpoweroff.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnpoweroff.Location = new System.Drawing.Point(85, 254);
- this.btnpoweroff.Name = "btnpoweroff";
- this.btnpoweroff.Size = new System.Drawing.Size(80, 23);
- this.btnpoweroff.TabIndex = 8;
- this.btnpoweroff.Text = "Power Off";
- this.btnpoweroff.UseVisualStyleBackColor = true;
- this.btnpoweroff.Click += new System.EventHandler(this.btnpoweroff_Click);
- //
- // btnupgrade
- //
- this.btnupgrade.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnupgrade.AutoSize = true;
- this.btnupgrade.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btnupgrade.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnupgrade.Location = new System.Drawing.Point(171, 254);
- this.btnupgrade.Name = "btnupgrade";
- this.btnupgrade.Size = new System.Drawing.Size(150, 23);
- this.btnupgrade.TabIndex = 7;
- this.btnupgrade.Text = "Upgrade This Module";
- this.btnupgrade.UseVisualStyleBackColor = true;
- this.btnupgrade.Click += new System.EventHandler(this.btnupgrade_Click);
- //
- // lbpcinfo
- //
- this.lbpcinfo.Location = new System.Drawing.Point(12, 41);
- this.lbpcinfo.Name = "lbpcinfo";
- this.lbpcinfo.Size = new System.Drawing.Size(367, 86);
- this.lbpcinfo.TabIndex = 6;
- this.lbpcinfo.Text = resources.GetString("lbpcinfo.Text");
- //
- // lbmoduletitle
- //
- this.lbmoduletitle.AutoSize = true;
- this.lbmoduletitle.Location = new System.Drawing.Point(10, 12);
- this.lbmoduletitle.Name = "lbmoduletitle";
- this.lbmoduletitle.Size = new System.Drawing.Size(75, 11);
- this.lbmoduletitle.TabIndex = 2;
- this.lbmoduletitle.Text = "Add Module";
- //
- // btncloseinfo
- //
- this.btncloseinfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btncloseinfo.AutoSize = true;
- this.btncloseinfo.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btncloseinfo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btncloseinfo.Location = new System.Drawing.Point(327, 254);
- this.btncloseinfo.Name = "btncloseinfo";
- this.btncloseinfo.Size = new System.Drawing.Size(52, 23);
- this.btncloseinfo.TabIndex = 1;
- this.btncloseinfo.Text = "Done.";
- this.btncloseinfo.UseVisualStyleBackColor = true;
- this.btncloseinfo.Click += new System.EventHandler(this.btncloseinfo_Click);
- //
- // flcontrols
- //
- this.flcontrols.Controls.Add(this.btnaddmodule);
- this.flcontrols.Controls.Add(this.lbcodepoints);
- this.flcontrols.Controls.Add(this.btntogglemusic);
- this.flcontrols.Controls.Add(this.lbsong);
- this.flcontrols.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.flcontrols.Location = new System.Drawing.Point(0, 710);
- this.flcontrols.Name = "flcontrols";
- this.flcontrols.Size = new System.Drawing.Size(1339, 31);
- this.flcontrols.TabIndex = 4;
- //
- // btnaddmodule
- //
- this.btnaddmodule.AutoSize = true;
- this.btnaddmodule.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btnaddmodule.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnaddmodule.Location = new System.Drawing.Point(3, 3);
- this.btnaddmodule.Name = "btnaddmodule";
- this.btnaddmodule.Size = new System.Drawing.Size(87, 23);
- this.btnaddmodule.TabIndex = 0;
- this.btnaddmodule.Text = "Add Module";
- this.btnaddmodule.UseVisualStyleBackColor = true;
- this.btnaddmodule.Click += new System.EventHandler(this.btnaddmodule_Click);
- //
- // lbcodepoints
- //
- this.lbcodepoints.Location = new System.Drawing.Point(96, 0);
- this.lbcodepoints.Name = "lbcodepoints";
- this.lbcodepoints.Size = new System.Drawing.Size(127, 26);
- this.lbcodepoints.TabIndex = 1;
- this.lbcodepoints.Text = "Codepoints:";
- this.lbcodepoints.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // btntogglemusic
- //
- this.btntogglemusic.AutoSize = true;
- this.btntogglemusic.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btntogglemusic.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btntogglemusic.Location = new System.Drawing.Point(229, 3);
- this.btntogglemusic.Name = "btntogglemusic";
- this.btntogglemusic.Size = new System.Drawing.Size(101, 23);
- this.btntogglemusic.TabIndex = 2;
- this.btntogglemusic.Text = "Toggle Music";
- this.btntogglemusic.UseVisualStyleBackColor = true;
- this.btntogglemusic.Click += new System.EventHandler(this.button2_Click);
- //
- // lbsong
- //
- this.lbsong.Location = new System.Drawing.Point(336, 0);
- this.lbsong.Name = "lbsong";
- this.lbsong.Size = new System.Drawing.Size(414, 26);
- this.lbsong.TabIndex = 3;
- this.lbsong.Text = "Codepoints:";
- this.lbsong.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // panel2
- //
- this.panel2.Controls.Add(this.pgpong);
- this.panel2.Controls.Add(this.pnltutorial);
- this.panel2.Controls.Add(this.pnlbuy);
- this.panel2.Controls.Add(this.pnlpcinfo);
- this.panel2.Controls.Add(this.pnldefensemanager);
- this.panel2.Controls.Add(this.tbui);
- this.panel2.Controls.Add(this.flcontrols);
- this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
- this.panel2.Location = new System.Drawing.Point(0, 0);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(1339, 741);
- this.panel2.TabIndex = 1;
- //
- // pgpong
- //
- this.pgpong.BackColor = System.Drawing.Color.Black;
- this.pgpong.Controls.Add(this.lblcountdown);
- this.pgpong.Controls.Add(this.ball);
- this.pgpong.Controls.Add(this.paddleHuman);
- this.pgpong.Controls.Add(this.paddleComputer);
- this.pgpong.Controls.Add(this.lbllevelandtime);
- this.pgpong.Controls.Add(this.lblstatsY);
- this.pgpong.Controls.Add(this.lblstatsX);
- this.pgpong.ForeColor = System.Drawing.Color.White;
- this.pgpong.Location = new System.Drawing.Point(0, 0);
- this.pgpong.Name = "pgpong";
- this.pgpong.Size = new System.Drawing.Size(700, 400);
- this.pgpong.TabIndex = 22;
- this.pgpong.Visible = false;
- this.pgpong.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pongMain_MouseMove);
- //
- // lblcountdown
- //
- this.lblcountdown.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lblcountdown.Location = new System.Drawing.Point(187, 152);
- this.lblcountdown.Name = "lblcountdown";
- this.lblcountdown.Size = new System.Drawing.Size(315, 49);
- this.lblcountdown.TabIndex = 7;
- this.lblcountdown.Text = "3";
- this.lblcountdown.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- this.lblcountdown.Visible = false;
- //
- // ball
- //
- this.ball.BackColor = System.Drawing.Color.Gray;
- this.ball.Location = new System.Drawing.Point(300, 152);
- this.ball.Name = "ball";
- this.ball.Size = new System.Drawing.Size(20, 20);
- this.ball.TabIndex = 2;
- //
- // paddleHuman
- //
- this.paddleHuman.BackColor = System.Drawing.Color.Gray;
- this.paddleHuman.Location = new System.Drawing.Point(10, 134);
- this.paddleHuman.Name = "paddleHuman";
- this.paddleHuman.Size = new System.Drawing.Size(20, 100);
- this.paddleHuman.TabIndex = 3;
- this.paddleHuman.TabStop = false;
- //
- // paddleComputer
- //
- this.paddleComputer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.paddleComputer.BackColor = System.Drawing.Color.Gray;
- this.paddleComputer.Location = new System.Drawing.Point(666, 134);
- this.paddleComputer.MaximumSize = new System.Drawing.Size(20, 100);
- this.paddleComputer.Name = "paddleComputer";
- this.paddleComputer.Size = new System.Drawing.Size(20, 100);
- this.paddleComputer.TabIndex = 1;
- //
- // lbllevelandtime
- //
- this.lbllevelandtime.Dock = System.Windows.Forms.DockStyle.Top;
- this.lbllevelandtime.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lbllevelandtime.Location = new System.Drawing.Point(0, 0);
- this.lbllevelandtime.Name = "lbllevelandtime";
- this.lbllevelandtime.Size = new System.Drawing.Size(700, 22);
- this.lbllevelandtime.TabIndex = 4;
- this.lbllevelandtime.Text = "Level: 1";
- this.lbllevelandtime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // lblstatsY
- //
- this.lblstatsY.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.lblstatsY.Font = new System.Drawing.Font("Georgia", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lblstatsY.Location = new System.Drawing.Point(542, 356);
- this.lblstatsY.Name = "lblstatsY";
- this.lblstatsY.Size = new System.Drawing.Size(144, 35);
- this.lblstatsY.TabIndex = 11;
- this.lblstatsY.Text = "Yspeed:";
- this.lblstatsY.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // lblstatsX
- //
- this.lblstatsX.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.lblstatsX.Font = new System.Drawing.Font("Georgia", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lblstatsX.Location = new System.Drawing.Point(3, 356);
- this.lblstatsX.Name = "lblstatsX";
- this.lblstatsX.Size = new System.Drawing.Size(144, 35);
- this.lblstatsX.TabIndex = 5;
- this.lblstatsX.Text = "Xspeed: ";
- this.lblstatsX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // pnltutorial
- //
- this.pnltutorial.Controls.Add(this.btnnext);
- this.pnltutorial.Controls.Add(this.lbtutorial);
- this.pnltutorial.Location = new System.Drawing.Point(174, 161);
- this.pnltutorial.Name = "pnltutorial";
- this.pnltutorial.Size = new System.Drawing.Size(363, 187);
- this.pnltutorial.TabIndex = 10;
- this.pnltutorial.Visible = false;
- //
- // lbtutorial
- //
- this.lbtutorial.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.lbtutorial.Location = new System.Drawing.Point(-2, 50);
- this.lbtutorial.Name = "lbtutorial";
- this.lbtutorial.Size = new System.Drawing.Size(367, 86);
- this.lbtutorial.TabIndex = 9;
- this.lbtutorial.Text = resources.GetString("lbtutorial.Text");
- this.lbtutorial.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- this.lbtutorial.Visible = false;
- //
- // tmrplayerhealthdetect
- //
- this.tmrplayerhealthdetect.Tick += new System.EventHandler(this.tmrplayerhealthdetect_Tick);
- //
- // tmrenemyhealthdetect
- //
- this.tmrenemyhealthdetect.Tick += new System.EventHandler(this.tmrenemyhealthdetect_Tick);
- //
- // tmrredraw
- //
- this.tmrredraw.Tick += new System.EventHandler(this.tmrredraw_Tick);
- //
- // tmrvisualizer
- //
- this.tmrvisualizer.Tick += new System.EventHandler(this.tmrvisualizer_Tick);
- //
- // pongGameTimer
- //
- this.pongGameTimer.Interval = 30;
- this.pongGameTimer.Tick += new System.EventHandler(this.pongGameTimer_Tick);
- //
- // counter
- //
- this.counter.Interval = 1000;
- this.counter.Tick += new System.EventHandler(this.counter_Tick);
- //
- // tmrcountdown
- //
- this.tmrcountdown.Interval = 1000;
- this.tmrcountdown.Tick += new System.EventHandler(this.tmrcountdown_Tick);
- //
- // HackUI
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 11F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.BackColor = System.Drawing.Color.Black;
- this.ClientSize = new System.Drawing.Size(1339, 741);
- this.Controls.Add(this.panel2);
- this.Font = new System.Drawing.Font("Lucida Console", 8.25F);
- this.ForeColor = System.Drawing.Color.LightGreen;
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- this.Name = "HackUI";
- this.Text = "HackUI";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.this_Closing);
- this.Load += new System.EventHandler(this.HackUI_Load);
- this.tbui.ResumeLayout(false);
- this.tbui.PerformLayout();
- this.pnlenemy.ResumeLayout(false);
- this.pnlenemy.PerformLayout();
- this.pnlyou.ResumeLayout(false);
- this.pnlyou.PerformLayout();
- this.pnlbuy.ResumeLayout(false);
- this.pnlbuy.PerformLayout();
- this.pnldefensemanager.ResumeLayout(false);
- this.pnldefensemanager.PerformLayout();
- this.pnlpcinfo.ResumeLayout(false);
- this.pnlpcinfo.PerformLayout();
- this.flcontrols.ResumeLayout(false);
- this.flcontrols.PerformLayout();
- this.panel2.ResumeLayout(false);
- this.pgpong.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.paddleHuman)).EndInit();
- this.pnltutorial.ResumeLayout(false);
- this.pnltutorial.PerformLayout();
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.TableLayoutPanel tbui;
- private System.Windows.Forms.Panel pnlyou;
- private System.Windows.Forms.Panel pnlbuy;
- private System.Windows.Forms.TextBox txthostname;
- private System.Windows.Forms.Label lbhostname;
- private System.Windows.Forms.TextBox txtgrade;
- private System.Windows.Forms.Label lbgrade;
- private System.Windows.Forms.Label lbmoduleinfo;
- private System.Windows.Forms.ComboBox cmbbuyable;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Button btndonebuying;
- private System.Windows.Forms.Panel pnldefensemanager;
- private System.Windows.Forms.Button btnbuy;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.ComboBox cmbmodules;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Button btnnext;
- private System.Windows.Forms.Panel pnlpcinfo;
- private System.Windows.Forms.Label lbtargets;
- private System.Windows.Forms.Button btnpoweroff;
- private System.Windows.Forms.Button btnupgrade;
- private System.Windows.Forms.Label lbpcinfo;
- private System.Windows.Forms.Label lbmoduletitle;
- private System.Windows.Forms.Button btncloseinfo;
- private System.Windows.Forms.FlowLayoutPanel flcontrols;
- private System.Windows.Forms.Button btnaddmodule;
- private System.Windows.Forms.Label lbcompromised;
- private System.Windows.Forms.Label lbstats;
- private System.Windows.Forms.TextBox txtyourconsole;
- private System.Windows.Forms.TextBox txtenemyconsole;
- private System.Windows.Forms.Panel pnlenemy;
- private System.Windows.Forms.Label lbenemycompromised;
- private System.Windows.Forms.Label lbenemystats;
- private System.Windows.Forms.Panel panel2;
- private System.Windows.Forms.Timer tmrplayerhealthdetect;
- private System.Windows.Forms.Timer tmrenemyhealthdetect;
- private System.Windows.Forms.Timer tmrredraw;
- private System.Windows.Forms.Label lbcodepoints;
- private System.Windows.Forms.Button btntogglemusic;
- private System.Windows.Forms.Label lbsong;
- private System.Windows.Forms.Panel pnltutorial;
- private System.Windows.Forms.Label lbtutorial;
- private System.Windows.Forms.Timer tmrvisualizer;
- internal System.Windows.Forms.Panel pgpong;
- internal System.Windows.Forms.Label lblcountdown;
- internal System.Windows.Forms.Panel ball;
- internal System.Windows.Forms.PictureBox paddleHuman;
- internal System.Windows.Forms.Panel paddleComputer;
- internal System.Windows.Forms.Label lbllevelandtime;
- internal System.Windows.Forms.Label lblstatsY;
- internal System.Windows.Forms.Label lblstatsX;
- internal System.Windows.Forms.Timer pongGameTimer;
- internal System.Windows.Forms.Timer counter;
- internal System.Windows.Forms.Timer tmrcountdown;
- }
-} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Gameplay/HackUI.cs b/source/WindowsFormsApplication1/Gameplay/HackUI.cs
deleted file mode 100644
index a1c1555..0000000
--- a/source/WindowsFormsApplication1/Gameplay/HackUI.cs
+++ /dev/null
@@ -1,2112 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace ShiftOS
-{
- public partial class HackUI : Form
- {
- public HackUI()
- {
- InitializeComponent();
- this.TopMost = false;
- ThisEnemyHacker = new EnemyHacker("Test Dummy", "A test hacker", "A test hacker", 1, 1, "easy");
- }
-
- public event EventHandler OnWin;
-
- private bool InOnlineBattle = false;
- private Online.Hacking.NetTransmitter transmitter = null;
- private Online.Hacking.NetTransmitter _playerTransmitter = null;
- private Online.Hacking.NetListener receiver = null;
- private Online.Hacking.NetListener player_listener = null;
-
- public HackUI(EnemyHacker enemy)
- {
- ThisEnemyHacker = enemy;
- InitializeComponent();
- }
-
- public HackUI(Online.Hacking.NetTransmitter t, Online.Hacking.NetListener l, Online.Hacking.NetListener playerListener, Online.Hacking.NetTransmitter playerTransmitter)
- {
- InOnlineBattle = true;
- transmitter = t;
- receiver = l;
- player_listener = playerListener;
- _playerTransmitter = playerTransmitter;
- InitializeComponent();
- }
-
- public Computer ThisPlayerPC = null;
- private decimal TotalPlayerHP = 0;
- private EnemyHacker EnemyNet = null;
-
- private List<Module> MyNetwork = new List<Module>();
-
- #region PLAYER
-
- private void LoadPlayerScreen()
- {
- AntiVirusBounds = new List<Rectangle>();
- var tc = new Module(SystemType.Core, 1, "localhost");
- tc.HP = 100;
- TutorialNetwork.Add(tc);
- foreach (var m in GetMyNet())
- {
- if (m.Type == SystemType.Core)
- {
- MyNetwork.Add(m);
- }
- }
- VisualizePlayerNetwork();
- if (EnemyNet != null)
- {
- tmrplayerhealthdetect.Start();
- }
- else
- {
- tmrplayerhealthdetect.Start();
- }
- if (IsTutorial)
- {
- SetupTutorialUI(0);
- }
- if (InOnlineBattle)
- LoadOnlinePlayer();
- }
-
- private void VisualizePlayerNetwork()
- {
- AllPlayerComputers = new List<Computer>();
- foreach (Module m in MyNetwork)
- {
- if (AllPlayerComputers.Count <= 10)
- {
- var c = m.Deploy();
- if (c.Type == SystemType.Core)
- {
- ThisPlayerPC = c;
- }
- AddModule(c);
- }
- }
- if(ThisPlayerPC == null)
- {
- var m = new Module(SystemType.Core, 1, "localhost");
- GetMyNet().Add(m);
- MyNetwork.Add(m);
- var c = m.Deploy();
- ThisPlayerPC = c;
- AddModule(c);
- }
- }
-
- private void player_listener_ModuleRemoved(object sender, Online.Hacking.Events.ModuleRemoved e)
- {
- Computer c = null;
- foreach (var m in AllPlayerComputers)
- {
- if (m.Hostname == e.new_module)
- {
- c = m;
- }
- }
- AllPlayerComputers.Remove(c);
- c.Dispose();
- }
-
- private void player_listener_ModuleHealthSet(object sender, Online.Hacking.Events.Health e)
- {
- var mod = new Computer();
- foreach (var m in AllPlayerComputers)
- {
- if (m.Hostname == e.host_name)
- mod = m;
- }
- mod.HP = e.health;
- int old_hp = mod.HP;
- mod.HP = e.health;
- if (mod.HP > old_hp)
- {
- mod.throw_repaired();
- }
- else
- {
- mod.throw_damaged();
- }
- }
-
-
- public void LoadOnlinePlayer()
- {
- //register event handlers
- player_listener.ModuleHealthSet += player_listener_ModuleHealthSet;
- player_listener.ModuleRemoved += player_listener_ModuleRemoved;
- player_listener.ModuleDisabled += (o, e) =>
- {
- foreach (var c in AllPlayerComputers)
- {
- if (c.Hostname == e.hostName)
- {
- c.Disable();
- }
- }
- };
- }
-
- public List<Computer> AllPlayerComputers = null;
-
- private void tmrplayerhealthdetect_Tick(object sender, EventArgs e)
- {
- if(ThisPlayerPC != null)
- {
- ThisPlayerPC.Left = (pnlyou.Width - ThisPlayerPC.Width) / 2;
- ThisPlayerPC.Top = (pnlyou.Height - ThisPlayerPC.Height) / 2;
-
- }
- var rnd = new Random();
- int chance = 0;
- foreach (var pc in AllPlayerComputers)
- {
- if (pc.Disabled == false)
- {
- var elist = new List<Computer>();
- if (pc.Enslaved)
- elist = AllPlayerComputers;
- else
- elist = pc.Enemies;
- if (elist != null)
- {
- foreach (var enemy in elist)
- {
- if (enemy != null && enemy.HP > 0)
- {
- chance = rnd.Next(1, 15);
- if (chance == 7)
- {
- if (IsTutorial)
- {
- if (TutorialProgress == 32 || TutorialProgress == 9)
- {
- enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
- }
- else
- {
- enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
- }
- }
- }
- }
- }
- }
- decimal health = 0;
- foreach (var pc in AllPlayerComputers)
- {
- health += (decimal)pc.HP;
- }
- if (health > TotalPlayerHP)
- {
- TotalPlayerHP = health;
- }
- try
- {
- decimal percent = (health / TotalPlayerHP) * 100;
- lbstats.Text = $"System Health: {percent}%";
- }
- catch
- {
-
- }
- if (ThisPlayerPC.HP <= 0)
- {
- API.CreateInfoboxSession("System compromised.", "The enemy hacker has overthrown your defenses and compromised your system. You will need to wait until your core heals before beginning another battle.", infobox.InfoboxMode.Info);
- Hacking.Failure = true;
- Hacking.FailDate = DateTime.Now;
- UserRequestedClose = false;
- this.Close();
- }
- }
-
- public bool UserRequestedClose = true;
-
- private void this_Closing(object sender, FormClosingEventArgs e)
- {
- var t = new Thread(new ThreadStart(() =>
- {
- int prev_volume = Audio._wmp.settings.volume;
- while(Audio._wmp.settings.volume > 0)
- {
- Thread.Sleep(100);
- Audio._wmp.settings.volume -= 1;
- }
- Audio.ForceStop();
- Audio._wmp.settings.volume = prev_volume;
- }));
- t.Start();
- if (UserRequestedClose == false)
- {
- this.TopMost = false;
- Computer[] pcs = new Computer[AllPlayerComputers.Count];
- AllPlayerComputers.CopyTo(pcs);
- foreach (var pc in pcs)
- {
- pc?.Dispose();
- }
- Computer[] epcs = new Computer[AllEnemyComputers.Count];
- AllEnemyComputers.CopyTo(epcs);
- foreach (var epc in epcs)
- {
- epc?.Dispose();
- }
- tmrplayerhealthdetect.Stop();
- tmrenemyhealthdetect.Stop();
- Hacking.RepairTimer.Start(); //Now the player can repair.
- }
- else
- {
- e.Cancel = true;
- }
- }
-
- public Computer SelectedPlayerComputer = null;
-
- public Computer module_to_steal = null;
-
- public void AddModule(Computer newModule)
- {
- if (InOnlineBattle)
- {
- newModule.Transmitter = transmitter;
- transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.PlaceModule, new Online.Hacking.Module { Grade = newModule.Grade, Hostname = newModule.Hostname, HP = newModule.HP, Type = (int)newModule.Type, X = newModule.Left, Y = newModule.Top });
- }
- pnlyou.Controls.Add(newModule);
- int hp = newModule.HP;
- WriteLine($"[Network] Welcome to the network, {newModule.Hostname}!");
- TotalPlayerHP += newModule.HP;
- AllPlayerComputers.Add(newModule);
- newModule.Show();
- if (!InOnlineBattle)
- {
- newModule.StolenModule += (o, a) =>
- {
- var t = new Thread(new ThreadStart(() =>
- {
- var rnd = new Random();
- var lst = new List<Computer>();
- if (newModule.Enslaved)
- lst = AllPlayerComputers;
- else
- lst = AllEnemyComputers;
- WriteLine($"[{newModule.Hostname}] Starting network hack...");
- Thread.Sleep(5000);
-
- var pc = lst[rnd.Next(0, lst.Count)];
- this.Invoke(new Action(() =>
- {
- if (pc.Type != SystemType.Core)
- {
- module_to_steal = pc;
-
- pgpong.Left = (this.Width - pgpong.Width) / 2;
- pgpong.Top = (this.Height - pgpong.Height) / 2;
-
- pgpong.Show();
- newgame();
- }
- }));
- }));
- t.Start();
- };
- newModule.EnslavedModule += (o, e) =>
- {
- if (!newModule.Enslaved)
- {
- var pc = AllEnemyComputers[rand.Next(0, AllEnemyComputers.Count)];
- if (!pc.Enslaved)
- {
- WriteLine($"[{newModule.Hostname}] Successfully enslaved {pc.Hostname}");
- pc.Enslaved = true;
- }
-
- }
- };
- }
- newModule.OnDestruction += (object s, EventArgs a) =>
- {
- if (this.SelectedPlayerComputer == newModule)
- {
- SelectedPlayerComputer = null;
- }
- if (newModule.Type == SystemType.Firewall)
- {
- Player_Firewall_Destroy(newModule);
- }
- AllPlayerComputers.Remove(newModule);
- newModule.Dispose();
- WriteLine($"[Network] {newModule.Hostname} has gone OFFLINE.");
- transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.RemoveModule, newModule.Hostname);
- };
- newModule.Select += (object s, EventArgs e) =>
- {
- SelectedPlayerComputer = newModule;
- ShowPCInfo(newModule.Hostname);
- if (IsTutorial)
- {
- if (TutorialProgress == 6)
- {
- if (newModule == ThisPlayerPC)
- {
- SetupTutorialUI(7);
- }
- }
- }
- };
- newModule.HP_Decreased += new EventHandler(Player_System_Damaged);
- newModule.OnRepair += new EventHandler(Player_System_Repaired);
- if (newModule.Type == SystemType.Antivirus || newModule.Type == SystemType.RepairModule)
- {
- var b = newModule.GetAreaOfEffect();
- AntiVirusBounds.Add(b);
- pnlyou.Refresh();
- newModule.AntivirusRepair += (object s, EventArgs a) =>
- {
- foreach (Computer pc in AllPlayerComputers)
- {
- if (pc != newModule && pc.Bounds.IntersectsWith(b))
- {
- if (newModule.Type == SystemType.RepairModule)
- {
- if (pc.HP < newModule.HP)
- {
- if (pc.HP < pc.GetTotal())
- {
- WriteLine($"[{newModule.Hostname}] Repairing neighbouring system \"{pc.Hostname}\"");
- pc.Repair(1);
- }
- }
-
- }
- else
- {
- if (pc.HP < 10)
- {
- WriteLine($"[{newModule.Hostname}] Repairing neighbouring system \"{pc.Hostname}\"");
- pc.Repair(1);
- }
- }
- }
- }
- };
-
- }
- if (newModule.Type == SystemType.Firewall)
- {
- var b = newModule.GetAreaOfEffect();
- AntiVirusBounds.Add(b);
- pnlenemy.Refresh();
- Player_Firewall_Deflect(newModule);
- }
- if (newModule.Type == SystemType.ServerStack)
- {
- newModule.MassDDoS += (object s, EventArgs a) =>
- {
- if (newModule.Enslaved)
- WormToPlayer();
- else
- WormToEnemy();
- };
- }
- }
-
- public void WormToEnemy()
- {
- var rnd = new Random();
- int r = rnd.Next(0, 10);
- WriteLine("[Network] Launching distributed denial-of-service attack on rival network.");
- foreach (Computer c in AllEnemyComputers)
- {
- if (r == 5)
- {
- c.Disable();
- }
- }
- }
-
- public void ShowPCInfo(string hostname)
- {
- Computer c = null;
- foreach (var pc in AllPlayerComputers)
- {
- if (pc.Hostname == hostname)
- {
- c = pc;
- }
- }
-
- Module mod = null;
- foreach (var m in GetMyNet())
- {
- if (m.Hostname == hostname)
- {
- mod = m;
- }
- }
- if (mod != null)
- {
- pnlpcinfo.Left = 7;
- pnlpcinfo.Show();
- lbmoduletitle.Text = "Module Info - " + hostname;
- lbpcinfo.Text = $"Hostname: {hostname}{Environment.NewLine}Type: {mod.Type.ToString()}{Environment.NewLine}{Environment.NewLine}";
- if (mod.Type == SystemType.Core)
- {
- lbpcinfo.Text += Environment.NewLine + "This represents your main system. If this module is destroyed, you will automatically lose the battle. Protect it at all costs.";
- btnupgrade.Hide();
- btnpoweroff.Hide();
- }
- else
- {
- lbpcinfo.Text += $"{Environment.NewLine}Grade: {mod.Grade}";
- if (mod.Grade < 4)
- {
- btnupgrade.Show();
- }
- else
- {
- btnupgrade.Hide();
- }
- btnpoweroff.Show();
- }
-
- }
- if (c != null)
- {
- if (c.Enslaved)
- {
- lbtargets.Text = "*** WARNING ***: This module has been ENSLAVED! Consider a redeploy.";
- }
- else
- {
- lbtargets.Text = "Targets: ";
- if (c.Enemies != null)
- {
- if (c.Enemies.Count > 0)
- {
- foreach (var pc in c.Enemies)
- {
- lbtargets.Text += " " + pc.Hostname + ",";
- }
- }
- else
- {
- lbtargets.Text += " - Click on an enemy module to target it.";
- }
- }
- else
- {
- lbtargets.Text += " - Click on an enemy module to target it.";
- }
- lbtargets.Text += Environment.NewLine + "Some modules will not fire at their targets.";
- }
- }
- }
-
- public void Player_Firewall_Deflect(Computer fwall)
- {
- //Safegaurd...
- if (fwall.Type == SystemType.Firewall)
- {
- var r = fwall.GetAreaOfEffect();
- foreach (var pc in AllPlayerComputers)
- {
- if (pc != fwall)
- {
- if (pc.Bounds.IntersectsWith(r))
- {
- pc.DamageDefector = fwall.Grade;
- }
- }
- }
- }
- }
-
- public void Player_Firewall_Destroy(Computer fwall)
- {
- //Safegaurd...
- if (fwall.Type == SystemType.Firewall)
- {
- var r = fwall.GetAreaOfEffect();
- foreach (var pc in AllPlayerComputers)
- {
- if (pc.Bounds.IntersectsWith(r))
- {
- pc.DamageDefector = 1;
- UpdatePlayerFirewalls();
- }
- }
- }
- }
-
- public void UpdatePlayerFirewalls()
- {
- foreach (var pc in AllPlayerComputers)
- {
- if (pc.Type == SystemType.Firewall)
- {
- Player_Firewall_Deflect(pc);
- }
- }
- }
-
-
- private void Player_System_Repaired(object s, EventArgs e)
- {
- var c = (Computer)s;
- WriteLine($"[{c.Hostname}] System repaired.");
- lbcompromised.Text = "System regenerating...";
- int location = c.Left - (lbcompromised.Width / 4);
- int y = c.Top - 25;
- lbcompromised.Location = new Point(location, y);
- lbcompromised.Show();
- c.Flash(lbcompromised);
- transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{c.Hostname} {c.HP}");
- }
-
-
- private void Player_System_Damaged(object s, EventArgs e)
- {
- var c = (Computer)s;
- WriteLine($"[{c.Hostname}] System damaged. Total HP: {c.HP}");
- lbcompromised.Text = "System damaged!";
- int location = c.Left - (lbcompromised.Width / 4);
- int y = c.Top - 25;
- lbcompromised.Location = new Point(location, y);
- lbcompromised.Show();
- c.Flash(lbcompromised);
- transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{c.Hostname} {c.HP}");
-
- }
-
- private void btnaddmodule_Click(object sender, EventArgs e)
- {
- SetupModuleList();
- pnldefensemanager.Left = 7;
- pnldefensemanager.Visible = !pnldefensemanager.Visible;
- if (IsTutorial)
- {
- if (TutorialProgress == 12)
- {
- SetupTutorialUI(13);
- }
- }
- }
-
- private Dictionary<string, SystemType> FutureModules = null;
- public List<Module> TutorialNetwork = new List<Module>();
-
- public void SetupModuleList()
- {
- FutureModules = new Dictionary<string, SystemType>();
- cmbmodules.Items.Clear();
- List<Module> net = null;
- if (IsTutorial)
- {
- net = TutorialNetwork;
- }
- else
- {
- net = Hacking.MyNetwork;
- }
- foreach (var item in net)
- {
- Computer m = null;
- foreach (var mod in AllPlayerComputers)
- {
- if (mod.Hostname == item.Hostname)
- {
- m = mod;
- }
- }
- if (m == null)
- {
- if (item.HP > 0)
- {
- cmbmodules.Items.Add(item.Hostname);
- FutureModules.Add(item.Hostname, item.Type);
- }
- }
- }
-
- }
-
- bool PlacingNewModule = false;
-
-
- private void button1_Click_1(object sender, EventArgs e)
- {
- if (cmbmodules.Text != "")
- {
- PlacingNewModule = true;
- pnldefensemanager.Hide();
- if (IsTutorial)
- {
- if (TutorialProgress == 20)
- {
- SetupTutorialUI(21);
- }
- }
- }
- }
-
- private void playfield_MouseDown(object sender, MouseEventArgs e)
- {
- if (PlacingNewModule == true)
- {
- if (e.Button == MouseButtons.Left)
- {
- if (AllPlayerComputers.Count < 10)
- {
- bool cont = true;
- try
- {
- SystemType type = FutureModules[cmbmodules.Text];
- }
- catch
- {
- cont = false;
- API.CreateInfoboxSession("Error", "Please select a module type.", infobox.InfoboxMode.Info);
- }
- if (cont == true)
- {
- var coordinates = pnlyou.PointToClient(Cursor.Position);
- int x = coordinates.X;
- int y = coordinates.Y;
-
- var m = new Module(FutureModules[cmbmodules.Text], 1, cmbmodules.Text);
- foreach (var mod in GetMyNet())
- {
- if (mod.Hostname == cmbmodules.Text)
- {
- m = mod;
- }
- }
- m.X = x;
- m.Y = y;
- var c = m.Deploy();
- AddModule(c);
- API.RemoveCodepoints(10);
- pnldefensemanager.Hide();
- if (IsTutorial)
- {
- if (TutorialProgress == 21)
- {
- SetupTutorialUI(22);
- }
- else if (TutorialProgress == 25)
- {
- SetupTutorialUI(26);
- }
- }
- }
- PlacingNewModule = false;
- }
- else
- {
- API.CreateInfoboxSession("Too much deployed modules", "You can have a maximum of 10 modules deployed on your network, including your main system. You will have to wait for one to be destroyed.", infobox.InfoboxMode.Info);
- PlacingNewModule = false;
- }
- }
- else
- {
- PlacingNewModule = false;
- }
- }
- }
-
- public List<FutureModule> BuyableModules = null;
-
- public void SetupBuyable()
- {
- if (!IsTutorial)
- {
- BuyableModules = Hacking.GetFutureModules();
- }
- cmbbuyable.Items.Clear();
- foreach (var m in BuyableModules)
- {
- cmbbuyable.Items.Add(m.Name);
- }
- lbmoduleinfo.Text = "";
- txtgrade.Text = "1";
- }
-
- private void btnbuy_Click(object sender, EventArgs e)
- {
- if (IsTutorial)
- {
- if (TutorialProgress == 14)
- {
- SetupTutorialUI(15);
- }
- }
- SetupBuyable();
- pnlbuy.Show();
- pnldefensemanager.Hide();
- }
-
- public List<Rectangle> AntiVirusBounds = null;
- public List<Rectangle> IndicatorsToDestroy = new List<Rectangle>();
- private void boundpaint(object sender, PaintEventArgs e)
- {
- foreach (Rectangle r in IndicatorsToDestroy)
- {
- AntiVirusBounds.Remove(r);
- var sb = new SolidBrush(Color.Black);
- var p = new Pen(sb);
- p.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
- p.Width = 2;
- e.Graphics.DrawRectangle(p, r);
-
- }
- IndicatorsToDestroy.Clear();
- foreach (Rectangle r in AntiVirusBounds)
- {
- IndicatorsToDestroy.Add(r);
- tmrredraw.Start();
- var sb = new SolidBrush(Color.White);
- var p = new Pen(sb);
- p.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
- p.Width = 2;
- e.Graphics.DrawRectangle(p, r);
- }
- }
-
- private void tmrredraw_Tick(object sender, EventArgs e)
- {
- pnlyou.Refresh();
- tmrredraw.Stop();
- }
-
- private void SetupModuleInfo()
- {
- bool cont = false;
- FutureModule m = null;
- foreach (var mod in BuyableModules)
- {
- if (mod.Name == cmbbuyable.Text)
- {
- m = mod;
- cont = true;
- }
- }
- if (cont == true)
- {
- lbmoduleinfo.Text = m.Name;
- lbmoduleinfo.Text += Environment.NewLine + $"Cost: {m.Cost * Convert.ToInt32(txtgrade.Text)} CP";
- lbmoduleinfo.Text += Environment.NewLine + $"Description: {Environment.NewLine}{m.Description}";
- }
- }
-
- private void cmbbuyable_SelectedIndexChanged(object sender, EventArgs e)
- {
- SetupModuleInfo();
- if (IsTutorial)
- {
- if (TutorialProgress == 17)
- {
- if (cmbbuyable.Text == "Antivirus")
- {
- SetupTutorialUI(18);
- }
- }
- }
- }
-
- private void txtgrade_TextChanged(object sender, EventArgs e)
- {
- try
- {
- int g = Convert.ToInt32(txtgrade.Text);
- if (g < 1)
- {
- txtgrade.Text = "1";
- }
- else if (g > 4)
- {
- txtgrade.Text = "4";
- }
- SetupModuleInfo();
- }
- catch
- {
- txtgrade.Text = "1";
- SetupModuleInfo();
- }
- }
-
- public List<Module> GetMyNet()
- {
- if (IsTutorial)
- {
- return TutorialNetwork;
- }
- else
- {
- return Hacking.MyNetwork;
- }
- }
-
- private void btndonebuying_Click(object sender, EventArgs e)
- {
- var mod = new FutureModule("", 0, "", SystemType.Core);
- bool cont = false;
- foreach (var m in BuyableModules)
- {
- if (m.Name == cmbbuyable.Text)
- {
- mod = m;
- cont = true;
- }
- }
- if (cont == true)
- {
- if (API.Codepoints >= mod.Cost)
- {
- if (txthostname.Text != "")
- {
- bool cont2 = true;
- string hname = txthostname.Text.Replace(" ", "_");
- foreach (var pc in GetMyNet())
- {
- if (pc.Hostname == hname)
- {
- cont2 = false;
- }
- }
- if (cont2 == true)
- {
- var newModule = new Module(mod.Type, Convert.ToInt32(txtgrade.Text), hname);
- newModule.HP = newModule.GetTotalHP();
- GetMyNet().Add(newModule);
- API.RemoveCodepoints(mod.Cost);
- API.CreateInfoboxSession("Module added.", "To deploy the module to the network, select 'Add Module' and choose the hostname from the menu.", infobox.InfoboxMode.Info);
- pnlbuy.Hide();
- if (IsTutorial)
- {
- if (TutorialProgress == 19)
- {
- SetupTutorialUI(20);
- }
- else if (TutorialProgress == 24)
- {
- SetupTutorialUI(25);
- }
- }
- }
- else
- {
- API.CreateInfoboxSession("Please enter a unique hostname.", "No two computers can share the same hostname. Please choose another.", infobox.InfoboxMode.Info);
- }
- }
- else
- {
- API.CreateInfoboxSession("Please enter a hostname.", "It is best to enter a hostname for your new computer so you know which one it is.", infobox.InfoboxMode.Info);
- }
-
- }
- else
- {
- API.CreateInfoboxSession("Insufficient Codepoints", "You do not have enough Codepoints to buy this module.", infobox.InfoboxMode.Info);
- }
- }
- }
-
- private void btncloseinfo_Click(object sender, EventArgs e)
- {
- SelectedPlayerComputer = null;
- pnlpcinfo.Hide();
- Hacking.SaveCharacters();
- }
-
- private void btnpoweroff_Click(object sender, EventArgs e)
- {
- //Remove the computer from the game.
- pnlyou.Controls.Remove(SelectedPlayerComputer);
- AllPlayerComputers.Remove(SelectedPlayerComputer);
- btnpoweroff.Hide();
- }
-
- private void btnupgrade_Click(object sender, EventArgs e)
- {
- int price = 20 * SelectedPlayerComputer.Grade;
- if (API.Codepoints >= price)
- {
- foreach (var m in GetMyNet())
- {
- if (m.Hostname == SelectedPlayerComputer.Hostname)
- {
- SelectedPlayerComputer.Grade += 1;
- m.Grade += 1;
- Hacking.SaveCharacters();
- API.CreateInfoboxSession("Upgrade successful.", "Your module has been upgraded.", infobox.InfoboxMode.Info);
- }
- }
- }
- else
- {
- API.CreateInfoboxSession("Insufficient funds", $"You need at least {price} CP to upgrade this module.", infobox.InfoboxMode.Info);
- }
- ShowPCInfo(SelectedPlayerComputer.Hostname);
- }
-
- public int TutorialProgress = 0;
- public bool IsTutorial = false;
-
- public void SetupTutorialUI(int p)
- {
- TutorialProgress = p;
- lbtutorial.Show();
- pnltutorial.Show();
- pnltutorial.Left = (this.Width - pnltutorial.Width) / 2;
- pnltutorial.Top = (this.Height - pnltutorial.Height) / 2;
- switch (p)
- {
- case 0:
- lbtutorial.Text = "Welcome to the Hacker Battle tutorial. This guide will teach you the fundamentals and basics of taking part in a Hacker Battle. When you're done here, you'll be able to start up a network and start dominating others' networks.";
- btnaddmodule.Hide();
- btnnext.Show();
- break;
- case 1:
- lbtutorial.Text = "Let's go over the user interface. It's quite simple, actually. There are 4 different displays on your screen. One for your network, one for your console, and same for the enemy.";
- break;
- case 2:
- lbtutorial.Text = "On the left side is your console and playfield. Your console will log all the actions that happen on your network. Your Playfield is a visual representation of your network. Each square represents a different module. Most of your actions will take place in the Playfield.";
- break;
- case 3:
- lbtutorial.Text = "On the right is the enemy's console and playfield. Both playfields will show the HP (health) of each module, and the total network HP.";
- break;
- case 4:
- lbtutorial.Text = "If the enemy's total network health hits 0%, or his core's strength hits 0%, you win.";
- break;
- case 5:
- lbtutorial.Text = "However, if the same happens to you, you will lose the battle, and won't be able to fight back until your Core heals.";
- break;
- case 6:
- lbtutorial.Text = "Each network has one core. It is represented by the square in the centre of the playfield. Click on your Core to view information about it.";
- btnnext.Hide();
- break;
- case 7:
- lbtutorial.Text = "When you click on a module, you can see information about it, such as it's grade level, HP, and type. This module is a Core, so it has no grade level. It currently has 100 HP.";
- btnnext.Show();
- break;
- case 8:
- lbtutorial.Text = "When a module is selected you can left-click an enemy module to target it. This will make the selected module attempt to fire at the target. Cores are very weak, but are capable of bringing a target down by 1 HP.";
- break;
- case 9:
- lbtutorial.Text = "The enemy Core is attacking your Core now. Looks like it's time to fight back. Select your core, and target the enemy's Core to fight back.";
- btnnext.Hide();
- break;
- case 10:
- lbtutorial.Text = "Phew! He couldn't do much damage before we fought back. In a real battle, modules won't just stop fighting randomly, but for the purpose of this tutorial, your Core will stop attacking the enemy Core.";
- btnnext.Show();
- ThisPlayerPC.Enemies.Clear();
- break;
- case 11:
- lbtutorial.Text = "Should your Core fall to a fatal state in the future, you can deploy some defenses to slow the enemy down. Any hacker knows it's best to disable defenses before attacking the main target.";
- ThisPlayerPC.HP = 5;
- break;
- case 12:
- lbtutorial.Text = "We will look at ways of healing damaged modules now. You can add new modules to the network by clicking the [Add Module] button in the lower-left corner.";
- btnaddmodule.Show();
- btnnext.Hide();
- break;
- case 13:
- btnbuy.Hide();
- lbtutorial.Text = "You can select a module from the list of hostnames. Only modules that are not powered on will display in the menu.";
- btnnext.Show();
- BuyableModules = new List<FutureModule>();
- BuyableModules.Add(new FutureModule("Antivirus", 0, "This module will heal any other module within it's area of effect to 10 HP. Higher grades can improve it's area of effect.", SystemType.Antivirus));
- break;
- case 14:
- btnbuy.Show();
- lbtutorial.Text = "In this demonstration, you have no other modules to deploy. You will need to buy some modules to get started. Click [Buy New Module] to continue.";
- btnnext.Hide();
- break;
- case 15:
- cmbbuyable.Enabled = false;
- lbtutorial.Text = "Let's go over the user interface, shall we? At the top is a list of all possible module types.";
- btnnext.Show();
- btndonebuying.Hide();
- lbgrade.Hide();
- txtgrade.Hide();
- txthostname.Hide();
- lbhostname.Hide();
- lbmoduleinfo.Hide();
- break;
- case 16:
- lbtutorial.Text = "Below that, is the cost and description of the selected module type. It's invisible right now, but when you select a new module, it will populate.";
- lbmoduleinfo.Show();
- break;
- case 17:
- cmbbuyable.Enabled = true;
- lbtutorial.Text = "We need an Antivirus module, so go ahead and select it from the menu.";
- btnnext.Hide();
- break;
- case 18:
- lbtutorial.Text = "Normally, an Antivirus would cost us 15 Codepoints, however since this is a tutorial, it is free.";
- btnnext.Show();
- break;
- case 19:
- lbtutorial.Text = "Below the description is the Hostname box. A Hostname is used to identify the new module. Pick something you'll remember as this new Antivirus, then click [Buy] to purchase it.";
- btnnext.Hide();
- lbhostname.Show();
- txthostname.Show();
- btndonebuying.Show();
- break;
- case 20:
- btnnext.Hide();
- lbtutorial.Text = "Now that we have an antivirus module, go ahead and deploy it by selecting [Add Module], choosing the hostname you entered, and clicking [Done].";
- break;
- case 21:
- btnnext.Hide();
- lbtutorial.Text = "Alrighty. Now you get to choose where you place your module. Simply left-click in a blank area where you'd like to place the module. Right-click to cancel. Oh, be sure to place close to our Core!";
- break;
- case 22:
- lbtutorial.Text = "The Antivirus has been placed. You may've noticed that white dotted box around it when you placed it. If the Core is even slightly within the box, the Antivirus will heal it back to 10 HP.";
- btnnext.Show();
- break;
- case 23:
- lbtutorial.Text = "The higher the Antivirus' grade, the bigger this area of effect becomes. However, it will always only be able to heal modules to 10 HP.";
- break;
- case 24:
- lbtutorial.Text = "A Turret has been added to the list of buyable modules. Go pick one up!";
- btnnext.Hide();
- BuyableModules.Clear();
- BuyableModules.Add(new FutureModule("Turret", 0, "It's not super-effective, but the Turret will blast through any Grade 1 defenses pretty quickly. The higher the grade, the higher the strength.", SystemType.Turret));
- break;
- case 25:
- lbtutorial.Text = "Turrets can fire damaging viruses at their targets. Go ahead and place your Turret somewhere within the Antivirus's Area of Effect.";
- break;
- case 26:
- lbtutorial.Text = "Notice how the Turret only has 10 HP, just like the Antivirus?";
- btnnext.Show();
- break;
- case 27:
- lbtutorial.Text = "This is because both the Antivirus and Turret are at Grade 1. There are four grades of modules you can get, and you can easily upgrade by selecting a module and choosing [Upgrade This Module].";
- break;
- case 28:
- lbtutorial.Text = "Upgrading a module will increase it's max HP. Grade 1 is 10 HP, Grade 2 is 20 HP, Grade 3 is 40 HP, and Grade 4 is 80 HP.";
- break;
- case 29:
- lbtutorial.Text = "Some modules will have a higher attack rate based on their grade. Others may throw more damaging attacks, and any module's Area of Effect (if it has one) will grow.";
- break;
- case 30:
- lbtutorial.Text = "Another tip: Multiple modules can target the same module, and a module can have multiple targets. This means that you can have your Core and your Turret both attack the enemy Core.";
- break;
- case 31:
- lbtutorial.Text = "Some modules do not work on a target-based system. Some may work using an area-of-effect system (like an Antivirus), and some may target the entire enemy network.";
- break;
- case 32:
- pnltutorial.Left = this.Width - pnltutorial.Width;
- pnltutorial.Top = this.Height - flcontrols.Height - pnltutorial.Height;
- lbtutorial.Text = "We have reset both your Cores' health. Go ahead and finish off the enemy Core using your newfound skills.";
- ThisPlayerPC.HP = 100;
- ThisEnemyPC.HP = 100;
- btnnext.Hide();
- BuyableModules = new List<FutureModule>();
- BuyableModules.Add(new FutureModule("Antivirus", 0, "This module will heal any other module within it's area of effect to 10 HP. Higher grades can improve it's area of effect.", SystemType.Antivirus));
- BuyableModules.Add(new FutureModule("Turret", 0, "It's not super-effective, but the Turret will blast through any Grade 1 defenses pretty quickly. The higher the grade, the higher the strength.", SystemType.Turret));
- break;
- default:
- btnnext.Show();
- lbtutorial.Text = "This concludes the Hacker Battle tutorial. Happy hunting, soldier. Just kidding. Stay safe.";
- btnnext.Text = "Close";
- break;
- }
- }
-
- private void btnnext_Click(object sender, EventArgs e)
- {
- if (btnnext.Text == "Close")
- {
- UserRequestedClose = false;
- this.Close();
- }
- SetupTutorialUI(TutorialProgress + 1);
- }
-
- #endregion
-
- private void HackUI_Load(object sender, EventArgs e)
- {
- this.TopMost = false;
- Audio.Stopped += (o, a) =>
- {
- if (this != null)
- {
- Audio.Play("hackerbattle_ambient");
- }
- };
- Audio.Play("hackerbattle_ambient");
-
- Hacking.RepairTimer.Stop(); //Don't want the player to be able to repair dead modules during a battle!
- this.WindowState = FormWindowState.Maximized;
- LoadPlayerScreen();
- if (InOnlineBattle)
- LoadOnlineEnemy();
- else
- LoadEnemyScreen();
- tmrvisualizer.Interval = 10;
- tmrvisualizer.Start();
- }
-
- #region ENEMY
- private EnemyHacker ThisEnemyHacker { get; set; }
- public List<Computer> AllEnemyComputers = null;
- public Computer ThisEnemyPC { get; set; }
- private void LoadEnemyScreen()
- {
- AllEnemyComputers = new List<Computer>();
- VisualizeEnemyNetwork();
- tmrenemyhealthdetect.Start();
- ThisEnemyPC.Enemy = !InOnlineBattle;
- }
-
- private void VisualizeEnemyNetwork()
- {
- var rnd = new Random();
- foreach (Module m in ThisEnemyHacker.Network)
- {
- m.HP = m.GetTotalHP();
- var c = m.Deploy();
- if (c.Type == SystemType.Core)
- {
- ThisEnemyPC = c;
- ThisEnemyPC.EnemyComputer = ThisPlayerPC;
- ThisPlayerPC.EnemyComputer = ThisEnemyPC;
- }
- AddEnemyModule(c);
- c.Location = new Point(m.X, m.Y);
- }
- }
-
- public void Enemy_System_Attacking(object s, EventArgs a)
- {
- if (!InOnlineBattle)
- {
- int i = new Random().Next(AllPlayerComputers.Count);
- var pc = AllPlayerComputers[i];
- var se = (Computer)s;
- pc.LaunchAttack(se.GetProperType());
- }
- }
-
- public Computer SelectedEnemyComputer = null;
-
- public void AddEnemyModule(Computer newModule)
- {
- if(newModule.Type == SystemType.Core)
- {
- newModule.Left = (pnlenemy.Width - newModule.Width) / 2;
- newModule.Top = (pnlenemy.Height - newModule.Height) / 2;
- }
- var rnd = new Random();
- pnlenemy.Controls.Add(newModule);
- foreach (var pc in AllEnemyComputers)
- {
- while (newModule.Bounds.IntersectsWith(pc.Bounds))
- {
- newModule.Location = new Point(rnd.Next(100, 350), rnd.Next(100, 350));
- }
- }
- AllEnemyComputers.Add(newModule);
- int hp = newModule.HP;
- TotalEnemyHP += (decimal)newModule.HP;
- newModule.Show();
-
- newModule.StolenModule += (o, a) =>
- {
- var t = new Thread(new ThreadStart(() =>
- {
- var lst = new List<Computer>();
- if (!newModule.Enslaved)
- lst = AllPlayerComputers;
- else
- lst = AllEnemyComputers;
- WriteLine_Enemy($"[{newModule.Hostname}] Starting network hack...");
- Thread.Sleep(5000);
-
- var pc = lst[rnd.Next(0, lst.Count)];
- this.Invoke(new Action(() =>
- {
- if (pc.Type != SystemType.Core)
- {
- module_to_steal = pc;
-
- pgpong.Left = (this.Width - pgpong.Width) / 2;
- pgpong.Top = (this.Height - pgpong.Height) / 2;
-
- pgpong.Show();
- newgame();
- }
- }));
- }));
- t.Start();
- };
- newModule.EnslavedModule += (o, e) =>
- {
- if (!newModule.Enslaved)
- {
- var pc = AllPlayerComputers[rand.Next(0, AllPlayerComputers.Count)];
- if (!pc.Enslaved)
- {
- WriteLine_Enemy($"[{newModule.Hostname}] Successfully enslaved {pc.Hostname}");
- pc.Enslaved = true;
- }
-
- }
- };
- newModule.OnDestruction += (object s, EventArgs a) =>
- {
- if (this.SelectedEnemyComputer == newModule)
- {
- SelectedEnemyComputer = null;
- }
- WriteLine_Enemy($"[Network] {newModule.Hostname} has gone OFFLINE.");
- AllEnemyComputers.Remove(newModule);
- newModule.Dispose();
- };
- newModule.Select += (object s, EventArgs a) =>
- {
- bool c = true;
- foreach (var pc in SelectedPlayerComputer.Enemies)
- {
- if (pc.Hostname == newModule.Hostname)
- {
- c = false;
- }
- }
- if (c == true)
- {
- SelectedPlayerComputer.Enemies.Add(newModule);
- ShowPCInfo(SelectedPlayerComputer.Hostname);
- if (IsTutorial)
- {
- if (TutorialProgress == 9)
- {
- SetupTutorialUI(10);
- }
- }
- WriteLine_Enemy("[Network] WARNING! Rival system has targeted a system on this network!");
- WriteLine($"[Network] System \"{SelectedPlayerComputer.Hostname}\" is now targeting rival system \"{newModule.Hostname}\".");
- }
- };
- newModule.HP_Decreased += new EventHandler(Enemy_System_Damaged);
- newModule.OnRepair += new EventHandler(Enemy_System_Repaired);
- if (newModule.Type == SystemType.Antivirus)
- {
- var b = newModule.GetAreaOfEffect();
- newModule.AntivirusRepair += (object s, EventArgs a) =>
- {
- foreach (Computer pc in AllEnemyComputers)
- {
- if (pc != newModule && pc.Bounds.IntersectsWith(b))
- {
- if (newModule.Type == SystemType.RepairModule)
- {
- if (pc.HP < newModule.HP)
- {
- if (pc.HP < pc.GetTotal())
- {
- WriteLine_Enemy($"[{newModule.Hostname}] Repairing neighbouring system \"{pc.Hostname}\"...");
- pc.Repair(1);
- }
- }
-
- }
- else
- {
- if (pc.HP < 10)
- {
- pc.Repair(1);
- }
- }
- }
- }
- };
- }
- if (newModule.Type == SystemType.Firewall)
- {
- pnlenemy.Refresh();
- Enemy_Firewall_Deflect(newModule);
- }
- if (newModule.Type == SystemType.ServerStack)
- {
- newModule.MassDDoS += (object s, EventArgs a) =>
- {
- if (newModule.Enslaved)
- WormToEnemy();
- else
- WormToPlayer();
- };
- }
- newModule.Enemy = !InOnlineBattle;
- }
-
- public void Enemy_Firewall_Deflect(Computer fwall)
- {
- //Safeguard... also apparently I can't spell... because this used to be 'Safegaurd'...
- if (fwall.Enslaved == false && fwall.Type == SystemType.Firewall)
- {
- var r = fwall.GetAreaOfEffect();
- foreach (var pc in AllEnemyComputers)
- {
- if (pc != fwall)
- {
- if (pc.Bounds.IntersectsWith(r))
- {
- pc.DamageDefector = fwall.Grade;
- }
- }
- }
- }
- }
-
- public void Enemy_Firewall_Destroy(Computer fwall)
- {
- //Safegaurd...
- if (fwall.Type == SystemType.Firewall)
- {
- var r = fwall.GetAreaOfEffect();
- foreach (var pc in AllEnemyComputers)
- {
- if (pc.Bounds.IntersectsWith(r))
- {
- pc.DamageDefector = 1;
- UpdateEnemyFirewalls();
- }
- }
- }
- }
-
- public void UpdateEnemyFirewalls()
- {
- foreach (var pc in AllEnemyComputers)
- {
- if (pc.Type == SystemType.Firewall)
- {
- Enemy_Firewall_Deflect(pc);
- }
- }
- }
-
-
- private void Enemy_System_Repaired(object s, EventArgs e)
- {
- var c = (Computer)s;
- WriteLine_Enemy($"[{c.Hostname}] System repaired.");
- lbenemycompromised.Text = "System regenerating...";
- int location = c.Left - (lbenemycompromised.Width / 4);
- int y = c.Top - 25;
- lbenemycompromised.Location = new Point(location, y);
- lbenemycompromised.Show();
- c.Flash(lbenemycompromised);
- _playerTransmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{c.Hostname} {c.HP}");
- }
-
-
- private void Enemy_System_Damaged(object s, EventArgs e)
- {
- var c = (Computer)s;
- WriteLine_Enemy($"[{c.Hostname}] System damaged. Current HP: {c.HP}");
- WriteLine($"[Network] Damaged system on rival network with hostname \"{c.Hostname}\"");
- lbenemycompromised.Text = "System damaged!";
- int location = c.Left - (lbenemycompromised.Width / 4);
- int y = c.Top - 25;
- lbenemycompromised.Location = new Point(location, y);
- lbenemycompromised.Show();
- c.Flash(lbenemycompromised);
- _playerTransmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{c.Hostname} {c.HP}");
- }
-
- private decimal TotalEnemyHP = 0;
-
- private void tmrenemyhealthdetect_Tick(object sender, EventArgs e)
- {
- lbsong.Visible = true;
- btntogglemusic.Visible = true;
-
- lbsong.Text = Audio.Name + " @ " + Audio.CurrentPosition;
-
- decimal health = 0;
- lbcodepoints.Text = $"Codepoints: {API.Codepoints}";
- var rnd = new Random();
- int chance = 0;
- if (!InOnlineBattle)
- {
- foreach (var pc in AllEnemyComputers)
- {
- if (pc.Disabled == false)
- {
- var elist = new List<Computer>();
- if (pc.Enslaved)
- elist = AllEnemyComputers;
- else
- elist = AllPlayerComputers;
- foreach (var enemy in elist)
- {
- chance = rnd.Next(1, 20);
- if (chance == 10)
- {
- if (IsTutorial)
- {
- if (TutorialProgress == 9)
- {
- ThisPlayerPC.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
- else if (TutorialProgress == 32)
- {
- enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
- else
- {
- enemy.Enemies.Clear();
- }
- }
- else
- {
- enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
- }
- }
- }
- }
- }
- foreach (var pc in AllEnemyComputers)
- {
- health += (decimal)pc.HP;
- }
- try
- {
- decimal percent = (health / TotalEnemyHP) * 100;
- lbenemystats.Text = $"Enemy Health: {percent}%";
- if (ThisEnemyPC.HP <= 0)
- {
- if (IsTutorial)
- {
- SetupTutorialUI(33);
- }
- else
- {
- string message = "You have successfully beaten the enemy hacker.";
- if (ThisEnemyHacker.IsLeader == false)
- {
- switch(rnd.Next(0, 6))
- {
- case 1:
- API.AddCodepoints(1000);
- message = "You have beaten the enemy. You have earned some precious Codepoints for your effort!";
- break;
- case 2:
- message = "You have beaten the enemy. As a reward, all Shiftorium Upgrades cost half-price.";
- Hacking.GiveHack(Hack.PriceDrop);
- break;
- case 3:
- message = "You have beaten the enemy. As a reward, applications will now pay out more Codepoints than usual.";
- Hacking.GiveHack(Hack.PayoutIncrease);
- break;
- case 4:
- message = "The enemy has recognized your skill and has decided to become a friend. You can now hire them for free as a partner during a system hack.";
- //befriend the enemy.
- var skill = ThisEnemyHacker.FriendSkill;
- var speed = ThisEnemyHacker.FriendSpeed;
- var desc = ThisEnemyHacker.FriendDesc;
- var name = ThisEnemyHacker.Name;
- Hacking.AddCharacter(new Character(name, desc, skill, speed, 0));
- break;
- case 5:
- var cats = SaveSystem.ShiftoriumRegistry.GetCategories(false);
- string cat = cats[rnd.Next(0, cats.Count - 1)];
- if (API.Upgrades[cat] == false)
- {
- API.Upgrades[cat] = true;
- message = $"You have beaten the enemy, and as a result, the {cat.ToUpper()} Shiftorium category has been unlocked.";
- }
- break;
- default:
- message = "You have successfully beaten the enemy hacker.";
- break;
- }
- }
- API.CreateInfoboxSession("You won.", message, infobox.InfoboxMode.Info);
-
- UserRequestedClose = false;
- var h = OnWin;
- if(h != null)
- {
- h(this, new EventArgs());
- }
- this.Close();
- }
- }
- }
- catch
- {
-
- }
- }
-
- public void WormToPlayer()
- {
- var rnd = new Random();
- int r = rnd.Next(0, 10);
- WriteLine_Enemy("[NETWORK] Launching distributed denial-of-service attack on rival network...");
- foreach (Computer c in AllPlayerComputers)
- {
- if (r == 5)
- {
- c.Disable();
- }
- }
- }
-
- public void WriteLine_Enemy(string text)
- {
- try
- {
- if (txtenemyconsole.Text.Length == 0)
- {
- txtenemyconsole.Text = text + Environment.NewLine;
- }
- else
- {
- txtenemyconsole.Text += text + Environment.NewLine;
- }
- txtenemyconsole.Select(txtenemyconsole.TextLength, 0);
- txtenemyconsole.ScrollToCaret();
- }
- catch
- {
- this.Invoke(new Action(() => { WriteLine_Enemy(text); }));
- }
- }
-
- public void WriteLine(string text)
- {
- try
- {
- if (txtyourconsole.Text.Length == 0)
- {
- txtyourconsole.Text = text + Environment.NewLine;
- }
- else
- {
- txtyourconsole.Text += text + Environment.NewLine;
- }
- txtyourconsole.Select(txtyourconsole.TextLength, 0);
- txtyourconsole.ScrollToCaret();
- }
- catch
- {
- this.Invoke(new Action(() => { WriteLine(text); }));
- }
- }
-
- #endregion
-
- #region ONLINE ENEMY
-
- public void LoadOnlineEnemy()
- {
- AllEnemyComputers = new List<Computer>();
- tmrenemyhealthdetect.Start();
- //register event handlers
- receiver.ModuleHealthSet += Receiver_ModuleHealthSet;
- receiver.ModulePlaced += Receiver_ModulePlaced;
- receiver.ModuleUpgraded += Receiver_ModuleUpgraded;
- receiver.ModuleRemoved += Receiver_ModuleRemoved;
- receiver.ModuleDisabled += (o, e) =>
- {
- foreach(var c in AllEnemyComputers)
- {
- if(c.Hostname == e.hostName)
- {
- c.Disable();
- }
- }
- };
- receiver.Won += (o, e) =>
- {
- //the enemy won!
- tmrplayerhealthdetect.Stop();
- tmrenemyhealthdetect.Stop();
- //dispose all the modules.
- while(AllPlayerComputers.Count > 0)
- {
- AllPlayerComputers[0].Dispose();
- AllPlayerComputers.RemoveAt(0);
- }
- while (AllEnemyComputers.Count > 0)
- {
- AllEnemyComputers[0].Dispose();
- AllEnemyComputers.RemoveAt(0);
- }
- //Destroy server connection.
- Online.Hacking.Matchmaker.DestroySession();
- //Display win message.
- API.CreateInfoboxSession($"{e.Winner.Name} won.", $"{e.Winner.Name} has overthrown your defenses and compromised your system.", infobox.InfoboxMode.Info);
- //Kill the hacker UI.
- UserRequestedClose = false;
- this.Close();
- };
- }
-
- private void Receiver_ModuleRemoved(object sender, Online.Hacking.Events.ModuleRemoved e)
- {
- Computer c = null;
- foreach(var m in AllEnemyComputers)
- {
- if(m.Hostname == e.new_module)
- {
- c = m;
- }
- }
- AllEnemyComputers.Remove(c);
- c.Dispose();
- }
-
- private void Receiver_ModuleUpgraded(object sender, Online.Hacking.Events.ModuleUpgraded e)
- {
- foreach(var m in AllEnemyComputers)
- {
- if (m.Hostname == e.hostname)
- m.Grade = e.grade;
- }
- }
-
- private void Receiver_ModulePlaced(object sender, Online.Hacking.Events.ModulePlaced e)
- {
- var newModule = new Module((SystemType)e.new_module.Type, e.new_module.Grade, e.new_module.Hostname);
- newModule.HP = e.new_module.HP;
- newModule.X = e.new_module.X;
- newModule.Y = e.new_module.Y;
- AddEnemyModule(newModule.Deploy());
- }
-
- private void Receiver_ModuleHealthSet(object sender, Online.Hacking.Events.Health e)
- {
- var mod = new Computer();
- foreach(var m in AllEnemyComputers)
- {
- if (m.Hostname == e.host_name)
- mod = m;
- }
- int old_hp = mod.HP;
- mod.HP = e.health;
- if(mod.HP > old_hp)
- {
- mod.throw_repaired();
- }
- else
- {
- mod.throw_damaged();
- }
- }
-
- #endregion
-
- bool playing = true;
-
- private void button2_Click(object sender, EventArgs e)
- {
- if (playing == true)
- {
- Audio.ForceStop();
- }
- else
- {
- Audio.Play("hackerbattle_ambient");
- }
- playing = !playing;
- }
-
- Panel winningPlayfield = null;
-
- int bgcol = 0;
- int pulse = 0;
- Panel losingPlayfield = null;
- private void tmrvisualizer_Tick(object sender, EventArgs e)
- {
- int enemy_hp = 0;
- int player_hp = 0;
- foreach(var p in AllPlayerComputers)
- {
- player_hp += p.HP;
- }
- foreach (var p in AllEnemyComputers)
- {
- enemy_hp += p.HP;
- }
-
- if (player_hp >= enemy_hp)
- {
- winningPlayfield = pnlyou;
- losingPlayfield = pnlenemy;
- }
- else
- {
- winningPlayfield = pnlenemy;
- losingPlayfield = pnlyou;
- }
-
- losingPlayfield.BackColor = Color.Black;
-
-
- try
- {
- var visualizer = Audio.GetVisualizer();
- switch(visualizer.type)
- {
- case VisualizerType.Pulse:
- tmrvisualizer.Interval = 1;
- if(pulse == 0)
- {
- if(bgcol < 255)
- {
- bgcol += 10;
- }
- else
- {
- pulse = 1;
- }
- }
- else
- {
- if(bgcol > 0)
- {
- bgcol -= 10;
- }
- else
- {
- pulse = 0;
- }
- }
- break;
- case VisualizerType.CalmDown:
- bgcol = 255 - MathEx.LinearInterpolate(visualizer.startTime * 100, visualizer.endTime * 100, Audio.CurrentPositionMS, 0, 255);
- break;
- case VisualizerType.BuildUp:
- bgcol = MathEx.LinearInterpolate(visualizer.startTime, visualizer.endTime, Audio.CurrentPosition, 0, 255);
- break;
- }
- Color c = new Color();
- int r = 0;
- int g = 0;
- int b = 0;
- if (visualizer.R)
- r = bgcol;
- if (visualizer.G)
- g = bgcol;
- if (visualizer.B)
- b = bgcol;
- c = Color.FromArgb(r, g, b);
- if(playing)
- winningPlayfield.BackColor = c;
- }
- catch
- {
-
- }
- }
-
- private void pongMain_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
- {
- paddleHuman.Location = new Point(paddleHuman.Location.X, (MousePosition.Y - pgpong.Location.Y) - (paddleHuman.Height / 2));
- }
-
-
- private void pongGameTimer_Tick(object sender, EventArgs e)
- {
- //Set the computer player to move according to the ball's position.
- if (ball.Location.X > 500 - xVel * 10 && xVel > 0)
- {
- if (ball.Location.Y > paddleComputer.Location.Y + 50)
- {
- paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y + computerspeed * 2 + ((int)yveldec / 2));
- }
- if (ball.Location.Y < paddleComputer.Location.Y + 50)
- {
- paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y - computerspeed * 2 + ((int)yveldec / 2));
- }
- casualposition = rand.Next(-150, 201);
- }
-
- //Set Xvel and Yvel speeds from decimal
- if (xVel > 0)
- xVel = (int)Math.Round(xveldec);
- if (xVel < 0)
- xVel = (int)-Math.Round(xveldec);
- if (yVel > 0)
- yVel = (int)Math.Round(yveldec);
- if (yVel < 0)
- yVel = (int)-Math.Round(yveldec);
-
- // Move the game ball.
- ball.Location = new Point(ball.Location.X + xVel, ball.Location.Y + yVel);
-
- // Check for top wall.
- if (ball.Location.Y < 0)
- {
- ball.Location = new Point(ball.Location.X, 0);
- yVel = -yVel;
- }
-
- // Check for bottom wall.
- if (ball.Location.Y > pgpong.Height - ball.Height)
- {
- ball.Location = new Point(ball.Location.X, pgpong.Height - ball.Size.Height);
- yVel = -yVel;
- }
-
- // Check for player paddle.
- if (ball.Bounds.IntersectsWith(paddleHuman.Bounds))
- {
- ball.Location = new Point(paddleHuman.Location.X + ball.Size.Width, ball.Location.Y);
- //randomly increase x or y speed of ball
- switch (rand.Next(1, 3))
- {
- case 1:
- xveldec = xveldec + incrementx;
- break;
- case 2:
- if (yveldec > 0)
- yveldec = yveldec + incrementy;
- if (yveldec < 0)
- yveldec = yveldec - incrementy;
- break;
- }
- xVel = -xVel;
- }
-
- // Check for computer paddle.
- if (ball.Bounds.IntersectsWith(paddleComputer.Bounds))
- {
- ball.Location = new Point(paddleComputer.Location.X - paddleComputer.Size.Width + 1, ball.Location.Y);
- xveldec = xveldec + incrementx;
- xVel = -xVel;
- }
-
- // Check for left wall.
- if (ball.Location.X < -100)
- {
- var m = module_to_steal;
- if (m.Enemy)
- AllEnemyComputers.Remove(m);
-
- var lst = new List<Module>();
- if (!m.Enemy)
- lst = MyNetwork;
- else
- lst = ThisEnemyHacker.Network;
-
- string hn = m.Hostname;
-
- Module mod = null;
- foreach(var pc in lst)
- {
- if(pc.Hostname == hn)
- {
- mod = pc;
- }
- }
-
- if (!AllPlayerComputers.Contains(m))
- AddModule(mod.Deploy());
-
- if(!Hacking.MyNetwork.Contains(mod))
- {
- Hacking.MyNetwork.Add(mod);
- }
-
- if(module_to_steal.Parent != pnlyou)
- {
- module_to_steal.Parent.Controls.Remove(module_to_steal);
- module_to_steal.Dispose();
- }
- tmrcountdown.Stop();
- pongGameTimer.Stop();
- counter.Stop();
- pgpong.Hide();
- }
-
- // Check for right wall.
- if (ball.Location.X > pgpong.Width - ball.Size.Width - paddleComputer.Width + 100)
- {
- var m = module_to_steal;
- if (!m.Enemy)
- AllPlayerComputers.Remove(m);
-
- var lst = new List<Module>();
- if (!m.Enemy)
- lst = MyNetwork;
- else
- lst = ThisEnemyHacker.Network;
-
- string hn = m.Hostname;
-
- Module mod = null;
- foreach (var pc in lst)
- {
- if (pc.Hostname == hn)
- {
- mod = pc;
- }
- }
-
- if (!AllEnemyComputers.Contains(m))
- AddEnemyModule(mod.Deploy());
-
- if (!ThisEnemyHacker.Network.Contains(mod))
- {
- ThisEnemyHacker.Network.Add(mod);
- }
-
- if (module_to_steal.Parent != pnlenemy)
- {
- module_to_steal.Parent.Controls.Remove(module_to_steal);
- module_to_steal.Dispose();
- }
- tmrcountdown.Stop();
- pongGameTimer.Stop();
- counter.Stop();
- pgpong.Hide();
- }
-
- //lblstats.Text = "Xspeed: " & Math.Abs(xVel) & " Yspeed: " & Math.Abs(yVel) & " Human Location: " & paddleHuman.Location.ToString & " Computer Location: " & paddleComputer.Location.ToString & Environment.NewLine & " Ball Location: " & ball.Location.ToString & " Xdec: " & xveldec & " Ydec: " & yveldec & " Xinc: " & incrementx & " Yinc: " & incrementy
- lblstatsX.Text = "Xspeed: " + xveldec;
- lblstatsY.Text = "Yspeed: " + yveldec;
-
- lbllevelandtime.Text = "Level: " + level;
-
- if (xVel > 20 || xVel < -20)
- {
- paddleHuman.Width = Math.Abs(xVel);
- paddleComputer.Width = Math.Abs(xVel);
- }
- else
- {
- paddleHuman.Width = 20;
- paddleComputer.Width = 20;
- }
-
- computerspeed = Math.Abs(yVel);
-
- // pgcontents.Refresh()
- // pgcontents.CreateGraphics.FillRectangle(Brushes.Black, ball.Location.X, ball.Location.Y, ball.Width, ball.Height)
-
- }
-
- #region pong visualizer variables
-
- Random rand = new Random();
- int xVel = 7;
- int yVel = 8;
- int computerspeed = 8;
- int level = 1;
- int secondsleft = 60;
- int casualposition;
- double xveldec = 3.0;
- double yveldec = 3.0;
- double incrementx = 0.4;
- double incrementy = 0.2;
- int levelxspeed = 3;
- int levelyspeed = 3;
- int[] levelrewards = new int[50];
- int countdown = 3;
-
- #endregion
-
- private void counter_Tick(object sender, EventArgs e)
- {
- secondsleft = secondsleft - 1;
- if (secondsleft == -1)
- {
- secondsleft = 60;
- level = level + 1;
- }
- }
-
- private void tmrcountdown_Tick(object sender, EventArgs e)
- {
- switch (countdown)
- {
- case 0:
- countdown = 3;
- lblcountdown.Hide();
- pongGameTimer.Start();
- counter.Start();
- tmrcountdown.Stop();
- break;
- case 1:
- lblcountdown.Text = "1";
- countdown = countdown - 1;
- break;
- case 2:
- lblcountdown.Text = "2";
- countdown = countdown - 1;
- break;
- case 3:
- lblcountdown.Text = "3";
- countdown = countdown - 1;
- lblcountdown.Show();
- break;
- }
-
- }
-
- private void newgame()
- {
- level = 1;
- secondsleft = 60;
- //reset stats text
- lblstatsX.Text = "Xspeed: ";
- lblstatsY.Text = "Yspeed: ";
-
- levelxspeed = 3;
- levelyspeed = 3;
-
- incrementx = 0.4;
- incrementy = 0.2;
-
- xveldec = levelxspeed;
- yveldec = levelyspeed;
-
- tmrcountdown.Start();
- if (xVel < 0)
- xVel = Math.Abs(xVel);
- lbllevelandtime.Text = "Level: " + level + " - " + secondsleft + " Seconds Left";
- }
- }
-}
-
-namespace System
-{
- public class MathEx
- {
- public static int LinearInterpolate(int input_start, int input_end, int input, int output_start, int output_end)
- {
- int input_range = input_end - input_start;
- int output_range = output_end - output_start;
-
- return (input - input_start) * output_range / input_range + output_start;
- }
- }
-}
diff --git a/source/WindowsFormsApplication1/Gameplay/HackUI.resx b/source/WindowsFormsApplication1/Gameplay/HackUI.resx
deleted file mode 100644
index 9def72b..0000000
--- a/source/WindowsFormsApplication1/Gameplay/HackUI.resx
+++ /dev/null
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="lbmoduleinfo.Text" xml:space="preserve">
- <value>When you press 'Done', simply click where you'd like to place the new module. You can right-click the playing field to cancel the deployment.
-
-Some modules have a range of effect. For example, an Antivirus will only heal modules within it's area of effect and only if their HP is below 10. This can be upgraded.
-
-To upgrade a module, simply right-click it on the playing field and choose 'Upgrade this module'.
-
-If you would like to buy a new module, click 'Buy new module'.</value>
- </data>
- <data name="label3.Text" xml:space="preserve">
- <value>When you press 'Done', simply click where you'd like to place the new module. You can right-click the playing field to cancel the deployment.
-
-Some modules have a range of effect. For example, an Antivirus will only heal modules within it's area of effect and only if their HP is below 10. This can be upgraded.
-
-To upgrade a module, simply right-click it on the playing field and choose 'Upgrade this module'.
-
-If you would like to buy a new module, click 'Buy new module'.</value>
- </data>
- <data name="lbpcinfo.Text" xml:space="preserve">
- <value>When you press 'Done', simply click where you'd like to place the new module. You can right-click the playing field to cancel the deployment.
-
-Some modules have a range of effect. For example, an Antivirus will only heal modules within it's area of effect and only if their HP is below 10. This can be upgraded.
-
-To upgrade a module, simply right-click it on the playing field and choose 'Upgrade this module'.
-
-If you would like to buy a new module, click 'Buy new module'.</value>
- </data>
- <data name="lbtutorial.Text" xml:space="preserve">
- <value>When you press 'Done', simply click where you'd like to place the new module. You can right-click the playing field to cancel the deployment.
-
-Some modules have a range of effect. For example, an Antivirus will only heal modules within it's area of effect and only if their HP is below 10. This can be upgraded.
-
-To upgrade a module, simply right-click it on the playing field and choose 'Upgrade this module'.
-
-If you would like to buy a new module, click 'Buy new module'.</value>
- </data>
- <metadata name="tmrplayerhealthdetect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
- <metadata name="tmrenemyhealthdetect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>63, 42</value>
- </metadata>
- <metadata name="tmrredraw.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>191, 17</value>
- </metadata>
- <metadata name="tmrvisualizer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>238, 42</value>
- </metadata>
- <metadata name="pongGameTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>358, 42</value>
- </metadata>
- <metadata name="counter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>501, 42</value>
- </metadata>
- <metadata name="tmrcountdown.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>594, 42</value>
- </metadata>
-</root> \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Gameplay/Hacking.cs b/source/WindowsFormsApplication1/Gameplay/Hacking.cs
deleted file mode 100644
index 23c382d..0000000
--- a/source/WindowsFormsApplication1/Gameplay/Hacking.cs
+++ /dev/null
@@ -1,810 +0,0 @@
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace ShiftOS
-{
- /// <summary>
- /// Hacker battles and stuff like that.
- /// </summary>
- public class Hacking
- {
- public static List<Character> Characters = new List<Character>();
- public static List<HackTool> Tools = new List<HackTool>();
- public static List<EnemyHacker> EnemyHackers = new List<EnemyHacker>();
- public static List<Module> MyNetwork = new List<Module>();
- public static bool Failure = false;
- public static DateTime FailDate = DateTime.Now;
- internal static string HackerBattleAward = null;
- public static Timer RepairTimer = null;
-
- public static Module MyCore
- {
- get
- {
- var m = new Module(SystemType.Core, 1, "invalid");
- foreach(var mod in MyNetwork)
- {
- if(mod.Hostname == "localhost")
- {
- m = mod;
- }
- }
- return m;
- }
- }
-
- /// <summary>
- /// Gives a shiftorium upgrade for free.
- /// </summary>
- /// <param name="id">Upgrade ID.</param>
- public static void GiveUpgrade(string id)
- {
- API.Upgrades[id] = true;
- }
-
- /// <summary>
- /// Increases skill of a character.
- /// </summary>
- /// <param name="cid">The character ID.</param>
- public static void IncreaseSkill(int cid)
- {
- var rnd = new Random();
- int newspeed = rnd.Next(0, 5);
- int newskill = rnd.Next(0, 10);
- Characters[cid].Speed += newspeed;
- Characters[cid].Skill += newskill;
- SaveCharacters();
- API.CreateInfoboxSession("Hack complete.", $"{Characters[cid].Name} has successfully completed their hack. {Characters[cid].Name} has gained {newspeed} Speed Points, and {newskill} Skill Points.", infobox.InfoboxMode.Info);
- }
-
- /// <summary>
- /// Applies a hack.
- /// </summary>
- /// <param name="hack">Type of hack to apply.</param>
- public static void GiveHack(Hack hack)
- {
- switch (hack)
- {
- case Hack.PayoutIncrease:
- API.CurrentSave.CodepointMultiplier += 1;
- break;
- case Hack.PriceDrop:
- API.CurrentSave.PriceDivider += 1;
- break;
- }
- }
-
- /// <summary>
- /// Add a new character.
- /// </summary>
- /// <param name="ch">The new character.</param>
- public static void AddCharacter(Character ch)
- {
- bool c = true;
- foreach(var character in Characters)
- {
- if(character.Name == ch.Name)
- {
- c = false;
- }
- }
- if(c == true)
- {
- Characters.Add(ch);
- SaveCharacters();
- }
- }
-
- /// <summary>
- /// Adds a new hacking tool.
- /// </summary>
- /// <param name="ch">The hacking tool.</param>
- public static void AddTool(HackTool ch)
- {
- if (!Tools.Contains(ch))
- {
- Tools.Add(ch);
- }
- }
-
- /// <summary>
- /// Returns a random hack type.
- /// </summary>
- /// <returns>The hack type.</returns>
- public static Hack GetRandomHack()
- {
- var t = new List<Hack>(Enum.GetValues(typeof(Hack)).Cast<Hack>());
- var rnd = new Random();
- return t[rnd.Next(0, t.Count - 1)];
- }
-
- /// <summary>
- /// Start a hack with a character.
- /// </summary>
- /// <param name="cid">Character to hire.</param>
- /// <param name="hack">Type of hack to pull off.</param>
- public static void StartHackWithCharacter(int cid, Hack hack)
- {
- var h = Characters[cid];
- var f = new Form();
- f.BackColor = Color.Black;
- f.ForeColor = Color.White;
- f.Font = new Font(OSInfo.GetMonospaceFont(), 9);
- var l = new Label();
- int p = 0;
- int speed = 10000 / h.Speed; //If a hacker has a speed of one, it will take 10,000 milliseconds to move 1% in the hack progress. Divide it by a thousand, you get 1,000 seconds.
- var t = new Timer();
- t.Interval = speed;
- f.FormBorderStyle = FormBorderStyle.None;
- f.Show();
- switch (API.CurrentSkin.desktoppanelposition)
- {
- case "Top":
- f.Location = new Point(5, API.CurrentSkin.desktoppanelheight + 5);
- break;
- case "Bottom":
- f.Location = new Point(5, 5);
- break;
- }
-
- f.Controls.Add(l);
- l.Show();
- l.TextAlign = ContentAlignment.MiddleCenter;
- f.Height = 25;
- f.TopMost = true;
- l.Text = $"Progress: {p}%";
- l.Dock = DockStyle.Fill;
- t.Tick += (object s, EventArgs a) =>
- {
- if (l.Text != "Hack failed.")
- {
- if (p <= 100)
- {
- l.Text = $"Progress: {p}%";
- int fail = new Random().Next(0, h.Skill * h.Speed);
- if (fail == 1)
- {
- l.Text = "Hack failed.";
- }
- }
- else
- {
- GiveHack(hack);
- f.Close();
- t.Stop();
- IncreaseSkill(cid);
- }
- }
- else
- {
- f.Close();
- t.Stop();
- }
-
- p += 1;
- };
- t.Start();
- }
-
- /// <summary>
- /// Hacker Battles: List of modules the user can buy.
- /// </summary>
- /// <returns>The list that was created by the method. What did you think it would return? A boolean?</returns>
- public static List<FutureModule> GetFutureModules()
- {
- var lst = new List<FutureModule>();
- lst.Add(new FutureModule("Antivirus", 15, "This module will heal any other module within it's area of effect to 10 HP. Higher grades can improve it's area of effect.", SystemType.Antivirus));
- lst.Add(new FutureModule("Enslaver", 75, "The Enslaver is a scary module for an opposing network. At any time, the Enslaver can take over any module on the enemy network and turn it against them.", SystemType.Enslaver));
- lst.Add(new FutureModule("Module Thief", 100, "The Module Thief can hack into the enemy's network and attempt to steal one of their modules and bring them into your network temporarily though. Be careful though, it might not work all the time!", SystemType.ModuleStealer));
- lst.Add(new FutureModule("Dedicated DDoS module", 10, "This module will attempt to disable the enemy network by sending a DDoS attack allowing you to take a breather.", SystemType.DedicatedDDoS));
- lst.Add(new FutureModule("Turret", 5, "It's not super-effective, but the Turret will blast through any Grade 1 defenses pretty quickly. The higher the grade, the higher the strength.", SystemType.Turret));
- lst.Add(new FutureModule("Firewall", 20, "Will decrease the amount of damage taken by any module within it's area of effect. The higher the grade, the bigger the area of effect and more protection it offers.", SystemType.Firewall));
- lst.Add(new FutureModule("Repair Module", 150, "Slowly repairs all modules within the area of effect to the same HP as the repair module.", SystemType.RepairModule));
- lst.Add(new FutureModule("Server Stack", 250, "Capable of sending a worm attack to the entire enemy network, preventing it from attacking until it can recover.", SystemType.ServerStack));
- return lst;
- }
-
- /// <summary>
- /// Hire a character to attempt to hack a Shiftorium Upgrade.
- /// </summary>
- /// <param name="cid">The character.</param>
- /// <param name="upgrade">The upgrade ID.</param>
- public static void StartHackWithCharacter(int cid, string upgrade)
- {
- if (upgrade == "random")
- {
- StartHackWithCharacter(cid, GetRandomHack());
- }
- else {
- var h = Characters[cid];
- var f = new Form();
- f.BackColor = Color.Black;
- f.ForeColor = Color.White;
- f.Font = new Font(OSInfo.GetMonospaceFont(), 9);
- var l = new Label();
- int p = 0;
- int speed = 10000 / h.Speed; //If a hacker has a speed of one, it will take 10,000 milliseconds to move 1% in the hack progress. Divide it by a thousand, you get 1,000 seconds.
- var t = new Timer();
- t.Interval = speed;
- f.FormBorderStyle = FormBorderStyle.None;
- f.Show();
- switch (API.CurrentSkin.desktoppanelposition)
- {
- case "Top":
- f.Location = new Point(5, API.CurrentSkin.desktoppanelheight + 5);
- break;
- case "Bottom":
- f.Location = new Point(5, 5);
- break;
- }
-
- f.Controls.Add(l);
- l.Show();
- l.TextAlign = ContentAlignment.MiddleCenter;
- f.Height = 25;
- f.TopMost = true;
- l.Text = $"Progress: {p}%";
- l.Dock = DockStyle.Fill;
- t.Tick += (object s, EventArgs a) =>
- {
- if (l.Text != "Hack failed.")
- {
- if (p <= 100)
- {
- l.Text = $"Progress: {p}%";
- int fail = new Random().Next(0, h.Skill * h.Speed);
- if (fail == 1)
- {
- l.Text = "Hack failed.";
- }
- }
- else
- {
- GiveUpgrade(upgrade);
- f.Close();
- t.Stop();
- IncreaseSkill(cid);
- }
- }
- else
- {
- f.Close();
- t.Stop();
- }
-
- p += 1;
- };
- t.Start();
- }
- }
-
- /// <summary>
- /// Start a hack with a tool.
- /// </summary>
- /// <param name="cid">Tool ID.</param>
- /// <param name="hack">The hack type.</param>
- public static void StartHack(int cid, Hack hack)
- {
- var h = Tools[cid];
- switch (h.Name)
- {
- case "Destabilizer Attack":
- var t = new Timer();
- t.Interval = 100;
- var rnd = new Random();
- t.Tick += (object s, EventArgs a) =>
- {
- int r = rnd.Next(0, 100);
- if (r == 90)
- {
- t.Stop();
-
- API.CreateInfoboxSession("Hack complete.", "The hack has been completed.", infobox.InfoboxMode.Info);
- GiveHack(hack);
- }
- else
- {
- try {
- int p = rnd.Next(0, 10);
- switch (p)
- {
- case 1:
- API.OpenProgram("shiftorium");
- break;
- case 2:
- API.OpenProgram("ki");
- break;
- case 3:
- API.CreateInfoboxSession(API.Encryption.Encrypt("Praise Lord Michael"), API.Encryption.Encrypt("You will bow down to me."), infobox.InfoboxMode.Info);
- break;
- case 4:
- API.PlaySound(Properties.Resources._3beepvirus);
- break;
- case 5:
- API.CurrentSession.BackColor = Color.White;
- break;
- case 6:
- API.CurrentSession.BackColor = Color.Black;
- break;
- case 7:
- API.PlaySound(Properties.Resources.dial_up_modem_02);
- break;
- case 8:
- API.PlaySound(Properties.Resources.writesound);
- break;
- case 9:
- API.PlaySound(Properties.Resources.typesound);
- break;
- }
- }
- catch
- {
- t.Stop();
- var tr = new Terminal();
- tr.Show();
- tr.WindowState = FormWindowState.Maximized;
- tr.txtterm.BackColor = Color.Red;
- tr.Crash();
- }
- }
- };
- t.Start();
-
-
- break;
- }
- }
-
- /// <summary>
- /// Start a hack with a tool, to attempt to get an upgrade.
- /// </summary>
- /// <param name="cid">Tool ID.</param>
- /// <param name="upgrade">Upgrade ID.</param>
- public static void StartHack(int cid, string upgrade)
- {
- if (upgrade == "random")
- {
- StartHack(cid, GetRandomHack());
- }
- else
- {
- if (Tools.Count <= cid)
- {
- API.CreateInfoboxSession("Failed!", "No Hacking Tools Avalible!", infobox.InfoboxMode.Info);
- return;
- }
- else
- {
- HackTool h = Tools[cid];
- switch (h.Name)
- {
- case "Destabilizer Attack":
- var t = new Timer();
- t.Interval = 1000 / h.Effectiveness;
- var rnd = new Random();
- t.Tick += (object s, EventArgs a) =>
- {
- int r = rnd.Next(0, 100);
- if (r == 90)
- {
- t.Stop();
- API.CreateInfoboxSession("Hack complete.", "The hack has been completed.", infobox.InfoboxMode.Info);
- GiveUpgrade(upgrade);
- }
- else
- {
- int p = rnd.Next(0, 10);
- switch (p)
- {
- case 1:
- API.OpenProgram("shiftorium");
- break;
- case 2:
- API.OpenProgram("ki");
- break;
- case 3:
- API.CreateInfoboxSession(API.Encryption.Encrypt("Praise Lord Michael"), API.Encryption.Encrypt("You will bow down to me."), infobox.InfoboxMode.Info);
- break;
- case 4:
- API.PlaySound(Properties.Resources._3beepvirus);
- break;
- case 5:
- API.CurrentSession.BackColor = Color.White;
- break;
- case 6:
- API.CurrentSession.BackColor = Color.Black;
- break;
- case 7:
- API.PlaySound(Properties.Resources.dial_up_modem_02);
- break;
- case 8:
- API.PlaySound(Properties.Resources.writesound);
- break;
- case 9:
- API.PlaySound(Properties.Resources.typesound);
- break;
- }
- }
- };
- t.Start();
-
-
- break;
- }
- }
- }
- }
-
- /// <summary>
- /// Initiates the Hacker Battle training simulation.
- /// </summary>
- public static void StartBattleTutorial()
- {
- var e = new EnemyHacker("Tutorial", "Tutorial hacker", "Tutorial hacker", 0, 0, "easy");
- var y = new HackUI(e);
- y.IsTutorial = true;
- API.CreateForm(y, "You", Properties.Resources.iconTerminal);
- }
-
- /// <summary>
- /// Loads characters and other data from the save file.
- /// </summary>
- public static void GetCharacters()
- {
- if (File.Exists(Paths.SystemDir + "_hackers.json"))
- {
- Characters = JsonConvert.DeserializeObject<List<Character>>(API.Encryption.Decrypt(File.ReadAllText(Paths.SystemDir + "_hackers.json")));
- }
- else
- {
- var c = new Character("BinaryFire", "I may not be good, but it's what I like to do. You don't need to pay me.", 25, 10, 0);
- AddCharacter(c);
- File.WriteAllText(Paths.SystemDir + "_hackers.json", API.Encryption.Encrypt(JsonConvert.SerializeObject(Characters)));
- }
- if(File.Exists(Paths.SystemDir + "_hacktools.json"))
- {
- Tools = JsonConvert.DeserializeObject<List<HackTool>>(API.Encryption.Decrypt(File.ReadAllText(Paths.SystemDir + "_hacktools.json")));
- }
- else
- {
- var c = new HackTool("Destabilizer Attack", 10, "Destabilize ShiftOS by causing it to go beyond what it can do, opening many programs at once, and making it do things it was NEVER intended to do.");
- AddTool(c);
- File.WriteAllText(Paths.SystemDir + "_hacktools.json", API.Encryption.Encrypt(JsonConvert.SerializeObject(Tools)));
-
- }
- if (File.Exists(Paths.SystemDir + "_enemies.json"))
- {
- EnemyHackers = JsonConvert.DeserializeObject<List<EnemyHacker>>(API.Encryption.Decrypt(File.ReadAllText(Paths.SystemDir + "_enemies.json")));
- }
- else
- {
- var c = new EnemyHacker("Tutorial", "Enter the Tutorial Sequence.", "", 0, 0, "Easy");
- EnemyHackers.Add(c);
- File.WriteAllText(Paths.SystemDir + "enemies.json", API.Encryption.Encrypt(JsonConvert.SerializeObject(EnemyHackers)));
-
- }
- if (File.Exists(Paths.Drivers + "Network.dri"))
- {
- MyNetwork = JsonConvert.DeserializeObject<List<Module>>(API.Encryption.Decrypt(File.ReadAllText(Paths.Drivers + "Network.dri")));
- }
- else
- {
- var c = new Module(SystemType.Core, 1, "localhost");
- c.HP = 100; //bugfix: core not appearing during battle on new save
- c.X = 0;
- c.Y = 0;
- MyNetwork.Add(c);
- File.WriteAllText(Paths.Drivers + "Network.dri", API.Encryption.Encrypt(JsonConvert.SerializeObject(MyNetwork)));
-
- }
- List<Module> coresToRemove = new List<Module>();
- foreach(var m in MyNetwork)
- {
- if(m.Type == SystemType.Core && m != MyCore)
- {
- coresToRemove.Add(m);
- }
- }
- foreach(var m in coresToRemove)
- {
- MyNetwork.Remove(m);
- }
- RepairTimer = new Timer();
- RepairTimer.Interval = 2000;
- var r = new Random();
- RepairTimer.Tick += (object s, EventArgs a) =>
- {
- var repairable = new List<Module>();
- foreach(var mod in MyNetwork)
- {
- if(mod.HP < mod.GetTotalHP())
- {
- repairable.Add(mod);
- }
- }
- int index = r.Next(0, repairable.Count);
- try
- {
- int increase = 1;
- foreach(var mod in MyNetwork)
- {
- if(mod.Type == SystemType.RepairModule)
- {
- increase += mod.HP / 4;
- }
- }
-
- var m = repairable[index];
- while(m.HP + increase > m.GetTotalHP())
- {
- increase -= 1;
- }
- if(m.HP < m.GetTotalHP())
- {
- m.HP += increase;
- }
- }
- catch
- {
-
- }
- };
- RepairTimer.Start();
- }
-
- /// <summary>
- /// Saves characters and other data to the save file.
- /// </summary>
- public static void SaveCharacters()
- {
- if (MyNetwork == null)
- {
- MyNetwork = new List<Module>();
- var c = new Module(SystemType.Core, 1, "localhost");
- c.HP = 100; //bugfix: core not appearing during battle on new save
- c.X = 0;
- c.Y = 0;
- MyNetwork.Add(c);
- }
- File.WriteAllText(Paths.SystemDir + "_hackers.json", API.Encryption.Encrypt(JsonConvert.SerializeObject(Characters)));
- File.WriteAllText(Paths.SystemDir + "_hacktools.json", API.Encryption.Encrypt(JsonConvert.SerializeObject(Tools)));
- File.WriteAllText(Paths.Drivers + "Network.dri", API.Encryption.Encrypt(JsonConvert.SerializeObject(MyNetwork)));
- File.WriteAllText(Paths.SystemDir + "_enemies.json", API.Encryption.Encrypt(JsonConvert.SerializeObject(EnemyHackers)));
-
- }
-
- /// <summary>
- /// Tells user about the 'help hacking' command.
- /// </summary>
- public static void StartTutorial()
- {
- API.CreateInfoboxSession("Upgrade Category Not Available", "This upgrade category requires more capability from the OS, and is locked. You can type 'help hacking' in the Terminal for more info.", infobox.InfoboxMode.Info);
- }
- }
-
- public class Character
- {
- /// <summary>
- /// Creates a new hirable character.
- /// </summary>
- /// <param name="name">The name of the character.</param>
- /// <param name="bio">The bio of the character.</param>
- /// <param name="skill">Starting skill level.</param>
- /// <param name="speed">Starting speed level.</param>
- /// <param name="cost">Amount of Codepoints required to hire the hacker.</param>
- public Character(string name, string bio, int skill, int speed, int cost)
- {
- Name = name;
- Skill = skill;
- Speed = speed;
- Cost = cost;
- Bio = bio;
- }
-
- public string Name { get; set; }
- public int Speed { get; set; }
- public int Skill { get; set; }
- public int Cost { get; set; }
- public string Bio { get; set; }
- }
-
- public class HackTool
- {
- /// <summary>
- /// Creates a new hacking tool.
- /// </summary>
- /// <param name="name">Tool name.</param>
- /// <param name="effectiveness">Effectiveness level.</param>
- /// <param name="description">Tool description.</param>
- public HackTool(string name, int effectiveness, string description)
- {
- Name = name;
- Effectiveness = effectiveness;
- Description = description;
- }
-
- public string Name { get; set; }
- public int Effectiveness { get; set; }
- public string Description { get; set; }
- }
-
- /// <summary>
- /// Enum representing a type of hack.
- /// </summary>
- public enum Hack
- {
- PriceDrop,
- PayoutIncrease,
- }
-
- public class Module
- {
- /// <summary>
- /// Creates a new module.
- /// </summary>
- /// <param name="t">Type of module.</param>
- /// <param name="grade">Starting grade level.</param>
- /// <param name="hname">Hostname.</param>
- public Module(SystemType t, int grade, string hname)
- {
- Hostname = hname;
- Type = t;
- Grade = grade;
- }
-
- public string Hostname { get; set; }
- public ModuleType ModuleType { get; set; }
- public SystemType Type { get; set; }
- public int HP { get; set; }
- public int Grade { get; set; }
- /// <summary>
- /// X position on the virtual network.
- /// </summary>
- public int X { get; set; }
- /// <summary>
- /// Y position on the virtual network.
- /// </summary>
- public int Y { get; set; }
-
- /// <summary>
- /// Deploys the module to a Computer control that can actually do things.
- /// </summary>
- /// <returns>The new computer.</returns>
- public Computer Deploy()
- {
- var c = new Computer();
- c.TotalHP = GetTotalHP(); //for proper status display
- c.Hostname = Hostname;
- c.Type = Type;
- c.HP = HP;
- c.Visible = true;
- c.Grade = Grade;
- if(X != 0 && Y != 0)
- {
- c.Location = new Point(X, Y);
- }
- return c;
- }
-
- public int GetTotalHP()
- {
- switch (Type)
- {
- case SystemType.Core:
- return 100;
- default:
- switch (Grade)
- {
- case 1:
- return 10;
- case 2:
- return 20;
- case 3:
- return 40;
- case 4:
- return 80;
- default:
- return 10;
-
- }
- }
- }
- }
-
- /// <summary>
- /// Unused...
- /// </summary>
- public enum ModuleType
- {
- Offensive,
- Defensive
- }
-
- public class EnemyHacker
- {
- /// <summary>
- /// An enemy network.
- /// </summary>
- /// <param name="name">Leader or network name.</param>
- /// <param name="description">Network Description</param>
- /// <param name="fdesc">If the leader becomes a friend, what will his bio be?</param>
- /// <param name="fskill">If the leader becomes a friend, what will his skill be?</param>
- /// <param name="fspeed">If the leader becomes a friend, what will his speed be?</param>
- /// <param name="difficulty">Arbitrary value that means absolutely nothing.</param>
- public EnemyHacker(string name, string description, string fdesc, int fskill, int fspeed, string difficulty)
- {
- Name = name;
- Description = description;
- FriendDesc = fdesc;
- FriendSkill = fskill;
- FriendSpeed = fspeed;
- Difficulty = difficulty;
- Network = new List<Module>();
- var m = new Module(SystemType.Core, 1, name.ToLower().Replace(" ", "_"));
- m.X = 0;
- m.Y = 0;
- Network.Add(m); //Hacker will always have a core system.
- }
-
- public bool IsLeader = false;
- public string Name { get; set; }
- public string FriendDesc { get; set; }
- public string Description { get; set; }
- public int FriendSpeed { get; set; }
- public int FriendSkill { get; set; }
- public string Difficulty { get; set; }
- public List<Module> Network { get; set; }
-
- /// <summary>
- /// Add a new module to this hacker's network.
- /// </summary>
- /// <param name="m">The module to add.</param>
- public void AddModule(Module m)
- {
- Network.Add(m);
- }
-
- /// <summary>
- /// Befriends the leader.
- /// </summary>
- /// <param name="cost">How much will it cost to hire him?</param>
- public void Befriend(int cost)
- {
- var c = new Character(Name, FriendDesc, FriendSpeed, FriendSkill, cost);
- Hacking.AddCharacter(c);
- Hacking.SaveCharacters();
- }
-
-
- }
-
- public class FutureModule
- {
- /// <summary>
- /// A purchasable module.
- /// </summary>
- /// <param name="name">Module name.</param>
- /// <param name="cost">Cost in Codepoints</param>
- /// <param name="description">Module description</param>
- /// <param name="type">Module type.</param>
- public FutureModule(string name, int cost, string description, SystemType type)
- {
- Name = name;
- Description = description;
- Type = type;
- Cost = cost;
- }
-
- public string Name { get; set; }
- public int Cost { get; set; }
- public string Description { get; set; }
- public SystemType Type { get; set; }
- }
-}
diff --git a/source/WindowsFormsApplication1/Gameplay/HijackScreen.Designer.cs b/source/WindowsFormsApplication1/Gameplay/HijackScreen.Designer.cs
deleted file mode 100644
index 12e30ab..0000000
--- a/source/WindowsFormsApplication1/Gameplay/HijackScreen.Designer.cs
+++ /dev/null
@@ -1,116 +0,0 @@
-using System;
-
-namespace ShiftOS
-{
- partial class HijackScreen
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.lblHijack = new System.Windows.Forms.Label();
- this.conversationtimer = new System.Windows.Forms.Timer(this.components);
- this.textgen = new System.Windows.Forms.Timer(this.components);
- this.lblhackwords = new System.Windows.Forms.Label();
- this.hackeffecttimer = new System.Windows.Forms.Timer(this.components);
- this.BackgroundWorker1 = new System.ComponentModel.BackgroundWorker();
- this.btnskip = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // lblHijack
- //
- this.lblHijack.Anchor = System.Windows.Forms.AnchorStyles.None;
- this.lblHijack.AutoSize = true;
- this.lblHijack.BackColor = System.Drawing.Color.WhiteSmoke;
- this.lblHijack.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lblHijack.ForeColor = System.Drawing.Color.DimGray;
- this.lblHijack.Location = new System.Drawing.Point(143, 193);
- this.lblHijack.Name = "lblHijack";
- this.lblHijack.Size = new System.Drawing.Size(18, 25);
- this.lblHijack.TabIndex = 0;
- this.lblHijack.Text = "\\";
- //
- // textgen
- //
- this.textgen.Interval = 20;
- //
- // lblhackwords
- //
- this.lblhackwords.AutoSize = true;
- this.lblhackwords.Dock = System.Windows.Forms.DockStyle.Fill;
- this.lblhackwords.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lblhackwords.ForeColor = System.Drawing.SystemColors.ButtonFace;
- this.lblhackwords.Location = new System.Drawing.Point(0, 0);
- this.lblhackwords.Name = "lblhackwords";
- this.lblhackwords.Size = new System.Drawing.Size(127, 18);
- this.lblhackwords.TabIndex = 1;
- this.lblhackwords.Text = "Hijack in progress";
- //
- // hackeffecttimer
- //
- this.hackeffecttimer.Interval = 50;
- //
- // btnskip
- //
- this.btnskip.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnskip.ForeColor = System.Drawing.Color.White;
- this.btnskip.Location = new System.Drawing.Point(566, 422);
- this.btnskip.Name = "btnskip";
- this.btnskip.Size = new System.Drawing.Size(75, 23);
- this.btnskip.TabIndex = 2;
- this.btnskip.Text = "Skip";
- this.btnskip.UseVisualStyleBackColor = true;
- this.btnskip.Visible = false;
- this.btnskip.Click += new System.EventHandler(this.btnskip_Click);
- //
- // HijackScreen
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.BackColor = System.Drawing.Color.Silver;
- this.ClientSize = new System.Drawing.Size(653, 457);
- this.Controls.Add(this.btnskip);
- this.Controls.Add(this.lblhackwords);
- this.Controls.Add(this.lblHijack);
- this.Name = "HijackScreen";
- this.Text = "ShiftOS";
- this.TransparencyKey = System.Drawing.Color.White;
- this.Load += new System.EventHandler(this.HijackScreen_Load);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
- internal System.Windows.Forms.Label lblHijack;
- internal System.Windows.Forms.Timer conversationtimer;
- internal System.Windows.Forms.Timer textgen;
- internal System.Windows.Forms.Label lblhackwords;
- internal System.Windows.Forms.Timer hackeffecttimer;
- internal System.ComponentModel.BackgroundWorker BackgroundWorker1;
- #endregion
-
- private System.Windows.Forms.Button btnskip;
- }
-} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Gameplay/HijackScreen.cs b/source/WindowsFormsApplication1/Gameplay/HijackScreen.cs
deleted file mode 100644
index e234514..0000000
--- a/source/WindowsFormsApplication1/Gameplay/HijackScreen.cs
+++ /dev/null
@@ -1,723 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace ShiftOS
-{
- public partial class HijackScreen : Form
- {
- public HijackScreen()
- {
- InitializeComponent();
- }
-
-
- string rtext;
- string gtexttotype;
- int charcount;
- int currentletter;
- int slashcount;
- int conversationcount = 0;
- Label textgeninput;
- bool needtoclose = false;
- public bool upgraded = false;
- FileStream fs;
- int hackeffect;
- int percentcount;
-
- // ERROR: Handles clauses are not supported in C#
- private void HijackScreen_Load(object sender, EventArgs e)
- {
- hackeffecttimer.Tick += new EventHandler(hackeffecttimer_Tick);
- conversationtimer.Tick += new EventHandler(conversationtimer_Tick);
- textgen.Tick += new EventHandler(textgen_Tick);
-
- this.FormBorderStyle = FormBorderStyle.None;
- this.WindowState = FormWindowState.Maximized;
- BackgroundWorker1.RunWorkerAsync();
- conversationtimer.Start();
- hackeffecttimer.Start();
- }
-
- private void TextType(string texttotype)
- {
- conversationtimer.Stop();
- charcount = texttotype.Length;
- gtexttotype = texttotype;
- currentletter = 0;
- slashcount = 1;
- textgen.Start();
- }
-
-
- // ERROR: Handles clauses are not supported in C#
- private void textgen_Tick(object sender, EventArgs e)
- {
- switch (slashcount)
- {
- case 1:
- if (currentletter < gtexttotype.Length)
- {
- textgeninput.Text = rtext + "\\";
- }
-
- break;
- case 2:
- if (currentletter < gtexttotype.Length)
- {
- textgeninput.Text = rtext + "|";
- }
-
- break;
- case 3:
- if (currentletter < gtexttotype.Length)
- {
- textgeninput.Text = rtext + "/";
- }
-
- break;
- case 4:
- if (currentletter < gtexttotype.Length)
- {
- rtext = rtext + gtexttotype.Substring(currentletter, 1);
- currentletter = currentletter + 1;
- textgeninput.Text = rtext;
- API.PlaySound(Properties.Resources.typesound);
- }
- break;
- }
-
- slashcount = slashcount + 1;
-
- if (slashcount == 5)
- slashcount = 1;
- if (currentletter == gtexttotype.Length)
- {
- gtexttotype = "";
- conversationtimer.Start();
- textgen.Stop();
- }
-
-
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void conversationtimer_Tick(object sender, EventArgs e)
- {
- switch (conversationcount)
- {
- case 0:
- if (needtoclose == true)
- this.Close();
- break;
- case 1:
-
- textgeninput = lblHijack;
- TextType("Your computer is now being Hijacked");
- conversationtimer.Interval = 1000;
-
- break;
- case 3:
- textgeninput = lblhackwords;
- textgen.Interval = 10;
- rtext = "";
- btnskip.Show();
- TextType("Congratulations, you have been involuntarily selected to be an Alpha Tester for ShiftOS." + Environment.NewLine + Environment.NewLine);
- break;
- case 4:
- TextType("At this current point in time I do not wish to reveal my identity or future intentions." + Environment.NewLine + Environment.NewLine);
- break;
- case 5:
- TextType("I just need to use you and your computer as an external test bed to evolve my experimental operating system." + Environment.NewLine + Environment.NewLine);
- break;
- case 6:
- TextType("Right now ShiftOS is practically non-existent but I’ll work on coding it remotely as you use it." + Environment.NewLine + Environment.NewLine);
- break;
- case 7:
- TextType("Your hard drive will now be formatted in preparation for the installation of ShiftOS" + Environment.NewLine + Environment.NewLine);
- break;
- case 8:
- TextType("Starting Format.");
- conversationtimer.Interval = 500;
- break;
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- TextType(".");
- break;
- case 19:
- rtext = "";
- break;
- case 20:
- TextType("Scanning System Drive...");
- break;
- case 21:
- TextType(Environment.NewLine + Environment.NewLine + "Current OS: " + OSInfo.GetPlatformID().Replace("microsoft", "Windows"));
- break;
- case 22:
- if(OSInfo.GetPlatformID() == "microsoft")
- {
- var dinf = new DriveInfo(Environment.GetFolderPath(Environment.SpecialFolder.Windows).Substring(0, 3));
- TextType(Environment.NewLine + $"Mountpoint and File System: {dinf.Name} ({dinf.DriveFormat})");
- }
- break;
- case 23:
- if (OSInfo.GetPlatformID() == "microsoft")
- {
- var dinf = new DriveInfo(Environment.GetFolderPath(Environment.SpecialFolder.Windows).Substring(0, 3));
- TextType(Environment.NewLine + $"Size: {dinf.TotalFreeSpace} free, {dinf.TotalSize} total");
- }
- break;
- case 24:
- TextType(Environment.NewLine + "New File System: ShiftFS");
- break;
- case 25:
- TextType(Environment.NewLine + Environment.NewLine + "Formatting system drive - ");
- conversationtimer.Interval = 100;
- break;
- case 26:
- case 28:
- case 30:
- case 32:
- case 36:
- case 38:
- case 40:
- case 42:
- case 44:
- case 46:
- case 48:
- case 50:
- case 52:
- case 54:
- case 56:
- case 58:
- case 60:
- case 62:
- case 64:
- case 66:
- case 68:
- case 70:
- case 72:
- case 74:
- case 76:
- case 78:
- case 80:
- case 82:
- case 84:
- case 86:
- case 88:
- case 90:
- case 92:
- case 94:
- case 96:
- case 98:
- case 100:
- case 102:
- case 104:
- case 106:
- case 108:
- case 110:
- case 112:
- case 114:
- case 116:
- case 118:
- case 120:
- case 122:
- case 124:
- case 126:
- textgeninput.Text = rtext + percentcount + "%";
- if (percentcount < 101)
- {
- percentcount += 2;
- API.PlaySound(Properties.Resources.writesound);
- }
- break;
- case 127:
- rtext = rtext + "100%";
- conversationtimer.Interval = 1000;
- break;
- case 128:
- TextType(Environment.NewLine + "Format Complete");
- break;
- case 129:
- rtext = "";
- percentcount = 0;
- TextType("Installing ShiftOS Alpha 0.0.1 - ");
- conversationtimer.Interval = 200;
- break;
- case 130:
- case 131:
- case 132:
- case 133:
- case 134:
- case 135:
- case 136:
- case 137:
- case 138:
- case 139:
- case 140:
- case 141:
- case 142:
- case 143:
- case 144:
- case 145:
- case 146:
- case 147:
- case 148:
- case 149:
- case 150:
- case 151:
- case 152:
- case 153:
- case 154:
- case 155:
- case 156:
- case 157:
- case 158:
- case 159:
- case 160:
- case 161:
- case 162:
- case 163:
- case 164:
- case 165:
- case 166:
- case 167:
- case 168:
- case 169:
- case 170:
- case 171:
- case 172:
- case 173:
- case 174:
- case 175:
- case 176:
- case 177:
- case 178:
- case 179:
- case 180:
- case 181:
- case 182:
- case 183:
- case 184:
- case 185:
- case 186:
- case 187:
- case 188:
- case 189:
- case 190:
- case 191:
- case 192:
- case 193:
- case 194:
- case 195:
- case 196:
- case 197:
- case 198:
- case 199:
- case 200:
- case 201:
- case 202:
- case 203:
- case 204:
- case 205:
- case 206:
- case 207:
- case 208:
- case 209:
- case 210:
- case 211:
- case 212:
- case 213:
- case 214:
- case 215:
- case 216:
- case 217:
- case 218:
- case 219:
- case 220:
- case 221:
- case 222:
- case 223:
- case 224:
- case 225:
- case 226:
- case 227:
- case 228:
- case 229:
- case 230:
-
- textgeninput.Text = rtext + percentcount + "%" + Environment.NewLine + Environment.NewLine;
- if (percentcount < 101)
- {
- percentcount = percentcount + 1;
- API.PlaySound(Properties.Resources.writesound);
- }
- switch (percentcount)
- {
- case 1:
- case 2:
- textgeninput.Text = textgeninput.Text + "/Home";
- if ((!System.IO.Directory.Exists(Paths.Home)))
- System.IO.Directory.CreateDirectory(Paths.Home);
- break;
- case 3:
- case 4:
- textgeninput.Text = textgeninput.Text + "/Home/Documents";
- if ((!System.IO.Directory.Exists(Paths.Documents)))
- System.IO.Directory.CreateDirectory(Paths.Documents);
- break;
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- textgeninput.Text = textgeninput.Text + "/Home/Music";
- if ((!System.IO.Directory.Exists(Paths.Music)))
- System.IO.Directory.CreateDirectory(Paths.Music);
- break;
- case 13:
- case 14:
- case 15:
- textgeninput.Text = textgeninput.Text + "/Home/Pictures";
- if ((!System.IO.Directory.Exists(Paths.Pictures)))
- System.IO.Directory.CreateDirectory(Paths.Pictures);
- break;
- case 16:
- case 17:
- case 18:
- textgeninput.Text = textgeninput.Text + "/Shiftum42";
- if ((!System.IO.Directory.Exists(Paths.SystemDir)))
- System.IO.Directory.CreateDirectory(Paths.SystemDir);
- break;
- case 19:
- case 20:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/Drivers";
- if ((!System.IO.Directory.Exists(Paths.Drivers)))
- System.IO.Directory.CreateDirectory(Paths.Drivers);
- break;
- case 21:
- case 22:
- case 23:
- case 24:
- case 25:
- case 26:
- case 27:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/Drivers/HDD.dri";
- break;
- case 28:
- case 29:
- case 30:
- case 31:
- case 32:
- case 33:
- case 34:
- case 35:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/Drivers/Keyboard.dri";
- fs = File.Create(Paths.Drivers + "Keyboard.dri");
- fs.Close();
- break;
- case 36:
- case 37:
- case 38:
- case 39:
- case 40:
- case 41:
- case 42:
- case 43:
- case 44:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/Drivers/Monitor.dri";
- fs = File.Create(Paths.Drivers + "Monitor.dri");
- fs.Close();
- break;
- case 45:
- case 46:
- case 47:
- case 48:
- case 49:
- case 50:
- case 51:
- case 52:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/Drivers/Mouse.dri";
- fs = File.Create(Paths.Drivers + "Mouse.dri");
- fs.Close();
- break;
- case 53:
- case 54:
- case 55:
- case 56:
- case 57:
- case 58:
- case 59:
- case 60:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/Drivers/Printer.dri";
- fs = File.Create(Paths.Drivers + "Printer.dri");
- fs.Close();
- break;
- case 61:
- case 62:
- case 63:
- case 64:
- case 65:
- case 66:
- case 67:
- case 68:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/Languages/";
- if ((!System.IO.Directory.Exists(Paths.SystemDir + "Languages")))
- System.IO.Directory.CreateDirectory(Paths.SystemDir + "Languages");
- break;
- case 69:
- case 70:
- case 71:
- case 72:
- case 73:
- case 74:
- case 75:
- case 76:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/Languages/Current.lang";
- fs = File.Create(Paths.SystemDir + "Languages/Current.lang");
- fs.Close();
- break;
- case 77:
- case 78:
- case 79:
- case 80:
- case 81:
- case 82:
- case 83:
- case 84:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/HDAccess.sft";
- break;
- case 85:
- case 86:
- case 87:
- case 88:
- case 89:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/ShiftGUI.sft";
- fs = File.Create(Paths.SystemDir + "ShiftGUI.sft");
- fs.Close();
- break;
- case 90:
- case 91:
- case 92:
- case 93:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/SKernal.sft";
- fs = File.Create(Paths.SystemDir + "SKernal.sft");
- fs.Close();
- break;
- case 94:
- case 95:
- case 96:
- case 97:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/SRead.sft";
- fs = File.Create(Paths.SystemDir + "SRead.sft");
- fs.Close();
- break;
- case 98:
- case 99:
- case 100:
- case 101:
- textgeninput.Text = textgeninput.Text + "/Shiftum42/SWrite.sft";
- fs = File.Create(Paths.SystemDir + "SWrite.sft");
- fs.Close();
- break;
- }
-
- break;
-
- case 231:
- textgeninput.Text = rtext + "100%" + Environment.NewLine + Environment.NewLine + "/Shiftum42/SWrite.sft";
- conversationtimer.Interval = 1000;
- API.PlaySound(Properties.Resources.writesound);
- break;
- case 232:
- textgeninput.Text = rtext + "100%" + Environment.NewLine + Environment.NewLine + "ShiftOS Installation Complete!";
- API.PlaySound(Properties.Resources.typesound);
- if ((!System.IO.Directory.Exists(Paths.SoftwareData)))
- System.IO.Directory.CreateDirectory(Paths.SoftwareData);
- if ((!System.IO.Directory.Exists(Paths.KnowledgeInput)))
- System.IO.Directory.CreateDirectory(Paths.KnowledgeInput);
- break;
- case 234:
- SaveSystem.Utilities.LoadedSave.newgame = false;
- API.CurrentSession.Opacity = 100;
- Terminal term = new Terminal();
- term.Show();
- term.tmrfirstrun.Start();
- this.Close();
-
- break;
- }
- conversationcount = conversationcount + 1;
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void hackeffecttimer_Tick(object sender, EventArgs e)
- {
- if (hackeffect < 101)
- {
- switch (hackeffect)
- {
- case 1:
- case 3:
- case 5:
- case 7:
- case 9:
- case 11:
- case 13:
- case 15:
- case 17:
- case 19:
- case 21:
- case 23:
- case 25:
- case 27:
- case 29:
- case 31:
- case 33:
- case 35:
- case 37:
- case 39:
- case 41:
- case 43:
- case 45:
- case 47:
- case 49:
- case 51:
- case 53:
- case 55:
- case 57:
- case 59:
- case 61:
- case 63:
- case 65:
- case 67:
- case 69:
- case 71:
- case 73:
- case 75:
- case 77:
- case 79:
- case 81:
- case 83:
- case 85:
- case 87:
- case 89:
- case 91:
- case 93:
- case 95:
- this.BackColor = Color.Magenta;
- this.TransparencyKey = Color.Magenta;
- API.PlaySound(Properties.Resources.writesound);
- this.TopMost = true;
- break;
- case 2:
- case 4:
- case 6:
- case 8:
- case 10:
- case 12:
- case 14:
- case 16:
- case 18:
- case 20:
- case 22:
- case 24:
- case 26:
- case 28:
- this.BackColor = Color.Magenta;
- API.PlaySound(Properties.Resources.typesound);
- break;
- case 30:
- case 32:
- case 34:
- case 36:
- case 38:
- case 40:
- case 42:
- case 44:
- case 46:
- case 48:
- case 50:
- this.BackColor = Color.Magenta;
- API.PlaySound(Properties.Resources.typesound);
- break;
- case 52:
- case 54:
- case 56:
- case 58:
- case 60:
- case 62:
- case 64:
- case 66:
- case 68:
- case 70:
- case 72:
- case 74:
- case 76:
- this.BackColor = Color.Magenta;
- API.PlaySound(Properties.Resources.typesound);
-
- break;
- case 78:
- case 80:
- case 82:
- case 84:
- case 86:
- case 88:
- case 90:
- case 92:
- case 94:
- this.BackColor = Color.DimGray;
- API.PlaySound(Properties.Resources.typesound);
-
- break;
- case 96:
- lblHijack.BackColor = Color.LightGray;
- break;
- case 97:
- lblHijack.BackColor = Color.DarkGray;
- break;
- case 98:
- lblHijack.BackColor = Color.DimGray;
- break;
- case 99:
- this.BackColor = Color.Black;
- lblHijack.BackColor = Color.Black;
- lblHijack.ForeColor = Color.DimGray;
- break;
- case 100:
- lblHijack.Hide();
- break;
- }
- }
- else {
- hackeffecttimer.Stop();
- }
- hackeffect = hackeffect + 1;
- }
-
- private void btnskip_Click(object sender, EventArgs e)
- {
- conversationcount = 19;
- btnskip.Hide();
- }
- }
-}
diff --git a/source/WindowsFormsApplication1/Gameplay/HijackScreen.resx b/source/WindowsFormsApplication1/Gameplay/HijackScreen.resx
deleted file mode 100644
index 89116b6..0000000
--- a/source/WindowsFormsApplication1/Gameplay/HijackScreen.resx
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <metadata name="conversationtimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
- <metadata name="textgen.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>167, 17</value>
- </metadata>
- <metadata name="hackeffecttimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>260, 17</value>
- </metadata>
- <metadata name="BackgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>396, 17</value>
- </metadata>
-</root> \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/ShiftOS.csproj b/source/WindowsFormsApplication1/ShiftOS.csproj
index 066a32e..9e24979 100644
--- a/source/WindowsFormsApplication1/ShiftOS.csproj
+++ b/source/WindowsFormsApplication1/ShiftOS.csproj
@@ -216,17 +216,17 @@
<Compile Include="Dialogs\Graphic_Picker.Designer.cs">
<DependentUpon>Graphic_Picker.cs</DependentUpon>
</Compile>
- <Compile Include="Gameplay\Hacking.cs" />
- <Compile Include="Gameplay\HackUI.cs">
+ <Compile Include="Hacking\Hacking.cs" />
+ <Compile Include="Hacking\HackUI.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Gameplay\HackUI.Designer.cs">
+ <Compile Include="Hacking\HackUI.Designer.cs">
<DependentUpon>HackUI.cs</DependentUpon>
</Compile>
- <Compile Include="Gameplay\HijackScreen.cs">
+ <Compile Include="Hacking\HijackScreen.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Gameplay\HijackScreen.Designer.cs">
+ <Compile Include="Hacking\HijackScreen.Designer.cs">
<DependentUpon>HijackScreen.cs</DependentUpon>
</Compile>
<Compile Include="Apps\HoloChat.cs">
@@ -464,10 +464,10 @@
<EmbeddedResource Include="Dialogs\Graphic_Picker.resx">
<DependentUpon>Graphic_Picker.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Gameplay\HackUI.resx">
+ <EmbeddedResource Include="Hacking\HackUI.resx">
<DependentUpon>HackUI.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Gameplay\HijackScreen.resx">
+ <EmbeddedResource Include="Hacking\HijackScreen.resx">
<DependentUpon>HijackScreen.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Apps\HoloChat.resx">