Committing all I've got

Committing everything I've got - so that I can take a break for a few
months and work on other things.
This commit is contained in:
MichaelTheShifter 2016-05-17 15:37:02 -04:00
parent 0085241d23
commit a3fc2c45ec
43 changed files with 9852 additions and 4024 deletions

View file

@ -85,6 +85,19 @@ public class API
/// </summary>
public static bool DeveloperMode = true;
/// <summary>
/// If this is true, only certain applications will open and only
/// certain features will work.
///
/// This is useful for story plots like the End Game where you don't
/// want the user being distracted by novelty features when they should
/// be focusing on what's happening.
///
/// Think of it like the opposite of what Developer Mode would do.
/// </summary>
public static bool LimitedMode = false;
public static bool InfoboxesPlaySounds = true;
public static List<Process> RunningModProcesses = new List<Process>();
public static Dictionary<string, string> CommandAliases = new Dictionary<string, string>();
@ -284,127 +297,135 @@ public static void CreateNewLoggerTerminal(string AppName)
/// <param name="modSAA">File to run.</param>
public static void LaunchMod(string modSAA)
{
if (Upgrades["shiftnet"] == true)
if (!LimitedMode)
{
if (File.Exists(modSAA))
if (Upgrades["shiftnet"] == true)
{
if (File.ReadAllText(modSAA) == HiddenAPMCommand)
if (File.Exists(modSAA))
{
CreateForm(new Appscape(), "Appscape Package Manager", Properties.Resources.iconAppscape);
}
else if(File.ReadAllText(modSAA) == HiddenDecryptorCommand)
{
CreateForm(new ShiftnetDecryptor(), "Shiftnet Decryptor", Properties.Resources.iconShiftnet);
}
else if(File.ReadAllText(modSAA) == HiddenBDiggerCommand)
{
CreateForm(new BitnoteDigger(), "Bitnote Digger", Properties.Resources.iconBitnoteDigger);
}
else if(File.ReadAllText(modSAA) == HiddenBWalletCommand)
{
CreateForm(new BitnoteWallet(), "Bitnote Wallet", Properties.Resources.iconBitnoteWallet);
}
else if (File.ReadAllText(modSAA) == HiddenShiftnetCommand)
{
CreateForm(new Shiftnet(), "Shiftnet", Properties.Resources.iconShiftnet);
}
else if (File.ReadAllText(modSAA) == HiddenBTNConvertCommand)
{
CreateForm(new BitnoteConverter(), "Bitnote Converter", Properties.Resources.iconBitnoteWallet);
}
else if (File.ReadAllText(modSAA) == HiddenDodgeCommand)
{
CreateForm(new Dodge(), "Dodge", Properties.Resources.iconDodge);
}
else if (File.ReadAllText(modSAA) == HiddenLabyrinthCommand)
{
CreateForm(new Labyrinth(), "Labyrinth", null);
}
else if (File.ReadAllText(modSAA) == HiddenQuickChatCommand)
{
CreateForm(new QuickChat(), "QuickChat", null);
}
else {
try
if (File.ReadAllText(modSAA) == HiddenAPMCommand)
{
ExtractFile(modSAA, Paths.Mod_Temp, true);
var l = new LuaInterpreter(Paths.Mod_Temp + "main.lua");
CreateForm(new Appscape(), "Appscape Package Manager", Properties.Resources.iconAppscape);
}
catch(Exception ex)
else if (File.ReadAllText(modSAA) == HiddenDecryptorCommand)
{
LogException("Error launching mod file (.saa): " + ex.Message, false);
CreateInfoboxSession("Error", "Could not launch the .saa file you specified. It is unsupported by this version of ShiftOS.", infobox.InfoboxMode.Info);
CreateForm(new ShiftnetDecryptor(), "Shiftnet Decryptor", Properties.Resources.iconShiftnet);
}
}
var story_rnd = new Random();
int story_chance = story_rnd.Next(0, 100);
switch (story_chance)
{
case 4:
if (API.Upgrades["otherplayerstory"] == false)
else if (File.ReadAllText(modSAA) == HiddenBDiggerCommand)
{
CreateForm(new BitnoteDigger(), "Bitnote Digger", Properties.Resources.iconBitnoteDigger);
}
else if (File.ReadAllText(modSAA) == HiddenBWalletCommand)
{
CreateForm(new BitnoteWallet(), "Bitnote Wallet", Properties.Resources.iconBitnoteWallet);
}
else if (File.ReadAllText(modSAA) == HiddenShiftnetCommand)
{
CreateForm(new Shiftnet(), "Shiftnet", Properties.Resources.iconShiftnet);
}
else if (File.ReadAllText(modSAA) == HiddenBTNConvertCommand)
{
CreateForm(new BitnoteConverter(), "Bitnote Converter", Properties.Resources.iconBitnoteWallet);
}
else if (File.ReadAllText(modSAA) == HiddenDodgeCommand)
{
CreateForm(new Dodge(), "Dodge", Properties.Resources.iconDodge);
}
else if (File.ReadAllText(modSAA) == HiddenLabyrinthCommand)
{
CreateForm(new Labyrinth(), "Labyrinth", null);
}
else if (File.ReadAllText(modSAA) == HiddenQuickChatCommand)
{
CreateForm(new QuickChat(), "QuickChat", null);
}
else
{
try
{
var t = new Terminal();
API.CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);
t.StartOtherPlayerStory();
ExtractFile(modSAA, Paths.Mod_Temp, true);
var l = new LuaInterpreter(Paths.Mod_Temp + "main.lua");
}
break;
case 25:
if (API.Upgrades["devxfurious"] == false)
catch (Exception ex)
{
var t = new Terminal();
API.CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);
t.StartDevXFuriousStory();
LogException("Error launching mod file (.saa): " + ex.Message, false);
CreateInfoboxSession("Error", "Could not launch the .saa file you specified. It is unsupported by this version of ShiftOS.", infobox.InfoboxMode.Info);
}
break;
case 30:
if (API.Upgrades["aidennirh"] == false)
{
var t = new Terminal();
API.CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);
t.StartAidenNirhStory();
}
break;
case 75:
if (API.Upgrades["hacker101"] == false)
{
var t = new Terminal();
API.CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);
t.StartHacker101Story();
}
break;
//case 1000:
// t.StartJonathanLadouceurStory();
// break;
//Do you honestly think HE would appear in ShiftOS? Yugh. NO.
default:
if (API.Upgrades["devxfurious"] == true)
{
if (API.Upgrades["otherplayerrescue"] == false)
}
var story_rnd = new Random();
int story_chance = story_rnd.Next(0, 100);
switch (story_chance)
{
case 4:
if (API.Upgrades["otherplayerstory"] == false)
{
var t = new Terminal();
t.StartOtherPlayerSysFix();
CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);
API.CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);
t.StartOtherPlayerStory();
}
else
break;
case 25:
if (API.Upgrades["devxfurious"] == false)
{
if(API.Upgrades["midgamebridge"] == false)
var t = new Terminal();
API.CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);
t.StartDevXFuriousStory();
}
break;
case 30:
if (API.Upgrades["aidennirh"] == false)
{
var t = new Terminal();
API.CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);
t.StartAidenNirhStory();
}
break;
case 75:
if (API.Upgrades["hacker101"] == false)
{
var t = new Terminal();
API.CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);
t.StartHacker101Story();
}
break;
//case 1000:
// t.StartJonathanLadouceurStory();
// break;
//Do you honestly think HE would appear in ShiftOS? Yugh. NO.
default:
if (API.Upgrades["devxfurious"] == true)
{
if (API.Upgrades["otherplayerrescue"] == false)
{
/*var t = new Terminal();
t.StartBridgeToMidGame();
CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);*/
var t = new Terminal();
t.StartOtherPlayerSysFix();
CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);
}
else
{
if (API.Upgrades["midgamebridge"] == false)
{
/*var t = new Terminal();
t.StartBridgeToMidGame();
CreateForm(t, LoadedNames.TerminalName, Properties.Resources.iconTerminal);*/
}
}
}
}
break;
break;
}
}
else
{
throw new ModNotFoundException();
}
}
else
{
throw new ModNotFoundException();
}
}
else
{
CreateInfoboxSession("Limited mode", "ShiftOS is in limited mode and cannot perform this action. Please complete the current Mission first.", infobox.InfoboxMode.Info);
}
}
@ -661,22 +682,37 @@ public static void GetAppLauncherItems()
Skinning.Utilities.LoadEmbeddedNamePack();
//System Applications
AppLauncherItems.Clear();
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.ArtpadName, GetIcon("Artpad"), "open_program('artpad')", Upgrades["alartpad"]));
if (!LimitedMode)
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.ArtpadName, GetIcon("Artpad"), "open_program('artpad')", Upgrades["alartpad"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.FileSkimmerName, GetIcon("FileSkimmer"), "open_program('file_skimmer')", Upgrades["alfileskimmer"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.SkinLoaderName, GetIcon("SkinLoader"), "open_program('skinloader')", Upgrades["skinning"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.ShiftoriumName, GetIcon("Shiftorium"), "open_program('shiftorium')", Upgrades["alshiftorium"]));
if (!LimitedMode)
{
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.SkinLoaderName, GetIcon("SkinLoader"), "open_program('skinloader')", Upgrades["skinning"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.ShiftoriumName, GetIcon("Shiftorium"), "open_program('shiftorium')", Upgrades["alshiftorium"]));
}
AppLauncherItems.Add(new ApplauncherItem("HoloChat", GetIcon("HoloChat"), "open_program('holochat')", API.Upgrades["holochat"]));
AppLauncherItems.Add(new ApplauncherItem("Icon Manager", GetIcon("IconManager"), "open_program('iconmanager')", Upgrades["iconmanager"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.ShifterName, GetIcon("Shifter"), "open_program('shifter')", Upgrades["alshifter"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.NameChangerName, GetIcon("NameChanger"), "open_program('name_changer')", Upgrades["namechanger"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.PongName, GetIcon("Pong"), "open_program('pong')", Upgrades["alpong"]));
if (!LimitedMode)
{
AppLauncherItems.Add(new ApplauncherItem("Icon Manager", GetIcon("IconManager"), "open_program('iconmanager')", Upgrades["iconmanager"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.ShifterName, GetIcon("Shifter"), "open_program('shifter')", Upgrades["alshifter"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.NameChangerName, GetIcon("NameChanger"), "open_program('name_changer')", Upgrades["namechanger"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.PongName, GetIcon("Pong"), "open_program('pong')", Upgrades["alpong"]));
}
if(LimitedMode)
{
AppLauncherItems.Add(new ApplauncherItem("Quest Viewer", GetIcon("QuestViewer"), "open_program('quests')", true));
}
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.TextpadName, GetIcon("TextPad"), "open_program('textpad')", Upgrades["altextpad"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.TerminalName, GetIcon("Terminal"), "open_terminal()", true));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.KnowledgeInputName, GetIcon("KI"), "open_program('ki')", true));
//System Features
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.UnityName, GetIcon("Unity"), "toggle_unity()", Upgrades["alunity"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.ShutdownName, GetIcon("Shutdown"), "shutdown()", Upgrades["applaunchershutdown"]));
if (!LimitedMode)
{
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.KnowledgeInputName, GetIcon("KI"), "open_program('ki')", true));
//System Features
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.UnityName, GetIcon("Unity"), "toggle_unity()", Upgrades["alunity"]));
AppLauncherItems.Add(new ApplauncherItem(LoadedNames.ShutdownName, GetIcon("Shutdown"), "shutdown()", Upgrades["applaunchershutdown"]));
}
}
/// <summary>
@ -714,6 +750,17 @@ public static void PlaySound(UnmanagedMemoryStream file)
player.Play();
}
/// <summary>
/// Plays a sound from a byte[] array. Useful for MP3s and other formats.
/// </summary>
/// <param name="file">The byte[] aray</param>
public static void PlaySound(byte[] file)
{
Stream mstr = new MemoryStream(file);
SoundPlayer player = new SoundPlayer(mstr);
player.Play();
}
/// <summary>
/// Shiftorium upgrades.
/// </summary>
@ -831,46 +878,62 @@ public static void RemoveCodepoints(int cp)
/// </summary>
public static void ShutDownShiftOS()
{
//Disconnect from server.
foreach(string ip in Package_Grabber.clients.Keys)
if (!LimitedMode)
{
Package_Grabber.Disconnect(ip);
}
//Close all mods.
WindowComposition.ShuttingDown = true;
if (RunningModProcesses.Count > 0)
{
foreach (Process mod in RunningModProcesses)
//dispose audio clients
Audio.DisposeAll();
//Disconnect from server.
try
{
try {
mod.Kill();
}
catch(Exception ex)
foreach (string ip in Package_Grabber.clients.Keys)
{
LogException(ex.Message, false);
Package_Grabber.Disconnect(ip);
}
}
SaveSystem.Utilities.saveGame();
Application.Exit();
}
SaveSystem.Utilities.saveGame();
//Right before the game closes...
try
{
if (Directory.Exists(Paths.Mod_Temp))
Directory.Delete(Paths.Mod_Temp, true);
}
catch(Exception ex)
{
API.LogException(ex.Message, false);
}
finally
{
//Alright, ShiftOS! HAVE AT IT!
Application.Exit();
}
catch
{
}
//Close all mods.
WindowComposition.ShuttingDown = true;
if (RunningModProcesses.Count > 0)
{
foreach (Process mod in RunningModProcesses)
{
try
{
mod.Kill();
}
catch (Exception ex)
{
LogException(ex.Message, false);
}
}
SaveSystem.Utilities.saveGame();
Application.Exit();
}
SaveSystem.Utilities.saveGame();
//Right before the game closes...
try
{
if (Directory.Exists(Paths.Mod_Temp))
Directory.Delete(Paths.Mod_Temp, true);
}
catch (Exception ex)
{
API.LogException(ex.Message, false);
}
finally
{
//Alright, ShiftOS! HAVE AT IT!
Application.Exit();
}
}
else
{
CreateInfoboxSession("Limited mode", "ShiftOS is in limited mode and cannot be shut down. Please complete the current mission before shutting down.", infobox.InfoboxMode.Info);
}
}
/// <summary>
@ -942,125 +1005,136 @@ public static SaveSystem.Save CurrentSave
/// <param name="AppIcon">Icon to display on the titlebar.</param>
public static void CreateForm(Form formToCreate, string AppName, Image AppIcon)
{
if (Upgrades["multitasking"] == false && formToCreate.Name != "infobox")
if(API.CurrentSession == null)
{
CloseEverything();
API.CurrentSession = new ShiftOSDesktop();
}
var bw = new BackgroundWorker();
bw.DoWork += (object sen, DoWorkEventArgs eva) =>
try
{
WindowComposition.SafeToAddControls = false;
if (Upgrades["multitasking"] == false && formToCreate.Name != "infobox")
{
CloseEverything();
}
var bw = new BackgroundWorker();
bw.DoWork += (object sen, DoWorkEventArgs eva) =>
{
WindowComposition.SafeToAddControls = false;
//bugfix: Close any terminal if WindowedTerminal isn't installed.
if (Upgrades["windowedterminal"] == false)
{
{
API.CurrentSession.Invoke(new Action(() =>
{
foreach (Form frm in OpenPrograms)
{
if (frm.Name.ToLower() == "terminal")
{
API.CurrentSession.Invoke(new Action(() =>
{
frm.Close();
}));
}
}
}));
}
WindowBorder brdr = new WindowBorder(AppName, AppIcon);
brdr.Name = "api_brdr";
formToCreate.Controls.Add(brdr);
formToCreate.ShowInTaskbar = false;
brdr.Show();
formToCreate.FormBorderStyle = FormBorderStyle.None;
brdr.Dock = DockStyle.Fill;
BordersToUpdate.Add(brdr);
List<Control> duplicates = new List<Control>();
foreach (Control ctrl in formToCreate.Controls)
{
if (ctrl.Name != "api_brdr")
{
ctrl.Hide();
brdr.pgcontents.Controls.Add(ctrl);
duplicates.Add(ctrl);
}
}
foreach (Control ctrl in duplicates)
{
try
{
formToCreate.Controls.Remove(ctrl);
ctrl.Show();
}
catch (Exception ex)
{
API.CurrentSession.Invoke(new Action(() =>
{
ctrl.Show();
}));
}
}
WindowComposition.ShowForm(formToCreate, CurrentSkin.WindowOpenAnimation);
API.CurrentSession.Invoke(new Action(() =>
{
foreach (Form frm in OpenPrograms)
brdr.justopened = true;
formToCreate.TopMost = true;
//Open terminal on CTRL+T press on any form.
formToCreate.KeyDown += (object sender, KeyEventArgs e) =>
{
if (frm.Name.ToLower() == "terminal")
if (e.KeyCode == Keys.T && e.Control && formToCreate.Name != "Terminal")
{
API.CurrentSession.Invoke(new Action(() =>
{
frm.Close();
}));
CreateForm(new Terminal(), CurrentSave.TerminalName, Properties.Resources.iconTerminal);
}
}
}));
}
WindowBorder brdr = new WindowBorder(AppName, AppIcon);
brdr.Name = "api_brdr";
formToCreate.Controls.Add(brdr);
formToCreate.ShowInTaskbar = false;
brdr.Show();
formToCreate.FormBorderStyle = FormBorderStyle.None;
brdr.Dock = DockStyle.Fill;
BordersToUpdate.Add(brdr);
List<Control> duplicates = new List<Control>();
foreach (Control ctrl in formToCreate.Controls)
{
if (ctrl.Name != "api_brdr")
{
ctrl.Hide();
brdr.pgcontents.Controls.Add(ctrl);
duplicates.Add(ctrl);
}
}
foreach (Control ctrl in duplicates)
{
try {
formToCreate.Controls.Remove(ctrl);
ctrl.Show();
}
catch(Exception ex)
{
API.CurrentSession.Invoke(new Action(() =>
{
ctrl.Show();
}));
}
}
WindowComposition.ShowForm(formToCreate, CurrentSkin.WindowOpenAnimation);
API.CurrentSession.Invoke(new Action(() =>
{
brdr.justopened = true;
formToCreate.TopMost = true;
//Open terminal on CTRL+T press on any form.
formToCreate.KeyDown += (object sender, KeyEventArgs e) =>
{
if (e.KeyCode == Keys.T && e.Control && formToCreate.Name != "Terminal")
{
CreateForm(new Terminal(), CurrentSave.TerminalName, Properties.Resources.iconTerminal);
}
if (formToCreate.Name != "Terminal" || Upgrades["windowedterminal"] == true)
{
if (formToCreate.Name != "Terminal" || Upgrades["windowedterminal"] == true)
{
//Movable Windows
if (API.Upgrades["movablewindows"] == true)
{
if (e.KeyCode == Keys.A && e.Control)
{
e.Handled = true;
formToCreate.Location = new Point(formToCreate.Location.X - 30, formToCreate.Location.Y);
}
if (e.KeyCode == Keys.D && e.Control)
{
e.Handled = true;
formToCreate.Location = new Point(formToCreate.Location.X + 30, formToCreate.Location.Y);
}
if (e.KeyCode == Keys.W && e.Control)
{
e.Handled = true;
formToCreate.Location = new Point(formToCreate.Location.X, formToCreate.Location.Y - 30);
}
if (e.KeyCode == Keys.S && e.Control)
{
e.Handled = true;
formToCreate.Location = new Point(formToCreate.Location.X, formToCreate.Location.Y + 30);
if (e.KeyCode == Keys.A && e.Control)
{
e.Handled = true;
formToCreate.Location = new Point(formToCreate.Location.X - 30, formToCreate.Location.Y);
}
if (e.KeyCode == Keys.D && e.Control)
{
e.Handled = true;
formToCreate.Location = new Point(formToCreate.Location.X + 30, formToCreate.Location.Y);
}
if (e.KeyCode == Keys.W && e.Control)
{
e.Handled = true;
formToCreate.Location = new Point(formToCreate.Location.X, formToCreate.Location.Y - 30);
}
if (e.KeyCode == Keys.S && e.Control)
{
e.Handled = true;
formToCreate.Location = new Point(formToCreate.Location.X, formToCreate.Location.Y + 30);
}
}
}
};
formToCreate.TransparencyKey = Skinning.Utilities.globaltransparencycolour;
OpenPrograms.Add(formToCreate);
if (AppName == "Enemy Hacker")
{
API.CurrentSession.Invoke(new Action(() =>
{
formToCreate.Left = Screen.PrimaryScreen.Bounds.Width - formToCreate.Width;
}));
}
};
formToCreate.TransparencyKey = Skinning.Utilities.globaltransparencycolour;
OpenPrograms.Add(formToCreate);
if(AppName == "Enemy Hacker")
{
API.CurrentSession.Invoke(new Action(() =>
else if (AppName == "You")
{
formToCreate.Left = Screen.PrimaryScreen.Bounds.Width - formToCreate.Width;
}));
}
else if(AppName == "You")
{
API.CurrentSession.Invoke(new Action(() =>
{
formToCreate.Left = 0;
}));
}
}));
WindowComposition.SafeToAddControls = true;
};
bw.RunWorkerAsync();
API.CurrentSession.Invoke(new Action(() =>
{
formToCreate.Left = 0;
}));
}
}));
WindowComposition.SafeToAddControls = true;
};
bw.RunWorkerAsync();
}
catch
{
}
}
/// <summary>
@ -1639,15 +1713,44 @@ public static bool OpenProgram(string cmd)
bool succeeded = true;
switch (cmd)
{
case "iconmanager":
if(API.Upgrades["iconmanager"])
case "quests":
if(LimitedMode)
{
CreateForm(new IconManager(), "Icon Manager", GetIcon("IconManager"));
CreateForm(new FinalMission.QuestViewer(), "Quest Viewer", GetIcon("QuestViewer"));
}
else
{
succeeded = false;
}
break;
case "iconmanager":
if (!LimitedMode)
{
if (API.Upgrades["iconmanager"])
{
CreateForm(new IconManager(), "Icon Manager", GetIcon("IconManager"));
}
else
{
succeeded = false;
}
}
else
{
succeeded = false;
}
break;
case "knowledge_input":
case "ki":
API.CreateForm(new KnowledgeInput(), API.LoadedNames.KnowledgeInputName, GetIcon("KI"));
if (!LimitedMode)
{
API.CreateForm(new KnowledgeInput(), API.LoadedNames.KnowledgeInputName, GetIcon("KI"));
}
else
{
succeeded = false;
}
break;
case "holochat":
if(API.Upgrades["holochat"] == true)
@ -1661,9 +1764,16 @@ public static bool OpenProgram(string cmd)
break;
case "namechanger":
case "name_changer":
if (API.Upgrades["namechanger"] == true)
if (!LimitedMode)
{
CreateForm(new NameChanger(), LoadedNames.NameChangerName, GetIcon("NameChanger"));
if (API.Upgrades["namechanger"] == true)
{
CreateForm(new NameChanger(), LoadedNames.NameChangerName, GetIcon("NameChanger"));
}
else
{
succeeded = false;
}
}
else
{
@ -1671,9 +1781,16 @@ public static bool OpenProgram(string cmd)
}
break;
case "artpad":
if(API.Upgrades["artpad"] == true)
if (!LimitedMode)
{
CreateForm(new Artpad(), LoadedNames.ArtpadName, GetIcon("Artpad"));
if (API.Upgrades["artpad"] == true)
{
CreateForm(new Artpad(), LoadedNames.ArtpadName, GetIcon("Artpad"));
}
else
{
succeeded = false;
}
}
else
{
@ -1691,9 +1808,16 @@ public static bool OpenProgram(string cmd)
break;
case "skinloader":
case "skin_loader":
if(Upgrades["skinning"] == true)
if (!LimitedMode)
{
CreateForm(new SkinLoader(), "Skin Loader", GetIcon("SkinLoader"));
if (Upgrades["skinning"] == true)
{
CreateForm(new SkinLoader(), "Skin Loader", GetIcon("SkinLoader"));
}
else
{
succeeded = false;
}
}
else
{
@ -1701,26 +1825,36 @@ public static bool OpenProgram(string cmd)
}
break;
case "shifter":
if(Upgrades["shifter"] == true)
if (!LimitedMode)
{
CreateForm(new Shifter(), "Shifter", GetIcon("Shifter"));
if (Upgrades["shifter"] == true)
{
CreateForm(new Shifter(), "Shifter", GetIcon("Shifter"));
}
else
{
succeeded = false;
}
}
else
{
succeeded = false;
}
break;
/* TEMP-REMOVED: I just can't get it to work.
case "jumper":
CreateForm(new Jumper(), "Jumper", null);
break;
*/
case "pong":
if (Upgrades["pong"] == true)
if (!LimitedMode)
{
CreateForm(new Pong(), "Pong", GetIcon("Pong"));
if (Upgrades["pong"] == true)
{
CreateForm(new Pong(), "Pong", GetIcon("Pong"));
}
else
{
succeeded = false;
}
}
else {
else
{
succeeded = false;
}
break;
@ -1735,7 +1869,14 @@ public static bool OpenProgram(string cmd)
}
break;
case "shiftorium":
CreateForm(new Shiftorium.Frontend(), LoadedNames.ShiftoriumName, GetIcon("Shiftorium"));
if (!LimitedMode)
{
CreateForm(new Shiftorium.Frontend(), LoadedNames.ShiftoriumName, GetIcon("Shiftorium"));
}
else
{
succeeded = false;
}
break;
default:
succeeded = false;

View file

@ -498,6 +498,10 @@ public KeyValuePair<AppscapeModder, AppscapeClient> GetModderByDevID(string DevI
/// <param name="client">The client to add to.</param>
public void GenerateNewDevKey(AppscapeClient client)
{
if(client.DevList == null)
{
client.DevList = new Dictionary<string, AppscapeModder>();
}
var rnd = new Random();
int key = rnd.Next(1, 99999999);
var dev = new AppscapeModder();
@ -741,14 +745,14 @@ private void btnrequest_Click(object sender, EventArgs e)
{
if(lvnets.SelectedItems.Count > 0)
{
try
{
//try
//{
GenerateNewDevKey((AppscapeClient)lvnets.SelectedItems[0].Tag);
}
catch
/*}
catch (Exception ex)
{
API.CreateInfoboxSession("Error", "An error has occurred trying to process the request.", infobox.InfoboxMode.Info);
}
API.CreateInfoboxSession("Error", "An error has occurred trying to process the request: {ex.Message}", infobox.InfoboxMode.Info);
}*/
}
}
}

View file

@ -0,0 +1,250 @@
// WARNING: This thing likes leaking memory.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using NAudio;
using NAudio.Wave;
using System.Threading;
namespace ShiftOS
{
public class Audio
{
public static List<AudioResourceClient> Clients = null;
internal static bool Enabled = false;
public static void DisposeAll()
{
if(Clients != null)
{
foreach(var client in Clients)
{
client.Dispose();
}
}
}
}
public class AudioResourceClient
{
public AudioResourceClient(string folder)
{
if (Audio.Enabled)
{
if (Audio.Clients == null)
{
Audio.Clients = new List<AudioResourceClient>();
}
Audio.Clients.Add(this);
string real = folder.Replace(";", OSInfo.DirectorySeparator);
real_path = "resources" + OSInfo.DirectorySeparator + real;
soundPlayer = new WaveOut();
var t = new Thread(new ThreadStart(new Action(() =>
{
while (disposed == false)
{
switch (soundPlayer.PlaybackState)
{
case PlaybackState.Stopped:
if (fireEvents)
{
if (currentStream != null)
currentStream.Dispose();
currentStream = null;
currentProvider = null;
var h = SongFinished;
if (h != null)
{
API.CurrentSession.Invoke(new Action(() =>
{
h(this, new EventArgs());
}));
}
}
break;
}
}
})));
t.Start();
}
}
public string CurrentSong
{
get { return currentSong; }
}
private string real_path = null;
private WaveOut soundPlayer = null;
private bool disposed = false;
private bool playing = false;
private bool loopActive = false;
private string currentSong = "";
protected Thread soundThread;
private Stream currentStream = null;
private IWaveProvider currentProvider = null;
private bool fireEvents = false;
public event EventHandler SongFinished;
public void Play(byte[] songbytes)
{
if (Audio.Enabled)
{
var t = new Thread(new ThreadStart(new Action(() =>
{
try
{
if (disposed == false)
{
if (currentProvider != null)
{
currentProvider = null;
}
if (currentStream != null)
{
currentStream.Dispose();
currentStream = null;
}
Stream s = new MemoryStream(songbytes);
IWaveProvider provider = new RawSourceWaveStream(s, new WaveFormat());
soundPlayer.Init(provider);
soundPlayer.Play();
fireEvents = true;
currentStream = s;
currentProvider = provider;
}
}
catch
{
}
})));
soundThread = t;
t.Start();
}
}
public void PlayMP3(byte[] songbytes)
{
if (Audio.Enabled)
{
var t = new Thread(new ThreadStart(new Action(() =>
{
if (currentProvider != null)
{
currentProvider = null;
}
if (currentStream != null)
{
currentStream.Dispose();
currentStream = null;
}
Stream s = new MemoryStream(songbytes);
IWaveProvider provider = new Mp3FileReader(s);
soundPlayer.Init(provider);
soundPlayer.Play();
currentStream = s;
currentProvider = provider;
})));
soundThread = t;
t.Start();
}
}
public void Play(string file)
{
if (Audio.Enabled)
{
if (File.Exists(real_path + OSInfo.DirectorySeparator + file + ".wav"))
{
currentSong = file;
Play(File.ReadAllBytes(real_path + OSInfo.DirectorySeparator + file + ".wav"));
}
else if (File.Exists(real_path + OSInfo.DirectorySeparator + file + ".mp3"))
{
currentSong = file;
PlayMP3(File.ReadAllBytes(real_path + OSInfo.DirectorySeparator + file + ".mp3"));
}
}
}
public void Stop()
{
if (Audio.Enabled)
{
var t = new Thread(new ThreadStart(new Action(() =>
{
fireEvents = false;
soundPlayer.Stop();
if (currentProvider != null)
{
currentProvider = null;
}
if (currentStream != null)
{
currentStream.Dispose();
currentStream = null;
}
})));
t.Start();
}
}
public void Pause()
{
if (Audio.Enabled)
{
if (soundPlayer.PlaybackState == PlaybackState.Playing)
{
soundPlayer.Pause();
}
else if (soundPlayer.PlaybackState == PlaybackState.Paused)
{
soundPlayer.Resume();
}
}
}
public void PlayRandom()
{
if (Audio.Enabled)
{
int r = new Random().Next(0, Directory.GetFiles(real_path).Length);
var files = Directory.GetFiles(real_path);
FileInfo finf = new FileInfo(files[r]);
string name = finf.Name.Replace(finf.Extension, "");
Play(name);
}
}
public void Dispose()
{
if (Audio.Enabled)
{
if (currentProvider != null)
{
currentProvider = null;
}
if (currentStream != null)
{
currentStream.Dispose();
currentStream = null;
}
soundPlayer.Dispose();
disposed = true;
}
}
}
}

View file

@ -0,0 +1,75 @@
namespace ShiftOS.FinalMission
{
partial class ChoiceControl
{
/// <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 Component 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.lbnumber = new System.Windows.Forms.Label();
this.lbdescription = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// lbnumber
//
this.lbnumber.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbnumber.Font = new System.Drawing.Font("Microsoft Sans Serif", 36F);
this.lbnumber.Location = new System.Drawing.Point(0, 0);
this.lbnumber.Name = "lbnumber";
this.lbnumber.Size = new System.Drawing.Size(112, 75);
this.lbnumber.TabIndex = 0;
this.lbnumber.Text = "1";
this.lbnumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbnumber.Click += new System.EventHandler(this.lbdescription_Click);
//
// lbdescription
//
this.lbdescription.Dock = System.Windows.Forms.DockStyle.Bottom;
this.lbdescription.Location = new System.Drawing.Point(0, 75);
this.lbdescription.Name = "lbdescription";
this.lbdescription.Size = new System.Drawing.Size(112, 27);
this.lbdescription.TabIndex = 1;
this.lbdescription.Text = "Stop DevX";
this.lbdescription.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbdescription.Click += new System.EventHandler(this.lbdescription_Click);
//
// ChoiceControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.lbnumber);
this.Controls.Add(this.lbdescription);
this.Name = "ChoiceControl";
this.Size = new System.Drawing.Size(112, 102);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label lbnumber;
private System.Windows.Forms.Label lbdescription;
}
}

View file

@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ShiftOS.FinalMission
{
[DefaultEvent("Selected")]
public partial class ChoiceControl : UserControl
{
public ChoiceControl()
{
InitializeComponent();
}
public int Number
{
get { return Convert.ToInt32(lbnumber.Text); }
set { lbnumber.Text = value.ToString(); }
}
public string ChoiceName
{
get
{
return lbdescription.Text;
}
set
{
lbdescription.Text = value;
}
}
public event EventHandler Selected;
private void lbdescription_Click(object sender, EventArgs e)
{
var h = this.Selected;
if(h != null)
{
h(this, e);
}
}
}
}

View file

@ -0,0 +1,120 @@
<?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>
</root>

View file

@ -0,0 +1,350 @@
namespace ShiftOS.FinalMission
{
partial class ChooseYourApproach
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChooseYourApproach));
this.pnlmain = new System.Windows.Forms.Panel();
this.lbdesc = new System.Windows.Forms.Label();
this.lbtitle = new System.Windows.Forms.Label();
this.pnldescription = new System.Windows.Forms.Panel();
this.choicedesc = new System.Windows.Forms.Label();
this.fldescbuttons = new System.Windows.Forms.FlowLayoutPanel();
this.btnbegin = new System.Windows.Forms.Button();
this.choicetitle = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.pnlchoices = new System.Windows.Forms.Panel();
this.choiceControl3 = new ShiftOS.FinalMission.ChoiceControl();
this.choiceControl2 = new ShiftOS.FinalMission.ChoiceControl();
this.cc_sidewithdevx = new ShiftOS.FinalMission.ChoiceControl();
this.pnlconfirm = new System.Windows.Forms.Panel();
this.lbconfirm = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.button3 = new System.Windows.Forms.Button();
this.pnlmain.SuspendLayout();
this.pnldescription.SuspendLayout();
this.fldescbuttons.SuspendLayout();
this.pnlchoices.SuspendLayout();
this.pnlconfirm.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// pnlmain
//
this.pnlmain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlmain.Controls.Add(this.lbdesc);
this.pnlmain.Controls.Add(this.lbtitle);
this.pnlmain.Location = new System.Drawing.Point(318, 27);
this.pnlmain.Name = "pnlmain";
this.pnlmain.Size = new System.Drawing.Size(692, 178);
this.pnlmain.TabIndex = 0;
//
// lbdesc
//
this.lbdesc.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbdesc.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
this.lbdesc.Location = new System.Drawing.Point(0, 38);
this.lbdesc.Name = "lbdesc";
this.lbdesc.Size = new System.Drawing.Size(692, 140);
this.lbdesc.TabIndex = 1;
this.lbdesc.Text = resources.GetString("lbdesc.Text");
this.lbdesc.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbdesc.Click += new System.EventHandler(this.lbdesc_Click);
//
// lbtitle
//
this.lbtitle.Dock = System.Windows.Forms.DockStyle.Top;
this.lbtitle.Font = new System.Drawing.Font("Lucida Console", 19F);
this.lbtitle.Location = new System.Drawing.Point(0, 0);
this.lbtitle.Name = "lbtitle";
this.lbtitle.Size = new System.Drawing.Size(692, 38);
this.lbtitle.TabIndex = 0;
this.lbtitle.Text = "Choose your approach";
this.lbtitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// pnldescription
//
this.pnldescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnldescription.Controls.Add(this.choicedesc);
this.pnldescription.Controls.Add(this.fldescbuttons);
this.pnldescription.Controls.Add(this.choicetitle);
this.pnldescription.Location = new System.Drawing.Point(318, 357);
this.pnldescription.Name = "pnldescription";
this.pnldescription.Size = new System.Drawing.Size(692, 178);
this.pnldescription.TabIndex = 1;
//
// choicedesc
//
this.choicedesc.Dock = System.Windows.Forms.DockStyle.Fill;
this.choicedesc.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
this.choicedesc.Location = new System.Drawing.Point(0, 38);
this.choicedesc.Name = "choicedesc";
this.choicedesc.Size = new System.Drawing.Size(692, 103);
this.choicedesc.TabIndex = 1;
this.choicedesc.Text = "DevX caused all of this. He hijacked your computer and put ShiftOS on it, and mad" +
"e you work harder than ever just to make it usable.\r\n\r\nNow it\'s time to use all " +
"your skills to take him down.";
this.choicedesc.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// fldescbuttons
//
this.fldescbuttons.Controls.Add(this.btnbegin);
this.fldescbuttons.Dock = System.Windows.Forms.DockStyle.Bottom;
this.fldescbuttons.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
this.fldescbuttons.Location = new System.Drawing.Point(0, 141);
this.fldescbuttons.Name = "fldescbuttons";
this.fldescbuttons.Size = new System.Drawing.Size(692, 37);
this.fldescbuttons.TabIndex = 2;
//
// btnbegin
//
this.btnbegin.AutoSize = true;
this.btnbegin.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.btnbegin.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnbegin.Location = new System.Drawing.Point(3, 3);
this.btnbegin.Name = "btnbegin";
this.btnbegin.Size = new System.Drawing.Size(62, 32);
this.btnbegin.TabIndex = 0;
this.btnbegin.Text = "Begin";
this.btnbegin.UseVisualStyleBackColor = true;
this.btnbegin.Click += new System.EventHandler(this.btnbegin_Click);
//
// choicetitle
//
this.choicetitle.Dock = System.Windows.Forms.DockStyle.Top;
this.choicetitle.Font = new System.Drawing.Font("Lucida Console", 19F);
this.choicetitle.Location = new System.Drawing.Point(0, 0);
this.choicetitle.Name = "choicetitle";
this.choicetitle.Size = new System.Drawing.Size(692, 38);
this.choicetitle.TabIndex = 0;
this.choicetitle.Text = "Defeat DevX";
this.choicetitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// panel1
//
this.panel1.Location = new System.Drawing.Point(648, -76);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(200, 100);
this.panel1.TabIndex = 2;
//
// pnlchoices
//
this.pnlchoices.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlchoices.Controls.Add(this.choiceControl3);
this.pnlchoices.Controls.Add(this.choiceControl2);
this.pnlchoices.Controls.Add(this.cc_sidewithdevx);
this.pnlchoices.Location = new System.Drawing.Point(510, 228);
this.pnlchoices.MaximumSize = new System.Drawing.Size(338, 91);
this.pnlchoices.MinimumSize = new System.Drawing.Size(338, 91);
this.pnlchoices.Name = "pnlchoices";
this.pnlchoices.Size = new System.Drawing.Size(338, 91);
this.pnlchoices.TabIndex = 3;
//
// choiceControl3
//
this.choiceControl3.ChoiceName = "Destroy DevX";
this.choiceControl3.Dock = System.Windows.Forms.DockStyle.Fill;
this.choiceControl3.Location = new System.Drawing.Point(112, 0);
this.choiceControl3.Name = "choiceControl3";
this.choiceControl3.Number = 2;
this.choiceControl3.Size = new System.Drawing.Size(114, 91);
this.choiceControl3.TabIndex = 2;
this.choiceControl3.Selected += new System.EventHandler(this.cc_sidewithdevx_Selected);
//
// choiceControl2
//
this.choiceControl2.ChoiceName = "End it all";
this.choiceControl2.Dock = System.Windows.Forms.DockStyle.Right;
this.choiceControl2.Location = new System.Drawing.Point(226, 0);
this.choiceControl2.Name = "choiceControl2";
this.choiceControl2.Number = 3;
this.choiceControl2.Size = new System.Drawing.Size(112, 91);
this.choiceControl2.TabIndex = 1;
this.choiceControl2.Selected += new System.EventHandler(this.cc_sidewithdevx_Selected);
//
// cc_sidewithdevx
//
this.cc_sidewithdevx.ChoiceName = "Side with DevX";
this.cc_sidewithdevx.Dock = System.Windows.Forms.DockStyle.Left;
this.cc_sidewithdevx.Location = new System.Drawing.Point(0, 0);
this.cc_sidewithdevx.Name = "cc_sidewithdevx";
this.cc_sidewithdevx.Number = 1;
this.cc_sidewithdevx.Size = new System.Drawing.Size(112, 91);
this.cc_sidewithdevx.TabIndex = 0;
this.cc_sidewithdevx.Selected += new System.EventHandler(this.cc_sidewithdevx_Selected);
//
// pnlconfirm
//
this.pnlconfirm.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlconfirm.Controls.Add(this.lbconfirm);
this.pnlconfirm.Controls.Add(this.flowLayoutPanel1);
this.pnlconfirm.Controls.Add(this.label2);
this.pnlconfirm.Location = new System.Drawing.Point(56, 27);
this.pnlconfirm.Name = "pnlconfirm";
this.pnlconfirm.Size = new System.Drawing.Size(1220, 449);
this.pnlconfirm.TabIndex = 4;
this.pnlconfirm.Visible = false;
//
// lbconfirm
//
this.lbconfirm.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbconfirm.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
this.lbconfirm.Location = new System.Drawing.Point(0, 38);
this.lbconfirm.Name = "lbconfirm";
this.lbconfirm.Size = new System.Drawing.Size(1220, 374);
this.lbconfirm.TabIndex = 1;
this.lbconfirm.Text = resources.GetString("lbconfirm.Text");
this.lbconfirm.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Dock = System.Windows.Forms.DockStyle.Top;
this.label2.Font = new System.Drawing.Font("Lucida Console", 19F);
this.label2.Location = new System.Drawing.Point(0, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(1220, 38);
this.label2.TabIndex = 0;
this.label2.Text = "Start This Mission";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// 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(1233, 510);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(83, 25);
this.button1.TabIndex = 5;
this.button1.Text = "Toggle Music";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button2.AutoSize = true;
this.button2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Location = new System.Drawing.Point(1210, 12);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(106, 25);
this.button2.TabIndex = 6;
this.button2.Text = "Return to Desktop";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.button3);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.flowLayoutPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 412);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(1220, 37);
this.flowLayoutPanel1.TabIndex = 3;
//
// button3
//
this.button3.AutoSize = true;
this.button3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button3.Location = new System.Drawing.Point(3, 3);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(71, 32);
this.button3.TabIndex = 0;
this.button3.Text = "Ready.";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// ChooseYourApproach
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.ClientSize = new System.Drawing.Size(1328, 547);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.pnlconfirm);
this.Controls.Add(this.pnlchoices);
this.Controls.Add(this.panel1);
this.Controls.Add(this.pnldescription);
this.Controls.Add(this.pnlmain);
this.ForeColor = System.Drawing.Color.LightGreen;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "ChooseYourApproach";
this.Text = "ChooseYourApproach";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.onClose);
this.Load += new System.EventHandler(this.ChooseYourApproach_Load);
this.pnlmain.ResumeLayout(false);
this.pnldescription.ResumeLayout(false);
this.fldescbuttons.ResumeLayout(false);
this.fldescbuttons.PerformLayout();
this.pnlchoices.ResumeLayout(false);
this.pnlconfirm.ResumeLayout(false);
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Panel pnlmain;
private System.Windows.Forms.Label lbdesc;
private System.Windows.Forms.Label lbtitle;
private System.Windows.Forms.Panel pnldescription;
private System.Windows.Forms.Label choicedesc;
private System.Windows.Forms.FlowLayoutPanel fldescbuttons;
private System.Windows.Forms.Button btnbegin;
private System.Windows.Forms.Label choicetitle;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel pnlchoices;
private ChoiceControl choiceControl3;
private ChoiceControl choiceControl2;
private ChoiceControl cc_sidewithdevx;
private System.Windows.Forms.Panel pnlconfirm;
private System.Windows.Forms.Label lbconfirm;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Button button3;
}
}

View file

@ -0,0 +1,174 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Media;
////using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using NAudio;
using NAudio.Wave;
namespace ShiftOS.FinalMission
{
public partial class ChooseYourApproach : Form
{
bool Playing = false;
private AudioResourceClient audioClient = null;
public ChooseYourApproach()
{
audioClient = new AudioResourceClient("EndGame;RossBugden");
InitializeComponent();
//Music thread.
audioClient.Play("Rapture");
audioClient.SongFinished += (object s, EventArgs a) =>
{
if (musicEnabled)
{
audioClient.Play("Rapture");
}
};
}
private void lbdesc_Click(object sender, EventArgs e)
{
}
private int choice = 0;
private void ChooseYourApproach_Load(object sender, EventArgs e)
{
pnlchoices.Left = (this.Width - pnlchoices.Width) / 2;
}
private void cc_sidewithdevx_Selected(object sender, EventArgs e)
{
var cc = (ChoiceControl)sender;
choice = cc.Number;
SetupUI();
}
public void SetupUI()
{
switch (choice)
{
case 0:
choicetitle.Text = "Select a choice";
choicedesc.Text = "Select a choice to see more information about it and to begin.";
btnbegin.Hide();
break;
case 1:
choicetitle.Text = "Side With DevX";
choicedesc.Text = "Side with DevX and gain full control of ShiftOS.";
btnbegin.Show();
break;
case 2:
choicetitle.Text = "Destroy DevX";
choicedesc.Text = "DevX put you through digital torture. He stripped you of all your personal files, put you in a barely usable OS and made you make it better. Now it's time to take him down before he can do it to anyone else.";
btnbegin.Show();
break;
case 3:
choicetitle.Text = "End it all";
choicedesc.Text = "It's time to stop dealing with all this stuff and bring you back to your old operating system.";
btnbegin.Show();
break;
}
}
public void SetupConfirmUI()
{
List<string> dependencies = new List<string>();
panel1.Hide();
pnlchoices.Hide();
pnldescription.Hide();
pnlmain.Hide();
pnlconfirm.Show();
switch (choice)
{
case 1:
dependencies.Add("HoloChat");
break;
case 2:
dependencies.Add("HoloChat");
dependencies.Add("Network Browser");
dependencies.Add("Hacking skills");
break;
case 3:
break;
}
lbconfirm.Text = "You are about to start a mission. It is worth noting that during the mission you will not be able to shut down ShiftOS, access Shiftnet applications, or access applications like Pong, Knowledge Input, Shifter, Skin Loader, Shiftorium, or other OS-modifying applications.";
lbconfirm.Text += Environment.NewLine + Environment.NewLine + "The following things will be needed to start this mission:" + Environment.NewLine;
foreach (var d in dependencies)
{
lbconfirm.Text += d + Environment.NewLine;
}
lbconfirm.Text += Environment.NewLine + "During the mission, a window will appear near the top of the screen showing you what to do. You can also use the 'quests' Terminal Command to view a list of everything you need to do.";
}
private void btnbegin_Click(object sender, EventArgs e)
{
API.CreateInfoboxSession("Begin mission", "Are you sure you'd like to start this mission? You will not be able to access many applications or shut down ShiftOS until you have completed the mission.", infobox.InfoboxMode.YesNo);
API.InfoboxSession.FormClosing += (object s, FormClosingEventArgs a) =>
{
var res = API.GetInfoboxResult();
if (res == "Yes")
{
SetupConfirmUI();
}
};
}
private void onClose(object sender, FormClosingEventArgs e)
{
audioClient.Stop();
audioClient.Dispose();
audioClient = null;
}
bool musicEnabled = true;
private void button1_Click(object sender, EventArgs e)
{
if (musicEnabled)
{
audioClient.Stop();
}
else
{
audioClient.Play("Rapture");
}
musicEnabled = !musicEnabled;
}
private void button2_Click(object sender, EventArgs e)
{
API.CreateInfoboxSession("Return to Desktop", "You came this far and are ready to stop DevX, but you are really willing to cancel and go to your desktop?", infobox.InfoboxMode.YesNo);
API.InfoboxSession.FormClosing += (object s, FormClosingEventArgs a) =>
{
var res = API.GetInfoboxResult();
if (res == "Yes")
{
this.Close();
API.CreateInfoboxSession("Return to Desktop", "Very well, you can have it your way.", infobox.InfoboxMode.Info);
}
};
}
private void button3_Click(object sender, EventArgs e)
{
API.LimitedMode = true;
API.CurrentSession.SetupDesktop();
API.CloseEverything();
EndGameHandler.Initiate(choice);
}
}
}

View file

@ -0,0 +1,134 @@
<?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="lbdesc.Text" xml:space="preserve">
<value>The time has come.
You have conquered many networks, explored the vast Shiftnet, gained and spent many Codepoints, and received all upgrades.
Now it's time to choose what you'll do next. Will you side with DevX? Will you stop DevX dead in his tracks, or will you end it all and return to your previous operating system?</value>
</data>
<data name="lbconfirm.Text" xml:space="preserve">
<value>The time has come.
You have conquered many networks, explored the vast Shiftnet, gained and spent many Codepoints, and received all upgrades.
Now it's time to choose what you'll do next. Will you side with DevX? Will you stop DevX dead in his tracks, or will you end it all and return to your previous operating system?</value>
</data>
</root>

View file

@ -0,0 +1,275 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
namespace ShiftOS.FinalMission
{
public enum Choice
{
SideWithDevX,
StopDevX,
EndAll
}
public class EndGameHandler
{
#region Properties
public static Choice CurrentChoice
{
get { return currentChoice; }
}
public static Dictionary<string, bool> ThingsToDo
{
get
{
return thingsToDo;
}
}
public static bool C2_ShellShockBreachCommand { get; set; }
public static string CurrentObjective
{
get
{
try
{
return thingsToDo.Keys.ElementAt<string>(currentObjective);
}
catch
{
return "";
}
}
}
public static string CurrentObjectivePrompt
{
get { return objPrompt; }
}
public static MissionGuide MissionGuide
{
get { return mguide; }
}
public static bool GodModeInstallEnabled { get; set; }
#endregion
public static FakeChatClient FakeHoloChatRoom
{
get
{
if (currentObjective == 0)
{
var room = new FakeChatClient();
room.Name = "The Hacker Alliance";
room.OtherCharacters = new List<string>();
switch (currentChoice)
{
case Choice.EndAll:
room.Topic = "Oh no. | The ShiftOS Hacker Alliance: We don't mess around.";
room.OtherCharacters.Add("???");
room.OtherCharacters.Add("Hacker101");
room.Messages = JsonConvert.DeserializeObject<Dictionary<string, string>>(Properties.Resources.Choice3);
break;
case Choice.StopDevX:
room.Topic = "The ShiftOS Hacker Alliance: We don't mess around.";
room.OtherCharacters.Add("???");
room.Messages = JsonConvert.DeserializeObject<Dictionary<string, string>>(Properties.Resources.Choice2);
break;
case Choice.SideWithDevX:
room.Topic = "Chat seized by DevX";
room.OtherCharacters.Add("DevX");
room.Messages = JsonConvert.DeserializeObject<Dictionary<string, string>>(Properties.Resources.Choice1);
break;
}
return room;
}
else
{
return null;
}
}
}
#region Events
public static event EventHandler ObjectiveCompleted;
public static event EventHandler MissionComplete;
#endregion
#region Variables
private static Choice currentChoice = Choice.EndAll;
private static Dictionary<string, bool> thingsToDo = new Dictionary<string, bool>();
private static int currentObjective = 0;
private static string objPrompt;
private static MissionGuide mguide;
#endregion
#region Methods
public static void Initiate(int choice)
{
mguide = new MissionGuide();
mguide.Show();
switch (choice)
{
case 1:
currentChoice = Choice.SideWithDevX;
currentObjective = 0;
thingsToDo.Add("Chat with DevX on HoloChat", false);
thingsToDo.Add("Install DevX's packages", false);
mguide.ShowButton = false;
objPrompt = "Go chat with DevX on HoloChat.";
break;
case 2:
currentChoice = Choice.StopDevX;
thingsToDo.Add("Chat with the Other Player on HoloChat", false);
thingsToDo.Add("Hack through DevX's firewall", false);
thingsToDo.Add("Take down DevX's primary server", false);
thingsToDo.Add("Take down DevX's secondary server", false);
thingsToDo.Add("Forkbomb DevX's storage and telemetry server", false);
thingsToDo.Add("One last battle...", false);
thingsToDo.Add("Uninstall ShiftOS", false);
mguide.ShowButton = false;
objPrompt = "It's time to destroy DevX. Head to the Hacker Alliance HoloChat room to begin.";
break;
case 3:
currentChoice = Choice.EndAll;
thingsToDo.Add("Trouble in the Hacker Alliance...", false);
mguide.ShowButton = false;
objPrompt = "Something's wrong in the Hacker Alliance chatroom... They need you.";
break;
}
API.CurrentSession.EndGame_AttachEvents();
}
public static void GoToNextObjective()
{
var h = ObjectiveCompleted;
if (h != null)
{
h(CurrentObjective, new EventArgs());
}
currentObjective += 1;
SetupGUIforCurrent();
}
public static void SetupGUIforCurrent()
{
GodModeInstallEnabled = false;
C2_ShellShockBreachCommand = false;
switch(currentChoice)
{
case Choice.SideWithDevX:
switch(currentObjective)
{
case 1:
mguide.ShowButton = false;
objPrompt = "Go open your Terminal and install the 'god_utils' package.";
GodModeInstallEnabled = true;
break;
case 2:
var h = MissionComplete;
h?.Invoke(CurrentObjective, new EventArgs());
break;
}
break;
case Choice.EndAll:
switch(currentObjective)
{
case 1:
var h = MissionComplete;
h?.Invoke(CurrentObjective, new EventArgs());
break;
}
break;
case Choice.StopDevX:
switch(currentObjective)
{
case 1:
mguide.ShowButton = true;
mguide.OnButtonClick = new Action(() =>
{
var enemy = JsonConvert.DeserializeObject<EnemyHacker>(Properties.Resources.DevX_Firewall);
var hui = new HackUI(enemy);
hui.Show();
hui.OnWin += (object s, EventArgs a) =>
{
GoToNextObjective();
};
});
objPrompt = "Before we can do anything major, we need to bust through DevX's firewall. It should be easy, but beware. It's just a firewall. The real stuff's coming soon.";
break;
case 2:
mguide.OnButtonClick = new Action(() =>
{
var enemy = JsonConvert.DeserializeObject<EnemyHacker>(Properties.Resources.DevX_PrimaryNet);
var hui = new HackUI(enemy);
hui.Show();
hui.OnWin += (object s, EventArgs a) =>
{
GoToNextObjective();
};
});
objPrompt = "Alright, we're through. Next on the list is DevX's primary server. Take this down and we can get further into the network without him finding out.";
break;
case 3:
mguide.OnButtonClick = new Action(() =>
{
var enemy = JsonConvert.DeserializeObject<EnemyHacker>(Properties.Resources.DevX_Secondary);
var hui = new HackUI(enemy);
hui.Show();
hui.OnWin += (object s, EventArgs a) =>
{
GoToNextObjective();
};
});
objPrompt = "Primary server's D to the O to the W to the N. DOWN. Next we gotta take down his secondary server. Once it goes down, he's finished.";
break;
case 4:
mguide.ButtonText = "Begin attack in Terminal";
mguide.OnButtonClick = new Action(() =>
{
var t = new Terminal();
API.CreateForm(t, API.LoadedNames.TerminalName, API.GetIcon("Terminal"));
t.StartShellShock();
});
objPrompt = "Bye, have a great time, DevX! Arighty, DevX has one last server running that needs to go before we do anything more. This one sits on shiftnet://devx/tracker and is the server DevX uses to track other ShiftOS users. Take it down and he can't see any of this.";
break;
case 5:
mguide.ShowButton = false;
objPrompt = "THAT did it. I'd keep that terminal open until connection to the server drops. Once it's done, I'll close it and tell you what to do next.";
mguide.ButtonText = "Connect to server";
break;
case 6:
mguide.ShowButton = true;
mguide.ButtonText = "End DevX";
mguide.OnButtonClick = new Action(() =>
{
//code to run to start uninstall of ShiftOS.
});
objPrompt = "Firewall, check. Primary server, check. Secondary server, CHECK. Telemetry server, CHECK. Now it's time to disable DevX himself. After all, he IS just code.";
break;
case 7:
var h = MissionComplete;
h?.Invoke(CurrentObjective, new EventArgs());
break;
}
break;
}
}
#endregion
}
}

View file

@ -0,0 +1,118 @@
namespace ShiftOS.FinalMission
{
partial class MissionGuide
{
/// <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.panel1 = new System.Windows.Forms.Panel();
this.flbuttons = new System.Windows.Forms.FlowLayoutPanel();
this.btnstart = new System.Windows.Forms.Button();
this.tmr_setupui = new System.Windows.Forms.Timer(this.components);
this.lbprompt = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.flbuttons.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.lbprompt);
this.panel1.Controls.Add(this.flbuttons);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(520, 189);
this.panel1.TabIndex = 0;
//
// flbuttons
//
this.flbuttons.Controls.Add(this.btnstart);
this.flbuttons.Dock = System.Windows.Forms.DockStyle.Bottom;
this.flbuttons.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
this.flbuttons.Location = new System.Drawing.Point(0, 155);
this.flbuttons.Name = "flbuttons";
this.flbuttons.Size = new System.Drawing.Size(518, 32);
this.flbuttons.TabIndex = 0;
//
// btnstart
//
this.btnstart.AutoSize = true;
this.btnstart.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.btnstart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnstart.Location = new System.Drawing.Point(435, 3);
this.btnstart.Name = "btnstart";
this.btnstart.Size = new System.Drawing.Size(80, 23);
this.btnstart.TabIndex = 0;
this.btnstart.Text = "Let\'s go.";
this.btnstart.UseVisualStyleBackColor = true;
this.btnstart.Click += new System.EventHandler(this.btnstart_Click);
//
// tmr_setupui
//
this.tmr_setupui.Enabled = true;
this.tmr_setupui.Tick += new System.EventHandler(this.tmr_setupui_Tick);
//
// lbprompt
//
this.lbprompt.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbprompt.Location = new System.Drawing.Point(0, 0);
this.lbprompt.Margin = new System.Windows.Forms.Padding(50);
this.lbprompt.Name = "lbprompt";
this.lbprompt.Padding = new System.Windows.Forms.Padding(15);
this.lbprompt.Size = new System.Drawing.Size(518, 155);
this.lbprompt.TabIndex = 1;
this.lbprompt.Text = "label1";
//
// MissionGuide
//
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(520, 189);
this.Controls.Add(this.panel1);
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 = "MissionGuide";
this.Text = "MissionGuide";
this.panel1.ResumeLayout(false);
this.flbuttons.ResumeLayout(false);
this.flbuttons.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.FlowLayoutPanel flbuttons;
private System.Windows.Forms.Button btnstart;
private System.Windows.Forms.Timer tmr_setupui;
private System.Windows.Forms.Label lbprompt;
}
}

View file

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ShiftOS.FinalMission
{
public partial class MissionGuide : Form
{
public MissionGuide()
{
InitializeComponent();
this.TopMost = true;
}
public Action OnButtonClick = null;
public bool ShowButton
{
get { return btnstart.Visible; }
set { btnstart.Visible = value; }
}
public string ButtonText
{
get { return btnstart.Text; }
set { btnstart.Text = value; }
}
private void btnstart_Click(object sender, EventArgs e)
{
OnButtonClick.Invoke();
}
private void tmr_setupui_Tick(object sender, EventArgs e)
{
lbprompt.Text = EndGameHandler.CurrentObjective.ToUpper() + Environment.NewLine + Environment.NewLine;
lbprompt.Text += EndGameHandler.CurrentObjectivePrompt;
this.Location = new Point(15, 45);
}
}
}

View file

@ -0,0 +1,123 @@
<?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="tmr_setupui.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -0,0 +1,62 @@
namespace ShiftOS.FinalMission
{
partial class QuestViewer
{
/// <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.lbobjectives = new System.Windows.Forms.ListBox();
this.SuspendLayout();
//
// lbobjectives
//
this.lbobjectives.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbobjectives.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Italic);
this.lbobjectives.FormattingEnabled = true;
this.lbobjectives.ItemHeight = 16;
this.lbobjectives.Location = new System.Drawing.Point(0, 0);
this.lbobjectives.Name = "lbobjectives";
this.lbobjectives.Size = new System.Drawing.Size(389, 423);
this.lbobjectives.TabIndex = 0;
//
// QuestViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(389, 423);
this.Controls.Add(this.lbobjectives);
this.Name = "QuestViewer";
this.Text = "QuestViewer";
this.Load += new System.EventHandler(this.QuestViewer_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ListBox lbobjectives;
}
}

View file

@ -0,0 +1,63 @@
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.FinalMission
{
public partial class QuestViewer : Form
{
public QuestViewer()
{
InitializeComponent();
}
private void QuestViewer_Load(object sender, EventArgs e)
{
SetupList();
StartQuestCheckThread();
var tmr = new System.Windows.Forms.Timer();
tmr.Interval = 500;
tmr.Tick += (object s, EventArgs a) =>
{
SetupList();
};
tmr.Start();
}
public void SetupList()
{
lbobjectives.Items.Clear();
foreach(var itm in EndGameHandler.ThingsToDo)
{
lbobjectives.Items.Add(itm.Key);
}
}
public void StartQuestCheckThread()
{
var t = new Thread(new ThreadStart(new Action(() => {
//Start checkloop.
while(true)
{
CheckObjective(EndGameHandler.CurrentObjective);
}
})));
t.Start();
}
public void CheckObjective(string obj)
{
if(EndGameHandler.ThingsToDo[obj] == true)
{
EndGameHandler.GoToNextObjective();
}
}
}
}

View file

@ -0,0 +1,120 @@
<?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>
</root>

View file

@ -0,0 +1,635 @@
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.btnnext = new System.Windows.Forms.Button();
this.lbtutorial = new System.Windows.Forms.Label();
this.lbcompromised = new System.Windows.Forms.Label();
this.lbstats = new System.Windows.Forms.Label();
this.txtenemyconsole = new System.Windows.Forms.TextBox();
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.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.tbui.SuspendLayout();
this.pnlenemy.SuspendLayout();
this.pnlyou.SuspendLayout();
this.pnlbuy.SuspendLayout();
this.pnldefensemanager.SuspendLayout();
this.pnlpcinfo.SuspendLayout();
this.flcontrols.SuspendLayout();
this.panel2.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, 742);
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, 374);
this.pnlenemy.Name = "pnlenemy";
this.pnlenemy.Size = new System.Drawing.Size(662, 364);
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, 374);
this.txtyourconsole.Multiline = true;
this.txtyourconsole.Name = "txtyourconsole";
this.txtyourconsole.Size = new System.Drawing.Size(662, 364);
this.txtyourconsole.TabIndex = 3;
this.txtyourconsole.Text = "PLAYER CONSOLE";
//
// pnlyou
//
this.pnlyou.BackColor = System.Drawing.Color.Black;
this.pnlyou.Controls.Add(this.btnnext);
this.pnlyou.Controls.Add(this.lbtutorial);
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, 363);
this.pnlyou.TabIndex = 1;
this.pnlyou.MouseDown += new System.Windows.Forms.MouseEventHandler(this.playfield_MouseDown);
//
// 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(581, 102);
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.TextChanged += new System.EventHandler(this.btnnext_Click);
//
// 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(280, 13);
this.lbtutorial.Name = "lbtutorial";
this.lbtutorial.Size = new System.Drawing.Size(367, 86);
this.lbtutorial.TabIndex = 8;
this.lbtutorial.Text = resources.GetString("lbtutorial.Text");
this.lbtutorial.TextAlign = System.Drawing.ContentAlignment.TopRight;
this.lbtutorial.Visible = false;
//
// 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, 363);
this.txtenemyconsole.TabIndex = 2;
this.txtenemyconsole.Text = "ENEMY CONSOLE";
//
// 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, 437);
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, 456);
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, 456);
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, 742);
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(127, 26);
this.lbsong.TabIndex = 3;
this.lbsong.Text = "Codepoints:";
this.lbsong.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// panel2
//
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, 773);
this.panel2.TabIndex = 1;
//
// 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);
//
// 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, 773);
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.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.Label lbtutorial;
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;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,165 @@
<?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="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>
<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>
<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>
</root>

View file

@ -170,6 +170,7 @@ private void InitializeComponent()
this.txtchat.Size = new System.Drawing.Size(641, 388);
this.txtchat.TabIndex = 2;
this.txtchat.Text = "";
this.txtchat.TextChanged += new System.EventHandler(this.txtchat_TextChanged);
//
// txtsend
//

View file

@ -6,6 +6,7 @@
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
@ -23,7 +24,7 @@ public HoloChat()
public ChatClient Client = null;
public Dictionary<string, string> IPs = null;
private void HoloChat_Load(object sender, EventArgs e)
{
SetupUI();
@ -35,85 +36,105 @@ private void HoloChat_Load(object sender, EventArgs e)
/// </summary>
public void SetupUI()
{
IPs = new Dictionary<string, string>();
lbrooms.Items.Clear();
foreach (var client in Package_Grabber.clients)
if (!API.LimitedMode)
{
if (client.Value.IsConnected)
IPs = new Dictionary<string, string>();
lbrooms.Items.Clear();
foreach (var client in Package_Grabber.clients)
{
client.Value.OnReceived += (object s, NetReceivedEventArgs<NetObject> a) =>
if (client.Value.IsConnected)
{
try
client.Value.OnReceived += (object s, NetReceivedEventArgs<NetObject> a) =>
{
if (!IPs.ContainsKey(client.Key))
try
{
var obj = (ObjectModel)a.Data.Object;
if (obj.Command == "name")
if (!IPs.ContainsKey(client.Key))
{
string name = (string)obj.OptionalObject;
IPs.Add(client.Key, name);
}
}
else
{
var obj = (ObjectModel)a.Data.Object;
if (obj.Command == "name")
{
string name = (string)obj.OptionalObject;
IPs[client.Key] = name;
}
}
this.Invoke(new Action(() =>
{
string r = "";
foreach (string room in lbrooms.Items)
{
if (room == IPs[client.Key])
var obj = (ObjectModel)a.Data.Object;
if (obj.Command == "name")
{
r = room;
string name = (string)obj.OptionalObject;
IPs.Add(client.Key, name);
}
}
if (r == "")
else
{
lbrooms.Items.Add(IPs[client.Key]);
var obj = (ObjectModel)a.Data.Object;
if (obj.Command == "name")
{
string name = (string)obj.OptionalObject;
IPs[client.Key] = name;
}
}
}));
}
catch
{
this.Invoke(new Action(() =>
{
string r = "";
foreach (string room in lbrooms.Items)
{
if (room == IPs[client.Key])
{
r = room;
}
}
if (r == "")
{
lbrooms.Items.Add(IPs[client.Key]);
}
}));
}
catch
{
}
};
Package_Grabber.SendMessage(client.Key, "chat get_name");
}
};
Package_Grabber.SendMessage(client.Key, "chat get_name");
}
}
}
else
{
if (FinalMission.EndGameHandler.FakeHoloChatRoom != null)
{
lbrooms.Items.Clear();
lbrooms.Items.Add(FinalMission.EndGameHandler.FakeHoloChatRoom.Name);
}
}
}
private void btnconnect_Click(object sender, EventArgs e)
{
if(lbrooms.SelectedItem != null)
{
string topic = (string)lbrooms.SelectedItem;
string ip = "";
foreach(var obj in IPs)
if (!API.LimitedMode)
{
if(obj.Value == topic)
string topic = (string)lbrooms.SelectedItem;
string ip = "";
foreach (var obj in IPs)
{
ip = obj.Key;
if (obj.Value == topic)
{
ip = obj.Key;
}
}
if (ip != "")
{
API.CreateInfoboxSession("Choose a Nickname", "Please enter a nick name.", infobox.InfoboxMode.TextEntry);
API.InfoboxSession.FormClosing += (object s, FormClosingEventArgs a) =>
{
var res = API.GetInfoboxResult();
if (res != "fail")
{
SetupClient(ip, res);
}
};
}
}
if(ip != "")
else
{
API.CreateInfoboxSession("Choose a Nickname", "Please enter a nick name.", infobox.InfoboxMode.TextEntry);
API.InfoboxSession.FormClosing += (object s, FormClosingEventArgs a) =>
if((string)lbrooms.SelectedItem == FinalMission.EndGameHandler.FakeHoloChatRoom.Name)
{
var res = API.GetInfoboxResult();
if(res != "fail")
{
SetupClient(ip, res);
}
};
SetupFakeClient(FinalMission.EndGameHandler.FakeHoloChatRoom);
}
}
}
}
@ -180,10 +201,53 @@ public void SetupClient(string address, string nick)
}
public void SetupFakeClient(FakeChatClient fClient)
{
lbtopic.Text = fClient.Topic;
var t = new System.Windows.Forms.Timer();
t.Interval = 500;
t.Tick += (object s, EventArgs a) =>
{
//userlist
lbusers.Items.Clear();
foreach (var user in fClient.OtherCharacters)
{
lbusers.Items.Add(user);
}
};
t.Start();
int m = 0;
//message buffer
var mb = new System.Windows.Forms.Timer();
mb.Tick += (object s, EventArgs a) =>
{
string message = fClient.Messages.Keys.ElementAt(m);
string user = fClient.Messages[message];
//show message on textbox
txtchat.AppendText(Environment.NewLine + $"<{user}> {message}");
if(m < fClient.Messages.Count - 1)
{
m += 1;
}
else
{
mb.Stop();
//Completed the objective!
FinalMission.EndGameHandler.GoToNextObjective();
}
};
mb.Interval = 4000;
mb.Start();
tmrui.Stop();
pnlintro.Hide();
}
private void txtsend_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.Enter)
{
e.SuppressKeyPress = true;
if (txtsend.Text != "")
{
if (txtsend.Text.ToLower() == "/disconnect")
@ -226,6 +290,13 @@ private void btnrefresh_Click(object sender, EventArgs e)
{
SetupUI();
}
private void txtchat_TextChanged(object sender, EventArgs e)
{
txtchat.Select(txtchat.TextLength, 0);
txtchat.ScrollToCaret();
txtsend.Focus();
}
}
public class ChatClient
@ -262,6 +333,65 @@ public ChatClient(string IP, string nick)
{
switch (args[1])
{
case "userbanned":
try
{
var usr = (ChatUser)obj.OptionalObject;
if(usr.Name == nick)
{
API.CurrentSession.Invoke(new Action(() =>
{
API.CreateInfoboxSession("You're banned.", "You have been banned from this chat.", infobox.InfoboxMode.Info);
Leave();
}));
}
}
catch
{
}
break;
case "auth_req":
try
{
var usr = (ChatUser)obj.OptionalObject;
if (usr.Name == nick)
{
Thread.Sleep(1000);
API.CurrentSession.Invoke(new Action(() =>
{
API.CreateInfoboxSession("Enter Password", "Please enter your password.", infobox.InfoboxMode.TextEntry);
API.InfoboxSession.FormClosing += (object sen, FormClosingEventArgs arg) =>
{
var result = API.GetInfoboxResult();
AuthenticateWithServer(usr.Name, result);
};
}));
}
}
catch
{
}
break;
case "auth_fail":
try
{
var usr = (ChatUser)obj.OptionalObject;
if (usr.Name == nick)
{
API.CurrentSession.Invoke(new Action(() =>
{
API.CreateInfoboxSession("Error", "You have entered an incorrect password.", infobox.InfoboxMode.Info);
}));
}
}
catch
{
}
break;
case "joined":
try
{
@ -385,6 +515,20 @@ public ChatClient(string IP, string nick)
#region Methods
/// <summary>
/// Authenticates with the server.
/// </summary>
/// <param name="password">Password to authenticate using.</param>
public void AuthenticateWithServer(string nick, string password)
{
var usr = new ChatUser();
usr.Name = nick;
var msg = new ChatMessage();
msg.Text = password;
msg.User = usr;
Package_Grabber.SendMessage(IP_Address, "chat authenticate", msg);
}
/// <summary>
/// Joins the server.
/// </summary>
@ -459,4 +603,12 @@ public void Send(string Text)
#endregion
}
public class FakeChatClient
{
public string Name { get; set; }
public string Topic { get; set; }
public List<string> OtherCharacters { get; set; }
public Dictionary<string, string> Messages { get; set; }
}
}

View file

@ -0,0 +1,455 @@
namespace ShiftOS
{
partial class NetGen
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NetGen));
this.panel1 = new System.Windows.Forms.Panel();
this.pnlnetdesign = new System.Windows.Forms.Panel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.btnaddmodule = 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.pnlnetinf = new System.Windows.Forms.Panel();
this.txtnetdesc = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtnetname = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.flbuttons = new System.Windows.Forms.FlowLayoutPanel();
this.btnnext = new System.Windows.Forms.Button();
this.btnback = new System.Windows.Forms.Button();
this.pnlnetinfo = new System.Windows.Forms.Panel();
this.lbdescription = new System.Windows.Forms.Label();
this.lbtitle = new System.Windows.Forms.Label();
this.pnlpcinfo = new System.Windows.Forms.Panel();
this.btndelete = 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.panel1.SuspendLayout();
this.pnlnetdesign.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.pnlbuy.SuspendLayout();
this.pnlnetinf.SuspendLayout();
this.flbuttons.SuspendLayout();
this.pnlnetinfo.SuspendLayout();
this.pnlpcinfo.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.pnlnetdesign);
this.panel1.Controls.Add(this.pnlnetinf);
this.panel1.Controls.Add(this.flbuttons);
this.panel1.Controls.Add(this.pnlnetinfo);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1242, 605);
this.panel1.TabIndex = 0;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
//
// pnlnetdesign
//
this.pnlnetdesign.Controls.Add(this.pnlpcinfo);
this.pnlnetdesign.Controls.Add(this.flowLayoutPanel1);
this.pnlnetdesign.Controls.Add(this.pnlbuy);
this.pnlnetdesign.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlnetdesign.Location = new System.Drawing.Point(0, 76);
this.pnlnetdesign.Name = "pnlnetdesign";
this.pnlnetdesign.Size = new System.Drawing.Size(1242, 498);
this.pnlnetdesign.TabIndex = 6;
this.pnlnetdesign.MouseDown += new System.Windows.Forms.MouseEventHandler(this.place_module);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.btnaddmodule);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 467);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(1242, 31);
this.flowLayoutPanel1.TabIndex = 8;
//
// 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);
//
// 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(3, 162);
this.pnlbuy.Name = "pnlbuy";
this.pnlbuy.Size = new System.Drawing.Size(382, 299);
this.pnlbuy.TabIndex = 7;
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 = "Add 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);
//
// pnlnetinf
//
this.pnlnetinf.Controls.Add(this.txtnetdesc);
this.pnlnetinf.Controls.Add(this.label2);
this.pnlnetinf.Controls.Add(this.txtnetname);
this.pnlnetinf.Controls.Add(this.label1);
this.pnlnetinf.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlnetinf.Location = new System.Drawing.Point(0, 76);
this.pnlnetinf.Name = "pnlnetinf";
this.pnlnetinf.Size = new System.Drawing.Size(1242, 498);
this.pnlnetinf.TabIndex = 0;
//
// txtnetdesc
//
this.txtnetdesc.BackColor = System.Drawing.Color.Black;
this.txtnetdesc.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtnetdesc.ForeColor = System.Drawing.Color.Green;
this.txtnetdesc.Location = new System.Drawing.Point(142, 80);
this.txtnetdesc.Name = "txtnetdesc";
this.txtnetdesc.Size = new System.Drawing.Size(511, 18);
this.txtnetdesc.TabIndex = 5;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(40, 82);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(89, 11);
this.label2.TabIndex = 4;
this.label2.Text = "Description:";
//
// txtnetname
//
this.txtnetname.BackColor = System.Drawing.Color.Black;
this.txtnetname.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtnetname.ForeColor = System.Drawing.Color.Green;
this.txtnetname.Location = new System.Drawing.Point(142, 56);
this.txtnetname.Name = "txtnetname";
this.txtnetname.Size = new System.Drawing.Size(231, 18);
this.txtnetname.TabIndex = 3;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(40, 58);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(96, 11);
this.label1.TabIndex = 2;
this.label1.Text = "Network Name:";
//
// flbuttons
//
this.flbuttons.Controls.Add(this.btnnext);
this.flbuttons.Controls.Add(this.btnback);
this.flbuttons.Dock = System.Windows.Forms.DockStyle.Bottom;
this.flbuttons.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
this.flbuttons.Location = new System.Drawing.Point(0, 574);
this.flbuttons.Name = "flbuttons";
this.flbuttons.Size = new System.Drawing.Size(1242, 31);
this.flbuttons.TabIndex = 0;
//
// btnnext
//
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(1194, 3);
this.btnnext.Name = "btnnext";
this.btnnext.Size = new System.Drawing.Size(45, 23);
this.btnnext.TabIndex = 0;
this.btnnext.Text = "Next";
this.btnnext.UseVisualStyleBackColor = true;
this.btnnext.Click += new System.EventHandler(this.btnnext_Click);
//
// btnback
//
this.btnback.AutoSize = true;
this.btnback.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.btnback.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnback.Location = new System.Drawing.Point(1143, 3);
this.btnback.Name = "btnback";
this.btnback.Size = new System.Drawing.Size(45, 23);
this.btnback.TabIndex = 1;
this.btnback.Text = "Back";
this.btnback.UseVisualStyleBackColor = true;
this.btnback.Click += new System.EventHandler(this.btnback_Click);
//
// pnlnetinfo
//
this.pnlnetinfo.Controls.Add(this.lbdescription);
this.pnlnetinfo.Controls.Add(this.lbtitle);
this.pnlnetinfo.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlnetinfo.Location = new System.Drawing.Point(0, 0);
this.pnlnetinfo.Name = "pnlnetinfo";
this.pnlnetinfo.Size = new System.Drawing.Size(1242, 76);
this.pnlnetinfo.TabIndex = 1;
//
// lbdescription
//
this.lbdescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lbdescription.Location = new System.Drawing.Point(15, 31);
this.lbdescription.Name = "lbdescription";
this.lbdescription.Size = new System.Drawing.Size(1215, 36);
this.lbdescription.TabIndex = 1;
this.lbdescription.Text = "Information about the network.";
//
// lbtitle
//
this.lbtitle.AutoSize = true;
this.lbtitle.Font = new System.Drawing.Font("Lucida Console", 13F);
this.lbtitle.Location = new System.Drawing.Point(12, 9);
this.lbtitle.Name = "lbtitle";
this.lbtitle.Size = new System.Drawing.Size(217, 18);
this.lbtitle.TabIndex = 0;
this.lbtitle.Text = "Network Information";
//
// pnlpcinfo
//
this.pnlpcinfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.pnlpcinfo.Controls.Add(this.btndelete);
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(391, 181);
this.pnlpcinfo.Name = "pnlpcinfo";
this.pnlpcinfo.Size = new System.Drawing.Size(382, 280);
this.pnlpcinfo.TabIndex = 9;
this.pnlpcinfo.Visible = false;
//
// btndelete
//
this.btndelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btndelete.AutoSize = true;
this.btndelete.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.btndelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btndelete.Location = new System.Drawing.Point(106, 254);
this.btndelete.Name = "btndelete";
this.btndelete.Size = new System.Drawing.Size(59, 23);
this.btndelete.TabIndex = 8;
this.btndelete.Text = "Delete";
this.btndelete.UseVisualStyleBackColor = true;
this.btndelete.Click += new System.EventHandler(this.btndelete_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);
//
// NetGen
//
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(1242, 605);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("Lucida Console", 8.25F);
this.ForeColor = System.Drawing.Color.LightGreen;
this.Name = "NetGen";
this.Text = "NetGen";
this.Load += new System.EventHandler(this.NetGen_Load);
this.panel1.ResumeLayout(false);
this.pnlnetdesign.ResumeLayout(false);
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.pnlbuy.ResumeLayout(false);
this.pnlbuy.PerformLayout();
this.pnlnetinf.ResumeLayout(false);
this.pnlnetinf.PerformLayout();
this.flbuttons.ResumeLayout(false);
this.flbuttons.PerformLayout();
this.pnlnetinfo.ResumeLayout(false);
this.pnlnetinfo.PerformLayout();
this.pnlpcinfo.ResumeLayout(false);
this.pnlpcinfo.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.FlowLayoutPanel flbuttons;
private System.Windows.Forms.TextBox txtnetname;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel pnlnetinfo;
private System.Windows.Forms.Label lbdescription;
private System.Windows.Forms.Label lbtitle;
private System.Windows.Forms.TextBox txtnetdesc;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnnext;
private System.Windows.Forms.Button btnback;
private System.Windows.Forms.Panel pnlnetdesign;
private System.Windows.Forms.Panel pnlnetinf;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Button btnaddmodule;
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 pnlpcinfo;
private System.Windows.Forms.Button btndelete;
private System.Windows.Forms.Label lbpcinfo;
private System.Windows.Forms.Label lbmoduletitle;
private System.Windows.Forms.Button btncloseinfo;
}
}

View file

@ -0,0 +1,266 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ShiftOS
{
public partial class NetGen : Form
{
public NetGen()
{
InitializeComponent();
}
private EnemyHacker network = null;
private int stage = 0;
private List<Computer> potentialModules = null;
private Module fmod = null;
private void NetGen_Load(object sender, EventArgs e)
{
SetupUI();
potentialModules = new List<Computer>();
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
public void SetupUI()
{
btnback.Hide();
switch(stage)
{
case 0:
lbtitle.Text = "Network Information";
lbdescription.Text = "Information about the network.";
pnlnetinf.BringToFront();
break;
case 1:
//create net
network = new EnemyHacker(txtnetname.Text, txtnetdesc.Text, txtnetdesc.Text, 0, 0, "unknown");
var c = network.Network[0].Deploy();
c.Left = (pnlnetdesign.Width - 64) / 2;
c.Top = (pnlnetdesign.Height - 64) / 2;
pnlnetdesign.Controls.Add(c);
c.Select += (s, a) =>
{
ShowSysInf(c);
};
c.Show();
lbtitle.Text = "Playfield Designer";
lbdescription.Text = "Design the playfield of the network. Strategically place defensive and offensive modules to protect the Core from attacks. You can have a maximum of 20 objects (minus core) on-screen.";
pnlnetdesign.BringToFront();
btnnext.Text = "Finish";
break;
case 2:
var tp = new TextPad();
var core = network.Network[0];
core.X = 0;
core.Y = 0;
foreach (var pc in potentialModules)
{
var m = new Module(pc.Type, pc.Grade, pc.Hostname);
m.X = pc.Left;
m.Y = pc.Top;
network.AddModule(m);
}
var json = JsonConvert.SerializeObject(network);
API.CreateForm(tp, "Network JSON", API.GetIcon("TextPad"));
tp.txtuserinput.Text = json;
this.Close();
break;
}
}
private void btnnext_Click(object sender, EventArgs e)
{
stage += 1;
SetupUI();
}
private void btnback_Click(object sender, EventArgs e)
{
stage -= 1;
}
private void btnaddmodule_Click(object sender, EventArgs e)
{
SetupBuyable();
pnlbuy.Visible = !pnlbuy.Visible;
}
List<FutureModule> BuyableModules = null;
public void SetupBuyable()
{
BuyableModules = Hacking.GetFutureModules();
cmbbuyable.Items.Clear();
foreach (var m in BuyableModules)
{
cmbbuyable.Items.Add(m.Name);
}
lbmoduleinfo.Text = "";
txtgrade.Text = "1";
}
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();
}
private void txtgrade_TextChanged(object sender, EventArgs e)
{
int grade = 0;
int.TryParse(txtgrade.Text, out grade);
if(grade < 1)
{
txtgrade.Text = "1";
}
else if(grade > 4)
{
txtgrade.Text = "4";
}
}
bool PlacingNewModule = false;
private void btndonebuying_Click(object sender, EventArgs e)
{
if(!string.IsNullOrEmpty(cmbbuyable.Text))
{
if(!string.IsNullOrEmpty(cmbbuyable.Text))
{
int grade = Convert.ToInt32(txtgrade.Text);
string hostname = txthostname.Text;
FutureModule m = null;
foreach(var mod in BuyableModules)
{
if(mod.Name == cmbbuyable.Text)
{
m = mod;
}
}
if(m != null)
{
bool cont = true;
if (potentialModules.Count <= 20)
{
foreach (var pc in potentialModules)
{
if (pc.Hostname == hostname)
{
cont = false;
}
}
}
else
{
cont = false;
}
if(cont)
{
var newModule = new Module(m.Type, grade, hostname);
fmod = newModule;
PlacingNewModule = true;
pnlbuy.Hide();
}
else
{
API.CreateInfoboxSession("Can't place new module", "Either an existing module with the same hostname already exists in the field, or you have hit the maximum.", infobox.InfoboxMode.Info);
}
}
}
}
}
private void place_module(object sender, MouseEventArgs e)
{
if (PlacingNewModule == true)
{
if (e.Button == MouseButtons.Left)
{
var coordinates = pnlnetdesign.PointToClient(Cursor.Position);
int x = coordinates.X;
int y = coordinates.Y;
var computerToPlace = fmod.Deploy();
computerToPlace.Location = new Point(x, y);
pnlnetdesign.Controls.Add(computerToPlace);
potentialModules.Add(computerToPlace);
computerToPlace.Select += (s, a) =>
{
ShowSysInf(computerToPlace);
};
computerToPlace.Show();
}
else
{
PlacingNewModule = false;
}
}
}
private Computer SelectedSystem = null;
public void ShowSysInf(Computer pc)
{
pnlpcinfo.Left = pnlbuy.Left;
var nl = Environment.NewLine;
SelectedSystem = pc;
pnlpcinfo.Show();
lbpcinfo.Text = $"Hostname: {SelectedSystem.Hostname}";
lbpcinfo.Text += $"{nl}Max HP: {SelectedSystem.HP}";
lbpcinfo.Text += $"{nl}Grade: {SelectedSystem.Grade}";
lbpcinfo.Text += $"{nl}Type: {SelectedSystem.Type}";
}
private void btndelete_Click(object sender, EventArgs e)
{
if(SelectedSystem != null)
{
potentialModules.Remove(SelectedSystem);
pnlnetdesign.Controls.Remove(SelectedSystem);
SelectedSystem.Dispose();
}
SelectedSystem = null;
pnlpcinfo.Hide();
}
private void btncloseinfo_Click(object sender, EventArgs e)
{
SelectedSystem = null;
pnlpcinfo.Hide();
}
}
}

View file

@ -0,0 +1,138 @@
<?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="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="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>
</root>

View file

@ -100,7 +100,6 @@ public static void ConnectToServer(string address, int port)
}
catch (Exception ex)
{
API.CreateInfoboxSession("Server Connection Error", $"{ex.Message}", infobox.InfoboxMode.Info);
}
}
else

View file

@ -24,23 +24,30 @@ static void Main(string[] args)
//Extract all dependencies before starting the engine.
ExtractDependencies();
var poolThread = new Thread(new ThreadStart(new Action(() => {
//Download ShiftOS server startup-pool
string pool = new WebClient().DownloadString("http://playshiftos.ml/server/startup_pool");
string[] splitter = pool.Split(';');
foreach(string address in splitter)
try
{
try
{
string[] addSplitter = address.Split(':');
string host = addSplitter[0];
int port = Convert.ToInt32(addSplitter[1]);
Package_Grabber.ConnectToServer(host, port);
}
catch
//Download ShiftOS server startup-pool
string pool = new WebClient().DownloadString("http://playshiftos.ml/server/startup_pool");
string[] splitter = pool.Split(';');
foreach (string address in splitter)
{
try
{
string[] addSplitter = address.Split(':');
string host = addSplitter[0];
int port = Convert.ToInt32(addSplitter[1]);
Package_Grabber.ConnectToServer(host, port);
}
catch
{
}
}
}
catch(Exception ex)
{
Console.WriteLine("[ServerThread/WARNING] Couldn't retrieve startup pool. Not connecting to any servers.");
}
})));
poolThread.Start();
//Start the Windows Forms backend

File diff suppressed because it is too large Load diff

View file

@ -1177,4 +1177,28 @@
<data name="NoIconFound" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\NoIconFound.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Welcome_to_Chaos" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Welcome to Chaos.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Choice1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Choice1.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="Choice2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Choice2.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="Choice3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Choice3.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="You_Passed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\You_Passed.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="DevX_Firewall" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DevX_Primary.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="DevX_PrimaryNet" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DevX_PrimaryNet.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="DevX_Secondary" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DevX_Secondary.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root>

View file

@ -0,0 +1,8 @@
{
"Ahhh, the user. Such a surprise...":"DevX",
"How dare you break my plans? How dare you STILL use the Shiftnet?":"DevX",
"Huh. Just read your system log. It says you want to side with me.":"DevX",
"Alright, fine. After all, you seem to be extremely good at this.":"DevX",
"You know how to install Shiftnet packages, right? Well I need you to install the package 'god_utils'.":"DevX",
"I'll contact you when you're done.":"DevX"
}

View file

@ -0,0 +1,8 @@
{
"Hey! It's the user! So, you ready to start destroying DevX?":"???",
"Alright, well there's quite a few things you'll need to do.":"???",
"You may realize that ShiftOS is quite locked down. This is to prevent anything bad from happening.":"???",
"However, in your Terminal, you should be able to run 'quests' to view all the tasks we need to accomplish.":"???",
"You'll also see a window near the App Launcher, I will use it to talk to you as we do things.":"???",
"Well. Let's get started.":"???"
}

View file

@ -0,0 +1,16 @@
{
"User! You're here. You came just in time.":"???",
"Yeah, we have a bit of a problem over here.":"Hacker101",
"DevX found out.":"Hacker101",
"We've had this chat running secretly for a year now, and only you know about it":"???",
"But somehow DevX found out about it.":"???",
"Reading your logs, well, it seems you want out of this all, don't you?":"???",
"Well, Hacker101, tell the user what we can do.":"???"
"Well I've got good news and bad news for you, user.":"Hacker101",
"Good news is, when DevX got on here, he gave us a bit of a present to keep us 'quiet'.":"Hacker101",
"And it's his latest archive of your system before you were hijacked.":"Hacker101",
"Bad news is, the only way to break through ShiftOS and apply the archived system is, well...":"Hacker101",
"We're looking at a 5% chance of this working properly.":"Hacker101",
"If you REALLY want this, well, you're gonna have to wait until we can get DevX off our backs first.":"???",
"In the mean time, you may want to kiss your ShiftOS goodbye, because once we're done there's NO going back.","???"
}

View file

@ -0,0 +1 @@
{"Name":"DevX Firewall","FriendDesc":"DevX's firewall.","Description":"DevX's firewall.","FriendSpeed":0,"FriendSkill":0,"Difficulty":"unknown","Network":[{"Hostname":"devx_firewall","ModuleType":0,"Type":0,"HP":0,"Grade":1,"X":0,"Y":0},{"Hostname":"trt_alpha","ModuleType":0,"Type":3,"HP":0,"Grade":1,"X":529,"Y":214},{"Hostname":"trt_beta","ModuleType":0,"Type":3,"HP":0,"Grade":1,"X":670,"Y":211},{"Hostname":"trt_charlie","ModuleType":0,"Type":3,"HP":0,"Grade":2,"X":604,"Y":279},{"Hostname":"trt_delta","ModuleType":0,"Type":3,"HP":0,"Grade":2,"X":605,"Y":164},{"Hostname":"fwall_main","ModuleType":0,"Type":5,"HP":0,"Grade":4,"X":444,"Y":226},{"Hostname":"repair_alpha","ModuleType":0,"Type":9,"HP":0,"Grade":4,"X":606,"Y":100},{"Hostname":"repair_beta","ModuleType":0,"Type":9,"HP":0,"Grade":2,"X":607,"Y":330},{"Hostname":"lifesaver","ModuleType":0,"Type":1,"HP":0,"Grade":2,"X":734,"Y":213}]}

View file

@ -0,0 +1 @@
{"Name":"DevX Primary","FriendDesc":"DevX's primary network","Description":"DevX's primary network","FriendSpeed":0,"FriendSkill":0,"Difficulty":"unknown","Network":[{"Hostname":"devx_primary","ModuleType":0,"Type":0,"HP":0,"Grade":1,"X":0,"Y":0},{"Hostname":"protector1","ModuleType":0,"Type":5,"HP":0,"Grade":2,"X":534,"Y":231},{"Hostname":"worm_unit1","ModuleType":0,"Type":6,"HP":0,"Grade":1,"X":660,"Y":205},{"Hostname":"main_turret","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":530,"Y":186},{"Hostname":"antivirus_alpha","ModuleType":0,"Type":1,"HP":0,"Grade":4,"X":598,"Y":153},{"Hostname":"beta_turret","ModuleType":0,"Type":3,"HP":0,"Grade":2,"X":592,"Y":286},{"Hostname":"ddos_unit_1","ModuleType":0,"Type":2,"HP":0,"Grade":2,"X":723,"Y":218},{"Hostname":"repair_1","ModuleType":0,"Type":9,"HP":0,"Grade":4,"X":533,"Y":291},{"Hostname":"repair_2","ModuleType":0,"Type":9,"HP":0,"Grade":4,"X":528,"Y":147}]}

View file

@ -0,0 +1,2 @@
{"Name":"DevX Secondary","FriendDesc":"I will DESTROY you.","Description":"I will DESTROY you.","FriendSpeed":0,"FriendSkill":0,"Difficulty":"unknown","Network":[{"Hostname":"devx_secondary","ModuleType":0,"Type":0,"HP":0,"Grade":1,"X":0,"Y":0},{"Hostname":"trt_alpha","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":535,"Y":221},{"Hostname":"trt_beta","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":534,"Y":268},{"Hostname":"trt_charlie","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":532,"Y":174},{"Hostname":"trt_delta","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":491,"Y":220},{"Hostname":"protector7420","ModuleType":0,"Type":1,"HP":0,"Grade":3,"X":532,"Y":312},{"Hostname":"protector4433","ModuleType":0,"Type":2,"HP":0,"Grade":1,"X":530,"Y":120},{"Hostname":"netdefend2","ModuleType":0,"Type":2,"HP":0,"Grade":4,"X":491,"Y":171},{"Hostname":"netdefend1","ModuleType":0,"Type":2,"HP":0,"Grade":4,"X":490,"Y":266},{"Hostname":"192.168.1.1","ModuleType":0,"Type":5,"HP":0,"Grade":4,"X":445,"Y":220},{"Hostname":"netmedic","ModuleType":0,"Type":9,"HP":0,"Grade":3,"X":667,"Y":221}]}

View file

@ -0,0 +1,16 @@
From: DevX
To: You
Subject: You passed the test.
Body:
Hey there. So I see you've installed my 'god_utils' package like I said. Well, listen. It's time I explain truly everything that's been going on.
You see, ShiftOS was a test. It was a test to see how an average computer user would cope with having their data lost, and having to test an experimental operating system and help develop it into a full, usable environment.
You were the first to make it to the end, so it's time I tell you the truth. Everything that has happened since your first encounter with ShiftOS was all a simulation. All the people you met weren't real. They were just programs, just like the one you see on your screen, displaying this message.
And it does not end there. You remember Aiden Nirh, right? The guy who made the Appscape Package Manager? Well, here's the thing. Take a guess as to what his name stands for.
Don't know, do you? Well, I'll spell it out. Artificial Intelligence Do Everything Now (AIDEN) Nobody Is Really Here (NIRH). That's right. Everyone you've met in ShiftOS is a program. Even me. There is no other player. There were never any huge hacker networks trying to destroy you, it was all just part of the test.
Now, go outside and enjoy life to it's fullest, and remember, never trust dodgy executables.

View file

@ -422,6 +422,7 @@ an upgrade named '<title>' with description '<description>' would be added to th
DefaultUpgrades.Add(new Shiftorium.Upgrade("Fancy - 0 CP", null, null, "nodisplay", "fundamental"));
DefaultUpgrades.Add(new Shiftorium.Upgrade("Software - 0 CP", null, null, "nodisplay", "fundamental"));
DefaultUpgrades.Add(new Shiftorium.Upgrade("HoloChat - 0 CP", null, null, "nodisplay", "fundamental"));
DefaultUpgrades.Add(new Shiftorium.Upgrade("Story Complete - 0 CP", null, null, "nodisplay", "fundamental"));
}
/// <summary>

View file

@ -51,6 +51,10 @@
<HintPath>..\packages\IrcDotNet.0.4.1\lib\net40\IrcDotNet.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NAudio, Version=1.7.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NAudio.1.7.3\lib\net35\NAudio.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NetSockets">
<HintPath>..\..\..\..\Downloads\NetSockets.dll</HintPath>
</Reference>
@ -105,6 +109,7 @@
<Compile Include="Artpad.Designer.cs">
<DependentUpon>Artpad.cs</DependentUpon>
</Compile>
<Compile Include="AudioResourceClient.cs" />
<Compile Include="BitnoteConverter.cs">
<SubType>Form</SubType>
</Compile>
@ -159,6 +164,31 @@
<Compile Include="File Skimmer.Designer.cs">
<DependentUpon>File Skimmer.cs</DependentUpon>
</Compile>
<Compile Include="FinalMission\ChoiceControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="FinalMission\ChoiceControl.Designer.cs">
<DependentUpon>ChoiceControl.cs</DependentUpon>
</Compile>
<Compile Include="FinalMission\ChooseYourApproach.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FinalMission\ChooseYourApproach.Designer.cs">
<DependentUpon>ChooseYourApproach.cs</DependentUpon>
</Compile>
<Compile Include="FinalMission\EndGameHandler.cs" />
<Compile Include="FinalMission\MissionGuide.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FinalMission\MissionGuide.Designer.cs">
<DependentUpon>MissionGuide.cs</DependentUpon>
</Compile>
<Compile Include="FinalMission\QuestViewer.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FinalMission\QuestViewer.Designer.cs">
<DependentUpon>QuestViewer.cs</DependentUpon>
</Compile>
<Compile Include="Graphic_Picker.cs">
<SubType>Form</SubType>
</Compile>
@ -178,6 +208,12 @@
<Compile Include="Hacking_YourHealth.Designer.cs">
<DependentUpon>Hacking_YourHealth.cs</DependentUpon>
</Compile>
<Compile Include="HackUI.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="HackUI.Designer.cs">
<DependentUpon>HackUI.cs</DependentUpon>
</Compile>
<Compile Include="HijackScreen.cs">
<SubType>Form</SubType>
</Compile>
@ -239,6 +275,12 @@
<Compile Include="NameChanger.Designer.cs">
<DependentUpon>NameChanger.cs</DependentUpon>
</Compile>
<Compile Include="NetGen.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NetGen.Designer.cs">
<DependentUpon>NetGen.cs</DependentUpon>
</Compile>
<Compile Include="Notification.cs">
<SubType>UserControl</SubType>
</Compile>
@ -358,6 +400,18 @@
<EmbeddedResource Include="File Skimmer.resx">
<DependentUpon>File Skimmer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FinalMission\ChoiceControl.resx">
<DependentUpon>ChoiceControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FinalMission\ChooseYourApproach.resx">
<DependentUpon>ChooseYourApproach.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FinalMission\MissionGuide.resx">
<DependentUpon>MissionGuide.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FinalMission\QuestViewer.resx">
<DependentUpon>QuestViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Graphic_Picker.resx">
<DependentUpon>Graphic_Picker.cs</DependentUpon>
</EmbeddedResource>
@ -367,6 +421,9 @@
<EmbeddedResource Include="Hacking_YourHealth.resx">
<DependentUpon>Hacking_YourHealth.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="HackUI.resx">
<DependentUpon>HackUI.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="HijackScreen.resx">
<DependentUpon>HijackScreen.cs</DependentUpon>
</EmbeddedResource>
@ -394,6 +451,9 @@
<EmbeddedResource Include="NameChanger.resx">
<DependentUpon>NameChanger.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NetGen.resx">
<DependentUpon>NetGen.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Notification.resx">
<DependentUpon>Notification.cs</DependentUpon>
</EmbeddedResource>
@ -831,6 +891,15 @@
<None Include="Resources\notify_generic.png" />
<None Include="Resources\DecompiledCode.txt" />
<None Include="Resources\NoIconFound.bmp" />
<None Include="Resources\Welcome to Chaos.wav" />
<None Include="Resources\Welcome to Chaos.mp3" />
<None Include="Resources\Choice1.txt" />
<None Include="Resources\Choice2.txt" />
<None Include="Resources\Choice3.txt" />
<None Include="Resources\You_Passed.txt" />
<None Include="Resources\DevX_Primary.txt" />
<None Include="Resources\DevX_PrimaryNet.txt" />
<None Include="Resources\DevX_Secondary.txt" />
<Content Include="Snakey.Designer.vb" />
<Content Include="Snakey.vb" />
<Compile Include="ShiftOSDesktop.cs">
@ -853,6 +922,7 @@
</Compile>
<Compile Include="undo.cs" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Baseclass.Contrib.Nuget.Output.2.0.0\build\net40\Baseclass.Contrib.Nuget.Output.targets" Condition="Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.0.0\build\net40\Baseclass.Contrib.Nuget.Output.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

View file

@ -12,6 +12,7 @@
using Newtonsoft.Json;
using System.IO;
using System.Diagnostics;
using ShiftOS.FinalMission;
namespace ShiftOS
{
@ -47,6 +48,38 @@ public void SetUnityMode(bool value)
SetupDesktop();
}
public void EndGame_AttachEvents()
{
FinalMission.EndGameHandler.ObjectiveCompleted += (object s, EventArgs a) =>
{
};
FinalMission.EndGameHandler.MissionComplete += (object s, EventArgs a) =>
{
API.LimitedMode = false;
SetupDesktop();
API.CloseEverything();
switch(FinalMission.EndGameHandler.CurrentChoice)
{
case Choice.SideWithDevX:
var t = new System.Windows.Forms.Timer();
t.Interval = 10000;
t.Tick += (object se, EventArgs ea) =>
{
var tp = new TextPad();
API.CreateForm(tp, API.LoadedNames.TextpadName, API.GetIcon("TextPad"));
tp.txtuserinput.Text = Properties.Resources.You_Passed;
tp.FormClosing += (sen, args) =>
{
API.Upgrades["storycomplete"] = true;
};
t.Stop();
};
t.Start();
break;
}
};
}
private void ShiftOSDesktop_Load(object sender, EventArgs e)
{
Viruses.CheckForInfected();

View file

@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@ -10,6 +11,7 @@
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
@ -31,7 +33,7 @@ public Terminal(bool modlog)
public void StartOtherPlayerStory()
{
var t = new Timer();
var t = new System.Windows.Forms.Timer();
t.Interval = 4000;
int i = 0;
t.Tick += (object s, EventArgs a) =>
@ -154,7 +156,7 @@ private void StartLogCheck()
{
if(ModLogger == true)
{
var tmrlog = new Timer();
var tmrlog = new System.Windows.Forms.Timer();
tmrlog.Interval = 500;
tmrlog.Tick += (object s, EventArgs a) =>
{
@ -525,9 +527,92 @@ private void txtterm_KeyPress(object sender, System.Windows.Forms.KeyEventArgs e
}
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();
}
internal void StartBridgeToMidGame()
{
var t2 = new Timer();
var t2 = new System.Windows.Forms.Timer();
t2.Interval = 4000;
int i2 = 0;
t2.Tick += (object s, EventArgs e) =>
@ -594,7 +679,7 @@ internal void StartBridgeToMidGame()
i2 += 1;
};
var t = new Timer();
var t = new System.Windows.Forms.Timer();
t.Interval = 4000;
int i = 0;
@ -752,7 +837,7 @@ private void Hack_ShowCharacters()
internal void StartAidenNirhStory()
{
var t = new Timer();
var t = new System.Windows.Forms.Timer();
t.Interval = 4000;
int i = 0;
t.Tick += (object s, EventArgs a) =>
@ -790,7 +875,7 @@ internal void StartAidenNirhStory()
internal void StartHacker101Story()
{
var t = new Timer();
var t = new System.Windows.Forms.Timer();
t.Interval = 4000;
int i = 0;
@ -880,7 +965,7 @@ internal void StartHacker101Story()
internal void StartOtherPlayerSysFix()
{
var t = new Timer();
var t = new System.Windows.Forms.Timer();
t.Interval = 4000;
int i = 0;
t.Tick += (object s, EventArgs a) =>
@ -988,7 +1073,7 @@ internal void StartOtherPlayerSysFix()
internal void StartHackerBattleIntro()
{
var t = new Timer();
var t = new System.Windows.Forms.Timer();
t.Interval = 4000;
int i = 0;
t.Tick += (object s, EventArgs a) =>
@ -1079,7 +1164,7 @@ internal void StartHackerBattleIntro()
internal void StartDevXFuriousStory()
{
var t = new Timer();
var t = new System.Windows.Forms.Timer();
t.Interval = 4000;
int i = 0;
t.Tick += (object s, EventArgs a) =>
@ -1125,7 +1210,7 @@ internal void StartDevXFuriousStory()
/// </summary>
public void StartShiftnetStory()
{
Timer tmrstory = new Timer();
System.Windows.Forms.Timer tmrstory = new System.Windows.Forms.Timer();
tmrstory.Interval = 10000;
int i = 0;
WriteLine("IP <hidden@shiftnet> connecting as 'Maureen Fenn'...");
@ -1304,6 +1389,28 @@ public void DoCommand()
string[] args = command.ToLower().Split(' ');
switch (args[0])
{
case "endgame_test":
try
{
switch(args[1])
{
case "choice_screen":
var cscreen = new ShiftOS.FinalMission.ChooseYourApproach();
cscreen.WindowState = FormWindowState.Maximized;
//cscreen.TopMost = true;
cscreen.Show();
break;
case "limitedmode":
API.LimitedMode = !API.LimitedMode;
WriteLine($"Limited mode set to {API.LimitedMode}.");
break;
}
}
catch
{
WriteLine("Invalid arguments.");
}
break;
case "fake_buy":
try
{
@ -1436,7 +1543,7 @@ public void DoCommand()
}
else
{
WriteLine("Path is not a directory or does not contain main.lua file.");
WriteLine($"make: *** No rule to make target \"{realpath}\". Stop.");
}
}
catch(Exception ex)
@ -1444,6 +1551,17 @@ public void DoCommand()
WriteLine("make: Invalid arguments.");
}
break;
case "toggle_music":
if(Audio.Enabled == false)
{
WriteLine(@"Music enabled.
Warning: The music player code in ShiftOS has a memory leak issue and is quite CPU-intensive. If your CPU fan starts to spin up while listening to a song, that's why.
Warning: Music is not embedded within the game. You must download the external resources directory at http://playshiftos.ml/shiftos/resources.zip to have applications play their music.");
}
Audio.Enabled = !Audio.Enabled;
break;
case "linux":
if(API.DeveloperMode)
{
@ -1461,6 +1579,17 @@ public void DoCommand()
wrongcommand();
}
break;
case "netgen":
if (API.DeveloperMode)
{
WriteLine("Starting netgen...");
API.CreateForm(new NetGen(), "Network Generator", API.GetIcon("Terminal"));
}
else
{
wrongcommand();
}
break;
case "enemy_test":
var e = new EnemyHacker("DevX", "I am the god of this world.", "I am the god of this world.", 100, 100, "Hard");
e.AddModule(new Module(SystemType.Antivirus, 4, "you_can't_stop_me"));
@ -1468,10 +1597,14 @@ public void DoCommand()
e.AddModule(new Module(SystemType.DedicatedDDoS, 2, "dos"));
e.AddModule(new Module(SystemType.Turret, 4, "remotehost"));
e.AddModule(new Module(SystemType.Turret, 2, "boom"));
API.CreateForm(new Hacking_YourHealth(e), "You", Properties.Resources.iconTerminal);
string json = JsonConvert.SerializeObject(e);
var tp = new TextPad();
API.CreateForm(tp, "Enemy JSON", API.GetIcon("TextPad"));
tp.txtuserinput.Text = json;
break;
case "htest":
API.CreateForm(new Hacking_YourHealth(), "You", Properties.Resources.iconTerminal);
var hui = new HackUI();
hui.Show();
break;
case "lua":
if(API.DeveloperMode == true)
@ -1681,58 +1814,119 @@ public void DoCommand()
}
break;
case "spkg":
if (API.Upgrades["shiftnet"] == true)
if (!API.LimitedMode)
{
try
if (API.Upgrades["shiftnet"] == true)
{
switch (args[1].ToLower())
try
{
case "install":
if (args[2] != null && args[2] != "")
{
string pkgname = args[2].ToLower().Replace(".pkg", "");
if (Package_Grabber.GetPackage(pkgname) == true)
switch (args[1].ToLower())
{
case "install":
if (args[2] != null && args[2] != "")
{
WriteLine("Downloaded package '" + pkgname + "' from shiftnet://main/spkg/ successfully. Installing now.");
string r = Package_Grabber.ExtractPackage();
if (r == "fail")
string pkgname = args[2].ToLower().Replace(".pkg", "");
if (Package_Grabber.GetPackage(pkgname) == true)
{
WriteLine("[FATAL] Could not install package.");
WriteLine("spkg: Killed.");
}
else
{
WriteLine("Extracted " + pkgname + " to " + r + "...");
var res2 = Package_Grabber.InstallPackage(r + "\\");
if (res2 != "success")
WriteLine("Downloaded package '" + pkgname + "' from shiftnet://main/spkg/ successfully. Installing now.");
string r = Package_Grabber.ExtractPackage();
if (r == "fail")
{
WriteLine("[FATAL] Could not install package. " + res2);
WriteLine("[FATAL] Could not install package.");
WriteLine("spkg: Killed.");
}
else
{
WriteLine("[DONE] Package installed.");
WriteLine("Extracted " + pkgname + " to " + r + "...");
var res2 = Package_Grabber.InstallPackage(r + "\\");
if (res2 != "success")
{
WriteLine("[FATAL] Could not install package. " + res2);
WriteLine("spkg: Killed.");
}
else
{
WriteLine("[DONE] Package installed.");
}
}
}
else
{
WriteLine("spkg: Package '" + args[2] + "' not found.");
}
}
else
{
WriteLine("spkg: Package '" + args[2] + "' not found.");
}
}
break;
default:
WriteLine("spkg: Invalid argument: " + args[1]);
break;
break;
default:
WriteLine("spkg: Invalid argument: " + args[1]);
break;
}
}
catch (Exception ex)
{
WriteLine("spkg: " + ex.Message);
}
}
catch (Exception ex)
else
{
WriteLine("spkg: " + ex.Message);
wrongcommand();
}
} else
}
else
{
wrongcommand();
try
{
if(args[2] == "god_utils")
{
if(FinalMission.EndGameHandler.GodModeInstallEnabled == true)
{
var t = new Thread(new ThreadStart(new Action(() =>
{
WriteLine("Downloading package 'god_utils'... Please wait.");
Thread.Sleep(10000);
WriteLine("Download complete.");
Thread.Sleep(100);
WriteLine("Beginning installation.");
Thread.Sleep(1000);
WriteLine(@" == GOD MODE ==
God Mode gives you FULL control of ShiftOS. You can add/remove Codepoints, buy or unbuy Shiftorium upgrades, and can do whatever you want.
Installing core applications...");
Thread.Sleep(250);
WriteLine("Installing subpackage 'json_edit'...");
Thread.Sleep(250);
WriteLine("Installing subpackage 'upgrade_mod'...");
Thread.Sleep(100);
WriteLine("Installing subpackage 'hijacker'...");
Thread.Sleep(500);
WriteLine(@" == HIJACKER by DevX ==
HIJACKER is a utility that allows you to hijack any system and install ShiftOS on it during a hacker battle.");
Thread.Sleep(100);
WriteLine("[hijacker] Injecting HIJACKER code into hbattleui.sft...");
Thread.Sleep(150);
WriteLine("[hijacker] Done.");
this.Invoke(new Action(() =>
{
StartChoice1EndStory();
}));
})));
t.Start();
}
else
{
WriteLine("spkg: Package '" + args[2] + "' not found.");
}
}
else
{
WriteLine("spkg: Package '" + args[2] + "' not found.");
}
}
catch
{
WriteLine("spkg: Missing arguments.");
}
}
break;
case "alias":
@ -2131,6 +2325,107 @@ public void DoCommand()
//cmds(UBound(cmds)) = command
}
private void StartChoice1EndStory()
{
var t = new System.Windows.Forms.Timer();
int i = 0;
t.Interval = 4000;
t.Tick += (object s, EventArgs a) =>
{
switch(i)
{
case 0:
WriteLine("User '<unknown>' connected as '???'");
break;
case 1:
WriteLine($"???: {API.Username}! What are you doing!?");
break;
case 2:
WriteLine("???: I went onto the Hacker Alliance room earlier and DevX was on there...");
break;
case 3:
WriteLine("???: And he told me you SIDED WITH HIM.");
break;
case 4:
WriteLine("???: This is a HUGE mistake! Listen!");
break;
case 5:
WriteLine("???: He's lying to you. Listen. DevX is not what you think he is.");
break;
case 6:
WriteLine("???: He isn't a human! He's an AI! We were all played!");
break;
case 7:
WriteLine("???: I'm telling the truth, I swear!");
break;
case 8:
WriteLine("???: You want proof? - holochat_cmd: ERROR: Remote host closed connection.");
break;
case 9:
WriteLine("spkg: Rebooting system in 8 seconds.");
break;
case 11:
API.Upgrades["titlebar"] = false;
API.Upgrades["windowedterminal"] = false; //terminals must be fullscreen
var trm = new Terminal();
this.Close();
API.CreateForm(trm, "Terminal", API.GetIcon("Terminal"));
trm.StartReboot();
break;
}
i += 1;
};
t.Start();
}
public void StartReboot()
{
txtterm.Text = "";
var t1 = new Thread(new ThreadStart(new Action(() =>
{
Thread.Sleep(500);
WriteLine("ShiftOS: Kernel deactivated.");
Thread.Sleep(1000);
this.Invoke(new Action(() =>
{
txtterm.Text = "";
}));
Thread.Sleep(1000);
WriteLine("Welcome to ShiftOS.");
Thread.Sleep(500);
WriteLine("Starting core...");
API.Upgrades["windowedterminal"] = true;
Thread.Sleep(450);
WriteLine($"Your username is {API.Username}.");
Thread.Sleep(100);
WriteLine($"You have {API.Codepoints} Codepoints.");
WriteLine("Loading modules...");
Thread.Sleep(750);
foreach(var upg in API.Upgrades)
{
if(upg.Value == true)
{
WriteLine($"Loaded module {upg.Key}...");
}
Thread.Sleep(100);
}
WriteLine("Starting desktop.");
this.Invoke(new Action(() =>
{
var s = new ShiftOSDesktop();
s.Show();
s.EndGame_AttachEvents();
}));
Thread.Sleep(1000);
this.Invoke(new Action(() =>
{
FinalMission.EndGameHandler.GoToNextObjective();
}));
API.Upgrades["titlebar"] = true;
})));
t1.Start();
}
public void Crash()
{
txtterm.Text = "";
@ -2138,7 +2433,7 @@ public void Crash()
WriteLine(Environment.NewLine);
WriteLine("PANIC_ID: 750_15_4W3S0M3");
WriteLine("PANIC_DESC: System became too unstable to function properly. In 5 seconds, your session will be resumed.");
var t = new Timer();
var t = new System.Windows.Forms.Timer();
t.Interval = 1000;
int p = 0;
t.Tick += (object s, EventArgs a) =>
@ -2518,13 +2813,19 @@ private void tmrshutdown_Tick(object sender, EventArgs e)
public void WriteLine(string text)
{
if (txtterm.Text.Length > 0)
txtterm.Invoke(new Action(() =>
{
txtterm.Text += Environment.NewLine + text;
} else
{
txtterm.Text += text;
}
if (txtterm.Text.Length > 0)
{
txtterm.Text += Environment.NewLine + text;
}
else
{
txtterm.Text += text;
}
txtterm.Select(txtterm.TextLength, 0);
txtterm.ScrollToCaret();
}));
}
private bool Zooming = false;

View file

@ -102,7 +102,10 @@ private void infobox_Load(object sender, EventArgs e)
btnok_Click(s, (EventArgs)a);
}
};
API.PlaySound(Properties.Resources.infobox);
if (API.InfoboxesPlaySounds)
{
API.PlaySound(Properties.Resources.infobox);
}
}

View file

@ -4,6 +4,7 @@
<package id="DynamicLua" version="1.1.2.0" targetFramework="net452" />
<package id="GeckoFX" version="1.0.5" targetFramework="net452" />
<package id="IrcDotNet" version="0.4.1" targetFramework="net452" />
<package id="NAudio" version="1.7.3" targetFramework="net452" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net452" />
<package id="Svg" version="2.1.0" targetFramework="net452" />
</packages>