Decompiled source of BoomRankStock v1.0.0

BoomRankStock.dll

Decompiled 2 days 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 HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Fields;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 BoomRankStock
{
	[BepInPlugin("com.corruptsoul.boomrankstock", "BoomRankStock", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "com.corruptsoul.boomrankstock";

		public static FloatField RankMultiplier;

		private void Awake()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			RankMultiplier = new FloatField(PluginConfigurator.Create("BoomRankStock", "com.corruptsoul.boomrankstock").rootPanel, "Rank Multiplier (1x - 50x)", "field.rankmultiplier", 1f, 1f, 50f, true, true);
			new Harmony("com.corruptsoul.boomrankstock").PatchAll(typeof(StylePatches));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"BoomRankStock loaded.");
		}
	}
	[HarmonyPatch(typeof(StyleHUD))]
	internal static class StylePatches
	{
		[HarmonyPrefix]
		[HarmonyPatch("AddPoints")]
		private static void AddPointsPrefix(ref int points)
		{
			if (points > 0)
			{
				float num = Plugin.RankMultiplier.value;
				if (num < 1f)
				{
					num = 1f;
				}
				if (num > 50f)
				{
					num = 50f;
				}
				points = (int)Math.Round((float)points * num);
			}
		}
	}
}