aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ShiftOS.Frontend/Apps/ChatClient.cs8
-rw-r--r--ShiftOS.Frontend/Apps/Installer.cs14
-rw-r--r--ShiftOS.Frontend/Commands.cs28
-rw-r--r--ShiftOS.Frontend/Properties/Resources.Designer.cs43
-rw-r--r--ShiftOS.Frontend/Properties/Resources.resx6
-rw-r--r--ShiftOS.Frontend/Resources/LootInfo.txt12
-rw-r--r--ShiftOS.Frontend/Resources/banana.cow.stp.txt6
-rw-r--r--ShiftOS.Frontend/Resources/fire hydrant.cow.stp.txt6
-rw-r--r--ShiftOS.Frontend/ShiftOS.Frontend.csproj3
-rw-r--r--ShiftOS_TheReturn/CommandParser.cs24
10 files changed, 124 insertions, 26 deletions
diff --git a/ShiftOS.Frontend/Apps/ChatClient.cs b/ShiftOS.Frontend/Apps/ChatClient.cs
index de9d80f..cac665c 100644
--- a/ShiftOS.Frontend/Apps/ChatClient.cs
+++ b/ShiftOS.Frontend/Apps/ChatClient.cs
@@ -92,9 +92,7 @@ namespace ShiftOS.Frontend.Apps
_input.Text = "";
//Let's try the AI stuff... :P
- if (!messagecache.Contains(_messages.Last().Message))
- messagecache.Add(_messages.Last().Message);
- var rmsg = messagecache[rnd.Next(messagecache.Count)];
+ var rmsg = _messages[rnd.Next(_messages.Count)].Message;
var split = new List<string>(rmsg.Split(' '));
List<string> nmsg = new List<string>();
if (split.Count > 2)
@@ -111,10 +109,10 @@ namespace ShiftOS.Frontend.Apps
{
split.RemoveAt(i);
}
- split.AddRange(Regex.Split(Regex.Replace(messagecache[rnd.Next(messagecache.Count)], "debugbot", outcomes[rnd.Next(outcomes.Length)], RegexOptions.IgnoreCase), " "));
+ split.AddRange(Regex.Split(Regex.Replace(_messages[rnd.Next(_messages.Count)].Message, "debugbot", outcomes[rnd.Next(outcomes.Length)], RegexOptions.IgnoreCase), " "));
}
split.RemoveAt(rnd.Next(split.Count));
- split.Add(Regex.Replace(messagecache[rnd.Next(messagecache.Count)], "debugbot", outcomes[rnd.Next(outcomes.Length)], RegexOptions.IgnoreCase));
+ split.Add(Regex.Replace(_messages[rnd.Next(_messages.Count)].Message, "debugbot", outcomes[rnd.Next(outcomes.Length)], RegexOptions.IgnoreCase));
string combinedResult = string.Join(" ", split);
_messages.Add(new ChatMessage
{
diff --git a/ShiftOS.Frontend/Apps/Installer.cs b/ShiftOS.Frontend/Apps/Installer.cs
index 86045e1..816e9b5 100644
--- a/ShiftOS.Frontend/Apps/Installer.cs
+++ b/ShiftOS.Frontend/Apps/Installer.cs
@@ -67,6 +67,17 @@ namespace ShiftOS.Frontend.Apps
Engine.Infobox.Show("Upgrade installed.", "The upgrade \"" + _setup.Source + "\" has been installed and is now ready to be used!");
break;
+ case SetupSource.CowFile:
+ string cow = _setup.Source;
+ string[] split = cow.Split('\t');
+ string fname = split[0] + ".cow";
+ string ascii = split[1];
+ string csCowfiles = Paths.GetPath("data") + "/cows";
+ if (!DirectoryExists(csCowfiles))
+ CreateDirectory(csCowfiles);
+ WriteAllText(csCowfiles + "/" + fname, ascii);
+ Engine.Infobox.Show("Cowsay", "New cowfile installed! Have fun with your talking " + split[0] + "!");
+ break;
}
}
@@ -126,6 +137,7 @@ namespace ShiftOS.Frontend.Apps
public enum SetupSource
{
- ShiftoriumUpgrade
+ ShiftoriumUpgrade,
+ CowFile
}
}
diff --git a/ShiftOS.Frontend/Commands.cs b/ShiftOS.Frontend/Commands.cs
index a4b70b0..7218802 100644
--- a/ShiftOS.Frontend/Commands.cs
+++ b/ShiftOS.Frontend/Commands.cs
@@ -52,6 +52,7 @@ namespace ShiftOS.Frontend
{
var builder = new List<string>();
int speechlen = (args.ContainsKey("width")) ? Convert.ToInt32(args["width"].ToString()) : 50;
+ string cowfile = (args.ContainsKey("file")) ? args["file"].ToString() : null;
string speech = args["id"].ToString();
AnimalMode _mode = AnimalMode.Normal;
if (args.ContainsKey("mode"))
@@ -72,7 +73,7 @@ namespace ShiftOS.Frontend
}
DrawSpeechBubble(ref builder, speechlen, speech);
- DrawCow(ref builder, _mode);
+ DrawCow(ref builder, _mode, cowfile);
Console.WriteLine(string.Join(Environment.NewLine, builder.ToArray()));
}
@@ -150,7 +151,7 @@ namespace ShiftOS.Frontend
Youthful
}
- private static void DrawCow(ref List<string> Builder, AnimalMode AnimalMode)
+ private static void DrawCow(ref List<string> Builder, AnimalMode AnimalMode, string cowfile)
{
var startingLinePadding = Builder.First().Length / 4;
@@ -194,12 +195,23 @@ namespace ShiftOS.Frontend
break;
}
-
- Builder.Add($"{' '.RepeatChar(startingLinePadding)}\\ ^__^");
- Builder.Add($"{' '.RepeatChar(startingLinePadding)} \\ ({eyeChar.RepeatChar(2)})\\_______");
- Builder.Add($"{' '.RepeatChar(startingLinePadding)} (__)\\ )\\/\\");
- Builder.Add($"{' '.RepeatChar(startingLinePadding)} {tongueChar.RepeatChar(1)} ||----w |");
- Builder.Add($"{' '.RepeatChar(startingLinePadding)} || ||");
+ string cowpath = Paths.GetPath("data") + "/cows/" + cowfile + ".cow";
+ if (string.IsNullOrWhiteSpace(cowfile) || !Utils.FileExists(cowpath))
+ {
+ Builder.Add($"{' '.RepeatChar(startingLinePadding)}\\ ^__^");
+ Builder.Add($"{' '.RepeatChar(startingLinePadding)} \\ ({eyeChar.RepeatChar(2)})\\_______");
+ Builder.Add($"{' '.RepeatChar(startingLinePadding)} (__)\\ )\\/\\");
+ Builder.Add($"{' '.RepeatChar(startingLinePadding)} {tongueChar.RepeatChar(1)} ||----w |");
+ Builder.Add($"{' '.RepeatChar(startingLinePadding)} || ||");
+ }
+ else
+ {
+ string[] lines = Utils.ReadAllText(cowpath).Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
+ foreach(var line in lines)
+ {
+ Builder.Add($"{' '.RepeatChar(startingLinePadding)}{line.Replace("#", eyeChar.ToString())}");
+ }
+ }
}
}
diff --git a/ShiftOS.Frontend/Properties/Resources.Designer.cs b/ShiftOS.Frontend/Properties/Resources.Designer.cs
index 0092c49..550ab28 100644
--- a/ShiftOS.Frontend/Properties/Resources.Designer.cs
+++ b/ShiftOS.Frontend/Properties/Resources.Designer.cs
@@ -61,6 +61,20 @@ namespace ShiftOS.Frontend.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to {
+ /// Name: &quot;Cowsay Banana Cowfile&quot;,
+ /// Description: &quot;It&apos;s fun to play with food. Especially in the form of a cowfile. This install file adds a Banana to Cowsay&apos;s cowfile list. To use it, simply do \&quot;cowsay --id Hello --file banana\&quot;.&quot;,
+ /// SourceType: &quot;CowFile&quot;,
+ /// Source: &quot;banana\t\&quot;-..___ __.=&apos;&gt;\r\n`. \&quot;\&quot;\&quot;\&quot;\&quot; ,&apos;\r\n \&quot;-..__ _.-\&quot;\r\n \&quot;\&quot;\&quot;&quot;
+ ///}.
+ /// </summary>
+ public static string banana_cow_stp {
+ get {
+ return ResourceManager.GetString("banana.cow.stp", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap cursor_9x_pointer {
@@ -98,6 +112,19 @@ namespace ShiftOS.Frontend.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to {
+ /// Name: &quot;Cowsay Fire Hydrant Cowfile&quot;,
+ /// Description: &quot;Ever been so thirsty that you wanted to open a fire hydrant and just take a giant drink of water? Well, you can&apos;t do that with this install file, but you can at least get a neat cowfile firehydrant so you can make one talk!&quot;,
+ /// SourceType: &quot;CowFile&quot;,
+ /// Source:&quot;fire hydrant\t \\ !\r\n \\ .:::.\r\n ///|\\\\\\\r\n {=-#-#-=}\r\n .-||||/..\\\r\n c[I ||||\\&apos;&apos;/\r\n &apos;-||||||| \r\n |||||||\r\n |||||||\r\n |||||||\r\n [rest of string was truncated]&quot;;.
+ /// </summary>
+ public static string fire_hydrant_cow_stp {
+ get {
+ return ResourceManager.GetString("fire hydrant.cow.stp", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to /* ShiftOS hackables data file
/// *
/// * This file contains information about all hackable systems in the game&apos;s campaign.
@@ -152,13 +179,16 @@ namespace ShiftOS.Frontend.Properties {
/// ID: &quot;sploitset_keepalive&quot;
/// },
/// {
+ /// FriendlyName: &quot;Banana Cow&quot;,
+ /// LootName: &quot;banana.cow.stp&quot;,
+ /// Rarity: 1,
+ /// PointTo: &quot;banana_cow_stp&quot;,
+ /// },
+ /// {
/// FriendlyName: &quot;SSHardline&quot;,
/// LootName: &quot;sploitset_sshardline.stp&quot;,
/// Rarity: 1,
- /// PointTo: &quot;sploitset_sshardline&quot;,
- /// ID: &quot;sploitset_keepalive&quot;
- /// }
- ///].
+ /// PointTo: &quot;sploitset_ssh [rest of string was truncated]&quot;;.
/// </summary>
public static string LootInfo {
get {
@@ -260,6 +290,11 @@ namespace ShiftOS.Frontend.Properties {
/// Cost: 1000000000,
/// Description: &quot;lolyouarentsupposedtobeabletobuythis&quot;,
/// Dependencies: &quot;thisupgradeshouldneverexistever&quot;,
+ /// },
+ /// {
+ /// Name: &quot;Pong&quot;,
+ /// Cost: 0,
+ /// Dependencies: &quot;pong&quot;,
/// }
///].
/// </summary>
diff --git a/ShiftOS.Frontend/Properties/Resources.resx b/ShiftOS.Frontend/Properties/Resources.resx
index 0298116..9f9582e 100644
--- a/ShiftOS.Frontend/Properties/Resources.resx
+++ b/ShiftOS.Frontend/Properties/Resources.resx
@@ -157,4 +157,10 @@
<data name="sploitset_keepalive" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sploitset_keepalive.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
+ <data name="banana.cow.stp" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\banana.cow.stp.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
+ </data>
+ <data name="fire hydrant.cow.stp" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\fire hydrant.cow.stp.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
+ </data>
</root> \ No newline at end of file
diff --git a/ShiftOS.Frontend/Resources/LootInfo.txt b/ShiftOS.Frontend/Resources/LootInfo.txt
index 188eb7c..dc0c109 100644
--- a/ShiftOS.Frontend/Resources/LootInfo.txt
+++ b/ShiftOS.Frontend/Resources/LootInfo.txt
@@ -13,6 +13,18 @@
ID: "sploitset_keepalive"
},
{
+ FriendlyName: "Banana Cow",
+ LootName: "banana.cow.stp",
+ Rarity: 1,
+ PointTo: "banana_cow_stp",
+ },
+ {
+ FriendlyName: "Fire Hydrant Cow",
+ LootName: "fire hydrant.cow.stp",
+ Rarity: 1,
+ PointTo: "fire_hydrant_cow_stp",
+ },
+ {
FriendlyName: "SSHardline",
LootName: "sploitset_sshardline.stp",
Rarity: 1,
diff --git a/ShiftOS.Frontend/Resources/banana.cow.stp.txt b/ShiftOS.Frontend/Resources/banana.cow.stp.txt
new file mode 100644
index 0000000..0147faf
--- /dev/null
+++ b/ShiftOS.Frontend/Resources/banana.cow.stp.txt
@@ -0,0 +1,6 @@
+{
+ Name: "Cowsay Banana Cowfile",
+ Description: "It's fun to play with food. Especially in the form of a cowfile. This install file adds a Banana to Cowsay's cowfile list. To use it, simply do \"cowsay --id Hello --file banana\".",
+ SourceType: "CowFile",
+ Source: "banana\t\"-..___ __.='>\r\n`. \"\"\"\"\" ,'\r\n \"-..__ _.-\"\r\n \"\"\""
+} \ No newline at end of file
diff --git a/ShiftOS.Frontend/Resources/fire hydrant.cow.stp.txt b/ShiftOS.Frontend/Resources/fire hydrant.cow.stp.txt
new file mode 100644
index 0000000..f25803c
--- /dev/null
+++ b/ShiftOS.Frontend/Resources/fire hydrant.cow.stp.txt
@@ -0,0 +1,6 @@
+{
+ Name: "Cowsay Fire Hydrant Cowfile",
+ Description: "Ever been so thirsty that you wanted to open a fire hydrant and just take a giant drink of water? Well, you can't do that with this install file, but you can at least get a neat cowfile firehydrant so you can make one talk!",
+ SourceType: "CowFile",
+ Source:"fire hydrant\t \\ !\r\n \\ .:::.\r\n ///|\\\\\\\r\n {=-#-#-=}\r\n .-||||/..\\\r\n c[I ||||\\''/\r\n '-||||||| \r\n |||||||\r\n |||||||\r\n |||||||\r\n [=======]\r\n"
+} \ No newline at end of file
diff --git a/ShiftOS.Frontend/ShiftOS.Frontend.csproj b/ShiftOS.Frontend/ShiftOS.Frontend.csproj
index c029107..cfc1132 100644
--- a/ShiftOS.Frontend/ShiftOS.Frontend.csproj
+++ b/ShiftOS.Frontend/ShiftOS.Frontend.csproj
@@ -107,6 +107,7 @@
<EmbeddedResource Include="Icon.bmp" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
+ <SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
@@ -196,6 +197,8 @@
</ItemGroup>
<ItemGroup>
<None Include="Resources\pong.txt" />
+ <None Include="Resources\banana.cow.stp.txt" />
+ <None Include="Resources\fire hydrant.cow.stp.txt" />
<Content Include="Resources\Ports.txt" />
<Content Include="Resources\Payloads.txt" />
<Content Include="Resources\Exploits.txt" />
diff --git a/ShiftOS_TheReturn/CommandParser.cs b/ShiftOS_TheReturn/CommandParser.cs
index 7568b98..8f25668 100644
--- a/ShiftOS_TheReturn/CommandParser.cs
+++ b/ShiftOS_TheReturn/CommandParser.cs
@@ -121,20 +121,28 @@ namespace ShiftOS.Engine
i = 0;
}
- CommandFormat part = parts[i];
- string inp = text.Substring(position);
+ CommandFormat part = parts[i];
+ string inp = text.Substring(position);
string res = part.CheckValidity(inp);
if(part is CommandFormatText)
{
- if(res == "+FALSE+")
+ if (res == "+FALSE+")
{
- if(id_found == false)
+#if SUPERMOSQUITO_DIAGNOSIS
+ if (!inp.Remove(0, 1).Contains(" "))
{
- id_found = true;
- id_text = inp.Remove(0,1);
- res = "";
- arguments.Add("id", id_text);
+
+
+ if (id_found == false)
+ {
+ id_found = true;
+ id_text = inp.Remove(0, 1);
+ res = "";
+ arguments.Add("id", id_text);
+
+ }
}
+#endif
}
}