aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/Story.cs
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-06-29 13:13:45 -0700
committerwilliam341 <[email protected]>2017-06-29 13:13:45 -0700
commitad387c41e7d6cc547431e88695d4723ea2dba913 (patch)
treea68282dda40c4f0b28883241c7adcf9010f4550e /ShiftOS_TheReturn/Story.cs
parentb4b19e7a4d203b58537f5b98214296ab52c49b2d (diff)
parent5bebd4411bc6266cbee482a429ba794eefa8f9b6 (diff)
downloadshiftos_thereturn-ad387c41e7d6cc547431e88695d4723ea2dba913.tar.gz
shiftos_thereturn-ad387c41e7d6cc547431e88695d4723ea2dba913.tar.bz2
shiftos_thereturn-ad387c41e7d6cc547431e88695d4723ea2dba913.zip
Merge remote-tracking branch 'refs/remotes/shiftos-game/master'
Diffstat (limited to 'ShiftOS_TheReturn/Story.cs')
-rw-r--r--ShiftOS_TheReturn/Story.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/ShiftOS_TheReturn/Story.cs b/ShiftOS_TheReturn/Story.cs
index 2b00686..bf727d8 100644
--- a/ShiftOS_TheReturn/Story.cs
+++ b/ShiftOS_TheReturn/Story.cs
@@ -141,7 +141,7 @@ namespace ShiftOS.Engine
{
foreach (var mth in type.GetMethods(BindingFlags.Public | BindingFlags.Static))
{
- foreach (var attrib in Array.FindAll(mth.GetCustomAttributes(false), a => a is StoryAttribute))
+ foreach (var attrib in Array.FindAll(mth.GetCustomAttributes(false), a => a is StoryAttribute || a is MissionAttribute))
{
var story = attrib as StoryAttribute;
if (story.StoryID == stid)
@@ -157,6 +157,19 @@ namespace ShiftOS.Engine
SaveSystem.CurrentSave.PickupPoint = Context.Id;
Context.OnComplete += () =>
{
+ if(story is MissionAttribute)
+ {
+ var mission = story as MissionAttribute;
+ ConsoleEx.ForegroundColor = ConsoleColor.Yellow;
+ ConsoleEx.Bold = true;
+ Console.WriteLine(" - mission complete - ");
+ ConsoleEx.Bold = false;
+ ConsoleEx.ForegroundColor = ConsoleColor.White;
+ Console.WriteLine($"{mission.Name} successfully finished. You have earned {mission.CodepointAward} Codepoints for your efforts.");
+ SaveSystem.CurrentSave.Codepoints += mission.CodepointAward;
+ TerminalBackend.PrintPrompt();
+ TerminalBackend.PrefixEnabled = true;
+ }
StoryComplete?.Invoke(stid);
SaveSystem.CurrentSave.PickupPoint = null;
};
@@ -209,5 +222,6 @@ namespace ShiftOS.Engine
/// </summary>
public string StoryID { get; private set; }
+ public ulong CodepointAward { get; protected set; }
}
}