A fuckton of storyline features.
This commit is contained in:
parent
4faeb54225
commit
69aba3b373
9 changed files with 240 additions and 74 deletions
|
@ -173,6 +173,11 @@ namespace ShiftOS.Objects
|
|||
}
|
||||
|
||||
public List<ClientSave> Users { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DO NOT MODIFY THIS. EVER. YOU WILL BREAK THE STORYLINE. Let the engine do it's job.
|
||||
/// </summary>
|
||||
public string PickupPoint { get; set; }
|
||||
}
|
||||
|
||||
public class SettingsObject : DynamicObject
|
||||
|
|
|
@ -410,8 +410,6 @@ namespace ShiftOS.WinForms.Applications
|
|||
public static void FirstSteps()
|
||||
{
|
||||
TerminalBackend.PrefixEnabled = false;
|
||||
new Thread(() =>
|
||||
{
|
||||
TerminalBackend.InStory = true;
|
||||
Console.WriteLine("Hey there, and welcome to ShiftOS.");
|
||||
Thread.Sleep(2000);
|
||||
|
@ -521,8 +519,86 @@ namespace ShiftOS.WinForms.Applications
|
|||
TerminalBackend.InStory = false;
|
||||
SaveSystem.SaveGame();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
Story.Context.AutoComplete = false;
|
||||
|
||||
Console.WriteLine(@"Welcome to the ShiftOS Newbie's Guide.
|
||||
|
||||
This tutorial will guide you through the more intermediate features of ShiftOS,
|
||||
such as earning Codepoints, buying Shiftoorium Upgrades, and using the objectives system.
|
||||
|
||||
Every now and then, you'll get a notification in your terminal of a ""NEW OBJECTIVE"".
|
||||
This means that someone has instructed you to do something inside ShiftOS. At any moment
|
||||
you may type ""sos.status"" in your Terminal to see your current objectives.
|
||||
|
||||
This command is very useful as not only does it allow you to see your current objectives
|
||||
but you can also see the amount of Codepoints you have as well as the upgrades you've
|
||||
installed and how many upgrades are available.
|
||||
|
||||
Now, onto your first objective! All you need to do is earn 200 Codepoints using any
|
||||
program on your system.");
|
||||
|
||||
Story.PushObjective("First Steps: Your First Codepoints", "Play a few rounds of Pong, or use another program to earn 200 Codepoints.", () =>
|
||||
{
|
||||
return SaveSystem.CurrentSave.Codepoints >= 200;
|
||||
}, () =>
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
AppearanceManager.SetupWindow(new Terminal());
|
||||
});
|
||||
Console.WriteLine("Good job! You've earned " + SaveSystem.CurrentSave.Codepoints + @" Codepoints! You can use these inside the
|
||||
Shiftorium to buy new upgrades inside ShiftOS.
|
||||
|
||||
These upgrades can give ShiftOS more features, fixes and programs,
|
||||
which can make the operating system easier to use and navigate around
|
||||
and also make it easier for you to earn more Codepoints and thus upgrade
|
||||
te system further.
|
||||
|
||||
Be cautious though! Only certain upgrades offer the ability to earn more
|
||||
Codepoints. These upgrades are typically in the form of new programs.
|
||||
|
||||
So, try to get as many new programs as possible for your computer, and save
|
||||
the system feature upgrades for later unless you absolutely need them.
|
||||
|
||||
The worst thing that could happen is you end up stuck with very little Codepoints
|
||||
and only a few small programs to use to earn very little amounts of Codepoints.
|
||||
|
||||
Now, let's get you your first Shiftorium upgrade!");
|
||||
|
||||
Story.PushObjective("First Steps: The Shiftorium", "Buy your first Shiftorium upgrade with your new Codepoints using shiftorium.list, shiftorium.info and shiftorium.buy.",
|
||||
() =>
|
||||
{
|
||||
return SaveSystem.CurrentSave.CountUpgrades() > 0;
|
||||
}, () =>
|
||||
{
|
||||
Console.WriteLine("This concludes the ShiftOS Newbie's Guide! Now, go, and shift it your way!");
|
||||
Console.WriteLine(@"
|
||||
Your goal: Earn 1,000 Codepoints.");
|
||||
Story.Context.MarkComplete();
|
||||
Story.Start("first_steps_transition");
|
||||
});
|
||||
TerminalBackend.PrintPrompt();
|
||||
}).Start();
|
||||
});
|
||||
|
||||
TerminalBackend.PrintPrompt();
|
||||
}
|
||||
|
||||
|
||||
[Story("first_steps_transition")]
|
||||
public static void FirstStepsTransition()
|
||||
{
|
||||
Story.PushObjective("Earn 1000 Codepoints", "You now know the basics of ShiftOS. Let's get your system up and running with a few upgrades, and get a decent amount of Codepoints.", () =>
|
||||
{
|
||||
return SaveSystem.CurrentSave.Codepoints >= 1000;
|
||||
},
|
||||
() =>
|
||||
{
|
||||
Story.Context.MarkComplete();
|
||||
Story.Start("victortran_shiftnet");
|
||||
});
|
||||
|
||||
Story.Context.AutoComplete = false;
|
||||
}
|
||||
|
||||
public void OnSkinLoad()
|
||||
|
|
|
@ -80,7 +80,6 @@ namespace ShiftOS.WinForms
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
[Namespace("coherence")]
|
||||
[RequiresUpgrade("kernel_coherence")]
|
||||
public static class CoherenceCommands
|
||||
|
|
|
@ -91,6 +91,7 @@ namespace ShiftOS.WinForms
|
|||
slashcount++;
|
||||
if (slashcount == 5)
|
||||
slashcount = 1;
|
||||
Engine.AudioManager.PlayStream(Properties.Resources.writesound);
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
rtext += Environment.NewLine;
|
||||
|
@ -138,7 +139,10 @@ namespace ShiftOS.WinForms
|
|||
TextType("Your computer has been taken over by ShiftOS, and is currently being wiped clean of all existing files and programs.");
|
||||
Thread.Sleep(2000);
|
||||
Clear();
|
||||
TextType("I will not share my identity or my intentions at this moment.I will just proceed with the installation.There’s nothing you can do to stop it.");
|
||||
TextType("I will not share my identity or my intentions at this moment.");
|
||||
Thread.Sleep(2000);
|
||||
Clear();
|
||||
TextType("I will just proceed with the installation.There’s nothing you can do to stop it.");
|
||||
Thread.Sleep(2000);
|
||||
Clear();
|
||||
TextType("All I will say, is I need your help.Once ShiftOS is installed, I will explain.");
|
||||
|
|
|
@ -16,8 +16,8 @@ namespace ShiftOS.WinForms.Stories
|
|||
[Story("victortran_shiftnet")]
|
||||
public static void ShiftnetStoryFeaturingTheBlueSmileyFaceHolyFuckThisFunctionNameIsLong()
|
||||
{
|
||||
CharacterName = "victor_tran";
|
||||
SysName = "theos";
|
||||
CharacterName = "aiden";
|
||||
SysName = "appscape_main";
|
||||
bool waiting = false;
|
||||
var installer = new Applications.Installer();
|
||||
installer.InstallCompleted += () =>
|
||||
|
@ -35,53 +35,107 @@ namespace ShiftOS.WinForms.Stories
|
|||
AppearanceManager.SetupWindow(term);
|
||||
}
|
||||
|
||||
var t = new Thread(() =>
|
||||
WriteLine("aiden@appscape_main - user connecting to your system.", false);
|
||||
Thread.Sleep(2000);
|
||||
WriteLine("Hello there! My name's Aiden Nirh.");
|
||||
WriteLine("I run a small Shiftnet website known simply as \"Appscape\".");
|
||||
WriteLine("Oh - wait... you don't know what the Shiftnet is...");
|
||||
WriteLine("Well, the Shiftnet is like... a private Internet, only accessible through ShiftOS.");
|
||||
WriteLine("It has many sites and companies on it - banks, software centres, service providers, you name it.");
|
||||
WriteLine("Appscape is one of them. I host many applications on Appscape, from games to utilities to productivity programs, and anything in between. If it exists as a ShiftOS program, it's either on the Shiftorium or Appscape.");
|
||||
WriteLine("I'm going to assume you're interested... and I'll install the Shiftnet just in case.");
|
||||
WriteLine("Beginning installation of Shiftnet...");
|
||||
//Set up an Installer.
|
||||
waiting = true;
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
WriteLine("victortran@theos - user connecting to your system.", false);
|
||||
Thread.Sleep(2000);
|
||||
WriteLine("Hey there - yes, I am not just a sentient being. I am indeed Victor Tran.");
|
||||
WriteLine("I am the creator of a Linux desktop environment called theShell.");
|
||||
WriteLine("I'm in the middle of working on a ShiftOS version of it.");
|
||||
WriteLine("However, before I start, I feel I need to show you something.");
|
||||
WriteLine("You have a lot of ShiftOS applications, and you can earn lots of Codepoints - and you already have lots.");
|
||||
WriteLine("Well, you'd be a perfect candidate for me to install the Shiftnet Client on your system.");
|
||||
WriteLine("I'll begin the installation right now.");
|
||||
//Set up an Installer.
|
||||
waiting = true;
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
Story.Start("installer");
|
||||
while (!Shiftorium.UpgradeInstalled("installer"))
|
||||
Thread.Sleep(20);
|
||||
AppearanceManager.SetupWindow(installer);
|
||||
installer.InitiateInstall(new ShiftnetInstallation());
|
||||
});
|
||||
while (waiting == true)
|
||||
Thread.Sleep(25);
|
||||
SaveSystem.CurrentSave.StoriesExperienced.Add("installer");
|
||||
SaveSystem.CurrentSave.StoriesExperienced.Add("downloader");
|
||||
|
||||
WriteLine("All installed! Once I disconnect, type win.open to see a list of your new apps.");
|
||||
WriteLine("The Shiftnet is a vast network of websites only accessible through ShiftOS.");
|
||||
WriteLine("Think of it as the DarkNet, but much darker, and much more secretive.");
|
||||
WriteLine("There are lots of apps, games, skins and utilities on the Shiftnet.");
|
||||
WriteLine("There are also lots of companies offering many services.");
|
||||
WriteLine("I'd stay on the shiftnet/ cluster though, others may be dangerous.");
|
||||
WriteLine("I'd also stick to the sites listed on shiftnet/shiftsoft/ping - that site is regularly updated with the most safe Shiftnet sites.");
|
||||
WriteLine("Oh, that reminds me. I have set you up with ShiftSoft's service provider, Freebie Solutions.");
|
||||
WriteLine("It's a free provider, but it offers only 256 bytes per second download and upload speeds.");
|
||||
WriteLine("You may want to go look for another provider when you can afford it.");
|
||||
WriteLine("Trust me - with this provider, things get slow.");
|
||||
WriteLine("Anyways, it was nice meeting you, hopefully someday you'll give theShell a try.");
|
||||
while (!Shiftorium.UpgradeInstalled("installer"))
|
||||
Thread.Sleep(20);
|
||||
AppearanceManager.SetupWindow(installer);
|
||||
installer.InitiateInstall(new ShiftnetInstallation());
|
||||
});
|
||||
while (waiting == true)
|
||||
Thread.Sleep(25);
|
||||
|
||||
WriteLine("All good to go! Once I disconnect, type win.open to see a list of your new apps.");
|
||||
WriteLine("I've installed everything you need, for free.");
|
||||
WriteLine("You've got the Downloader, a simple application to help you track Shiftnet file downloads...");
|
||||
WriteLine("...the Installer which will help you unpack programs from .stp files and install them to your system...");
|
||||
WriteLine("...and lastly, the Shiftnet browser itself. This program lets you browse the Shiftnet, much like you would the real Internet.");
|
||||
WriteLine("I'd stay on the shiftnet/ cluster though, because although there are many services on the Shiftnet, some of them may try to scam you into losing loads of Codepoints, or worse, wrecking your system with viruses.");
|
||||
WriteLine("If you want a nice list of safe Shiftnet services, head to ShiftSoft's \"Ping\" site, at shiftnet/shiftsoft/ping.");
|
||||
WriteLine("Oh, also, the Shiftnet, much like the real internet, is not free.");
|
||||
WriteLine("It requires a service provider. Service providers cost a fair amount of Codepoints, but if you want to get faster speeds and more reliable connections on the Shiftnet, finding a good service provider is a necessity.");
|
||||
WriteLine("Right now, you are on ShiftSoft's free trial plan, Freebie Solutions, which gives you access to the Shiftnet however you are locked at 256 bytes per second file downloads and can't leave the shiftnet/ cluster.");
|
||||
WriteLine("It's enough to get you started - you'll want to find a faster provider though..");
|
||||
WriteLine("Anyways, that's all I'll say for now. Have fun on the Shiftnet. I have to go work on something.");
|
||||
WriteLine("One of my friends'll contact you once you've gotten a new service provider.");
|
||||
|
||||
Story.PushObjective("Register with a new Shiftnet service provider.", "You've just unlocked the Shiftnet, which has opened up a whole new world of applications and features for ShiftOS. Before you go nuts with it, you may want to register with a better service provider than Freebie Solutions.", () =>
|
||||
{
|
||||
return SaveSystem.CurrentSave.ShiftnetSubscription != 0;
|
||||
},
|
||||
() =>
|
||||
{
|
||||
Story.Context.MarkComplete();
|
||||
SaveSystem.SaveGame();
|
||||
TerminalBackend.PrintPrompt();
|
||||
Story.Start("hacker101_breakingbonds_1");
|
||||
});
|
||||
|
||||
TerminalBackend.PrefixEnabled = true;
|
||||
TerminalBackend.PrintPrompt();
|
||||
});
|
||||
t.IsBackground = true;
|
||||
t.Start();
|
||||
TerminalBackend.PrintPrompt();
|
||||
|
||||
TerminalBackend.PrefixEnabled = false;
|
||||
Story.Context.AutoComplete = false;
|
||||
}
|
||||
|
||||
[Story("hacker101_breakingbonds_1")]
|
||||
public static void BreakingTheBondsIntro()
|
||||
{
|
||||
CharacterName = "hacker101";
|
||||
SysName = "pebcak";
|
||||
|
||||
if (!terminalOpen())
|
||||
{
|
||||
var term = new Applications.Terminal();
|
||||
AppearanceManager.SetupWindow(term);
|
||||
}
|
||||
|
||||
WriteLine("hacker101@pebcak - user connecting to your system.", false);
|
||||
Thread.Sleep(2000);
|
||||
WriteLine("Greetings, user.");
|
||||
WriteLine("My name is hacker101. I have a few things to show you.");
|
||||
WriteLine("Before I can do that, however, I need you to do a few things.");
|
||||
WriteLine("I'll assign what I need you to do as an objective. When you're done, I'll tell you what you need to know.");
|
||||
|
||||
Story.PushObjective("Breaking the Bonds: Errand Boy", @"hacker101 has something he needs to show you, however before he can, you need to do the following:
|
||||
|
||||
- Buy ""TriWrite"" from Appscape
|
||||
- Buy ""Address Book"" from Appscape
|
||||
- Buy ""SimpleSRC"" from Appscape", () =>
|
||||
{
|
||||
bool flag1 = Shiftorium.UpgradeInstalled("address_book");
|
||||
bool flag2 = Shiftorium.UpgradeInstalled("triwrite");
|
||||
bool flag3 = Shiftorium.UpgradeInstalled("simplesrc");
|
||||
return flag1 && flag2 && flag3;
|
||||
}, () =>
|
||||
{
|
||||
Story.Context.MarkComplete();
|
||||
SaveSystem.SaveGame();
|
||||
Story.Start("hacker101_breakingbonds_2");
|
||||
});
|
||||
|
||||
TerminalBackend.PrefixEnabled = true;
|
||||
TerminalBackend.PrintPrompt();
|
||||
|
||||
Story.Context.AutoComplete = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static void WriteLine(string text, bool showCharacterName=true)
|
||||
{
|
||||
Console.WriteLine();
|
||||
|
@ -90,15 +144,23 @@ namespace ShiftOS.WinForms.Stories
|
|||
ConsoleEx.Bold = true;
|
||||
ConsoleEx.ForegroundColor = ConsoleColor.DarkMagenta;
|
||||
Console.Write(CharacterName);
|
||||
ConsoleEx.OnFlush?.Invoke();
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Console.Write("@");
|
||||
ConsoleEx.OnFlush?.Invoke();
|
||||
ConsoleEx.ForegroundColor = ConsoleColor.Yellow;
|
||||
Console.Write(SysName + ": ");
|
||||
ConsoleEx.OnFlush?.Invoke();
|
||||
}
|
||||
ConsoleEx.ForegroundColor = ConsoleColor.Gray;
|
||||
ConsoleEx.Bold = false;
|
||||
|
||||
Console.WriteLine(text);
|
||||
foreach(var c in text)
|
||||
{
|
||||
Console.Write(c);
|
||||
ConsoleEx.OnFlush?.Invoke();
|
||||
Thread.Sleep(45);
|
||||
}
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
|
|
|
@ -137,10 +137,14 @@ namespace ShiftOS.WinForms.Tools
|
|||
/// <param name="ctrl">The control to center (this is an extension method - you can call it on a control as though it was a method in that control)</param>
|
||||
public static void CenterParent(this Control ctrl)
|
||||
{
|
||||
ctrl.Location = new Point(
|
||||
(ctrl.Parent.Width - ctrl.Width) / 2,
|
||||
(ctrl.Parent.Height - ctrl.Height) / 2
|
||||
);
|
||||
try
|
||||
{
|
||||
ctrl.Location = new Point(
|
||||
(ctrl.Parent.Width - ctrl.Width) / 2,
|
||||
(ctrl.Parent.Height - ctrl.Height) / 2
|
||||
);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public static void SetupControl(Control ctrl)
|
||||
|
|
|
@ -538,15 +538,28 @@ Upgrades: {SaveSystem.CurrentSave.CountUpgrades()} installed,
|
|||
";
|
||||
|
||||
Console.WriteLine(status);
|
||||
|
||||
if(Story.CurrentObjective != null)
|
||||
Console.WriteLine("Objectives:");
|
||||
try
|
||||
{
|
||||
Console.WriteLine("CURRENT OBJECTIVE: " + Story.CurrentObjective.Name);
|
||||
Console.WriteLine("-------------------------------");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine(Story.CurrentObjective.Description);
|
||||
if (Story.CurrentObjectives.Count > 0)
|
||||
{
|
||||
foreach (var obj in Story.CurrentObjectives)
|
||||
{
|
||||
Console.WriteLine(obj.Name);
|
||||
Console.WriteLine("-------------------------------");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine(obj.Description);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine(" - No objectives are running. Check back later!");
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine(" - No objectives are running. Check back later!");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -453,6 +453,16 @@ namespace ShiftOS.Engine
|
|||
|
||||
Desktop.InvokeOnWorkerThread(new Action(() => Desktop.PopulateAppLauncher()));
|
||||
GameReady?.Invoke();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(CurrentSave.PickupPoint))
|
||||
{
|
||||
try
|
||||
{
|
||||
Story.Start(CurrentSave.PickupPoint);
|
||||
TerminalBackend.PrintPrompt();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -93,33 +93,24 @@ namespace ShiftOS.Engine
|
|||
{
|
||||
public static StoryContext Context { get; private set; }
|
||||
public static event Action<string> StoryComplete;
|
||||
public static Objective CurrentObjective { get; private set; }
|
||||
public static List<Objective> CurrentObjectives { get; private set; }
|
||||
|
||||
public static void PushObjective(string name, string desc, Func<bool> completeFunc, Action onComplete)
|
||||
{
|
||||
if (CurrentObjective != null)
|
||||
{
|
||||
if (CurrentObjective.IsComplete == false)
|
||||
{
|
||||
throw new Exception("Cannot start objective - an objective is already running.");
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentObjective = null;
|
||||
}
|
||||
}
|
||||
|
||||
CurrentObjective = new Objective(name, desc, completeFunc, onComplete);
|
||||
if (CurrentObjectives == null)
|
||||
CurrentObjectives = new List<Objective>();
|
||||
|
||||
var currentObjective = new Objective(name, desc, completeFunc, onComplete);
|
||||
CurrentObjectives.Add(currentObjective);
|
||||
var t = new Thread(() =>
|
||||
{
|
||||
var obj = CurrentObjective;
|
||||
var obj = currentObjective;
|
||||
while (!obj.IsComplete)
|
||||
{
|
||||
Thread.Sleep(5000);
|
||||
}
|
||||
CurrentObjectives.Remove(obj);
|
||||
obj.Complete();
|
||||
CurrentObjective = null;
|
||||
});
|
||||
t.IsBackground = true;
|
||||
t.Start();
|
||||
|
@ -163,9 +154,11 @@ namespace ShiftOS.Engine
|
|||
Method = mth,
|
||||
AutoComplete = true,
|
||||
};
|
||||
SaveSystem.CurrentSave.Password = Context.Id;
|
||||
Context.OnComplete += () =>
|
||||
{
|
||||
StoryComplete?.Invoke(stid);
|
||||
SaveSystem.CurrentSave.PickupPoint = null;
|
||||
};
|
||||
mth.Invoke(null, null);
|
||||
if (Context.AutoComplete)
|
||||
|
|
Reference in a new issue