Decompiled source of FixInvincibleMithrix v0.0.1

FixInvincibleMithrix.dll

Decompiled 3 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 IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using RoR2;

[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("FixInvincibleMithrix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+8b4b1fe2cea1e448d0dae8ff0db2bd32820f786c")]
[assembly: AssemblyProduct("FixInvincibleMithrix")]
[assembly: AssemblyTitle("FixInvincibleMithrix")]
[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 FixInvincibleMithrix
{
	[BepInPlugin("RiskOfResources.FixInvincibleMithrix", "FixInvincibleMithrix", "0.0.1")]
	public class Main : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__CharacterBody_OnClientBuffsChanged;
		}

		public const string PluginGUID = "RiskOfResources.FixInvincibleMithrix";

		public const string PluginAuthor = "RiskOfResources";

		public const string PluginName = "FixInvincibleMithrix";

		public const string PluginVersion = "0.0.1";

		public void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			object obj = <>O.<0>__CharacterBody_OnClientBuffsChanged;
			if (obj == null)
			{
				Manipulator val = CharacterBody_OnClientBuffsChanged;
				<>O.<0>__CharacterBody_OnClientBuffsChanged = val;
				obj = (object)val;
			}
			CharacterBody.OnClientBuffsChanged += (Manipulator)obj;
		}

		private static void CharacterBody_OnClientBuffsChanged(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			VariableDefinition val2 = new VariableDefinition(il.Import(typeof(IncreaseDamageOnMultiKillItemDisplayUpdater)));
			il.Method.Body.Variables.Add(val2);
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<CharacterBody>(x, "increaseDamageOnMultiKillItemDisplayUpdater")
			}))
			{
				val.Emit(OpCodes.Stloc, val2);
				val.Emit(OpCodes.Ldloc, val2);
				ILLabel val3 = val.DefineLabel();
				val.Emit(OpCodes.Brfalse, (object)val3);
				val.Emit(OpCodes.Ldloc, val2);
				val.Index += 2;
				val.MarkLabel(val3);
			}
		}
	}
}