aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-06-04 15:18:53 -0400
committerMichael <[email protected]>2017-06-04 15:18:53 -0400
commit69aba3b373f9c9c70ec4ef2250e71465d3327299 (patch)
tree5a429b05410d2ea63cfde3c766c103309be45b1c /ShiftOS_TheReturn
parent4faeb54225919bab1692859b4fe9d9b65f3bedea (diff)
downloadshiftos_thereturn-69aba3b373f9c9c70ec4ef2250e71465d3327299.tar.gz
shiftos_thereturn-69aba3b373f9c9c70ec4ef2250e71465d3327299.tar.bz2
shiftos_thereturn-69aba3b373f9c9c70ec4ef2250e71465d3327299.zip
A fuckton of storyline features.
Diffstat (limited to 'ShiftOS_TheReturn')
-rw-r--r--ShiftOS_TheReturn/Commands.cs27
-rw-r--r--ShiftOS_TheReturn/SaveSystem.cs10
-rw-r--r--ShiftOS_TheReturn/Story.cs25
3 files changed, 39 insertions, 23 deletions
diff --git a/ShiftOS_TheReturn/Commands.cs b/ShiftOS_TheReturn/Commands.cs
index 72bccb1..f37bcb3 100644
--- a/ShiftOS_TheReturn/Commands.cs
+++ b/ShiftOS_TheReturn/Commands.cs
@@ -538,15 +538,28 @@ Upgrades: {SaveSystem.CurrentSave.CountUpgrades()} installed,
";
Console.WriteLine(status);
-
- if(Story.CurrentObjective != null)
+ Console.WriteLine("Objectives:");
+ try
+ {
+ 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("CURRENT OBJECTIVE: " + Story.CurrentObjective.Name);
- Console.WriteLine("-------------------------------");
- Console.WriteLine();
- Console.WriteLine(Story.CurrentObjective.Description);
+ Console.WriteLine(" - No objectives are running. Check back later!");
}
-
return true;
}
}
diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs
index 155f002..e98a51e 100644
--- a/ShiftOS_TheReturn/SaveSystem.cs
+++ b/ShiftOS_TheReturn/SaveSystem.cs
@@ -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>
diff --git a/ShiftOS_TheReturn/Story.cs b/ShiftOS_TheReturn/Story.cs
index 848c757..4d1d5cc 100644
--- a/ShiftOS_TheReturn/Story.cs
+++ b/ShiftOS_TheReturn/Story.cs
@@ -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)