Decompiled source of Double Money v1.0.3

DoubleMoney.dll

Decompiled 2 months 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 AddWatermark;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LBoL.Base.Extensions;
using LBoL.Core;
using UnityEngine;

[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: IgnoresAccessChecksTo("LBoL.Base")]
[assembly: IgnoresAccessChecksTo("LBoL.ConfigData")]
[assembly: IgnoresAccessChecksTo("LBoL.Core")]
[assembly: IgnoresAccessChecksTo("LBoL.EntityLib")]
[assembly: IgnoresAccessChecksTo("LBoL.Presentation")]
[assembly: IgnoresAccessChecksTo("Untitled.ConfigDataBuilder.Base")]
[assembly: AssemblyCompany("DoubleMoney")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DoubleMoney")]
[assembly: AssemblyTitle("DoubleMoney")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace DoubleMoney
{
	[BepInPlugin("intoxicatedkid.doublemoney", "Double Money", "1.0.3")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInProcess("LBoL.exe")]
	public class BepinexPlugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(GameRunController), "InternalGainMoney")]
		private class GameRunController_InternalGainMoney_Patch
		{
			private static void Prefix(GameRunController __instance, ref int money)
			{
				money = MathExtensions.RoundToInt((float)money * ((float)Math.Min(Math.Max(MoneyMultiplier.Value, 0), 100000) / 100f));
			}
		}

		private static readonly Harmony harmony = PInfo.harmony;

		internal static ManualLogSource log;

		public static ConfigEntry<int> MoneyMultiplier;

		private void Awake()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_0055: Expected O, but got Unknown
			log = ((BaseUnityPlugin)this).Logger;
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			MoneyMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("MoneyMultiplier", "MoneyMultiplier"), 200, new ConfigDescription("Multiply the amount of money gained by X%. Range 0 ~ 100000.", (AcceptableValueBase)null, Array.Empty<object>()));
			harmony.PatchAll();
			if (Chainloader.PluginInfos.ContainsKey("neo.lbol.tools.watermark"))
			{
				WatermarkWrapper.ActivateWatermark();
			}
		}

		private void OnDestroy()
		{
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}
	}
	public static class PInfo
	{
		public const string GUID = "intoxicatedkid.doublemoney";

		public const string Name = "Double Money";

		public const string version = "1.0.3";

		public static readonly Harmony harmony = new Harmony("intoxicatedkid.doublemoney");
	}
	internal class WatermarkWrapper
	{
		[MethodImpl(MethodImplOptions.NoInlining)]
		internal static void ActivateWatermark()
		{
			API.ActivateWatermark();
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		internal IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}