diff options
author | Chase W <chasew@silkweaver.com> | 2017-06-03 10:25:49 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-06-04 16:22:36 -0400 |
commit | 57d20614b8dd3a6e468e81dafb611064119087ad (patch) | |
tree | 0bae9894f6253ea47c5b83136ed8116aba5ec3c5 /src/TrainerMod/TrainerMod.cs | |
parent | 36930ffd7d363d6afd7f8cac4918c7d1c1c3e339 (diff) | |
download | SMAPI-57d20614b8dd3a6e468e81dafb611064119087ad.tar.gz SMAPI-57d20614b8dd3a6e468e81dafb611064119087ad.tar.bz2 SMAPI-57d20614b8dd3a6e468e81dafb611064119087ad.zip |
Add player_addwallpaper and player_addflooring
Diffstat (limited to 'src/TrainerMod/TrainerMod.cs')
-rw-r--r-- | src/TrainerMod/TrainerMod.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/TrainerMod/TrainerMod.cs b/src/TrainerMod/TrainerMod.cs index 9a3a8d0b..0cafd51f 100644 --- a/src/TrainerMod/TrainerMod.cs +++ b/src/TrainerMod/TrainerMod.cs @@ -99,6 +99,8 @@ namespace TrainerMod .Add("player_additem", $"Gives the player an item.\n\nUsage: player_additem <item> [count] [quality]\n- item: the item ID (use the 'list_items' command to see a list).\n- count (optional): how many of the item to give.\n- quality (optional): one of {Object.lowQuality} (normal), {Object.medQuality} (silver), {Object.highQuality} (gold), or {Object.bestQuality} (iridium).", this.HandleCommand) .Add("player_addweapon", "Gives the player a weapon.\n\nUsage: player_addweapon <item>\n- item: the weapon ID (use the 'list_items' command to see a list).", this.HandleCommand) .Add("player_addring", "Gives the player a ring.\n\nUsage: player_addring <item>\n- item: the ring ID (use the 'list_items' command to see a list).", this.HandleCommand) + .Add("player_addwallpaper", "Gives the player a wallpaper.\n\nUsage: player_addwallpaper <wallpaper>\n- wallpaper: the wallpaper ID (ranges from 0 to 111).", this.HandleCommand) + .Add("player_addflooring", "Gives the player a flooring.\n\nUsage: player_addflooring <flooring>\n- flooring: the flooring ID (ranges from 0 to 39).", this.HandleCommand) .Add("list_items", "Lists and searches items in the game data.\n\nUsage: list_items [search]\n- search (optional): an arbitrary search string to filter by.", this.HandleCommand) @@ -709,6 +711,31 @@ namespace TrainerMod this.LogArgumentsInvalid(command); break; + case "player_addwallpaper": + case "player_addflooring": + if (args.Any()) + { + string type = command.Substring(10); + int wallpaperID; + if (int.TryParse(args[0], out wallpaperID)) + { + int upperID = type == "wallpaper" ? 111 : 39; + if (wallpaperID < 0 || wallpaperID > upperID) + this.Monitor.Log($"There is no such {type} ID (must be between 0 and {upperID}).", LogLevel.Error); + else + { + Wallpaper wallpaper = new Wallpaper(wallpaperID, type == "flooring" ); + Game1.player.addItemByMenuIfNecessary(wallpaper); + this.Monitor.Log($"OK, added {type} {wallpaperID} to your inventory.", LogLevel.Info); + } + } + else + this.Monitor.Log($"<{type}> is invalid", LogLevel.Error); + } + else + this.LogArgumentsInvalid(command); + break; + case "list_items": { var matches = this.GetItems(args).ToArray(); |