Decompiled source of No Void Allies v1.0.7

NoVoidAllies.dll

Decompiled 4 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using EntityStates;
using EntityStates.VoidInfestor;
using IL.EntityStates.VoidInfestor;
using Mono.Cecil.Cil;
using MonoMod.Cil;
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("NoVoidAllies")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+9c20ab96f6714a646ddbf4100338ee8c8c5814b3")]
[assembly: AssemblyProduct("NoVoidAllies")]
[assembly: AssemblyTitle("NoVoidAllies")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NoVoidAllies
{
	[BepInPlugin("com.Moffein.NoVoidAllies", "No Void Allies", "1.0.7")]
	public class NoVoidAllies : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

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

			public static Func<BullseyeSearch, BullseyeSearch> <>9__0_3;

			public static Manipulator <>9__0_0;

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

			public static Func<bool, CharacterBody, bool> <>9__0_5;

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

			public static Func<TeamIndex, Infest, TeamIndex> <>9__0_7;

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

			public static Func<TeamIndex, Infest, TeamIndex> <>9__0_9;

			public static Manipulator <>9__0_1;

			internal void <Awake>b__0_0(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				ILCursor val = new ILCursor(il);
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallvirt<BullseyeSearch>(x, "RefreshCandidates")
				});
				val.EmitDelegate<Func<BullseyeSearch, BullseyeSearch>>((Func<BullseyeSearch, BullseyeSearch>)delegate(BullseyeSearch search)
				{
					((TeamMask)(ref search.teamMaskFilter)).RemoveTeam((TeamIndex)1);
					return search;
				});
			}

			internal bool <Awake>b__0_2(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallvirt<BullseyeSearch>(x, "RefreshCandidates");
			}

			internal BullseyeSearch <Awake>b__0_3(BullseyeSearch search)
			{
				((TeamMask)(ref search.teamMaskFilter)).RemoveTeam((TeamIndex)1);
				return search;
			}

			internal void <Awake>b__0_1(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_009a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallvirt<CharacterBody>(x, "get_isPlayerControlled")
				});
				val.Emit(OpCodes.Ldloc_3);
				val.EmitDelegate<Func<bool, CharacterBody, bool>>((Func<bool, CharacterBody, bool>)((bool playerControlled, CharacterBody body) => playerControlled || (Object.op_Implicit((Object)(object)body.teamComponent) && (int)body.teamComponent.teamIndex == 1) || body.isBoss));
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallvirt<CharacterMaster>(x, "set_teamIndex")
				});
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<TeamIndex, Infest, TeamIndex>>((Func<TeamIndex, Infest, TeamIndex>)((TeamIndex team, Infest self) => ((BaseState)self).GetTeam()));
				val.GotoNext(new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallvirt<TeamComponent>(x, "set_teamIndex")
				});
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<TeamIndex, Infest, TeamIndex>>((Func<TeamIndex, Infest, TeamIndex>)((TeamIndex team, Infest self) => ((BaseState)self).GetTeam()));
			}

			internal bool <Awake>b__0_4(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallvirt<CharacterBody>(x, "get_isPlayerControlled");
			}

			internal bool <Awake>b__0_5(bool playerControlled, CharacterBody body)
			{
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Invalid comparison between Unknown and I4
				return playerControlled || (Object.op_Implicit((Object)(object)body.teamComponent) && (int)body.teamComponent.teamIndex == 1) || body.isBoss;
			}

			internal bool <Awake>b__0_6(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallvirt<CharacterMaster>(x, "set_teamIndex");
			}

			internal TeamIndex <Awake>b__0_7(TeamIndex team, Infest self)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				return ((BaseState)self).GetTeam();
			}

			internal bool <Awake>b__0_8(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallvirt<TeamComponent>(x, "set_teamIndex");
			}

			internal TeamIndex <Awake>b__0_9(TeamIndex team, Infest self)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				return ((BaseState)self).GetTeam();
			}
		}

		public void Awake()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			object obj = <>c.<>9__0_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
					ILCursor val4 = new ILCursor(il);
					val4.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallvirt<BullseyeSearch>(x, "RefreshCandidates")
					});
					val4.EmitDelegate<Func<BullseyeSearch, BullseyeSearch>>((Func<BullseyeSearch, BullseyeSearch>)delegate(BullseyeSearch search)
					{
						((TeamMask)(ref search.teamMaskFilter)).RemoveTeam((TeamIndex)1);
						return search;
					});
				};
				<>c.<>9__0_0 = val;
				obj = (object)val;
			}
			Infest.OnEnter += (Manipulator)obj;
			object obj2 = <>c.<>9__0_1;
			if (obj2 == null)
			{
				Manipulator val2 = 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_0039: Unknown result type (might be due to invalid IL or missing references)
					//IL_009a: Unknown result type (might be due to invalid IL or missing references)
					//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val3 = new ILCursor(il);
					val3.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallvirt<CharacterBody>(x, "get_isPlayerControlled")
					});
					val3.Emit(OpCodes.Ldloc_3);
					val3.EmitDelegate<Func<bool, CharacterBody, bool>>((Func<bool, CharacterBody, bool>)((bool playerControlled, CharacterBody body) => playerControlled || (Object.op_Implicit((Object)(object)body.teamComponent) && (int)body.teamComponent.teamIndex == 1) || body.isBoss));
					val3.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallvirt<CharacterMaster>(x, "set_teamIndex")
					});
					val3.Emit(OpCodes.Ldarg_0);
					val3.EmitDelegate<Func<TeamIndex, Infest, TeamIndex>>((Func<TeamIndex, Infest, TeamIndex>)((TeamIndex team, Infest self) => ((BaseState)self).GetTeam()));
					val3.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchCallvirt<TeamComponent>(x, "set_teamIndex")
					});
					val3.Emit(OpCodes.Ldarg_0);
					val3.EmitDelegate<Func<TeamIndex, Infest, TeamIndex>>((Func<TeamIndex, Infest, TeamIndex>)((TeamIndex team, Infest self) => ((BaseState)self).GetTeam()));
				};
				<>c.<>9__0_1 = val2;
				obj2 = (object)val2;
			}
			Infest.FixedUpdate += (Manipulator)obj2;
		}
	}
}
namespace R2API.Utils
{
	[AttributeUsage(AttributeTargets.Assembly)]
	public class ManualNetworkRegistrationAttribute : Attribute
	{
	}
}