aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend/Commands.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-08-01 12:22:15 -0400
committerMichael <[email protected]>2017-08-01 12:22:15 -0400
commitd51bda2fc57ab24a9041d87f7103483ff38f5e07 (patch)
treee2c5693cb1feed5009ed71c99837ac814c902127 /ShiftOS.Frontend/Commands.cs
parent9cad19bf1a099cf2ca166f1151d406d7ebef4d2a (diff)
downloadshiftos_thereturn-d51bda2fc57ab24a9041d87f7103483ff38f5e07.tar.gz
shiftos_thereturn-d51bda2fc57ab24a9041d87f7103483ff38f5e07.tar.bz2
shiftos_thereturn-d51bda2fc57ab24a9041d87f7103483ff38f5e07.zip
finish tutorials and add mission cmds
Diffstat (limited to 'ShiftOS.Frontend/Commands.cs')
-rw-r--r--ShiftOS.Frontend/Commands.cs67
1 files changed, 67 insertions, 0 deletions
diff --git a/ShiftOS.Frontend/Commands.cs b/ShiftOS.Frontend/Commands.cs
index da1d1c1..5172d29 100644
--- a/ShiftOS.Frontend/Commands.cs
+++ b/ShiftOS.Frontend/Commands.cs
@@ -44,6 +44,73 @@ using ShiftOS.Engine;
namespace ShiftOS.Frontend
{
+ public static class MissionsCommands
+ {
+ [Command("startmission")]
+ [RequiresArgument("id")]
+ [RequiresUpgrade("tutorial1")]
+ public static void StartMission(Dictionary<string, object> args)
+ {
+ string id = args["id"].ToString();
+ try
+ {
+ if (!Shiftorium.UpgradeInstalled(id))
+ {
+ Story.Start(id);
+ return;
+ }
+ Console.WriteLine("That mission has already been complete. You can't replay it.");
+ }
+ catch
+ {
+ Console.WriteLine("That mission could not be found. Try running missions for a list of available missions.");
+ }
+ }
+
+ [Command("missions")]
+ [RequiresUpgrade("tutorial1")]
+ public static void Missions()
+ {
+ Console.WriteLine("Available missions");
+ Console.WriteLine("===================");
+ Console.WriteLine();
+ bool found = false;
+ foreach (var type in ReflectMan.Types)
+ {
+ foreach(var mth in type.GetMethods(BindingFlags.Public | BindingFlags.Static))
+ {
+ var missionattrib = mth.GetCustomAttributes(false).FirstOrDefault(x => x is MissionAttribute) as MissionAttribute;
+ if(missionattrib != null)
+ {
+ found = true;
+ Console.WriteLine();
+ Console.WriteLine($@"{missionattrib.Name} (id {missionattrib.StoryID})
+------------------------------------
+
+assigner: {missionattrib.Assigner}
+cp reward: {missionattrib.CodepointAward}
+
+{missionattrib.Description}");
+ }
+ }
+ }
+ if(found == false)
+ {
+ Console.WriteLine();
+ Console.WriteLine(@"No missions found.
+------------------------------------
+
+assigner: undefined
+cp reward: [object Object]
+
+There are no missions available for you to complete. Please check back later for more!");
+
+ }
+ }
+ }
+
+
+
[TutorialLock]
public static class TerminalCommands
{