Decompiled source of VoidFogNerf v1.1.1

VoidFogNerf.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 BepInEx.Logging;
using IL.RoR2;
using Mono.Cecil;
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 = "")]
[assembly: AssemblyCompany("VoidFogNerf")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("VoidFogNerf")]
[assembly: AssemblyTitle("VoidFogNerf")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace VoidFogNerf
{
	[BepInPlugin("OakPrime.VoidFogNerf", "VoidFogNerf", "1.1.1")]
	public class VoidFogNerf : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Func<Instruction, bool> <>9__4_1;

			public static Func<Instruction, bool> <>9__4_2;

			public static Func<CharacterBody, float> <>9__4_3;

			public static Func<Instruction, bool> <>9__4_4;

			public static Func<Instruction, bool> <>9__4_5;

			public static Func<Instruction, bool> <>9__4_6;

			public static Manipulator <>9__4_0;

			internal void <Awake>b__4_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.TryGotoNext(new Func<Instruction, bool>[2]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_healthComponent"),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "get_fullCombinedHealth")
				});
				val.RemoveRange(2);
				val.EmitDelegate<Func<CharacterBody, float>>((Func<CharacterBody, float>)((CharacterBody key) => key.healthComponent.combinedHealth));
				int index = val.Index;
				val.Index = index + 1;
				val.Emit(OpCodes.Ldc_R4, 1.3f);
				val.Emit(OpCodes.Mul);
				MethodReference val2 = default(MethodReference);
				val.TryGotoNext(new Func<Instruction, bool>[3]
				{
					(Instruction x) => ILPatternMatchingExt.MatchDup(x),
					(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 66),
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val2)
				});
				val.RemoveRange(4);
			}

			internal bool <Awake>b__4_1(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_healthComponent");
			}

			internal bool <Awake>b__4_2(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "get_fullCombinedHealth");
			}

			internal float <Awake>b__4_3(CharacterBody key)
			{
				return key.healthComponent.combinedHealth;
			}

			internal bool <Awake>b__4_4(Instruction x)
			{
				return ILPatternMatchingExt.MatchDup(x);
			}

			internal bool <Awake>b__4_5(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcI4(x, 66);
			}

			internal bool <Awake>b__4_6(Instruction x)
			{
				MethodReference val = default(MethodReference);
				return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val);
			}
		}

		public const string PluginGUID = "OakPrime.VoidFogNerf";

		public const string PluginAuthor = "OakPrime";

		public const string PluginName = "VoidFogNerf";

		public const string PluginVersion = "1.1.1";

		public void Awake()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			try
			{
				object obj = <>c.<>9__4_0;
				if (obj == null)
				{
					Manipulator val = delegate(ILContext il)
					{
						//IL_0002: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Expected O, but got Unknown
						//IL_0099: Unknown result type (might be due to invalid IL or missing references)
						//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
						ILCursor val2 = new ILCursor(il);
						val2.TryGotoNext(new Func<Instruction, bool>[2]
						{
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_healthComponent"),
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "get_fullCombinedHealth")
						});
						val2.RemoveRange(2);
						val2.EmitDelegate<Func<CharacterBody, float>>((Func<CharacterBody, float>)((CharacterBody key) => key.healthComponent.combinedHealth));
						int index = val2.Index;
						val2.Index = index + 1;
						val2.Emit(OpCodes.Ldc_R4, 1.3f);
						val2.Emit(OpCodes.Mul);
						MethodReference val3 = default(MethodReference);
						val2.TryGotoNext(new Func<Instruction, bool>[3]
						{
							(Instruction x) => ILPatternMatchingExt.MatchDup(x),
							(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 66),
							(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val3)
						});
						val2.RemoveRange(4);
					};
					<>c.<>9__4_0 = val;
					obj = (object)val;
				}
				FogDamageController.MyFixedUpdate += (Manipulator)obj;
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}
	}
}
namespace ExamplePlugin
{
	internal static class Log
	{
		internal static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void LogDebug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void LogError(object data)
		{
			_logSource.LogError(data);
		}

		internal static void LogFatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void LogInfo(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void LogMessage(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void LogWarning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}