using HarmonyLib; using Kitchen; using KitchenLib.Preferences; namespace MMOKitchen.Patches { [HarmonyPatch(typeof(DifficultyHelpers))] public class DifficultyHelpersPatch { [HarmonyPatch("CustomerPlayersRateModifier")] [HarmonyPrefix] static bool CustomerPlayersRateModifier_Prefix(ref float __result, int player_count) { if (player_count > 4 && Mod.manager.GetPreference(Mod.PREFERENCE_SCALE_ABOVE_4_PLAYERS).Value) { __result = (float)(1.5 + 0.25 * (player_count - 4) * Mod.manager.GetPreference(Mod.PREFERENCE_CUSTOMER_SCALE_AMOUNT).Value); return false; } Mod.Logger.LogInfo("5"); return true; } [HarmonyPatch("FireSpreadModifier")] [HarmonyPrefix] static bool FireSpreadModifier_Prefix(ref float __result, int player_count) { if (player_count > 4 && Mod.manager.GetPreference(Mod.PREFERENCE_SCALE_ABOVE_4_PLAYERS).Value) { __result = (float)(1.15 + 0.05 * (player_count - 4) * Mod.manager.GetPreference(Mod.PREFERENCE_FIRE_SCALE_AMOUNT).Value); return false; } return true; } [HarmonyPatch("PatiencePlayerCountModifier")] [HarmonyPrefix] static bool PatiencePlayerCountModifier_Prefix(ref float __result, int player_count) { if (player_count > 4 && Mod.manager.GetPreference(Mod.PREFERENCE_SCALE_ABOVE_4_PLAYERS).Value) { __result = (float)(1.5 + 0.25 * (player_count - 4) * Mod.manager.GetPreference(Mod.PREFERENCE_PATIENCE_SCALE_AMOUNT).Value); return false; } return true; } } }