From fbe307281c10f886252c944b4d39095a00dd5930 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sat, 17 May 2025 12:07:45 +0200 Subject: [PATCH] Add salary multiplier --- .../BlacksmithMaster/BlacksmithMaster/Class1.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs b/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs index 33e6c33..b456e04 100644 --- a/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs +++ b/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs @@ -17,6 +17,7 @@ namespace BlacksmithMaster { public static ConfigEntry xpMultiplier; public static ConfigEntry moneyMultiplier; public static ConfigEntry researchMultiplier; + public static ConfigEntry salaryMultiplier; public void Awake() { debug = Config.Bind("General", "Debug", false); @@ -30,6 +31,9 @@ namespace BlacksmithMaster { researchMultiplier = Config.Bind( "General", "Research Multiplier", 1f, new ConfigDescription("Research Multiplier", new AcceptableValueRange(0.01f, 1024f))); + salaryMultiplier = Config.Bind( + "General", "Salary Multiplier", 1f, + new ConfigDescription("Salary Multiplier", new AcceptableValueRange(0.01f, 1024f))); Logger.LogInfo("Cykasmith loaded"); HarmonyFileLog.Enabled = true; @@ -73,4 +77,13 @@ namespace BlacksmithMaster { Main.LogDebug("Modified research amount: " + value); } } + + [HarmonyPatch(typeof(StaffInfo), "get_Salary")] + public class StaffInfo_GetSalary { + public static void Postfix(ref int __result) { + Main.LogDebug("Original salary: " + __result); + __result = (int)((float)__result * Main.salaryMultiplier.Value); + Main.LogDebug("Modified salary: " + __result); + } + } }