diff --git a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs index 3f5b7f5..af96147 100644 --- a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs +++ b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.cs @@ -2,6 +2,7 @@ using System.Linq; using BepInEx; using BepInEx.Configuration; +using GameCustomization; using HarmonyLib; using HarmonyLib.Tools; @@ -14,12 +15,12 @@ namespace InfectionFreeZone { public static ConfigEntry debug; - public static ConfigEntry moneyMultiplier; + public static ConfigEntry resourceMultiplier; public void Awake() { debug = Config.Bind("General", "Debug", false); - moneyMultiplier = Config.Bind("General", "MoneyMultiplier", 1f); + resourceMultiplier = Config.Bind("General", "ResourceMultiplier", 1f); Logger.LogInfo("Cyka mod loaded"); HarmonyFileLog.Enabled = true; @@ -33,61 +34,61 @@ namespace InfectionFreeZone { } } - // [HarmonyPatch] - // public class Patches { - // [HarmonyPrefix] - // [HarmonyPatch(typeof(TavernModel), "ChangeMoney")] - // public static void PrefixMoney(ref int value) { - // if (Main.debug.Value) - // Console.WriteLine($"Money is {value}"); - // if (value > 0) { - // value = (int)(value * Main.moneyMultiplier.Value); - // if (Main.debug.Value) - // Console.WriteLine($"Money modified to {value}"); - // } - // } - // - // [HarmonyPrefix] - // [HarmonyPatch(typeof(UiController), "ChangeGameSpeed")] - // public static void PrefixSpeed(ref int gameSpeed) { - // if (Main.debug.Value) - // Console.WriteLine($"Game speed is {gameSpeed}"); - // if (gameSpeed > 1) { - // gameSpeed = Main.fastSpeed.Value; - // if (Main.debug.Value) - // Console.WriteLine($"Game speed modified to {gameSpeed}"); - // } - // } - // - // [HarmonyPrefix] - // [HarmonyPatch(typeof(StaffModel), "UpdateXp")] - // public static void PrefixXp(ref int id, ref int amount) { - // if (Main.debug.Value) - // Console.WriteLine($"Staff xp is {amount}"); - // if (amount > 0) { - // amount = (int)(amount * Main.staffXpMultiplier.Value); - // if (Main.debug.Value) - // Console.WriteLine($"Staff xp modified to {amount}"); - // } - // } - // - // [HarmonyPostfix] - // [HarmonyPatch(typeof(TechTreeModel), nameof(TechTreeModel.GetBonusPeoplePerMinute))] - // public static void PostfixPeoplePerMinute(ref float __result) { - // __result *= Main.peoplePerMinuteMultiplier.Value; - // __result += Main.peoplePerMinuteOffset.Value; - // } - // - // [HarmonyPostfix] - // [HarmonyPatch(typeof(TavernModel), nameof(TavernModel.GetQuality))] - // public static void PostfixQuality(ref int __result) { - // if (Main.debug.Value) - // Console.WriteLine($"Quality is {__result}"); - // if (__result > 0) { - // __result = (int)(__result * Main.prestigeMultiplier.Value); - // if (Main.debug.Value) - // Console.WriteLine($"Quality modified to {__result}"); - // } - // } - // } + [HarmonyPatch] + public class Patches { + [HarmonyPrefix] + [HarmonyPatch(typeof(GameCustomize), "LoadResourcesSettings")] + public static void PostfixResourceMultiplier(ref float multiplier) { + if (Main.debug.Value) + Console.WriteLine($"Resource multiplier is {multiplier}"); + if (multiplier > 0) { + multiplier = (int)(multiplier * Main.resourceMultiplier.Value); + if (Main.debug.Value) + Console.WriteLine($"Resource multiplier modified to {multiplier}"); + } + } + // + // [HarmonyPrefix] + // [HarmonyPatch(typeof(UiController), "ChangeGameSpeed")] + // public static void PrefixSpeed(ref int gameSpeed) { + // if (Main.debug.Value) + // Console.WriteLine($"Game speed is {gameSpeed}"); + // if (gameSpeed > 1) { + // gameSpeed = Main.fastSpeed.Value; + // if (Main.debug.Value) + // Console.WriteLine($"Game speed modified to {gameSpeed}"); + // } + // } + // + // [HarmonyPrefix] + // [HarmonyPatch(typeof(StaffModel), "UpdateXp")] + // public static void PrefixXp(ref int id, ref int amount) { + // if (Main.debug.Value) + // Console.WriteLine($"Staff xp is {amount}"); + // if (amount > 0) { + // amount = (int)(amount * Main.staffXpMultiplier.Value); + // if (Main.debug.Value) + // Console.WriteLine($"Staff xp modified to {amount}"); + // } + // } + // + // [HarmonyPostfix] + // [HarmonyPatch(typeof(TechTreeModel), nameof(TechTreeModel.GetBonusPeoplePerMinute))] + // public static void PostfixPeoplePerMinute(ref float __result) { + // __result *= Main.peoplePerMinuteMultiplier.Value; + // __result += Main.peoplePerMinuteOffset.Value; + // } + // + // [HarmonyPostfix] + // [HarmonyPatch(typeof(TavernModel), nameof(TavernModel.GetQuality))] + // public static void PostfixQuality(ref int __result) { + // if (Main.debug.Value) + // Console.WriteLine($"Quality is {__result}"); + // if (__result > 0) { + // __result = (int)(__result * Main.prestigeMultiplier.Value); + // if (Main.debug.Value) + // Console.WriteLine($"Quality modified to {__result}"); + // } + // } + } } \ No newline at end of file diff --git a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.csproj b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.csproj index 0a7a1a6..9ea9993 100644 --- a/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.csproj +++ b/Projects/InfectionFreeZone/InfectionFreeZone/InfectionFreeZone.csproj @@ -57,6 +57,9 @@ $(GAME_MANAGED)/UnityEngine.CoreModule.dll + + $(GAME_MANAGED)/Ifz.dll +