Always level skills evenly

This commit is contained in:
2025-05-17 12:38:17 +02:00
parent fbe307281c
commit 402909f3fd

View File

@@ -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<float> moneyMultiplier;
public static ConfigEntry<float> researchMultiplier;
public static ConfigEntry<float> salaryMultiplier;
public static ConfigEntry<bool> 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<float>(0.01f, 1024f)));
salaryMultiplier = Config.Bind(
"General", "Salary Multiplier", 1f,
new ConfigDescription("Salary Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
salaryMultiplier =
Config.Bind("General", "Salary Multiplier", 1f,
new ConfigDescription("Salary Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
alwaysEvenly =
Config.Bind("General", "Always Evenly", false,
new ConfigDescription("Always Evenly", new AcceptableValueRange<bool>(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;
}
}
}