diff --git a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs index 254a900..d73871b 100644 --- a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs +++ b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs @@ -48,6 +48,7 @@ namespace InfectionFreeZone { public static ConfigEntry vehicleTrunkCapacityMultiplier; public static ConfigEntry deconstructionTimeMultiplier; public static ConfigEntry constructionTimeMultiplier; + public static ConfigEntry productionTimeMultiplier; public void Awake() { debug = Config.Bind("General", "Debug", false); @@ -64,6 +65,7 @@ namespace InfectionFreeZone { vehicleTrunkCapacityMultiplier = Config.Bind("General", "Vehicle Trunk Capacity Multiplier", 1f); deconstructionTimeMultiplier = Config.Bind("General", "Deconstruction Time Multiplier", 1f); constructionTimeMultiplier = Config.Bind("General", "Construction Time Multiplier", 1f); + productionTimeMultiplier = Config.Bind("General", "Production Time Multiplier", 1f); Logger.LogInfo("Cyka mod loaded"); HarmonyFileLog.Enabled = true; @@ -102,6 +104,7 @@ namespace InfectionFreeZone { Console.WriteLine($"People multiplier modified to {people}"); } } + [HarmonyPostfix] [HarmonyPatch(typeof(ScavengeWork), MethodType.Constructor, typeof(float), typeof(List))] @@ -263,5 +266,18 @@ namespace InfectionFreeZone { if (Main.debug.Value) Console.WriteLine($"Construction time modified to {timeToConstruct}"); } + + [HarmonyPostfix] + [HarmonyPatch(typeof(ProductionData), "GetProductionTime")] + public static void PostfixProductionTime(ref float __result) { + if (Main.productionTimeMultiplier.Value <= 0) + return; + + if (Main.debug.Value) + Console.WriteLine($"Production time is {__result}"); + __result *= Main.productionTimeMultiplier.Value; + if (Main.debug.Value) + Console.WriteLine($"Production time modified to {__result}"); + } } } \ No newline at end of file