diff --git a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs index 947862f..9bd7ee3 100644 --- a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs +++ b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs @@ -3,15 +3,19 @@ using System.Collections.Generic; using System.Linq; using BepInEx; using BepInEx.Configuration; +using Controllers.Weather; using GameCustomization; using Gameplay.Buildings; using Gameplay.GameResources; using Gameplay.InGameResources; using Gameplay.Scavenge; +using Gameplay.Units.Icons; using Gameplay.Units.Movements; using Gameplay.Units.Workers.WorkSystem.Works; +using Gameplay.Vehicles; using HarmonyLib; using HarmonyLib.Tools; +using Zenject; // See: // ConstructableWork @@ -38,6 +42,7 @@ namespace InfectionFreeZone { public static ConfigEntry buildingQuartersCapacityMultiplier; public static ConfigEntry buildingDeconstructionResourcesMultiplier; public static ConfigEntry humanMovementSpeedMultiplier; + public static ConfigEntry vehicleTrunkCapacityMultiplier; // public static ConfigEntry workSpeedMultiplier; public void Awake() { @@ -51,6 +56,7 @@ namespace InfectionFreeZone { buildingDeconstructionResourcesMultiplier = Config.Bind("General", "Building Deconstruction Resources Multiplier", 1f); humanMovementSpeedMultiplier = Config.Bind("General", "Human Movement Speed Multiplier", 1f); + vehicleTrunkCapacityMultiplier = Config.Bind("General", "Vehicle Trunk Capacity Multiplier", 1f); // workSpeedMultiplier = Config.Bind("General", "WorkSpeedMultiplier", 1f); Logger.LogInfo("Cyka mod loaded"); @@ -189,5 +195,20 @@ namespace InfectionFreeZone { // if (Main.debug.Value) // Console.WriteLine($"Human movement speed modified to {__result}"); } + + [HarmonyPostfix] + [HarmonyPatch(typeof(Vehicle), "Constructor", + typeof(GroupIconsPool), typeof(SignalBus), typeof(WeatherController))] + public static void PostfixVehicle(ref Vehicle __instance) { + if (Main.vehicleTrunkCapacityMultiplier.Value <= 0) + return; + + if (Main.debug.Value) + Console.WriteLine($"Vehicle trunk capacity is {__instance.Trunk.Capacity}"); + __instance.Trunk.SetCapacity((int)(__instance.Trunk.Capacity * Main.vehicleTrunkCapacityMultiplier.Value), + true); + if (Main.debug.Value) + Console.WriteLine($"Vehicle trunk capacity modified to {__instance.Trunk.Capacity}"); + } } } \ No newline at end of file diff --git a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.csproj b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.csproj index 9ea9993..dff4014 100644 --- a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.csproj +++ b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.csproj @@ -60,6 +60,9 @@ $(GAME_MANAGED)/Ifz.dll + + $(GAME_MANAGED)/Zenject.dll +