Add resource multiplier multiplier
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using BepInEx;
|
using BepInEx;
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
|
using GameCustomization;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using HarmonyLib.Tools;
|
using HarmonyLib.Tools;
|
||||||
|
|
||||||
@@ -14,12 +15,12 @@ namespace InfectionFreeZone {
|
|||||||
|
|
||||||
public static ConfigEntry<bool> debug;
|
public static ConfigEntry<bool> debug;
|
||||||
|
|
||||||
public static ConfigEntry<float> moneyMultiplier;
|
public static ConfigEntry<float> resourceMultiplier;
|
||||||
|
|
||||||
public void Awake() {
|
public void Awake() {
|
||||||
debug = Config.Bind("General", "Debug", false);
|
debug = Config.Bind("General", "Debug", false);
|
||||||
|
|
||||||
moneyMultiplier = Config.Bind("General", "MoneyMultiplier", 1f);
|
resourceMultiplier = Config.Bind("General", "ResourceMultiplier", 1f);
|
||||||
|
|
||||||
Logger.LogInfo("Cyka mod loaded");
|
Logger.LogInfo("Cyka mod loaded");
|
||||||
HarmonyFileLog.Enabled = true;
|
HarmonyFileLog.Enabled = true;
|
||||||
@@ -33,61 +34,61 @@ namespace InfectionFreeZone {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// [HarmonyPatch]
|
[HarmonyPatch]
|
||||||
// public class Patches {
|
public class Patches {
|
||||||
// [HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
// [HarmonyPatch(typeof(TavernModel), "ChangeMoney")]
|
[HarmonyPatch(typeof(GameCustomize), "LoadResourcesSettings")]
|
||||||
// public static void PrefixMoney(ref int value) {
|
public static void PostfixResourceMultiplier(ref float multiplier) {
|
||||||
// if (Main.debug.Value)
|
if (Main.debug.Value)
|
||||||
// Console.WriteLine($"Money is {value}");
|
Console.WriteLine($"Resource multiplier is {multiplier}");
|
||||||
// if (value > 0) {
|
if (multiplier > 0) {
|
||||||
// value = (int)(value * Main.moneyMultiplier.Value);
|
multiplier = (int)(multiplier * Main.resourceMultiplier.Value);
|
||||||
// if (Main.debug.Value)
|
if (Main.debug.Value)
|
||||||
// Console.WriteLine($"Money modified to {value}");
|
Console.WriteLine($"Resource multiplier modified to {multiplier}");
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//
|
//
|
||||||
// [HarmonyPrefix]
|
// [HarmonyPrefix]
|
||||||
// [HarmonyPatch(typeof(UiController), "ChangeGameSpeed")]
|
// [HarmonyPatch(typeof(UiController), "ChangeGameSpeed")]
|
||||||
// public static void PrefixSpeed(ref int gameSpeed) {
|
// public static void PrefixSpeed(ref int gameSpeed) {
|
||||||
// if (Main.debug.Value)
|
// if (Main.debug.Value)
|
||||||
// Console.WriteLine($"Game speed is {gameSpeed}");
|
// Console.WriteLine($"Game speed is {gameSpeed}");
|
||||||
// if (gameSpeed > 1) {
|
// if (gameSpeed > 1) {
|
||||||
// gameSpeed = Main.fastSpeed.Value;
|
// gameSpeed = Main.fastSpeed.Value;
|
||||||
// if (Main.debug.Value)
|
// if (Main.debug.Value)
|
||||||
// Console.WriteLine($"Game speed modified to {gameSpeed}");
|
// Console.WriteLine($"Game speed modified to {gameSpeed}");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// [HarmonyPrefix]
|
// [HarmonyPrefix]
|
||||||
// [HarmonyPatch(typeof(StaffModel), "UpdateXp")]
|
// [HarmonyPatch(typeof(StaffModel), "UpdateXp")]
|
||||||
// public static void PrefixXp(ref int id, ref int amount) {
|
// public static void PrefixXp(ref int id, ref int amount) {
|
||||||
// if (Main.debug.Value)
|
// if (Main.debug.Value)
|
||||||
// Console.WriteLine($"Staff xp is {amount}");
|
// Console.WriteLine($"Staff xp is {amount}");
|
||||||
// if (amount > 0) {
|
// if (amount > 0) {
|
||||||
// amount = (int)(amount * Main.staffXpMultiplier.Value);
|
// amount = (int)(amount * Main.staffXpMultiplier.Value);
|
||||||
// if (Main.debug.Value)
|
// if (Main.debug.Value)
|
||||||
// Console.WriteLine($"Staff xp modified to {amount}");
|
// Console.WriteLine($"Staff xp modified to {amount}");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// [HarmonyPostfix]
|
// [HarmonyPostfix]
|
||||||
// [HarmonyPatch(typeof(TechTreeModel), nameof(TechTreeModel.GetBonusPeoplePerMinute))]
|
// [HarmonyPatch(typeof(TechTreeModel), nameof(TechTreeModel.GetBonusPeoplePerMinute))]
|
||||||
// public static void PostfixPeoplePerMinute(ref float __result) {
|
// public static void PostfixPeoplePerMinute(ref float __result) {
|
||||||
// __result *= Main.peoplePerMinuteMultiplier.Value;
|
// __result *= Main.peoplePerMinuteMultiplier.Value;
|
||||||
// __result += Main.peoplePerMinuteOffset.Value;
|
// __result += Main.peoplePerMinuteOffset.Value;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// [HarmonyPostfix]
|
// [HarmonyPostfix]
|
||||||
// [HarmonyPatch(typeof(TavernModel), nameof(TavernModel.GetQuality))]
|
// [HarmonyPatch(typeof(TavernModel), nameof(TavernModel.GetQuality))]
|
||||||
// public static void PostfixQuality(ref int __result) {
|
// public static void PostfixQuality(ref int __result) {
|
||||||
// if (Main.debug.Value)
|
// if (Main.debug.Value)
|
||||||
// Console.WriteLine($"Quality is {__result}");
|
// Console.WriteLine($"Quality is {__result}");
|
||||||
// if (__result > 0) {
|
// if (__result > 0) {
|
||||||
// __result = (int)(__result * Main.prestigeMultiplier.Value);
|
// __result = (int)(__result * Main.prestigeMultiplier.Value);
|
||||||
// if (Main.debug.Value)
|
// if (Main.debug.Value)
|
||||||
// Console.WriteLine($"Quality modified to {__result}");
|
// Console.WriteLine($"Quality modified to {__result}");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
}
|
||||||
}
|
}
|
@@ -57,6 +57,9 @@
|
|||||||
<Reference Include="UnityEngine.CoreModule">
|
<Reference Include="UnityEngine.CoreModule">
|
||||||
<HintPath>$(GAME_MANAGED)/UnityEngine.CoreModule.dll</HintPath>
|
<HintPath>$(GAME_MANAGED)/UnityEngine.CoreModule.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Ifz">
|
||||||
|
<HintPath>$(GAME_MANAGED)/Ifz.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
|
||||||
</Project>
|
</Project>
|
||||||
|
Reference in New Issue
Block a user