Decompiled source of MicroDropBotsRevived v1.1.2

MicroDropBots.dll

Decompiled 3 weeks ago
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using R2API.Utils;
using RoR2;
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: AssemblyCompany("MicroDropBots")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+9121e9b05d8dfc0da3cef4ecdf00a4deb7952d36")]
[assembly: AssemblyProduct("MicroDropBots")]
[assembly: AssemblyTitle("MicroDropBots")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[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 MicroDropBotsRevived
{
	[BepInPlugin("com.phreel.MicroDropBotsRevived", "MicroDropBotsRevived", "1.1.2")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class MicroDropBots : BaseUnityPlugin
	{
		public void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("com.arimah.MicroDropBots").PatchAll(Assembly.GetExecutingAssembly());
		}
	}
	[HarmonyPatch(typeof(ItemCatalog))]
	internal class ItemCatalogPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("SetItemDefs")]
		private static void SetItemDefs(ItemDef[] newItemDefs)
		{
			ManualLogSource val = Logger.CreateLogSource("MicroDropBotsRevived");
			try
			{
				ItemDef val2 = newItemDefs.First((ItemDef i) => ((Object)i).name == "CaptainDefenseMatrix");
				if (Object.op_Implicit((Object)(object)val2))
				{
					ItemTag[] array = new ItemTag[4];
					RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
					val2.tags = (ItemTag[])(object)array;
					val.LogMessage((object)"Defensive Microbots is now findable");
				}
				else
				{
					val.LogWarning((object)"Could not locate Defensive Microbots item");
				}
			}
			finally
			{
				((IDisposable)val)?.Dispose();
			}
		}
	}
}