Make always chads

This commit is contained in:
2025-05-17 12:47:58 +02:00
parent 402909f3fd
commit dcf88a498e

View File

@@ -20,6 +20,7 @@ namespace BlacksmithMaster {
public static ConfigEntry<float> researchMultiplier; public static ConfigEntry<float> researchMultiplier;
public static ConfigEntry<float> salaryMultiplier; public static ConfigEntry<float> salaryMultiplier;
public static ConfigEntry<bool> alwaysEvenly; public static ConfigEntry<bool> alwaysEvenly;
public static ConfigEntry<bool> alwaysChad;
public void Awake() { public void Awake() {
debug = Config.Bind("General", "Debug", false); debug = Config.Bind("General", "Debug", false);
@@ -39,6 +40,8 @@ namespace BlacksmithMaster {
alwaysEvenly = alwaysEvenly =
Config.Bind("General", "Always Evenly", false, Config.Bind("General", "Always Evenly", false,
new ConfigDescription("Always Evenly", new AcceptableValueRange<bool>(false, true))); new ConfigDescription("Always Evenly", new AcceptableValueRange<bool>(false, true)));
alwaysChad = Config.Bind("General", "Always Chad", false,
new ConfigDescription("Always Chad", new AcceptableValueRange<bool>(false, true)));
Logger.LogInfo("Cykasmith loaded"); Logger.LogInfo("Cykasmith loaded");
HarmonyFileLog.Enabled = true; HarmonyFileLog.Enabled = true;
@@ -96,7 +99,18 @@ namespace BlacksmithMaster {
public class StaffUtil_FillBasicInfo { public class StaffUtil_FillBasicInfo {
public static void Postfix(TavernData.StaffType staffType, Random rnd, ref TavernData.StaffInfo newPerson) { public static void Postfix(TavernData.StaffType staffType, Random rnd, ref TavernData.StaffInfo newPerson) {
Main.LogDebug("Setting skill assignment strategy to evenly"); Main.LogDebug("Setting skill assignment strategy to evenly");
if (Main.alwaysEvenly.Value)
newPerson.SkillAssignmentStrategy = TavernData.SkillAssignmentStrategyType.Balanced; newPerson.SkillAssignmentStrategy = TavernData.SkillAssignmentStrategyType.Balanced;
} }
} }
[HarmonyPatch(typeof(HireData), "GetStaffInfo")]
public class TavernData_GetStaffInfo {
public static void Prefix(Random rnd, int id, string staffName, bool isMale, ref bool shouldBeSuperWorker,
ref EliteTraitType forcedEliteTrait) {
Main.LogDebug("Setting shouldBeSuperWorker to true");
if (Main.alwaysChad.Value)
shouldBeSuperWorker = true;
}
}
} }