Decompiled source of PowerupsConfig v2.0.1

PowerupsConfig.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 BepInEx;
using BepInEx.Configuration;
using BoplFixedMath;
using HarmonyLib;
using HarmonyLib.Tools;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("PowerupsConfig")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Config options for powerup drops")]
[assembly: AssemblyFileVersion("2.0.1.0")]
[assembly: AssemblyInformationalVersion("2.0.1")]
[assembly: AssemblyProduct("PowerupsConfig")]
[assembly: AssemblyTitle("PowerupsConfig")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.0.1.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 PowerupsConfig
{
	[BepInPlugin("com.Starbox614.PowerupsConfig", "PowerupsConfig", "2.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(AbilitySpawner), "Awake")]
		private class Patch
		{
			private static void Prefix(ref Fix ___SpawnDelay, ref int ___MaxSpawns)
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				___SpawnDelay = (Fix)configSpawnDelay.Value;
				___MaxSpawns = configMaxSpawns.Value;
			}
		}

		private Harmony harmony = new Harmony("com.Starbox614.PowerupsConfig");

		private static ConfigEntry<float> configSpawnDelay;

		private static ConfigEntry<int> configMaxSpawns;

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin PowerupsConfig is loaded!");
			HarmonyFileLog.Enabled = true;
			configSpawnDelay = ((BaseUnityPlugin)this).Config.Bind<float>("main", "spawn delay", 40f, "delay between spawning abilities");
			configMaxSpawns = ((BaseUnityPlugin)this).Config.Bind<int>("main", "max spawns", 3, "maximum amount of spawns");
			harmony.PatchAll();
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "PowerupsConfig";

		public const string PLUGIN_NAME = "PowerupsConfig";

		public const string PLUGIN_VERSION = "2.0.1";
	}
}