using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using ULTRAKILL.Portal; using ULTRAPortalCreator; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; 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: AssemblyTitle("Disintegration_Loop_is_ALL")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Disintegration_Loop_is_ALL")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("37faf8cb-9ffd-4b4c-be88-8a17da871319")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")] [assembly: AssemblyVersion("1.0.0.0")] namespace DisintegrationLoopDoors { [BepInPlugin("com.ultrakill.temp.ultra83", "Disintegration Loop Doors", "1.0.0")] public class Plugin : BaseUnityPlugin { [CompilerGenerated] private sealed class d__3 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Action callback; public Plugin <>4__this; private UnityWebRequest 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = UnityWebRequestMultimedia.GetAudioClip("https://github.com/TensulStudios/personalhobbyassets/raw/refs/heads/main/Modding/ULTRAKILL/8-3DOORS/Opening.mp3", (AudioType)13); <>1__state = -3; <>2__current = 5__1.SendWebRequest(); <>1__state = 1; return true; case 1: { <>1__state = -3; Result result = 5__1.result; Log("Result: " + ((object)(Result)(ref result)).ToString()); callback(DownloadHandlerAudioClip.GetContent(5__1)); <>m__Finally1(); 5__1 = null; return false; } } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (5__1 != null) { ((IDisposable)5__1).Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Plugin main; public static Harmony harmony; public static AudioClip openDoor; private readonly List layers = new List(); [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPrefix] private static void SkipReadCheck(ref bool checkReadWrite) { checkReadWrite = false; } [IteratorStateMachine(typeof(d__3))] private IEnumerator LoadOpenSound(Action callback) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { <>4__this = this, callback = callback }; } public void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown main = this; harmony = new Harmony("com.ultrakill.temp.ultra83"); harmony.PatchAll(); Log("Disintegration Loop Doors loaded!"); SceneManager.sceneLoaded += SceneManager_sceneLoaded; ((MonoBehaviour)this).StartCoroutine(LoadOpenSound(delegate(AudioClip clip) { openDoor = clip; Log("Loaded opening clip"); })); for (int i = 2; i <= 21; i++) { Log("Getting slice_capture_" + i); UnityWebRequest request = UnityWebRequestTexture.GetTexture("https://github.com/TensulStudios/personalhobbyassets/raw/refs/heads/main/Modding/ULTRAKILL/8-3DOORS/slice_capture_" + i + ".png"); ((AsyncOperation)request.SendWebRequest()).completed += delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 if ((int)request.result != 1) { Debug.LogError((object)("Failed: " + request.error)); } else { Texture2D content = DownloadHandlerTexture.GetContent(request); layers.Add(content); } }; } } private void MakePlane(float z, Texture2D tex) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown GameObject val = GameObject.CreatePrimitive((PrimitiveType)4); val.transform.position = new Vector3(0f, 200f, z); val.transform.eulerAngles = new Vector3(0f, 90f, 90f); val.transform.localScale = Vector3.one * 6f; Shader val2 = (((Object)(object)Shader.Find("Hidden/InternalErrorShader") != (Object)null) ? Shader.Find("GUI/Text Shader") : null); string[] array = new string[5] { "Sprites/Default", "UI/Default", "Unlit/Transparent", "Unlit/Transparent Cutout", "GUI/Text Shader" }; foreach (string text in array) { val2 = Shader.Find(text); if ((Object)(object)val2 != (Object)null) { Log("Using shader: " + text); break; } } Material val3 = new Material(val2 ?? RenderSettings.skybox.shader); val3.SetTexture("_MainTex", (Texture)(object)tex); MeshRenderer component = val.GetComponent(); ((Renderer)component).material = val3; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component).receiveShadows = false; } private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) { for (int i = 0; i < layers.Count; i++) { MakePlane(293f - 0.25f * (float)i, layers[i]); MakePlane(293f - 0.25f * (float)layers.Count, layers[i]); } } public static void Log(string msg) { ((BaseUnityPlugin)main).Logger.LogMessage((object)msg); } } public static class PluginInfo { public const string Name = "Disintegration Loop Doors"; public const string Version = "1.0.0"; public const string Creator = "Temp"; public const string GUID = "com.ultrakill.temp.ultra83"; } } namespace DisintegrationLoopDoors.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { ResourceManager resourceManager = new ResourceManager("DisintegrationLoopDoors.Properties.Resources", typeof(Resources).Assembly); resourceMan = resourceManager; } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] Layer1 { get { object @object = ResourceManager.GetObject("Layer1", resourceCulture); return (byte[])@object; } } internal static byte[] Layer2 { get { object @object = ResourceManager.GetObject("Layer2", resourceCulture); return (byte[])@object; } } internal static byte[] Layer3 { get { object @object = ResourceManager.GetObject("Layer3", resourceCulture); return (byte[])@object; } } internal static byte[] Layer4 { get { object @object = ResourceManager.GetObject("Layer4", resourceCulture); return (byte[])@object; } } internal Resources() { } } } namespace DisintegrationLoopDoors.Patches { [HarmonyPatch(typeof(Door), "Open", new Type[] { typeof(bool), typeof(bool) })] public static class DoorPortalCreator { [CompilerGenerated] private sealed class d__2 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private NewMovement 5__1; private CameraController 5__2; private Transform 5__3; private Transform 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (loading83) { return false; } loading83 = true; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = SceneHelper.LoadSceneAsync("Level 8-3", false); <>1__state = 2; return true; case 2: <>1__state = -1; SceneHelper.ShowLoadingBlocker(); 5__1 = MonoSingleton.Instance; 5__2 = MonoSingleton.Instance; 5__1.StopMovement(); 5__1.DeactivateMovement(); 5__1.DeactivatePlayer(); ((Behaviour)5__2).enabled = false; <>2__current = (object)new WaitForSeconds(2.5f); <>1__state = 3; return true; case 3: <>1__state = -1; SceneHelper.DismissBlockers(); MonoSingleton.Instance.LevelStart(); 5__1.ReactivateMovement(); ((Behaviour)5__2).enabled = true; 5__3 = ((Component)5__1).transform; 5__4 = ((Component)5__2.cam).transform; GameObject.Find("Pre-Space/Rooms/1 - Escher Entrance").SetActive(true); 5__3.position = new Vector3(-14.9741f, 38.74f, 449.205f); 5__3.eulerAngles = new Vector3(0f, 268.6597f, 0f); 5__4.eulerAngles = new Vector3(90f, 0f, 0f); loading83 = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static List alreadyPortalDoors = new List(); private static bool loading83 = false; [IteratorStateMachine(typeof(d__2))] private static IEnumerator TeleportAfterTime() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0); } public static void Prefix(Door __instance) { //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) if (Random.Range(1, 50) != 1 || SceneHelper.CurrentScene == "Level 8-3" || loading83) { return; } try { if (!__instance.locked && !Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponentInParent())) { __instance.activatedRooms = (GameObject[])(object)new GameObject[0]; __instance.deactivatedRooms = (GameObject[])(object)new GameObject[0]; ((MonoBehaviour)Plugin.main).StartCoroutine(TeleportAfterTime()); NewMovement instance = MonoSingleton.Instance; CameraController instance2 = MonoSingleton.Instance; instance.StopMovement(); instance.DeactivateMovement(); instance.DeactivatePlayer(); ((Behaviour)instance2).enabled = false; RenderSettings.fog = false; Plugin.Log("Going forward making for " + ((object)(DoorType)(ref __instance.doorType)).ToString()); if (!alreadyPortalDoors.Contains(__instance)) { alreadyPortalDoors.Add(__instance); AudioSource.PlayClipAtPoint(Plugin.openDoor, ((Component)__instance).transform.position, 2f); MonoSingleton.Instance.ForceStopMusic(); PortalTransform val = default(PortalTransform); ((PortalTransform)(ref val))..ctor(((Component)__instance).transform.position, ((Component)__instance).transform.eulerAngles + Vector3.up * 90f, Vector2.one * 15f); PortalTransform val2 = default(PortalTransform); ((PortalTransform)(ref val2))..ctor(new Vector3(0f, 200f, 300f), Vector3.zero, Vector2.one * 15f); PortalResult val3 = PortalConstructor.MakePortal(new PortalConstructorArgs(val, val2, true, true)); val3.portal.entryTravelFlags = (PortalTravellerFlags)0; val3.portal.exitTravelFlags = (PortalTravellerFlags)0; } } } catch (Exception ex) { Plugin.Log(ex.ToString()); } } } }