Decompiled source of MicroDropBotsRevived v1.1.1

MicroDropBots.dll

Decompiled 3 months 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 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 = "")]
[assembly: AssemblyCompany("MicroDropBots")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[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]
namespace MicroDropBotsRevived;

[BepInPlugin("com.phreel.MicroDropBotsRevived", "MicroDropBotsRevived", "1.1.1")]
[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))
			{
				val2.tags = (ItemTag[])(object)new ItemTag[3]
				{
					default(ItemTag),
					(ItemTag)4,
					(ItemTag)3
				};
				val.LogMessage((object)"Defensive Microbots is now findable");
			}
			else
			{
				val.LogWarning((object)"Could not locate Defensive Microbots item");
			}
		}
		finally
		{
			((IDisposable)val)?.Dispose();
		}
	}
}