2024-04-01 08:12:01 +11:00
|
|
|
using HarmonyLib;
|
|
|
|
|
using Kitchen;
|
|
|
|
|
using KitchenLib.Preferences;
|
|
|
|
|
|
|
|
|
|
namespace MMOKitchen.Patches
|
|
|
|
|
{
|
|
|
|
|
[HarmonyPatch(typeof(DifficultyHelpers))]
|
|
|
|
|
public class DifficultyHelpersPatch
|
|
|
|
|
{
|
|
|
|
|
[HarmonyPatch("CustomerPlayersRateModifier")]
|
2026-03-05 17:09:17 +11:00
|
|
|
[HarmonyPrefix]
|
|
|
|
|
static bool CustomerPlayersRateModifier_Postfix(ref float __result, int player_count)
|
2024-04-01 08:12:01 +11:00
|
|
|
{
|
2026-03-05 17:09:17 +11:00
|
|
|
if (player_count < 4 && Mod.manager.GetPreference<PreferenceBool>("scaleAbove4Players").Value)
|
|
|
|
|
{
|
|
|
|
|
__result = (0.55f + (player_count * 0.25f) - 0.05f) * Mod.manager.GetPreference<PreferenceFloat>("scaleAbove4PlayersMultiplier").Value;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
2024-04-01 08:12:01 +11:00
|
|
|
}
|
|
|
|
|
|
2026-03-05 17:09:17 +11:00
|
|
|
/*
|
2024-04-01 08:12:01 +11:00
|
|
|
[HarmonyPatch("FireSpreadModifier")]
|
|
|
|
|
[HarmonyPostfix]
|
|
|
|
|
static void FireSpreadModifier_Postfix(ref float __result, int player_count)
|
|
|
|
|
{
|
|
|
|
|
if (Mod.manager.GetPreference<PreferenceBool>("scaleAbove4Players").Value)
|
|
|
|
|
if (player_count > 4)
|
|
|
|
|
__result = 0.75f + (player_count * Mod.manager.GetPreference<PreferenceFloat>("scaleAbove4PlayersMultiplier").Value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HarmonyPatch("PatiencePlayerCountModifier")]
|
|
|
|
|
[HarmonyPostfix]
|
|
|
|
|
static void PatiencePlayerCountModifier_Postfix(ref float __result, int player_count)
|
|
|
|
|
{
|
|
|
|
|
if (Mod.manager.GetPreference<PreferenceBool>("scaleAbove4Players").Value)
|
|
|
|
|
if (player_count > 4)
|
|
|
|
|
__result = 0.75f + (player_count * Mod.manager.GetPreference<PreferenceFloat>("scaleAbove4PlayersMultiplier").Value);
|
|
|
|
|
}
|
2026-03-05 17:09:17 +11:00
|
|
|
*/
|
2024-04-01 08:12:01 +11:00
|
|
|
}
|
|
|
|
|
}
|