diff options
| author | Michael <[email protected]> | 2017-06-04 15:18:53 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-06-04 15:18:53 -0400 |
| commit | 69aba3b373f9c9c70ec4ef2250e71465d3327299 (patch) | |
| tree | 5a429b05410d2ea63cfde3c766c103309be45b1c /ShiftOS_TheReturn/Story.cs | |
| parent | 4faeb54225919bab1692859b4fe9d9b65f3bedea (diff) | |
| download | shiftos_thereturn-69aba3b373f9c9c70ec4ef2250e71465d3327299.tar.gz shiftos_thereturn-69aba3b373f9c9c70ec4ef2250e71465d3327299.tar.bz2 shiftos_thereturn-69aba3b373f9c9c70ec4ef2250e71465d3327299.zip | |
A fuckton of storyline features.
Diffstat (limited to 'ShiftOS_TheReturn/Story.cs')
| -rw-r--r-- | ShiftOS_TheReturn/Story.cs | 25 |
1 files changed, 9 insertions, 16 deletions
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) |
