示例#1
0
 private static void save_CommandFired(object sender, EventArgsCommand e)
 {
     SaveGame.Save();
 }
示例#2
0
 private static void load_CommandFired(object sender, EventArgsCommand e)
 {
     Game1.hasLoadedGame = false;
     Game1.activeClickableMenu = new LoadGameMenu();
 }
示例#3
0
 private static void RegisterNewItem(object sender, EventArgsCommand e)
 {
     #if DEBUG
     SObject s = SGame.PullModItemFromDict(0, true);
     s.Stack = 999;
     Game1.player.addItemToInventory(s);
     #endif
 }
示例#4
0
 private static void world_setSeason(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 0)
     {
         var obj = e.Command.CalledArgs[0];
         var objs = "winter,spring,summer,fall".Split(',');
         if (objs.Contains(obj))
         {
             Game1.currentSeason = obj;
         }
         else
         {
             Log.LogValueInvalid();
         }
     }
     else
     {
         Log.LogValueNotSpecified();
     }
 }
示例#5
0
 private static void blank_command(object sender, EventArgsCommand e)
 {
 }
示例#6
0
 private static void world_downMineLevel(object sender, EventArgsCommand e)
 {
     Game1.nextMineLevel();
 }
示例#7
0
 private static void world_setDay(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 0)
     {
         if (e.Command.CalledArgs[0].IsInt32())
         {
             if (e.Command.CalledArgs[0].AsInt32() <= 28 && e.Command.CalledArgs[0].AsInt32() > 0)
             {
                 Game1.dayOfMonth = e.Command.CalledArgs[0].AsInt32();
             }
             else
             {
                 Log.AsyncY("<value> must be between 1 and 28");
             }
         }
         else
         {
             Log.LogValueNotInt32();
         }
     }
     else
     {
         Log.LogValueNotSpecified();
     }
 }
示例#8
0
 private static void player_changeStyle(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 1)
     {
         var obj = e.Command.CalledArgs[0];
         var objs = "hair,shirt,skin,acc,shoe,swim,gender".Split(',');
         if (objs.Contains(obj))
         {
             if (e.Command.CalledArgs[1].IsInt32())
             {
                 var i = e.Command.CalledArgs[1].AsInt32();
                 switch (obj)
                 {
                     case "hair":
                         Game1.player.changeHairStyle(i);
                         break;
                     case "shirt":
                         Game1.player.changeShirt(i);
                         break;
                     case "acc":
                         Game1.player.changeAccessory(i);
                         break;
                     case "skin":
                         Game1.player.changeSkinColor(i);
                         break;
                     case "shoe":
                         Game1.player.changeShoeColor(i);
                         break;
                     case "swim":
                         if (i == 0)
                             Game1.player.changeOutOfSwimSuit();
                         else if (i == 1)
                             Game1.player.changeIntoSwimsuit();
                         else
                             Log.AsyncR("<value> must be 0 or 1 for this <object>");
                         break;
                     case "gender":
                         if (i == 0)
                             Game1.player.changeGender(true);
                         else if (i == 1)
                             Game1.player.changeGender(false);
                         else
                             Log.AsyncR("<value> must be 0 or 1 for this <object>");
                         break;
                 }
             }
             else
             {
                 Log.LogValueInvalid();
             }
         }
         else
         {
             Log.LogObjectInvalid();
         }
     }
     else
     {
         Log.LogObjectValueNotSpecified();
     }
 }
示例#9
0
 private static void player_setHealth(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 0)
     {
         if (e.Command.CalledArgs[0] == "inf")
         {
             infHealth = true;
         }
         else
         {
             infHealth = false;
             if (e.Command.CalledArgs[0].IsInt32())
             {
                 Game1.player.health = e.Command.CalledArgs[0].AsInt32();
             }
             else
             {
                 Log.LogValueNotInt32();
             }
         }
     }
     else
     {
         Log.LogValueNotSpecified();
     }
 }
示例#10
0
 private static void player_addRing(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 0)
     {
         if (e.Command.CalledArgs[0].IsInt32())
         {
             var toAdd = new Ring(e.Command.CalledArgs[0].AsInt32());
             Game1.player.addItemByMenuIfNecessary(toAdd);
             Log.Async($"Given {toAdd.Name} to {Game1.player.Name}");
         }
         else
         {
             Log.AsyncR("<item> is invalid");
         }
     }
     else
     {
         Log.LogObjectValueNotSpecified();
     }
 }
示例#11
0
 private static void player_changeColour(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 1)
     {
         var obj = e.Command.CalledArgs[0];
         var objs = "hair,eyes,pants".Split(',');
         if (objs.Contains(obj))
         {
             var cs = e.Command.CalledArgs[1].Split(new[] {','}, 3);
             if (cs[0].IsInt32() && cs[1].IsInt32() && cs[2].IsInt32())
             {
                 var c = new Color(cs[0].AsInt32(), cs[1].AsInt32(), cs[2].AsInt32());
                 switch (obj)
                 {
                     case "hair":
                         Game1.player.hairstyleColor = c;
                         break;
                     case "eyes":
                         Game1.player.changeEyeColor(c);
                         break;
                     case "pants":
                         Game1.player.pantsColor = c;
                         break;
                 }
             }
             else
             {
                 Log.AsyncR("<colour> is invalid");
             }
         }
         else
         {
             Log.LogObjectInvalid();
         }
     }
     else
     {
         Log.AsyncR("<object> and <colour> must be specified");
     }
 }
示例#12
0
        private static void player_addItem(object sender, EventArgsCommand e)
        {
            if (e.Command.CalledArgs.Length > 0)
            {
                if (e.Command.CalledArgs[0].IsInt32())
                {
                    var count = 1;
                    var quality = 0;
                    if (e.Command.CalledArgs.Length > 1)
                    {
                        Console.WriteLine(e.Command.CalledArgs[1]);
                        if (e.Command.CalledArgs[1].IsInt32())
                        {
                            count = e.Command.CalledArgs[1].AsInt32();
                        }
                        else
                        {
                            Log.AsyncR("[count] is invalid");
                            return;
                        }

                        if (e.Command.CalledArgs.Length > 2)
                        {
                            if (e.Command.CalledArgs[2].IsInt32())
                            {
                                quality = e.Command.CalledArgs[2].AsInt32();
                            }
                            else
                            {
                                Log.AsyncR("[quality] is invalid");
                                return;
                            }
                        }
                    }

                    var o = new Object(e.Command.CalledArgs[0].AsInt32(), count) {quality = quality};

                    Game1.player.addItemByMenuIfNecessary(o);
                }
                else
                {
                    Log.AsyncR("<item> is invalid");
                }
            }
            else
            {
                Log.LogObjectValueNotSpecified();
            }
        }
示例#13
0
 private static void out_rings(object sender, EventArgsCommand e)
 {
     for (var i = 0; i < 100; i++)
     {
         try
         {
             Item it = new Ring(i);
             if (it.Name != "Error Item")
                 Console.WriteLine(i + "| " + it.Name);
         }
         catch
         {
         }
     }
 }
示例#14
0
 private static void out_melee(object sender, EventArgsCommand e)
 {
     var d = Game1.content.Load<Dictionary<int, string>>("Data\\weapons");
     Console.Write("DATA\\WEAPONS: ");
     foreach (var v in d)
     {
         Console.WriteLine(v.Key + " | " + v.Value);
     }
 }
示例#15
0
 private static void show_CommandFired(object sender, EventArgsCommand e)
 {
     Program.StardewInvoke(() => { Program.StardewForm.Show(); });
 }
示例#16
0
 private static void player_setLevel(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 1)
     {
         var skill = e.Command.CalledArgs[0];
         var skills = "luck,mining,combat,farming,fishing,foraging".Split(',');
         if (skills.Contains(skill))
         {
             var ou = 0;
             if (int.TryParse(e.Command.CalledArgs[1], out ou))
             {
                 switch (skill)
                 {
                     case "luck":
                         Game1.player.LuckLevel = ou;
                         break;
                     case "mining":
                         Game1.player.MiningLevel = ou;
                         break;
                     case "combat":
                         Game1.player.CombatLevel = ou;
                         break;
                     case "farming":
                         Game1.player.FarmingLevel = ou;
                         break;
                     case "fishing":
                         Game1.player.FishingLevel = ou;
                         break;
                     case "foraging":
                         Game1.player.ForagingLevel = ou;
                         break;
                 }
             }
             else
             {
                 Log.LogValueNotInt32();
             }
         }
         else
         {
             Log.AsyncR("<skill> is invalid");
         }
     }
     else
     {
         Log.AsyncR("<skill> and <value> must be specified");
     }
 }
示例#17
0
 private static void types_CommandFired(object sender, EventArgsCommand e)
 {
     Log.AsyncY($"[Int32: {int.MinValue} - {int.MaxValue}], [Int64: {long.MinValue} - {long.MaxValue}], [String: \"raw text\"], [Colour: r,g,b (EG: 128, 32, 255)]");
 }
示例#18
0
 private static void player_setMaxHealth(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 0)
     {
         if (e.Command.CalledArgs[0].IsInt32())
         {
             Game1.player.maxHealth = e.Command.CalledArgs[0].AsInt32();
         }
         else
         {
             Log.LogValueNotInt32();
         }
     }
     else
     {
         Log.LogValueNotSpecified();
     }
 }
示例#19
0
 private static void world_freezeTime(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 0)
     {
         if (e.Command.CalledArgs[0].IsInt32())
         {
             if (e.Command.CalledArgs[0].AsInt32() == 0 || e.Command.CalledArgs[0].AsInt32() == 1)
             {
                 freezeTime = e.Command.CalledArgs[0].AsInt32() == 1;
                 frozenTime = freezeTime ? Game1.timeOfDay : 0;
                 Log.AsyncY("Time is now " + (freezeTime ? "frozen" : "thawed"));
             }
             else
             {
                 Log.AsyncR("<value> should be 0 or 1");
             }
         }
         else
         {
             Log.LogValueNotInt32();
         }
     }
     else
     {
         Log.LogValueNotSpecified();
     }
 }
示例#20
0
 private static void player_setName(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 1)
     {
         var obj = e.Command.CalledArgs[0];
         var objs = "player,pet,farm".Split(',');
         if (objs.Contains(obj))
         {
             switch (obj)
             {
                 case "player":
                     Game1.player.Name = e.Command.CalledArgs[1];
                     break;
                 case "pet":
                     Log.AsyncR("Pets cannot currently be renamed.");
                     break;
                 case "farm":
                     Game1.player.farmName = e.Command.CalledArgs[1];
                     break;
             }
         }
         else
         {
             Log.LogObjectInvalid();
         }
     }
     else
     {
         Log.LogObjectValueNotSpecified();
     }
 }
示例#21
0
 private static void world_setMineLevel(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 0)
     {
         if (e.Command.CalledArgs[0].IsInt32())
         {
             Game1.enterMine(true, e.Command.CalledArgs[0].AsInt32(), "");
         }
         else
         {
             Log.LogValueNotInt32();
         }
     }
     else
     {
         Log.LogValueNotSpecified();
     }
 }
示例#22
0
 private static void player_setSpeed(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 0)
     {
         if (e.Command.CalledArgs[0].IsInt32())
         {
             Game1.player.addedSpeed = e.Command.CalledArgs[0].AsInt32();
             Log.Async($"Set {Game1.player.Name}'s added speed to {Game1.player.addedSpeed}");
         }
         else
         {
             Log.LogValueNotInt32();
         }
     }
     else
     {
         Log.LogValueNotSpecified();
     }
 }
示例#23
0
 private static void world_setTime(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 0)
     {
         if (e.Command.CalledArgs[0].IsInt32())
         {
             if (e.Command.CalledArgs[0].AsInt32() <= 2600 && e.Command.CalledArgs[0].AsInt32() >= 600)
             {
                 Game1.timeOfDay = e.Command.CalledArgs[0].AsInt32();
                 frozenTime = freezeTime ? Game1.timeOfDay : 0;
                 Log.AsyncY("Time set to: " + Game1.timeOfDay);
             }
             else
             {
                 Log.AsyncR("<value> should be between 600 and 2600 (06:00 AM - 02:00 AM [NEXT DAY])");
             }
         }
         else
         {
             Log.LogValueNotInt32();
         }
     }
     else
     {
         Log.LogValueNotSpecified();
     }
 }
示例#24
0
 private static void player_setStamina(object sender, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 0)
     {
         if (e.Command.CalledArgs[0] == "inf")
         {
             infStamina = true;
         }
         else
         {
             infStamina = false;
             var ou = 0;
             if (int.TryParse(e.Command.CalledArgs[0], out ou))
             {
                 Game1.player.Stamina = ou;
                 Log.Async($"Set {Game1.player.Name}'s stamina to {Game1.player.Stamina}");
             }
             else
             {
                 Log.LogValueNotInt32();
             }
         }
     }
     else
     {
         Log.LogValueNotSpecified();
     }
 }
示例#25
0
 private static void help_CommandFired(object o, EventArgsCommand e)
 {
     if (e.Command.CalledArgs.Length > 0)
     {
         var fnd = Command.FindCommand(e.Command.CalledArgs[0]);
         if (fnd == null)
             Log.AsyncR("The command specified could not be found");
         else
         {
             Log.AsyncY(fnd.CommandArgs.Length > 0 ? $"{fnd.CommandName}: {fnd.CommandDesc} - {fnd.CommandArgs.ToSingular()}" : $"{fnd.CommandName}: {fnd.CommandDesc}");
         }
     }
     else
         Log.AsyncY("Commands: " + Command.RegisteredCommands.Select(x => x.CommandName).ToSingular());
 }
示例#26
0
 private static void exit_CommandFired(object sender, EventArgsCommand e)
 {
     Program.gamePtr.Exit();
     Environment.Exit(0);
 }