Decompiled source of BetterQuotaDays v1.0.0

BetterQuotaDays.dll

Decompiled 10 months ago
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.Logging;
using BetterQuotaDays.Patches;
using HarmonyLib;

[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 = "")]
[assembly: AssemblyCompany("BetterQuotaDays")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BetterQuotaDays")]
[assembly: AssemblyTitle("BetterQuotaDays")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace BetterQuotaDays
{
	[BepInPlugin("BetterQuotaDays", "BetterQuotaDays", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public static ManualLogSource LoggerInstance;

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("BetterQuotaDays");
			val.PatchAll(typeof(TimeOfDayPatch));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin BetterQuotaDays is loaded!");
			LoggerInstance = ((BaseUnityPlugin)this).Logger;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "BetterQuotaDays";

		public const string PLUGIN_NAME = "BetterQuotaDays";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace BetterQuotaDays.Patches
{
	[HarmonyPatch(typeof(TimeOfDay))]
	internal class TimeOfDayPatch
	{
		[HarmonyPatch("SetNewProfitQuota")]
		[HarmonyPostfix]
		private static void Postfix(TimeOfDay __instance)
		{
			int num = 4 + __instance.profitQuota / 1000;
			__instance.timeUntilDeadline = __instance.totalTime * (float)num;
			__instance.quotaVariables.deadlineDaysAmount = num;
			Plugin.LoggerInstance.LogInfo((object)$"New deadline: {num} days");
		}

		[HarmonyPatch("SyncNewProfitQuotaClientRpc")]
		[HarmonyPostfix]
		private static void Postfix2(TimeOfDay __instance)
		{
			int num = 4 + __instance.profitQuota / 1000;
			__instance.timeUntilDeadline = __instance.totalTime * (float)num;
			__instance.quotaVariables.deadlineDaysAmount = num;
			Plugin.LoggerInstance.LogInfo((object)$"New deadline: {num} days");
		}
	}
}