Add housing capacity patch
This commit is contained in:
@@ -21,7 +21,7 @@ namespace CaptainOfIndustry {
|
||||
public static ConfigEntry<float> unityGenerationMultiplier;
|
||||
public static ConfigEntry<float> depotTransferSpeedMultiplier;
|
||||
public static ConfigEntry<float> worldMineSpeedMultiplier;
|
||||
public static ConfigEntry<float> worldMineLevelIncrementMultiplier;
|
||||
public static ConfigEntry<float> housingCapacityMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
excavatorCapacityMultiplier = Config.Bind("General", "Excavator Capacity Multiplier", 1, new ConfigDescription("Excavator Capacity Multiplier"));
|
||||
@@ -33,7 +33,7 @@ namespace CaptainOfIndustry {
|
||||
unityGenerationMultiplier = Config.Bind("General", "Unity Generation Multiplier", 1f, new ConfigDescription("Unity Generation Multiplier"));
|
||||
depotTransferSpeedMultiplier = Config.Bind("General", "Depot Transfer Speed Multiplier", 1f, new ConfigDescription("Depot Transfer Speed Multiplier"));
|
||||
worldMineSpeedMultiplier = Config.Bind("General", "World Mine Speed Multiplier", 1f, new ConfigDescription("World Mine Speed Multiplier"));
|
||||
worldMineLevelIncrementMultiplier = Config.Bind("General", "World Mine Level Increment Multiplier", 1f, new ConfigDescription("World Mine Level Increment Multiplier"));
|
||||
housingCapacityMultiplier = Config.Bind("General", "Housing Capacity Multiplier", 1f, new ConfigDescription("Housing Capacity Multiplier"));
|
||||
|
||||
// shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
|
||||
// energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
|
||||
|
@@ -4,9 +4,11 @@ using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using HarmonyLib;
|
||||
using Mafi;
|
||||
using Mafi.Collections.ImmutableCollections;
|
||||
using Mafi.Core;
|
||||
using Mafi.Core.Buildings.Cargo.Modules;
|
||||
using Mafi.Core.Buildings.Cargo.Ships.Modules;
|
||||
using Mafi.Core.Buildings.Settlements;
|
||||
using Mafi.Core.Buildings.Storages;
|
||||
using Mafi.Core.Entities;
|
||||
using Mafi.Core.Entities.Dynamic;
|
||||
@@ -337,5 +339,23 @@ namespace CaptainOfIndustry {
|
||||
|
||||
return codes.AsEnumerable();
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(SettlementHousingModuleProto), MethodType.Constructor, new[] {
|
||||
typeof(StaticEntityProto.ID),
|
||||
typeof(Proto.Str),
|
||||
typeof(EntityLayout),
|
||||
typeof(EntityCosts),
|
||||
typeof(int),
|
||||
typeof(Upoints),
|
||||
typeof(ImmutableArray<KeyValuePair<ImmutableArray<PopNeedProto>, Percent>>),
|
||||
typeof(IReadOnlyDictionary<PopNeedProto, Percent>),
|
||||
typeof(Option<SettlementHousingModuleProto>),
|
||||
typeof(SettlementHousingModuleProto.Gfx),
|
||||
})]
|
||||
static void housingCapacityMultiplier(SettlementHousingModuleProto __instance) {
|
||||
Traverse.Create(__instance).Field<int>("Capacity").Value =
|
||||
(int)(__instance.Capacity * Main.housingCapacityMultiplier.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user