aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarverh <[email protected]>2016-07-20 20:47:35 -0700
committercarverh <[email protected]>2016-07-20 20:47:35 -0700
commit2747ec98b77a58a4d311265229b5c2981df6d92f (patch)
tree4dafbf76c9f30371eb4199c4b2d36063fdc6f147
parent4fe0de40aa9e3dc82de40d447331c39fab5f4c4c (diff)
downloadshiftos-c-_theultimatehacker-2747ec98b77a58a4d311265229b5c2981df6d92f.tar.gz
shiftos-c-_theultimatehacker-2747ec98b77a58a4d311265229b5c2981df6d92f.tar.bz2
shiftos-c-_theultimatehacker-2747ec98b77a58a4d311265229b5c2981df6d92f.zip
Fixed Couple Bugs and Crashes
- Fixed: Crash when Hacking With No Tools - Fixed: Accessing directories outside of C:\ShiftOS using 'ls' command - Added Small Features
-rw-r--r--source/WindowsFormsApplication1/Apps/Terminal.cs11
-rw-r--r--source/WindowsFormsApplication1/Gameplay/Hacking.cs111
-rw-r--r--source/WindowsFormsApplication1/Resources/Credits.txt17
3 files changed, 74 insertions, 65 deletions
diff --git a/source/WindowsFormsApplication1/Apps/Terminal.cs b/source/WindowsFormsApplication1/Apps/Terminal.cs
index 8293283..1d39f70 100644
--- a/source/WindowsFormsApplication1/Apps/Terminal.cs
+++ b/source/WindowsFormsApplication1/Apps/Terminal.cs
@@ -1378,8 +1378,15 @@ Password: z7fjsd3");
public string GetParent(string path)
{
- var d = new DirectoryInfo(path);
- return d.Parent.FullName;
+ if (new DirectoryInfo(path).Parent.FullName.Contains("ShiftOS"))
+ {
+ var d = new DirectoryInfo(path);
+ return d.Parent.FullName;
+ }
+ else
+ {
+ return path;
+ }
}
public void DoCommand()
diff --git a/source/WindowsFormsApplication1/Gameplay/Hacking.cs b/source/WindowsFormsApplication1/Gameplay/Hacking.cs
index 7b18852..23c382d 100644
--- a/source/WindowsFormsApplication1/Gameplay/Hacking.cs
+++ b/source/WindowsFormsApplication1/Gameplay/Hacking.cs
@@ -373,62 +373,71 @@ namespace ShiftOS
{
StartHack(cid, GetRandomHack());
}
- else {
- var h = Tools[cid];
- switch(h.Name)
+ else
+ {
+ if (Tools.Count <= cid)
{
- case "Destabilizer Attack":
- var t = new Timer();
- t.Interval = 1000 / h.Effectiveness;
- var rnd = new Random();
- t.Tick += (object s, EventArgs a) =>
- {
- int r = rnd.Next(0, 100);
- if(r == 90)
- {
- t.Stop();
- API.CreateInfoboxSession("Hack complete.", "The hack has been completed.", infobox.InfoboxMode.Info);
- GiveUpgrade(upgrade);
- }
- else
+ API.CreateInfoboxSession("Failed!", "No Hacking Tools Avalible!", infobox.InfoboxMode.Info);
+ return;
+ }
+ else
+ {
+ HackTool h = Tools[cid];
+ switch (h.Name)
+ {
+ case "Destabilizer Attack":
+ var t = new Timer();
+ t.Interval = 1000 / h.Effectiveness;
+ var rnd = new Random();
+ t.Tick += (object s, EventArgs a) =>
{
- int p = rnd.Next(0, 10);
- switch(p)
+ int r = rnd.Next(0, 100);
+ if (r == 90)
{
- case 1:
- API.OpenProgram("shiftorium");
- break;
- case 2:
- API.OpenProgram("ki");
- break;
- case 3:
- API.CreateInfoboxSession(API.Encryption.Encrypt("Praise Lord Michael"), API.Encryption.Encrypt("You will bow down to me."), infobox.InfoboxMode.Info);
- break;
- case 4:
- API.PlaySound(Properties.Resources._3beepvirus);
- break;
- case 5:
- API.CurrentSession.BackColor = Color.White;
- break;
- case 6:
- API.CurrentSession.BackColor = Color.Black;
- break;
- case 7:
- API.PlaySound(Properties.Resources.dial_up_modem_02);
- break;
- case 8:
- API.PlaySound(Properties.Resources.writesound);
- break;
- case 9:
- API.PlaySound(Properties.Resources.typesound);
- break;
+ t.Stop();
+ API.CreateInfoboxSession("Hack complete.", "The hack has been completed.", infobox.InfoboxMode.Info);
+ GiveUpgrade(upgrade);
}
- }
- };
- t.Start();
+ else
+ {
+ int p = rnd.Next(0, 10);
+ switch (p)
+ {
+ case 1:
+ API.OpenProgram("shiftorium");
+ break;
+ case 2:
+ API.OpenProgram("ki");
+ break;
+ case 3:
+ API.CreateInfoboxSession(API.Encryption.Encrypt("Praise Lord Michael"), API.Encryption.Encrypt("You will bow down to me."), infobox.InfoboxMode.Info);
+ break;
+ case 4:
+ API.PlaySound(Properties.Resources._3beepvirus);
+ break;
+ case 5:
+ API.CurrentSession.BackColor = Color.White;
+ break;
+ case 6:
+ API.CurrentSession.BackColor = Color.Black;
+ break;
+ case 7:
+ API.PlaySound(Properties.Resources.dial_up_modem_02);
+ break;
+ case 8:
+ API.PlaySound(Properties.Resources.writesound);
+ break;
+ case 9:
+ API.PlaySound(Properties.Resources.typesound);
+ break;
+ }
+ }
+ };
+ t.Start();
-
- break;
+
+ break;
+ }
}
}
}
diff --git a/source/WindowsFormsApplication1/Resources/Credits.txt b/source/WindowsFormsApplication1/Resources/Credits.txt
index 9961fa3..8ddd3d0 100644
--- a/source/WindowsFormsApplication1/Resources/Credits.txt
+++ b/source/WindowsFormsApplication1/Resources/Credits.txt
@@ -1,18 +1,11 @@
ShiftOS #VER#
+== Developers ==
+Philip Adams
+Michael VanOverbeek
+Carver (www.harri.cf)
-
-A game by Michael VanOverbeek
-
-
-
-
-
-
-
-
-
- == External Libraries / Dependencies ==
+== External Libraries / Dependencies ==
JSON.NET - Version 8.0.2
By James Newton-King