Decompiled source of BetterDrops v1.0.0

BepInEx/plugins/BetterDrops.dll

Decompiled 4 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 BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("BetterDrops")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+6151cb268910346be7b59b80f09c09cf3a1ae016")]
[assembly: AssemblyProduct("Increases the luck modifier for gear drops")]
[assembly: AssemblyTitle("BetterDrops")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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 BetterDrops
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "BetterDrops";

		public const string PLUGIN_NAME = "Increases the luck modifier for gear drops";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace MoreResources
{
	[BepInPlugin("BetterDrops", "Increases the luck modifier for gear drops", "1.0.0")]
	public class Plugin : BasePlugin
	{
		private static ConfigEntry<int> _luckBuff;

		private static ManualLogSource Log;

		public override void Load()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			Harmony.CreateAndPatchAll(typeof(Plugin), (string)null);
			_luckBuff = ((BasePlugin)this).Config.Bind<int>("Cheats", "Luck", 25, new ConfigDescription("How much to increase luck by. Higher values give better upgrade choices during the runs.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			Log = ((BasePlugin)this).Log;
			ManualLogSource log = Log;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(18, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("BetterDrops");
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
			}
			log.LogInfo(val);
		}

		[HarmonyPatch(typeof(RarityWeight), "PullRarity")]
		[HarmonyPrefix]
		private static void PullRarityPrefix(RarityWeight __instance, ref float luck)
		{
			luck += _luckBuff.Value;
		}
	}
}