From f72fcee86c1b956343e46cc629e199f19dded6fc Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sat, 17 May 2025 13:17:01 +0200 Subject: [PATCH] Add hiring cost multiplier and patch for cost calculation --- .../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 89b27ac..ad1e654 100644 --- a/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs +++ b/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs @@ -25,6 +25,7 @@ namespace BlacksmithMaster { public static ConfigEntry decorationAdditionOffset; public static ConfigEntry globalSpeedMultiplier; public static ConfigEntry globalSpeedOffset; + public static ConfigEntry hiringCostMultiplier; public static ConfigEntry alwaysEvenly; public static ConfigEntry alwaysChad; @@ -61,6 +62,9 @@ namespace BlacksmithMaster { globalSpeedOffset = Config.Bind( "General", "Global Speed Offset", 0f, new ConfigDescription("Global Speed Offset", new AcceptableValueRange(-1024f, 1024f))); + hiringCostMultiplier = Config.Bind( + "General", "Hiring Cost Multiplier", 1f, + new ConfigDescription("Hiring Cost Multiplier", new AcceptableValueRange(0.01f, 1024f))); alwaysEvenly = Config.Bind("General", "Always Evenly", false, new ConfigDescription("Always Evenly", new AcceptableValueRange(false, true))); @@ -146,6 +150,15 @@ namespace BlacksmithMaster { } } + [HarmonyPatch(typeof(StaffModel), "GetCostToHire")] + public class StaffModel_GetCostToHire { + public static void Postfix(ref int __result) { + Main.LogDebug("Original hiring cost: " + __result); + __result = (int)(__result * Main.hiringCostMultiplier.Value); + Main.LogDebug("Modified hiring cost: " + __result); + } + } + [HarmonyPatch(typeof(StaffUtil), "FillBasicInfo")] public class StaffUtil_FillBasicInfo { public static void Postfix(TavernData.StaffType staffType, Random rnd, ref TavernData.StaffInfo newPerson) {