From 57bc4aa552c3a20adb62c7b9a8222764e0dd8243 Mon Sep 17 00:00:00 2001 From: Zoryn Aaron Date: Mon, 29 Feb 2016 05:21:45 -0500 Subject: [PATCH] commands im tired --- .gitignore | 2 + Release/StardewModdingAPI.exe | Bin 49664 -> 52736 bytes StardewModdingAPI/Program.cs | 113 ++++++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+) diff --git a/.gitignore b/.gitignore index 439aa86b..00cc0c56 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ StardewModdingAPI/bin/ StardewModdingAPI/obj/ +*.symlink +*.lnk !*.exe !*.dll \ No newline at end of file diff --git a/Release/StardewModdingAPI.exe b/Release/StardewModdingAPI.exe index 3167a40b5840f4514ec6a85a9f455d0a9c762d3a..21f3c99eb866942490dc582ac94ee1d5c362a428 100644 GIT binary patch delta 9472 zcmcIqd3;pWz5ks%GdIZ)Le|MlX3Y$NAz?y75+o4`J4Asb1X)BL1Tw}*$iQS{5r(+c zQ1ltErGSEnNR?7B23aavsJQjnC%Dw2h}i0@D?%&PpbhVP&b^aN0BQed!{>hQ`Tq8E z&hIX{Va;8-HIL{XxYu21eR~FJKc`7zeOMo&XCO#Zg>lE*cFu^~dyHr%7n~+KW@<}M z?!zb+^!7K1Y)ZN`SeeZR8k5^0a^ZMJS5?xhd-QAB$&MmJadOrP?j8KlKub*bAqMll&jsG$M8?2q!0K$c`jV2n zdyC`$YjRk8?Y2U@aFM;Uk-1M) z;3i&WPB_me%A2-pOu|A_<%U)Nr#S6vFz>DQtxP(v?-=7W=|bjIT9SHS9%gQoO~JKb z+hngE)nLYN;#4042w-KfN(Z0~{;`+C1aqXrTbDS@fHrs=peI9ROr*oxH(uiL4EK2X zDjx4#;^45rp$O2EVy{KH)on{Lr9m?s(4*Ourfh^}kQJJ-fF8|3tMWT&bT()_fF8{b zoASNe>JOUiP>lrisCv)k50_N7g*zPWQEo6&p{ZTqw;!&Gxjv5 zfMi+GlX{DjpJ)`I`Xf&y5le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>9Jd zRMRH;W7K~}C6o^ag^}U3l74DD3w$yI^pO25b`+<4jhL+b3DKi8A!aHg=mE%6%1I55 z{zqdC9j$D{vL+}dQ-NOAJf+AqoNiZ2U^x8Tc-YK;tN5g7-~yxDNUutsman=I>)}3a&$|4 zBd1Db`fNSzPwgTF=&w?TOZnoZA|Lq6#6Wl<^%@xnb5fs1oxf1z!vL1TL*mIG zV^Rz3*_&h~KH6E}7=h!3UMcK#0yhe!PS}kCF9>B!GH+Wca2+BWIn0}}&c($#fsF#e z%@wb}&H~47X0xh2};1yI!2KL@{piTL?{N#JFegv!^56t2Kzw67vk_y(q;eGL)c z18^!A&=vHYp~^^2Ii{ngVs>t1K5Zyv@uQxjH{ERJsGcqAp`Fy9w37yscHxtw3asJL zQ;)`_m$fVC(j`z@mQz&Jr7)+UFuyP-&?V44r+ZoZ;%=qgi;4={1z7LUNtRpnM)Fa1z`13bjBMHa1_CB@g>Ev#!YJZ+_^@pbd;mWN|rcC^Cz*6-T{wNV2 z@4+v`1`_Xfo1zG6CLqKzRRR)kshSWj+|!5P-q8QUgVO ", new[] { "(hair, eyes, pants) (r,g,b)" }).CommandFired += player_changeColour; Command.RegisterCommand("player_changestyle", "Sets the player's style of the specified object | player_changecolor ", new[] { "(hair, shirt, skin, acc, shoe, swim, gender) (Int32)" }).CommandFired += player_changeStyle; + Command.RegisterCommand("player_additem", "Gives the player an item | player_additem ", new[] { "? (Int32)" }).CommandFired += player_addItem; + Command.RegisterCommand("player_addmelee", "Gives the player a melee item | player_addmelee ", new[] { "?" }).CommandFired += player_addMelee; + + Command.RegisterCommand("out_items", "Outputs a list of items | out_items", new[] { "" }).CommandFired += out_items; + Command.RegisterCommand("out_melee", "Outputs a list of melee weapons | out_melee", new[] { "" }).CommandFired += out_melee; + Command.RegisterCommand("world_settime", "Sets the time to the specified value | world_settime ", new[] { "(Int32) The target time [06:00 AM is 600]" }).CommandFired += world_setTime; Command.RegisterCommand("world_freezetime", "Freezes or thaws time | world_freezetime ", new[] { "(0 - 1) Whether or not to freeze time. 0 is thawed, 1 is frozen" }).CommandFired += world_freezeTime; Command.RegisterCommand("world_setday", "Sets the day to the specified value | world_setday ", new[] { "(Int32) The target day [1-28]" }).CommandFired += world_setDay; Command.RegisterCommand("world_setseason", "Sets the season to the specified value | world_setseason ", new[] { "(winter, spring, summer, fall) The target season" }).CommandFired += world_setSeason; + Command.RegisterCommand("world_downminelevel", "Goes down one mine level? | world_downminelevel", new[] { "" }).CommandFired += world_downMineLevel; + Command.RegisterCommand("world_setminelevel", "Sets mine level? | world_setminelevel", new[] { "(Int32) The target level" }).CommandFired += world_setMineLevel; } static void help_CommandFired(Command cmd) @@ -738,6 +748,109 @@ namespace StardewModdingAPI } } + static void player_addItem(Command cmd) + { + if (cmd.CalledArgs.Length > 0) + { + if (cmd.CalledArgs[0].IsInt32()) + { + int count = 1; + if (cmd.CalledArgs.Length > 1) + { + if (cmd.CalledArgs[1].IsInt32()) + { + count = cmd.CalledArgs[1].AsInt32(); + } + else + { + LogError(" is invalid"); + return; + } + } + Game1.player.addItemByMenuIfNecessary((Item) new StardewValley.Object(cmd.CalledArgs[0].AsInt32(), count)); + } + else + { + LogError(" is invalid"); + } + } + else + { + LogObjectValueNotSpecified(); + } + } + + static void player_addMelee(Command cmd) + { + if (cmd.CalledArgs.Length > 0) + { + if (cmd.CalledArgs[0].IsInt32()) + { + MeleeWeapon toAdd = new MeleeWeapon(cmd.CalledArgs[0].AsInt32()); + Game1.player.addItemByMenuIfNecessary(toAdd); + LogInfo("Given {0} to {1}", toAdd.Name, Game1.player.Name); + } + else + { + LogError(" is invalid"); + } + } + else + { + LogObjectValueNotSpecified(); + } + } + + static void out_items(Command cmd) + { + for (int i = 0; i < 1000; i++) + { + try + { + Item it = new StardewValley.Object(i, 1); + Console.WriteLine(i + "| " + it.Name); + } + catch + { + + } + } + } + + static void out_melee(Command cmd) + { + Dictionary d = Game1.content.Load>("Data\\weapons"); + Console.Write("DATA\\WEAPONS: "); + foreach (var v in d) + { + Console.WriteLine(v.Key + " | " + v.Value); + } + } + + static void world_downMineLevel(Command cmd) + { + Game1.nextMineLevel(); + } + + static void world_setMineLevel(Command cmd) + { + if (cmd.CalledArgs.Length > 0) + { + if (cmd.CalledArgs[0].IsInt32()) + { + Game1.enterMine(true, cmd.CalledArgs[0].AsInt32(), ""); + } + else + { + LogValueNotInt32(); + } + } + else + { + LogValueNotSpecified(); + } + } + static void blank_command(Command cmd) { } #endregion