aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ShiftOS.WinForms/MissionAttribute.cs12
-rw-r--r--ShiftOS.WinForms/ShiftOS.WinForms.csproj1
-rw-r--r--ShiftOS_TheReturn/MissionAttribute.cs24
-rw-r--r--ShiftOS_TheReturn/ShiftOS.Engine.csproj1
-rw-r--r--ShiftOS_TheReturn/Story.cs14
5 files changed, 51 insertions, 1 deletions
diff --git a/ShiftOS.WinForms/MissionAttribute.cs b/ShiftOS.WinForms/MissionAttribute.cs
new file mode 100644
index 0000000..795e624
--- /dev/null
+++ b/ShiftOS.WinForms/MissionAttribute.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ShiftOS.WinForms
+{
+ class MissionAttribute
+ {
+ }
+}
diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj
index d79a7e3..a83bed1 100644
--- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj
+++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj
@@ -357,6 +357,7 @@
<Compile Include="MainMenu\MainMenu.Designer.cs">
<DependentUpon>MainMenu.cs</DependentUpon>
</Compile>
+ <Compile Include="MissionAttribute.cs" />
<Compile Include="Oobe.cs">
<SubType>Form</SubType>
</Compile>
diff --git a/ShiftOS_TheReturn/MissionAttribute.cs b/ShiftOS_TheReturn/MissionAttribute.cs
new file mode 100644
index 0000000..4a0750c
--- /dev/null
+++ b/ShiftOS_TheReturn/MissionAttribute.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ShiftOS.Engine
+{
+ [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
+ public class MissionAttribute : StoryAttribute
+ {
+ public MissionAttribute(string id, string friendlyName, string friendlyDesc, ulong codepointAward, string assigner) : base(id)
+ {
+ Name = friendlyName;
+ Description = friendlyDesc;
+ CodepointAward = codepointAward;
+ Assigner = assigner;
+ }
+
+ public string Name { get; private set; }
+ public string Description { get; private set; }
+ public string Assigner { get; set; }
+ }
+}
diff --git a/ShiftOS_TheReturn/ShiftOS.Engine.csproj b/ShiftOS_TheReturn/ShiftOS.Engine.csproj
index 66d2747..4bb930e 100644
--- a/ShiftOS_TheReturn/ShiftOS.Engine.csproj
+++ b/ShiftOS_TheReturn/ShiftOS.Engine.csproj
@@ -139,6 +139,7 @@
<Compile Include="Localization.cs" />
<Compile Include="LoginManager.cs" />
<Compile Include="Lunix.cs" />
+ <Compile Include="MissionAttribute.cs" />
<Compile Include="NotificationDaemon.cs" />
<Compile Include="OutOfBoxExperience.cs" />
<Compile Include="Paths.cs" />
diff --git a/ShiftOS_TheReturn/Story.cs b/ShiftOS_TheReturn/Story.cs
index 2b00686..02fe6e3 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,17 @@ 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;
+ }
StoryComplete?.Invoke(stid);
SaveSystem.CurrentSave.PickupPoint = null;
};
@@ -209,5 +220,6 @@ namespace ShiftOS.Engine
/// </summary>
public string StoryID { get; private set; }
+ public ulong CodepointAward { get; protected set; }
}
}