From eed75e919f76a9919470d6ea1ddb2d1c76949412 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sat, 17 May 2025 11:41:57 +0200 Subject: [PATCH] Multiply research --- .../BlacksmithMaster/BlacksmithMaster/Class1.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs b/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs index 5267070..33e6c33 100644 --- a/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs +++ b/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs @@ -16,6 +16,7 @@ namespace BlacksmithMaster { public static ConfigEntry xpMultiplier; public static ConfigEntry moneyMultiplier; + public static ConfigEntry researchMultiplier; public void Awake() { debug = Config.Bind("General", "Debug", false); @@ -26,6 +27,9 @@ namespace BlacksmithMaster { moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f, new ConfigDescription("Money Multiplier", new AcceptableValueRange(0.01f, 1024f))); + researchMultiplier = Config.Bind( + "General", "Research Multiplier", 1f, + new ConfigDescription("Research Multiplier", new AcceptableValueRange(0.01f, 1024f))); Logger.LogInfo("Cykasmith loaded"); HarmonyFileLog.Enabled = true; @@ -59,4 +63,14 @@ namespace BlacksmithMaster { Main.LogDebug("Modified money amount: " + value); } } + + [HarmonyPatch(typeof(ResourcesModel), "ChangeResearchPoints")] + public class ResourcesModel_ChangeResearchPoints { + public static void Prefix(ref int value) { + Main.LogDebug("Original research amount: " + value); + if (value > 0) + value = (int)((float)value * Main.researchMultiplier.Value); + Main.LogDebug("Modified research amount: " + value); + } + } }