Decompiled source of OrbTunneling v0.0.1

OrbTunneling.dll

Decompiled 3 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Battle.PegBehaviour;
using BepInEx;
using Microsoft.CodeAnalysis;
using On.Battle.PegBehaviour;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("OrbTunneling")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Prevents Concentrication and Lazorb from passing through special pegs")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyProduct("OrbTunneling")]
[assembly: AssemblyTitle("OrbTunneling")]
[assembly: AssemblyVersion("0.0.1.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[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 OrbTunneling
{
	[BepInPlugin("OrbTunneling", "OrbTunneling", "0.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			PegTriggerActivator.OnTriggerEnter2D += new hook_OnTriggerEnter2D(PegTriggerActivatorOnOnTriggerEnter2D);
		}

		private void OnDestroy()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			PegTriggerActivator.OnTriggerEnter2D -= new hook_OnTriggerEnter2D(PegTriggerActivatorOnOnTriggerEnter2D);
		}

		private void PegTriggerActivatorOnOnTriggerEnter2D(orig_OnTriggerEnter2D orig, PegTriggerActivator self, Collider2D collision)
		{
			PachinkoBall componentInParent = ((Component)collision).GetComponentInParent<PachinkoBall>();
			if (Object.op_Implicit((Object)(object)componentInParent) && componentInParent.IsDummy)
			{
				orig.Invoke(self, collision);
				return;
			}
			ConcentricationPachinko componentInParent2 = ((Component)collision).GetComponentInParent<ConcentricationPachinko>();
			Peg componentInParent3 = ((Component)self).GetComponentInParent<Peg>();
			if (Object.op_Implicit((Object)(object)componentInParent2) && Object.op_Implicit((Object)(object)componentInParent3) && componentInParent3.IsSpecialPeg())
			{
				Debug.Log((object)"Preventing ConcentricationPachinko from activating special peg");
			}
			else
			{
				orig.Invoke(self, collision);
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "OrbTunneling";

		public const string PLUGIN_NAME = "OrbTunneling";

		public const string PLUGIN_VERSION = "0.0.1";
	}
}