From 900c804c29b6dcedef158d3b36fcebb7846e8a16 Mon Sep 17 00:00:00 2001 From: Zoryn Aaron Date: Wed, 2 Mar 2016 12:24:15 -0500 Subject: update for new event and other crap --- TrainerMod/bin/Debug/TrainerMod.dll | Bin 23040 -> 23040 bytes TrainerMod/obj/Debug/TrainerMod.dll | Bin 23040 -> 23040 bytes 2 files changed, 0 insertions(+), 0 deletions(-) (limited to 'TrainerMod') diff --git a/TrainerMod/bin/Debug/TrainerMod.dll b/TrainerMod/bin/Debug/TrainerMod.dll index 790f0444..4552ec76 100644 Binary files a/TrainerMod/bin/Debug/TrainerMod.dll and b/TrainerMod/bin/Debug/TrainerMod.dll differ diff --git a/TrainerMod/obj/Debug/TrainerMod.dll b/TrainerMod/obj/Debug/TrainerMod.dll index 790f0444..4552ec76 100644 Binary files a/TrainerMod/obj/Debug/TrainerMod.dll and b/TrainerMod/obj/Debug/TrainerMod.dll differ -- cgit From 10a800f456fe865fdefb07e954d85d1753c2bbf7 Mon Sep 17 00:00:00 2001 From: Zoryn Aaron Date: Wed, 2 Mar 2016 16:25:23 -0500 Subject: add quality param to additem --- TrainerMod/TrainerMod.cs | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'TrainerMod') diff --git a/TrainerMod/TrainerMod.cs b/TrainerMod/TrainerMod.cs index 6e1b4b17..250ccab5 100644 --- a/TrainerMod/TrainerMod.cs +++ b/TrainerMod/TrainerMod.cs @@ -90,7 +90,7 @@ namespace TrainerMod Command.RegisterCommand("player_changecolour", "Sets the player's colour of the specified object | player_changecolor ", 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_additem", "Gives the player an item | player_additem [count] [quality]", new[] { "(Int32) (Int32)[count] (Int32)[quality]" }).CommandFired += player_addItem; Command.RegisterCommand("player_addmelee", "Gives the player a melee item | player_addmelee ", new[] { "?" }).CommandFired += player_addMelee; Command.RegisterCommand("player_addring", "Gives the player a ring | player_addring ", new[] { "?" }).CommandFired += player_addRing; @@ -596,6 +596,7 @@ namespace TrainerMod if (cmd.CalledArgs[0].IsInt32()) { int count = 1; + int quality = 0; if (cmd.CalledArgs.Length > 1) { if (cmd.CalledArgs[1].IsInt32()) @@ -604,13 +605,29 @@ namespace TrainerMod } else { - Program.LogError(" is invalid"); + Program.LogError("[count] is invalid"); return; } + + if (cmd.CalledArgs.Length > 2) + { + if (cmd.CalledArgs[2].IsInt32()) + { + quality = cmd.CalledArgs[2].AsInt32(); + } + else + { + Program.LogError("[quality] is invalid"); + return; + } + + } } - Item i = (Item) new StardewValley.Object(cmd.CalledArgs[0].AsInt32(), count); - - Game1.player.addItemByMenuIfNecessary(i); + + StardewValley.Object o = new StardewValley.Object(cmd.CalledArgs[0].AsInt32(), count); + o.quality = quality; + + Game1.player.addItemByMenuIfNecessary((Item)o); } else { @@ -739,7 +756,9 @@ namespace TrainerMod static void RegisterNewItem(Command cmd) { - Game1.player.addItemToInventory(SGame.PullModItemFromDict(0, true)); + SObject s = SGame.PullModItemFromDict(0, true); + s.Stack = 999; + Game1.player.addItemToInventory(s); } } } -- cgit From 47fecbd81eeecd9244ee2384f99bc224d5475029 Mon Sep 17 00:00:00 2001 From: Zoryn Aaron Date: Wed, 2 Mar 2016 22:54:37 -0500 Subject: more events --- TrainerMod/TrainerMod.cs | 5 +++++ TrainerMod/bin/Debug/TrainerMod.dll | Bin 23040 -> 23040 bytes TrainerMod/obj/Debug/TrainerMod.dll | Bin 23040 -> 23040 bytes 3 files changed, 5 insertions(+) (limited to 'TrainerMod') diff --git a/TrainerMod/TrainerMod.cs b/TrainerMod/TrainerMod.cs index 250ccab5..a9896aac 100644 --- a/TrainerMod/TrainerMod.cs +++ b/TrainerMod/TrainerMod.cs @@ -46,6 +46,9 @@ namespace TrainerMod static void Events_UpdateTick() { + if (Game1.player == null) + return; + if (infHealth) { Game1.player.health = Game1.player.maxHealth; @@ -756,6 +759,8 @@ namespace TrainerMod static void RegisterNewItem(Command cmd) { + if (!Program.debug) + return; SObject s = SGame.PullModItemFromDict(0, true); s.Stack = 999; Game1.player.addItemToInventory(s); diff --git a/TrainerMod/bin/Debug/TrainerMod.dll b/TrainerMod/bin/Debug/TrainerMod.dll index 4552ec76..2ca9ad54 100644 Binary files a/TrainerMod/bin/Debug/TrainerMod.dll and b/TrainerMod/bin/Debug/TrainerMod.dll differ diff --git a/TrainerMod/obj/Debug/TrainerMod.dll b/TrainerMod/obj/Debug/TrainerMod.dll index 4552ec76..2ca9ad54 100644 Binary files a/TrainerMod/obj/Debug/TrainerMod.dll and b/TrainerMod/obj/Debug/TrainerMod.dll differ -- cgit From 250559d227fa3a8148ad97d75a725ed0a47a0f4f Mon Sep 17 00:00:00 2001 From: Zoryn Aaron Date: Wed, 2 Mar 2016 23:38:51 -0500 Subject: we can have more than 2 args in a command, c'mon brain --- TrainerMod/TrainerMod.cs | 1 + TrainerMod/bin/Debug/TrainerMod.dll | Bin 23040 -> 23552 bytes TrainerMod/obj/Debug/TrainerMod.dll | Bin 23040 -> 23552 bytes 3 files changed, 1 insertion(+) (limited to 'TrainerMod') diff --git a/TrainerMod/TrainerMod.cs b/TrainerMod/TrainerMod.cs index a9896aac..86b03673 100644 --- a/TrainerMod/TrainerMod.cs +++ b/TrainerMod/TrainerMod.cs @@ -602,6 +602,7 @@ namespace TrainerMod int quality = 0; if (cmd.CalledArgs.Length > 1) { + Console.WriteLine(cmd.CalledArgs[1]); if (cmd.CalledArgs[1].IsInt32()) { count = cmd.CalledArgs[1].AsInt32(); diff --git a/TrainerMod/bin/Debug/TrainerMod.dll b/TrainerMod/bin/Debug/TrainerMod.dll index 2ca9ad54..9fc10782 100644 Binary files a/TrainerMod/bin/Debug/TrainerMod.dll and b/TrainerMod/bin/Debug/TrainerMod.dll differ diff --git a/TrainerMod/obj/Debug/TrainerMod.dll b/TrainerMod/obj/Debug/TrainerMod.dll index 2ca9ad54..9fc10782 100644 Binary files a/TrainerMod/obj/Debug/TrainerMod.dll and b/TrainerMod/obj/Debug/TrainerMod.dll differ -- cgit