Add hiring cost multiplier and patch for cost calculation
This commit is contained in:
@@ -25,6 +25,7 @@ namespace BlacksmithMaster {
|
||||
public static ConfigEntry<float> decorationAdditionOffset;
|
||||
public static ConfigEntry<float> globalSpeedMultiplier;
|
||||
public static ConfigEntry<float> globalSpeedOffset;
|
||||
public static ConfigEntry<float> hiringCostMultiplier;
|
||||
public static ConfigEntry<bool> alwaysEvenly;
|
||||
public static ConfigEntry<bool> alwaysChad;
|
||||
|
||||
@@ -61,6 +62,9 @@ namespace BlacksmithMaster {
|
||||
globalSpeedOffset = Config.Bind(
|
||||
"General", "Global Speed Offset", 0f,
|
||||
new ConfigDescription("Global Speed Offset", new AcceptableValueRange<float>(-1024f, 1024f)));
|
||||
hiringCostMultiplier = Config.Bind(
|
||||
"General", "Hiring Cost Multiplier", 1f,
|
||||
new ConfigDescription("Hiring Cost Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
|
||||
alwaysEvenly =
|
||||
Config.Bind("General", "Always Evenly", false,
|
||||
new ConfigDescription("Always Evenly", new AcceptableValueRange<bool>(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) {
|
||||
|
Reference in New Issue
Block a user