diff --git a/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs b/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs index b456e04..e2c7182 100644 --- a/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs +++ b/Projects/BlacksmithMaster/BlacksmithMaster/Class1.cs @@ -4,6 +4,7 @@ using BepInEx; using BepInEx.Configuration; using HarmonyLib; using HarmonyLib.Tools; +using static TavernData; namespace BlacksmithMaster { [BepInPlugin(PluginGuid, PluginName, PluginVersion)] @@ -18,6 +19,7 @@ namespace BlacksmithMaster { public static ConfigEntry moneyMultiplier; public static ConfigEntry researchMultiplier; public static ConfigEntry salaryMultiplier; + public static ConfigEntry alwaysEvenly; public void Awake() { debug = Config.Bind("General", "Debug", false); @@ -31,9 +33,12 @@ 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))); + salaryMultiplier = + Config.Bind("General", "Salary Multiplier", 1f, + new ConfigDescription("Salary Multiplier", new AcceptableValueRange(0.01f, 1024f))); + alwaysEvenly = + Config.Bind("General", "Always Evenly", false, + new ConfigDescription("Always Evenly", new AcceptableValueRange(false, true))); Logger.LogInfo("Cykasmith loaded"); HarmonyFileLog.Enabled = true; @@ -78,7 +83,7 @@ namespace BlacksmithMaster { } } - [HarmonyPatch(typeof(StaffInfo), "get_Salary")] + [HarmonyPatch(typeof(StaffInfo), "Salary", MethodType.Getter)] public class StaffInfo_GetSalary { public static void Postfix(ref int __result) { Main.LogDebug("Original salary: " + __result); @@ -86,4 +91,12 @@ namespace BlacksmithMaster { Main.LogDebug("Modified salary: " + __result); } } + + [HarmonyPatch(typeof(StaffUtil), "FillBasicInfo")] + public class StaffUtil_FillBasicInfo { + public static void Postfix(TavernData.StaffType staffType, Random rnd, ref TavernData.StaffInfo newPerson) { + Main.LogDebug("Setting skill assignment strategy to evenly"); + newPerson.SkillAssignmentStrategy = TavernData.SkillAssignmentStrategyType.Balanced; + } + } }