Decompiled source of Nacreous Depths v0.0.5

woodzwarper.dll

Decompiled a month 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 Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("woodzwarper")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Seamless Teleport")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyProduct("woodzwarper")]
[assembly: AssemblyTitle("woodzwarper")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.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 woodzwarper
{
	[BepInPlugin("info.mariobluegloves.warperp", "Warper", "0.0.1")]
	[BepInProcess("Bomb Rush Cyberfunk.exe")]
	public class WarperPlugin : BaseUnityPlugin
	{
		private class PlayerTriggerHandler : MonoBehaviour
		{
			private WarperPlugin plugin;

			private Vector3 positionDifference;

			private Quaternion rotationDifference;

			public void Initialize(WarperPlugin plugin)
			{
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: 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_001b: Unknown result type (might be due to invalid IL or missing references)
				this.plugin = plugin;
				positionDifference = plugin.positionDifference;
				rotationDifference = plugin.rotationDifference;
			}

			private void OnTriggerEnter(Collider other)
			{
				if (((Object)((Component)other).gameObject).name == "seamlesswarp")
				{
					ApplyWarp();
				}
				if (((Object)((Component)other).gameObject).name == "seamlesswarp2")
				{
					ApplyWarp2();
				}
			}

			private void ApplyWarp()
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				Transform transform = ((Component)this).transform;
				transform.position += positionDifference;
			}

			private void ApplyWarp2()
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				Transform transform = ((Component)this).transform;
				transform.position -= positionDifference;
			}
		}

		private Transform warpto;

		private Transform warpfrom;

		private bool sceneLoaded = false;

		private Vector3 positionDifference;

		private Quaternion rotationDifference;

		private Vector3 positionDifference2;

		private Quaternion rotationDifference2;

		private void Awake()
		{
			SceneManager.sceneLoaded += OnSceneLoaded;
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			sceneLoaded = true;
		}

		private void Update()
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			if (sceneLoaded)
			{
				GameObject val = GameObject.Find("Player_HUMAN0");
				GameObject obj = GameObject.Find("WarpTo");
				warpto = ((obj != null) ? obj.transform : null);
				GameObject obj2 = GameObject.Find("WarpFrom");
				warpfrom = ((obj2 != null) ? obj2.transform : null);
				if ((Object)(object)warpto != (Object)null && (Object)(object)warpfrom != (Object)null && (Object)(object)val != (Object)null)
				{
					Vector3 position = warpto.position;
					Quaternion rotation = warpto.rotation;
					Vector3 position2 = warpfrom.position;
					Quaternion rotation2 = warpfrom.rotation;
					positionDifference = position - position2;
					rotationDifference = rotation * Quaternion.Inverse(rotation2);
					PlayerTriggerHandler playerTriggerHandler = val.AddComponent<PlayerTriggerHandler>();
					playerTriggerHandler.Initialize(this);
					sceneLoaded = false;
				}
			}
		}
	}
}