From b076a8557952fb60f035e12d460e72a3c61d6756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Majdand=C5=BEi=C4=87?= Date: Wed, 17 Apr 2024 13:37:39 +0200 Subject: [PATCH] Add ground resource patch --- .../CaptainOfIndustry/Patches.cs | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Projects/CaptainOfIndustry/CaptainOfIndustry/Patches.cs b/Projects/CaptainOfIndustry/CaptainOfIndustry/Patches.cs index 33736d5..e3d27b1 100644 --- a/Projects/CaptainOfIndustry/CaptainOfIndustry/Patches.cs +++ b/Projects/CaptainOfIndustry/CaptainOfIndustry/Patches.cs @@ -4,6 +4,7 @@ using HarmonyLib; using Mafi; using Mafi.Core.Buildings.Cargo.Ships.Modules; using Mafi.Core.Entities.Dynamic; +using Mafi.Core.Map; using Mafi.Core.Products; using Mafi.Core.Prototypes; @@ -81,21 +82,17 @@ namespace CaptainOfIndustry { Console.WriteLine("IndustrialCyka: New speeds: (F) {0}, (B) {1}, (A) {2}", maxForwardsSpeedField.GetValue(), maxBackwardsSpeedField.GetValue(), maxAccelerationField.GetValue()); } - // this.m_maxForwardsSpeed = speedFactor.Apply(this.m_maxForwardsSpeedBase); - // this.m_maxBackwardsSpeed = speedFactor.Apply(this.m_maxBackwardsSpeedBase); - // this.m_maxAcceleration = speedFactor.Apply(this.m_maxAccelerationBase); - - // [HarmonyPrefix] - // [HarmonyPatch(typeof(ManPlayer), "AddMoney")] - // static void MoneyMulti(ref int amount) { - // amount = (int)(amount * Main.moneyMultiplier.Value); - // } - // - // [HarmonyPrefix] - // [HarmonyPatch(typeof(TechHolders), "SetHeartbeatInterval")] - // static void HeartbeatMulti(ref float interval) { - // interval *= Main.heartbeatIntervalMultiplier.Value; + // Could not make this work either... idk why... Doesn't make sense... + // [HarmonyPostfix] + // [HarmonyPatch(typeof(SimpleVirtualResource), "MineResourceAt")] + // static void infiniteGroundResources(SimpleVirtualResource __instance) { + // Console.WriteLine("IndustrialCyka: Patching ground resources (Capacity)"); + // Traverse traverse = Traverse.Create(__instance); + // Traverse capacityField = traverse.Field("Capacity"); + // capacityField.SetValue(1000000000); + // Traverse quantityField = traverse.Field("Quantity"); + // quantityField.SetValue(1000000000); // } } }