diff --git a/Projects/WeedShop3/WeedShop.sln b/Projects/WeedShop3/WeedShop.sln new file mode 100644 index 0000000..d17afae --- /dev/null +++ b/Projects/WeedShop3/WeedShop.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeedShop", "WeedShop\WeedShop.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Projects/WeedShop3/WeedShop.sln.DotSettings.user b/Projects/WeedShop3/WeedShop.sln.DotSettings.user new file mode 100644 index 0000000..d3b7dce --- /dev/null +++ b/Projects/WeedShop3/WeedShop.sln.DotSettings.user @@ -0,0 +1,8 @@ + + True + True + True + True + True + True + True \ No newline at end of file diff --git a/Projects/WeedShop3/WeedShop/Class1.cs b/Projects/WeedShop3/WeedShop/Class1.cs new file mode 100644 index 0000000..a941c45 --- /dev/null +++ b/Projects/WeedShop3/WeedShop/Class1.cs @@ -0,0 +1,50 @@ +using System.Linq; +using almost; +using almost.WF; +using BepInEx; +using BepInEx.Configuration; +using com.ootii.Messages; +using HarmonyLib; +using HarmonyLib.Tools; +using MeshCombineStudio; + +namespace WeedShop { + [BepInPlugin(pluginGuid, pluginName, pluginVersion)] + public class Main : BaseUnityPlugin { + private const string pluginGuid = "CykaMod"; + private const string pluginName = "CykaMod"; + private const string pluginVersion = "1.0.0"; + + public static ConfigEntry moneyMultiplier; + public static ConfigEntry weedQuantityMultiplier; + public static ConfigEntry weedQualityMultiplier; + + public void Awake() { + moneyMultiplier = Config.Bind("General", "Money Multiplier", 2f, new ConfigDescription("Money Multiplier", new AcceptableValueRange(2f, 32f))); + weedQuantityMultiplier = Config.Bind("General", "Weed Quantity Multiplier", 2f, new ConfigDescription("Weed Quantity Multiplier", new AcceptableValueRange(2f, 8f))); + weedQualityMultiplier = Config.Bind("General", "Weed Quality Multiplier", 1.5f, new ConfigDescription("Weed Quality Multiplier", new AcceptableValueRange(1.5f, 8f))); + + Logger.LogInfo("Cyka mod loaded"); + HarmonyFileLog.Enabled = true; + Harmony harmony = new Harmony(pluginGuid); + harmony.PatchAll(); + var originalMethods = harmony.GetPatchedMethods(); + Logger.LogInfo("Patched " + originalMethods.Count() + " methods"); + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(WeedFactory), "OnMakeMoney")] + private void OnMakeMoney(ref IMessage message) { + Console.Log("OnMakeMoney " + message.Data); + message.Data = (long)message.Data * moneyMultiplier.Value; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(ShopInventory), "AddWeed")] + public virtual void AddWeed(BI item, ref float rawQuality, ref int quantity) { + Console.Log("AddWeed " + item + " " + rawQuality + " " + quantity); + quantity = (int)(quantity * weedQuantityMultiplier.Value); + rawQuality *= weedQualityMultiplier.Value; + } + } +} \ No newline at end of file diff --git a/Projects/WeedShop3/WeedShop/Properties/AssemblyInfo.cs b/Projects/WeedShop3/WeedShop/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ca6f22b --- /dev/null +++ b/Projects/WeedShop3/WeedShop/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TerraTech")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TerraTech")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Projects/WeedShop3/WeedShop/WeedShop.csproj b/Projects/WeedShop3/WeedShop/WeedShop.csproj new file mode 100644 index 0000000..336c4fb --- /dev/null +++ b/Projects/WeedShop3/WeedShop/WeedShop.csproj @@ -0,0 +1,69 @@ + + + + + Debug + AnyCPU + {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE} + Library + Properties + TerraTech + TerraTech + v4.8 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + ..\libs\0Harmony.dll + + + ..\libs\Assembly-CSharp.dll + + + ..\libs\BepInEx.dll + + + ..\libs\ConfigurationManager.dll + + + ..\libs\ootii.dll + + + ..\libs\UnityEngine.dll + + + ..\libs\UnityEngine.CoreModule.dll + + + + + \ No newline at end of file