Decompiled source of LethalCompTime v1.1.5

LethalCompTime.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LethalCompTime.Compat;
using LethalCompTime.Configs;
using LethalCompTime.Patches;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using LobbyCompatibility.Enums;
using LobbyCompatibility.Features;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalCompTime")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Allows for more controlled quota rollover. For if Quota Rollover starts feeling too easy.")]
[assembly: AssemblyFileVersion("1.1.5.0")]
[assembly: AssemblyInformationalVersion("1.1.5+eb0a4cac3daff0b7a53d832e1d740959ef07e766")]
[assembly: AssemblyProduct("LethalCompTime")]
[assembly: AssemblyTitle("LethalCompTime")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.5.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LethalCompTime
{
	[BepInPlugin("com.github.cdusold.LethalCompTime", "LethalCompTime", "1.1.5")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private readonly Harmony harmony = new Harmony("cdusold.LethalCompTime");

		private static Plugin Instance;

		public static ManualLogSource logger;

		public static int currentOverfulfillment;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			logger = ((BaseUnityPlugin)this).Logger;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Mod cdusold.LethalCompTime is loaded!");
			ConfigManager.Init(((BaseUnityPlugin)this).Config);
			if (Chainloader.PluginInfos.ContainsKey("ainavt.lc.lethalconfig"))
			{
				LethalConfigManager.Init(((BaseUnityPlugin)this).Config);
			}
			if (Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility"))
			{
				LobbyCompatibilityManager.Init();
			}
			if ((float)ConfigManager.RolloverFraction.Value != 0f)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)$"Rollover percentage set to {ConfigManager.RolloverFraction.Value}");
			}
			if ((float)ConfigManager.RolloverThreshold.Value != 0f)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)$"Rollover max percentage set to {ConfigManager.RolloverThreshold.Value}");
			}
			if ((float)ConfigManager.RolloverPenalty.Value != 0f)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)$"Rollover max percentage set to {ConfigManager.RolloverPenalty.Value}");
			}
			harmony.PatchAll(typeof(Plugin));
			harmony.PatchAll(typeof(TimeOfDayPatch));
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LethalCompTime";

		public const string PLUGIN_NAME = "LethalCompTime";

		public const string PLUGIN_VERSION = "1.1.5";
	}
}
namespace LethalCompTime.Patches
{
	[HarmonyPatch(typeof(TimeOfDay))]
	internal class TimeOfDayPatch
	{
		public static int CalculateQuotaRollover(int quotaFulfilled, int profitQuota)
		{
			bool flag = false;
			double num = quotaFulfilled;
			if (flag)
			{
				Plugin.logger.LogInfo((object)$"Calc: {quotaFulfilled}/{profitQuota}");
			}
			double num2 = (double)ConfigManager.RolloverThreshold.Value / 100.0;
			double num3 = (double)ConfigManager.RolloverPenalty.Value / 100.0;
			double num4 = (double)ConfigManager.RolloverFraction.Value / 100.0;
			if (flag)
			{
				Plugin.logger.LogInfo((object)$"Thresh: {num2} penalty: {num3} fraction: {num4}");
			}
			bool flag2 = ConfigManager.PenaltyUsed.Value == ConfigManager.PenaltyType.Logarithmic;
			if (flag2)
			{
				num *= num4;
			}
			double num5 = num2 * (double)profitQuota;
			if (num5 > 0.0 && num3 != 1.0 && num > num5)
			{
				int num8;
				if (flag2)
				{
					double num6 = 1.0 / num3;
					double num7 = num5 - num * (1.0 - num6);
					if (flag)
					{
						Plugin.logger.LogInfo((object)$"Math.Log({num7}/{num5}, {num6})");
					}
					num8 = (int)Math.Floor(Math.Log(num7 / num5, num6));
				}
				else
				{
					num8 = (int)Math.Floor(num / num5);
				}
				if (flag)
				{
					Plugin.logger.LogInfo((object)$"Calc: #{num8}");
				}
				double num9 = Math.Pow(num3, num8);
				if (flag)
				{
					Plugin.logger.LogInfo((object)$"Calc: %{num9}");
				}
				double num10;
				if (flag2)
				{
					num10 = num - num5 * (1.0 - 1.0 / num9) / (1.0 - 1.0 / num3);
					if (flag)
					{
						Plugin.logger.LogInfo((object)$"Calc: {num5 * (1.0 - 1.0 / num9) / (1.0 - 1.0 / num3)} < {num} < {num5 * (1.0 - 1.0 / (num9 * num3)) / (1.0 - 1.0 / num3)}");
					}
				}
				else
				{
					num10 = num - (double)num8 * num5;
				}
				if (flag)
				{
					Plugin.logger.LogInfo((object)$"Calc: r{num10}");
				}
				num = num9 * num10;
				num = ((!flag2) ? (num + num5 * (1.0 - num9) / (1.0 - num3)) : (num + num5 * (double)num8));
			}
			if (!flag2)
			{
				num *= num4;
			}
			if (flag)
			{
				Plugin.logger.LogInfo((object)$"Calc: v{num}");
			}
			return (int)Math.Floor(num);
		}

		[HarmonyPatch("SetNewProfitQuota")]
		[HarmonyPrefix]
		[HarmonyAfter(new string[] { })]
		private static bool GetQuotaFulfilledHost(ref int ___quotaFulfilled, ref int ___profitQuota, ref int ___timesFulfilledQuota, ref QuotaSettings ___quotaVariables, ref float ___timeUntilDeadline, ref float ___totalTime, ref int ___daysUntilDeadline)
		{
			Plugin.logger.LogInfo((object)$"days: {TimeOfDay.Instance.daysUntilDeadline} time: {TimeOfDay.Instance.timeUntilDeadline} ID: {StartOfRound.Instance.currentLevelID}");
			Plugin.currentOverfulfillment = 0;
			if (TimeOfDay.Instance.daysUntilDeadline < 0)
			{
				Plugin.currentOverfulfillment = ___quotaFulfilled - ___profitQuota;
				Plugin.logger.LogInfo((object)$"Host: Required {___profitQuota}");
				Plugin.logger.LogInfo((object)$"Host: Got {___quotaFulfilled}");
				if (((NetworkBehaviour)TimeOfDay.Instance).IsServer)
				{
					___timesFulfilledQuota++;
					int num = ___quotaFulfilled - ___profitQuota;
					float num2 = Mathf.Clamp(1f + (float)___timesFulfilledQuota * ((float)___timesFulfilledQuota / ___quotaVariables.increaseSteepness), 0f, 10000f);
					TimeOfDay.Instance.CalculateLuckValue();
					float num3 = Random.Range(0f, 1f);
					Debug.Log((object)$"Randomizer amount before: {num3}");
					num3 *= Mathf.Abs(TimeOfDay.Instance.luckValue - 1f);
					Debug.Log((object)$"Randomizer amount after: {num3}");
					num2 = ___quotaVariables.baseIncrease * num2 * (___quotaVariables.randomizerCurve.Evaluate(num3) * ___quotaVariables.randomizerMultiplier + 1f);
					Debug.Log((object)$"Amount to increase quota:{num2}");
					___profitQuota = (int)Mathf.Clamp((float)___profitQuota + num2, 0f, 1E+09f);
					___quotaFulfilled = CalculateQuotaRollover(Plugin.currentOverfulfillment, ___profitQuota);
					if (ConfigManager.OvertimeOverride.Value)
					{
						num -= Math.Min(___quotaFulfilled, num);
					}
					___timeUntilDeadline = ___totalTime * 4f;
					int num4 = num / 5 + 15 * ___daysUntilDeadline;
					TimeOfDay.Instance.furniturePlacedAtQuotaStart.Clear();
					AutoParentToShip[] array = Object.FindObjectsByType<AutoParentToShip>((FindObjectsSortMode)0);
					for (int i = 0; i < array.Length; i++)
					{
						if (array[i].unlockableID != -1)
						{
							TimeOfDay.Instance.furniturePlacedAtQuotaStart.Add(array[i].unlockableID);
						}
					}
					TimeOfDay.Instance.SyncNewProfitQuotaClientRpc(___profitQuota, num4, ___timesFulfilledQuota);
					return false;
				}
				return true;
			}
			return false;
		}

		[HarmonyPatch("SetNewProfitQuota")]
		[HarmonyPostfix]
		[HarmonyBefore(new string[] { })]
		private static void SetQuotaFulfilledHost(ref int ___quotaFulfilled, ref int ___profitQuota)
		{
			if (ConfigManager.RolloverFraction.Value > 0 && Plugin.currentOverfulfillment > 0 && TimeOfDay.Instance.daysUntilDeadline < 0)
			{
				___quotaFulfilled = CalculateQuotaRollover(Plugin.currentOverfulfillment, ___profitQuota);
			}
			Plugin.logger.LogInfo((object)$"Host: New quota completion at: {___quotaFulfilled}");
		}

		[HarmonyPatch("SyncNewProfitQuotaClientRpc")]
		[HarmonyPrefix]
		private static void GetNewQuotaFulfilledClient(ref int ___quotaFulfilled, ref int ___profitQuota)
		{
			if (Plugin.currentOverfulfillment == 0)
			{
				Plugin.currentOverfulfillment = ___quotaFulfilled - ___profitQuota;
			}
			Plugin.logger.LogInfo((object)$"Client: Required {___profitQuota}");
			Plugin.logger.LogInfo((object)$"Client: Got {___quotaFulfilled}");
		}

		[HarmonyPatch("SyncNewProfitQuotaClientRpc")]
		[HarmonyPostfix]
		private static void SetNewQuotaFulfiledClient(ref int ___quotaFulfilled, ref int ___profitQuota)
		{
			if (___quotaFulfilled == 0 && ConfigManager.RolloverFraction.Value > 0 && Plugin.currentOverfulfillment > 0 && TimeOfDay.Instance.daysUntilDeadline < 0)
			{
				___quotaFulfilled = CalculateQuotaRollover(Plugin.currentOverfulfillment, ___profitQuota);
				Plugin.logger.LogInfo((object)$"Client: New quota completion at: {___quotaFulfilled}");
			}
			Plugin.currentOverfulfillment = 0;
		}

		[HarmonyPatch("UpdateProfitQuotaCurrentTime")]
		[HarmonyPostfix]
		public static void SetUpdateProfitQuotaCurrentTime(ref int ___quotaFulfilled, ref int ___profitQuota)
		{
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (StartOfRound.Instance.isChallengeFile || ConfigManager.ScreenColoration.Value == ConfigManager.ColorOptions.None)
				{
					return;
				}
				Color color = default(Color);
				if (ConfigManager.ScreenColoration.Value == ConfigManager.ColorOptions.Text)
				{
					if (___quotaFulfilled < ___profitQuota)
					{
						ColorUtility.TryParseHtmlString(ConfigManager.ColorUnderFulfilled.Value, ref color);
					}
					else if (ConfigManager.RolloverFraction.Value <= 0 || ConfigManager.RolloverPenalty.Value <= 0 || (float)___quotaFulfilled < (float)___profitQuota * ((float)ConfigManager.RolloverThreshold.Value / 100f + 1f))
					{
						ColorUtility.TryParseHtmlString(ConfigManager.ColorFulfilled.Value, ref color);
					}
					else
					{
						ColorUtility.TryParseHtmlString(ConfigManager.ColorOverFulfilled.Value, ref color);
					}
				}
				else
				{
					Color color2 = default(Color);
					if (___quotaFulfilled == 0)
					{
						((Color)(ref color2))..ctor(0f, 0f, 0f, 1f);
						((Color)(ref color))..ctor(0f, 1f, 0f, 1f);
					}
					else if (___quotaFulfilled < ___profitQuota)
					{
						ColorUtility.TryParseHtmlString(ConfigManager.ColorUnderFulfilled.Value, ref color2);
						ColorUtility.TryParseHtmlString(ConfigManager.TextColorOverrideUnderFulfilled.Value, ref color);
					}
					else if (ConfigManager.RolloverFraction.Value <= 0 || ConfigManager.RolloverPenalty.Value <= 0 || (float)___quotaFulfilled < (float)___profitQuota * ((float)ConfigManager.RolloverThreshold.Value / 100f + 1f))
					{
						ColorUtility.TryParseHtmlString(ConfigManager.ColorFulfilled.Value, ref color2);
						ColorUtility.TryParseHtmlString(ConfigManager.TextColorOverrideFulfilled.Value, ref color);
					}
					else
					{
						ColorUtility.TryParseHtmlString(ConfigManager.ColorOverFulfilled.Value, ref color2);
						ColorUtility.TryParseHtmlString(ConfigManager.TextColorOverrideOverFulfilled.Value, ref color);
					}
					((Graphic)StartOfRound.Instance.deadlineMonitorBGImage).color = color2;
					((Graphic)StartOfRound.Instance.profitQuotaMonitorBGImage).color = color2;
				}
				((Graphic)StartOfRound.Instance.profitQuotaMonitorText).color = color;
				((Graphic)StartOfRound.Instance.deadlineMonitorText).color = color;
			}
			catch (Exception ex)
			{
				Plugin.logger.LogError((object)"Error in monitor update");
				Plugin.logger.LogError((object)ex.ToString());
			}
		}
	}
}
namespace LethalCompTime.Configs
{
	internal class ConfigManager
	{
		public enum PenaltyType
		{
			Asymptotic,
			Logarithmic
		}

		public enum ColorOptions
		{
			None,
			Text,
			Screen
		}

		public static ConfigManager Instance { get; private set; }

		public static ConfigEntry<int> RolloverFraction { get; private set; }

		public static ConfigEntry<int> RolloverThreshold { get; private set; }

		public static ConfigEntry<int> RolloverPenalty { get; private set; }

		public static ConfigEntry<PenaltyType> PenaltyUsed { get; private set; }

		public static ConfigEntry<bool> OvertimeOverride { get; private set; }

		public static ConfigEntry<ColorOptions> ScreenColoration { get; private set; }

		public static ConfigEntry<string> ColorOverFulfilled { get; private set; }

		public static ConfigEntry<string> ColorFulfilled { get; private set; }

		public static ConfigEntry<string> ColorUnderFulfilled { get; private set; }

		public static ConfigEntry<string> TextColorOverrideOverFulfilled { get; private set; }

		public static ConfigEntry<string> TextColorOverrideFulfilled { get; private set; }

		public static ConfigEntry<string> TextColorOverrideUnderFulfilled { get; private set; }

		public static void Init(ConfigFile config)
		{
			if (Instance == null)
			{
				Instance = new ConfigManager(config);
			}
		}

		private ConfigManager(ConfigFile config)
		{
			RolloverFraction = config.Bind<int>("General", "RolloverBasePercent", 50, "The starting percentage of your excess quota that automatically carries over to the next cycle.");
			RolloverThreshold = config.Bind<int>("General", "RolloverPenaltyThreshold", 100, "The point at which diminishing returns take effect for rollover amounts. Each multiple of the threshold exceeded reduces the rollover of the surplus over that threshold.");
			RolloverPenalty = config.Bind<int>("General", "RolloverPenaltyPercent", 50, "The percentage deduction applied to your rollover amount for each threshold exceeded. This creates a gradual decline in rollover benefits for larger surpluses.");
			PenaltyUsed = config.Bind<PenaltyType>("General", "RolloverPenaltyType", PenaltyType.Asymptotic, "Whether to use asymptotic or logarithmic rollover scaling.");
			OvertimeOverride = config.Bind<bool>("General", "RolloverOvertimeOverride", true, "Set this to false to allow full overtime bonus even with rollover. (Not Recommended.)");
			ScreenColoration = config.Bind<ColorOptions>("Visual", "RolloverScreenColoration", ColorOptions.None, "If and how to display quota status colors. None, Text (only), Screen (background).");
			ColorUnderFulfilled = config.Bind<string>("Visual", "RolloverColorUnderFulfilled", "red", "The indication color for if the quota isn't met yet.");
			ColorFulfilled = config.Bind<string>("Visual", "RolloverColorFulfilled", "green", "The indication color for if the quota has been met.");
			ColorOverFulfilled = config.Bind<string>("Visual", "RolloverColorOverFulfilled", "yellow", "The indication color for if a penalty will be applied to the rollover.");
			TextColorOverrideUnderFulfilled = config.Bind<string>("Visual", "RolloverTextColorOverrideUnderFulfilled", "#000000", "The text color in Scene mode for when the quota isn't met yet.");
			TextColorOverrideFulfilled = config.Bind<string>("Visual", "RolloverTextColorOverrideFulfilled", "#000000", "The text color in Scene mode for when the quota has been met.");
			TextColorOverrideOverFulfilled = config.Bind<string>("Visual", "RolloverTextColorOverrideOverFulfilled", "#000000", "The text color in Scene mode for when a penalty will be applied to the rollover.");
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	internal class LethalConfigManager
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static GenericButtonHandler <>9__13_0;

			public static GenericButtonHandler <>9__13_1;

			public static GenericButtonHandler <>9__13_2;

			public static GenericButtonHandler <>9__13_3;

			public static GenericButtonHandler <>9__13_4;

			public static GenericButtonHandler <>9__13_5;

			public static GenericButtonHandler <>9__13_6;

			public static CanModifyDelegate <>9__13_12;

			internal void <.ctor>b__13_0()
			{
				ConfigManager.OvertimeOverride.Value = false;
				ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
				ConfigManager.RolloverFraction.Value = 100;
				ConfigManager.RolloverThreshold.Value = 100;
				ConfigManager.RolloverPenalty.Value = 100;
			}

			internal void <.ctor>b__13_1()
			{
				ConfigManager.OvertimeOverride.Value = true;
				ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
				ConfigManager.RolloverFraction.Value = 100;
				ConfigManager.RolloverThreshold.Value = 100;
				ConfigManager.RolloverPenalty.Value = 100;
			}

			internal void <.ctor>b__13_2()
			{
				ConfigManager.OvertimeOverride.Value = true;
				ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Logarithmic;
				ConfigManager.RolloverFraction.Value = 100;
				ConfigManager.RolloverThreshold.Value = 50;
				ConfigManager.RolloverPenalty.Value = 75;
			}

			internal void <.ctor>b__13_3()
			{
				ConfigManager.OvertimeOverride.Value = true;
				ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
				ConfigManager.RolloverFraction.Value = 100;
				ConfigManager.RolloverThreshold.Value = 100;
				ConfigManager.RolloverPenalty.Value = 0;
			}

			internal void <.ctor>b__13_4()
			{
				ConfigManager.OvertimeOverride.Value = true;
				ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
				ConfigManager.RolloverFraction.Value = 100;
				ConfigManager.RolloverThreshold.Value = 50;
				ConfigManager.RolloverPenalty.Value = 50;
			}

			internal void <.ctor>b__13_5()
			{
				ConfigManager.OvertimeOverride.Value = true;
				ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
				ConfigManager.RolloverFraction.Value = 50;
				ConfigManager.RolloverThreshold.Value = 100;
				ConfigManager.RolloverPenalty.Value = 50;
			}

			internal void <.ctor>b__13_6()
			{
				ConfigManager.OvertimeOverride.Value = true;
				ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
				ConfigManager.RolloverFraction.Value = 0;
				ConfigManager.RolloverThreshold.Value = 100;
				ConfigManager.RolloverPenalty.Value = 100;
			}

			internal CanModifyResult <.ctor>b__13_12()
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				return CanModifyResult.False("Press Apply to update this value.");
			}
		}

		public static LethalConfigManager Instance { get; private set; }

		public static ConfigEntry<int> ExampleQuota { get; private set; }

		public static ConfigEntry<int> ExampleRollover { get; private set; }

		public static void Init(ConfigFile config)
		{
			if (Instance == null)
			{
				Instance = new LethalConfigManager(config);
			}
		}

		private LethalConfigManager(ConfigFile config)
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Expected O, but got Unknown
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Expected O, but got Unknown
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Expected O, but got Unknown
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Expected O, but got Unknown
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Expected O, but got Unknown
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Expected O, but got Unknown
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Expected O, but got Unknown
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Expected O, but got Unknown
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Expected O, but got Unknown
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Expected O, but got Unknown
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Expected O, but got Unknown
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			//IL_02c0: Expected O, but got Unknown
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Expected O, but got Unknown
			//IL_035b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Expected O, but got Unknown
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0376: Expected O, but got Unknown
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Expected O, but got Unknown
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Expected O, but got Unknown
			//IL_039f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Expected O, but got Unknown
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Expected O, but got Unknown
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Expected O, but got Unknown
			LethalConfigManager.SetModDescription("Allows for more controlled quota rollover. For if Quota Rollover starts feeling too easy.");
			object obj = <>c.<>9__13_0;
			if (obj == null)
			{
				GenericButtonHandler val = delegate
				{
					ConfigManager.OvertimeOverride.Value = false;
					ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
					ConfigManager.RolloverFraction.Value = 100;
					ConfigManager.RolloverThreshold.Value = 100;
					ConfigManager.RolloverPenalty.Value = 100;
				};
				<>c.<>9__13_0 = val;
				obj = (object)val;
			}
			LethalConfigManager.AddConfigItem((BaseConfigItem)new GenericButtonConfigItem("Quick Settings", "ClassicQR", "Sets rollover to be fully held at week end and still give overtime bonus as well.", "Classic Quota Rollover (Easiest)", (GenericButtonHandler)obj));
			object obj2 = <>c.<>9__13_1;
			if (obj2 == null)
			{
				GenericButtonHandler val2 = delegate
				{
					ConfigManager.OvertimeOverride.Value = true;
					ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
					ConfigManager.RolloverFraction.Value = 100;
					ConfigManager.RolloverThreshold.Value = 100;
					ConfigManager.RolloverPenalty.Value = 100;
				};
				<>c.<>9__13_1 = val2;
				obj2 = (object)val2;
			}
			LethalConfigManager.AddConfigItem((BaseConfigItem)new GenericButtonConfigItem("Quick Settings", "QRBalanced", "Sets rollover to be fully held at week end but doesn't double dip with the overtime bonus.", "Balanced Quota Rollover (Easy)", (GenericButtonHandler)obj2));
			object obj3 = <>c.<>9__13_2;
			if (obj3 == null)
			{
				GenericButtonHandler val3 = delegate
				{
					ConfigManager.OvertimeOverride.Value = true;
					ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Logarithmic;
					ConfigManager.RolloverFraction.Value = 100;
					ConfigManager.RolloverThreshold.Value = 50;
					ConfigManager.RolloverPenalty.Value = 75;
				};
				<>c.<>9__13_2 = val3;
				obj3 = (object)val3;
			}
			LethalConfigManager.AddConfigItem((BaseConfigItem)new GenericButtonConfigItem("Quick Settings", "ScaledDown", "Gradually reduces rollover out the more you turn in.", "Significant Rollover (Easy)", (GenericButtonHandler)obj3));
			object obj4 = <>c.<>9__13_3;
			if (obj4 == null)
			{
				GenericButtonHandler val4 = delegate
				{
					ConfigManager.OvertimeOverride.Value = true;
					ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
					ConfigManager.RolloverFraction.Value = 100;
					ConfigManager.RolloverThreshold.Value = 100;
					ConfigManager.RolloverPenalty.Value = 0;
				};
				<>c.<>9__13_3 = val4;
				obj4 = (object)val4;
			}
			LethalConfigManager.AddConfigItem((BaseConfigItem)new GenericButtonConfigItem("Quick Settings", "HardCapped", "You can rollover exactly one quota's worth. No more.", "Hard Capped (Easy)", (GenericButtonHandler)obj4));
			object obj5 = <>c.<>9__13_4;
			if (obj5 == null)
			{
				GenericButtonHandler val5 = delegate
				{
					ConfigManager.OvertimeOverride.Value = true;
					ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
					ConfigManager.RolloverFraction.Value = 100;
					ConfigManager.RolloverThreshold.Value = 50;
					ConfigManager.RolloverPenalty.Value = 50;
				};
				<>c.<>9__13_4 = val5;
				obj5 = (object)val5;
			}
			LethalConfigManager.AddConfigItem((BaseConfigItem)new GenericButtonConfigItem("Quick Settings", "Recommended", "The more you turn in, the closer you'll get to the next quota, but you shouldn't be able to reach it.", "Recommended (Medium)", (GenericButtonHandler)obj5));
			object obj6 = <>c.<>9__13_5;
			if (obj6 == null)
			{
				GenericButtonHandler val6 = delegate
				{
					ConfigManager.OvertimeOverride.Value = true;
					ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
					ConfigManager.RolloverFraction.Value = 50;
					ConfigManager.RolloverThreshold.Value = 100;
					ConfigManager.RolloverPenalty.Value = 50;
				};
				<>c.<>9__13_5 = val6;
				obj6 = (object)val6;
			}
			LethalConfigManager.AddConfigItem((BaseConfigItem)new GenericButtonConfigItem("Quick Settings", "CompanyIssue", "Rollover starts at 50% and decreases from there so that you can never reach a full quota.", "Company Issued Rollover (Hard)", (GenericButtonHandler)obj6));
			object obj7 = <>c.<>9__13_6;
			if (obj7 == null)
			{
				GenericButtonHandler val7 = delegate
				{
					ConfigManager.OvertimeOverride.Value = true;
					ConfigManager.PenaltyUsed.Value = ConfigManager.PenaltyType.Asymptotic;
					ConfigManager.RolloverFraction.Value = 0;
					ConfigManager.RolloverThreshold.Value = 100;
					ConfigManager.RolloverPenalty.Value = 100;
				};
				<>c.<>9__13_6 = val7;
				obj7 = (object)val7;
			}
			LethalConfigManager.AddConfigItem((BaseConfigItem)new GenericButtonConfigItem("Quick Settings", "Vanilla", "No rollover is given. Only overtime bonus. Just like the base game.", "No Rollover (Hardest)", (GenericButtonHandler)obj7));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(ConfigManager.RolloverFraction, false));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(ConfigManager.RolloverThreshold, false));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(ConfigManager.RolloverPenalty, false));
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem<ConfigManager.PenaltyType>(ConfigManager.PenaltyUsed, false));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(ConfigManager.OvertimeOverride, false));
			ExampleQuota = config.Bind<int>("General", "ExampleQuota", 200, "Enter an example amount of quota to rollover (assuming a required 100 quota).");
			IntInputFieldConfigItem val8 = new IntInputFieldConfigItem(ExampleQuota, false);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val8);
			ExampleRollover = config.Bind<int>("General", "ExampleRollover", TimeOfDayPatch.CalculateQuotaRollover(ExampleQuota.Value - 100, 100), "After 100 quota is collected, this much will be rolled over (assuming the next quota is 100 for simplicity).");
			ConfigEntry<int> exampleRollover = ExampleRollover;
			IntInputFieldOptions val9 = new IntInputFieldOptions
			{
				RequiresRestart = false
			};
			object obj8 = <>c.<>9__13_12;
			if (obj8 == null)
			{
				CanModifyDelegate val10 = () => CanModifyResult.False("Press Apply to update this value.");
				<>c.<>9__13_12 = val10;
				obj8 = (object)val10;
			}
			((BaseOptions)val9).CanModifyCallback = (CanModifyDelegate)obj8;
			IntInputFieldConfigItem ExampleRolloverItem = new IntInputFieldConfigItem(exampleRollover, val9);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)ExampleRolloverItem);
			ExampleQuota.SettingChanged += delegate
			{
				ExampleRollover.Value = TimeOfDayPatch.CalculateQuotaRollover(ExampleQuota.Value - 100, 100);
				((BaseConfigItem)ExampleRolloverItem).ApplyChanges();
			};
			ConfigManager.RolloverFraction.SettingChanged += delegate
			{
				ExampleRollover.Value = TimeOfDayPatch.CalculateQuotaRollover(ExampleQuota.Value - 100, 100);
				((BaseConfigItem)ExampleRolloverItem).ApplyChanges();
			};
			ConfigManager.RolloverThreshold.SettingChanged += delegate
			{
				ExampleRollover.Value = TimeOfDayPatch.CalculateQuotaRollover(ExampleQuota.Value - 100, 100);
				((BaseConfigItem)ExampleRolloverItem).ApplyChanges();
			};
			ConfigManager.RolloverPenalty.SettingChanged += delegate
			{
				ExampleRollover.Value = TimeOfDayPatch.CalculateQuotaRollover(ExampleQuota.Value - 100, 100);
				((BaseConfigItem)ExampleRolloverItem).ApplyChanges();
			};
			ConfigManager.PenaltyUsed.SettingChanged += delegate
			{
				ExampleRollover.Value = TimeOfDayPatch.CalculateQuotaRollover(ExampleQuota.Value - 100, 100);
				((BaseConfigItem)ExampleRolloverItem).ApplyChanges();
			};
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem<ConfigManager.ColorOptions>(ConfigManager.ScreenColoration, false));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(ConfigManager.ColorUnderFulfilled, false));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(ConfigManager.ColorFulfilled, false));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(ConfigManager.ColorOverFulfilled, false));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(ConfigManager.TextColorOverrideUnderFulfilled, false));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(ConfigManager.TextColorOverrideFulfilled, false));
			LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(ConfigManager.TextColorOverrideOverFulfilled, false));
		}
	}
}
namespace LethalCompTime.Compat
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	internal class LobbyCompatibilityManager
	{
		public static LobbyCompatibilityManager Instance { get; private set; }

		public static void Init()
		{
			if (Instance == null)
			{
				Instance = new LobbyCompatibilityManager();
			}
		}

		private LobbyCompatibilityManager()
		{
			PluginHelper.RegisterPlugin("LethalCompTime", new Version("1.1.5"), (CompatibilityLevel)0, (VersionStrictness)0);
		}
	}
}