Exemple #1
0
        public static bool ViewInfo(Dictionary <string, object> userArgs)
        {
            try
            {
                string upgrade = "";

                upgrade = (string)userArgs["upgrade"];

                foreach (var upg in Shiftorium.GetDefaults())
                {
                    if (upg.ID == upgrade)
                    {
                        Console.WriteLine(Localization.Parse("{COM_UPGRADEINFO}", new Dictionary <string, string>
                        {
                            ["%id"]          = upg.ID,
                            ["%category"]    = upg.Category,
                            ["%name"]        = upg.Name,
                            ["%cost"]        = upg.Cost.ToString(),
                            ["%description"] = upg.Description
                        }));

                        return(true);
                    }
                }

                throw new Exception("{ERR_NOUPGRADE}");
            }
            catch
            {
                return(false);
            }
        }
Exemple #2
0
 public static bool GetAllUpgrades()
 {
     foreach (var upg in Shiftorium.GetDefaults())
     {
         Shiftorium.Buy(upg.ID, 0);
     }
     return(true);
 }
Exemple #3
0
        public static bool ViewInfo(Dictionary <string, object> userArgs)
        {
            try {
                string upgrade = "";

                if (userArgs.ContainsKey("upgrade"))
                {
                    upgrade = (string)userArgs["upgrade"];
                }
                else
                {
                    throw new Exception("You must specify a valid 'upgrade' value.");
                }

                foreach (var upg in Shiftorium.GetDefaults())
                {
                    if (upg.ID == upgrade)
                    {
                        Console.WriteLine($@"Information for {upgrade}:

{upg.Name} - {upg.Cost} Codepoints
------------------------------------------------------

{upg.Description}

To buy this upgrade, run:
shiftorium.buy{{upgrade:""{upg.ID}""}}");
                        return(true);
                    }
                }

                throw new Exception($"Couldn't find upgrade with ID: {upgrade}");
            } catch {
                return(false);
            }
        }