diff --git a/Projects/SupermarketTogether/SupermarketTogether/Class1.cs b/Projects/SupermarketTogether/SupermarketTogether/Class1.cs index 82ea705..e29769c 100644 --- a/Projects/SupermarketTogether/SupermarketTogether/Class1.cs +++ b/Projects/SupermarketTogether/SupermarketTogether/Class1.cs @@ -1,4 +1,7 @@ -using System.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; using BepInEx; using BepInEx.Configuration; using HarmonyLib; @@ -11,10 +14,10 @@ namespace CykaMod { private const string pluginName = "SupermarketTogether"; private const string pluginVersion = "1.0.0"; - public static ConfigEntry skillCap; + // public static ConfigEntry skillCap; public void Awake() { - skillCap = Config.Bind("General", "Skill Cap", 100f); + // skillCap = Config.Bind("General", "Skill Cap", 100f); Logger.LogInfo("Cyka mod loaded"); HarmonyFileLog.Enabled = true; @@ -24,4 +27,20 @@ namespace CykaMod { Logger.LogInfo("Patched " + originalMethods.Count() + " methods"); } } + + [HarmonyPatch(typeof(UpgradesManager), "ManageExtraPerks")] + public static class ConsoleProductionReductionPatch { + static IEnumerable Transpiler(IEnumerable instructions) { + var codes = new List(instructions); + + for (int i = 0; i < codes.Count; i++) { + if (codes[i].opcode == OpCodes.Ldc_I4_1) { + Console.WriteLine("Found Ldc_I4_1"); + codes[i].opcode = OpCodes.Ldc_I4_2; + } + } + + return codes.AsEnumerable(); + } + } } \ No newline at end of file