Decompiled source of Jaket v1.2.22

Jaket.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using BepInEx;
using Discord;
using GameConsole;
using HarmonyLib;
using Jaket.Assets;
using Jaket.Commands;
using Jaket.Content;
using Jaket.IO;
using Jaket.Net;
using Jaket.Net.Endpoints;
using Jaket.Net.Types;
using Jaket.Sam;
using Jaket.Sprays;
using Jaket.UI;
using Jaket.UI.Dialogs;
using Jaket.UI.Elements;
using Jaket.UI.Fragments;
using Jaket.World;
using Microsoft.CodeAnalysis;
using Sandbox;
using Steamworks;
using Steamworks.Data;
using TMPro;
using ULTRAKILL.Cheats;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.UI.Extensions;
using plog;
using plog.Models;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Jaket")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Multikill is still in development, so I created my own multiplayer mod for Ultrakill")]
[assembly: AssemblyFileVersion("1.2.22.0")]
[assembly: AssemblyInformationalVersion("1.2.22")]
[assembly: AssemblyProduct("Jaket")]
[assembly: AssemblyTitle("Jaket")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.22.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
}
namespace Jaket
{
	public class Events : MonoSingleton<Events>
	{
		public static SafeEvent OnLoaded = new SafeEvent();

		public static SafeEvent OnMainMenuLoaded = new SafeEvent();

		public static SafeEvent OnLobbyAction = new SafeEvent();

		public static SafeEvent OnLobbyEntered = new SafeEvent();

		public static SafeEvent OnTeamChanged = new SafeEvent();

		public static SafeEvent OnWeaponChanged = new SafeEvent();

		public static Queue<Action> Tasks = new Queue<Action>();

		public static SafeEvent EverySecond = new SafeEvent();

		public static SafeEvent EveryTick = new SafeEvent();

		public static void Load()
		{
			Tools.Create<Events>("Events", (Transform)null);
			SceneManager.sceneLoaded += delegate
			{
				OnLoaded.Fire();
				if (Tools.Scene == "Main Menu")
				{
					OnMainMenuLoaded.Fire();
				}
			};
			SteamMatchmaking.OnLobbyMemberLeave += delegate
			{
				Post(OnTeamChanged.Fire);
			};
			SteamMatchmaking.OnLobbyDataChanged += delegate
			{
				OnLobbyAction.Fire();
			};
			SteamMatchmaking.OnLobbyEntered += delegate
			{
				OnLobbyEntered.Fire();
			};
			OnLobbyAction += new Action(OnTeamChanged.Fire);
			OnLobbyAction += new Action(OnWeaponChanged.Fire);
			OnLobbyAction += (Action)delegate
			{
				DiscordController.Instance.FetchSceneActivity(Tools.Scene);
				SteamController.Instance.FetchSceneActivity(Tools.Scene);
				Application.runInBackground = LobbyController.Online;
			};
		}

		public static void Post(Action task)
		{
			Tasks.Enqueue(task);
		}

		public static void Post2(Action task)
		{
			Post(delegate
			{
				Post(task);
			});
		}

		private void Second()
		{
			EverySecond.Fire();
		}

		private void Tick()
		{
			EveryTick.Fire();
		}

		private void Start()
		{
			((MonoBehaviour)this).InvokeRepeating("Second", 1f, 1f);
			((MonoBehaviour)this).InvokeRepeating("Tick", 1f, 0.0625f);
		}

		private void LateUpdate()
		{
			int count = Tasks.Count;
			for (int i = 0; i < count; i++)
			{
				Tasks.Dequeue()?.Invoke();
			}
		}
	}
	public class SafeEvent
	{
		private List<Action> listeners = new List<Action>();

		public void Fire()
		{
			for (int i = 0; i < listeners.Count; i++)
			{
				try
				{
					listeners[i]();
				}
				catch (Exception ex)
				{
					Log.Error(ex);
				}
			}
		}

		public static SafeEvent operator +(SafeEvent e, Action listener)
		{
			e.listeners.Add(listener);
			return e;
		}

		public static SafeEvent operator -(SafeEvent e, Action listener)
		{
			e.listeners.Remove(listener);
			return e;
		}
	}
	public class Log
	{
		public enum Level
		{
			Debug,
			Info,
			Warning,
			Error
		}

		public const string TIME_FORMAT = "yyyy.MM.dd HH:mm:ss";

		public const int STORAGE_CAPACITY = 32;

		public static List<string> ToWrite = new List<string>();

		public static Logger Logger;

		public static string LogPath;

		public static string Time => DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");

		public static void Load()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			Logger = new Logger("Jaket");
			LogPath = Path.Combine(Path.GetDirectoryName(Plugin.Instance.Location), "logs", "Log " + Time.Replace(':', '.') + ".txt");
			Events.OnLobbyAction += (Action)delegate
			{
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: 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_003c: Unknown result type (might be due to invalid IL or missing references)
				Lobby val;
				object obj;
				if (!LobbyController.Offline)
				{
					object arg;
					if (!LobbyController.Lobby.HasValue)
					{
						arg = null;
					}
					else
					{
						val = LobbyController.Lobby.GetValueOrDefault();
						arg = ((Lobby)(ref val)).GetData("name");
					}
					val = LobbyController.Lobby.Value;
					obj = $"{arg} ({((Lobby)(ref val)).Id})";
				}
				else
				{
					obj = "null";
				}
				string text = (string)obj;
				object obj2;
				if (!LobbyController.Lobby.HasValue)
				{
					obj2 = null;
				}
				else
				{
					val = LobbyController.Lobby.GetValueOrDefault();
					Friend owner = ((Lobby)(ref val)).Owner;
					obj2 = ((object)(Friend)(ref owner)).ToString();
				}
				if (obj2 == null)
				{
					obj2 = "null";
				}
				string text2 = (string)obj2;
				Debug("Lobby status updated: cl is " + text + ", owner is " + text2);
			};
			Events.OnLobbyEntered += (Action)delegate
			{
				Debug("Entered the new lobby");
			};
		}

		public static void LogLevel(Level level, string msg)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			Logger logger = Logger;
			string text = ((level == Level.Debug) ? ("<color=#BBBBBB>" + msg + "</color>") : msg);
			Level val;
			switch (level)
			{
			case Level.Debug:
			case Level.Info:
				val = (Level)10;
				break;
			case Level.Warning:
				val = (Level)20;
				break;
			default:
				val = (Level)30;
				break;
			}
			logger.Log(text, val, (IEnumerable<Tag>)null, (string)null);
			ToWrite.Add($"[{Time}] [{(new char[4] { 'D', 'I', 'W', 'E' })[(int)level]}] {msg}");
			if (ToWrite.Count > 32)
			{
				Flush();
			}
		}

		public static void Flush()
		{
			if (ToWrite.Count != 0)
			{
				Directory.CreateDirectory(Path.GetDirectoryName(LogPath));
				File.AppendAllLines(LogPath, ToWrite);
				ToWrite.Clear();
			}
		}

		public static void Debug(string msg)
		{
			LogLevel(Level.Debug, msg);
		}

		public static void Info(string msg)
		{
			LogLevel(Level.Info, msg);
		}

		public static void Warning(string msg)
		{
			LogLevel(Level.Warning, msg);
		}

		public static void Error(string msg)
		{
			LogLevel(Level.Error, msg);
		}

		public static void Error(Exception ex)
		{
			LogLevel(Level.Error, ex.ToString() + "\nOuter:\n" + StackTraceUtility.ExtractStackTrace());
		}
	}
	[BepInPlugin("xzxADIxzx.Jaket", "Jaket", "1.2.22")]
	public class PluginLoader : BaseUnityPlugin
	{
		private void Awake()
		{
			SceneManager.sceneLoaded += delegate
			{
				if ((Object)(object)Plugin.Instance == (Object)null)
				{
					Tools.Create<Plugin>("Jaket", (Transform)null).Location = ((BaseUnityPlugin)this).Info.Location;
				}
			};
		}
	}
	public class Plugin : MonoBehaviour
	{
		public static Plugin Instance;

		public bool Initialized;

		public string Location;

		private void Awake()
		{
			Object.DontDestroyOnLoad((Object)(object)(Instance = this));
		}

		private void Start()
		{
			Log.Load();
			Log.Info("Loading jaket...");
			Events.Load();
			Events.OnMainMenuLoaded += new Action(Init);
		}

		private void OnApplicationQuit()
		{
			Log.Flush();
		}

		private void Init()
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			if (!Initialized)
			{
				Version.Check4Update();
				Jaket.Commands.Commands.Load();
				Bundle.Load();
				DollAssets.Load();
				Enemies.Load();
				Weapons.Load();
				Bullets.Load();
				Items.Load();
				Administration.Load();
				LobbyController.Load();
				Networking.Load();
				Entities.Load();
				Jaket.World.World.Load();
				WorldActionsList.Load();
				Movement.Load();
				SprayManager.Load();
				UIB.Load();
				Jaket.UI.UI.Load();
				new Harmony("Should I write something here?").PatchAll();
				Initialized = true;
				Log.Info("Jaket initialized!");
			}
		}
	}
	public class Tools
	{
		public static string Scene => SceneHelper.CurrentScene;

		public static void Load(string scene)
		{
			SceneHelper.LoadScene(scene, false);
		}

		public static bool IsReal(GameObject obj)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			Scene scene = obj.scene;
			return ((Scene)(ref scene)).name != null;
		}

		public static bool IsReal(Component comp)
		{
			return IsReal(comp.gameObject);
		}

		public static GameObject Create(string name, Transform parent = null)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			GameObject val = new GameObject(name);
			Transform transform = val.transform;
			object obj = parent;
			if (obj == null)
			{
				Plugin instance = Plugin.Instance;
				obj = ((instance != null) ? ((Component)instance).transform : null);
			}
			transform.SetParent((Transform)obj, false);
			return val;
		}

		public static T Create<T>(string name, Transform parent = null) where T : Component
		{
			return Create(name, parent).AddComponent<T>();
		}

		public static void Destroy(Object obj)
		{
			Object.Destroy(obj);
		}

		public static void DestroyImmediate(Object obj)
		{
			Object.DestroyImmediate(obj);
		}

		public static T[] ResFind<T>() where T : Object
		{
			return Resources.FindObjectsOfTypeAll<T>();
		}

		public static void ResFind<T>(Predicate<T> pred, Action<T> cons) where T : Object
		{
			T[] array = ResFind<T>();
			foreach (T obj in array)
			{
				if (pred(obj))
				{
					cons(obj);
				}
			}
		}

		public static T ObjFind<T>() where T : Object
		{
			return Object.FindObjectOfType<T>();
		}

		public static GameObject ObjFind(string name)
		{
			return GameObject.Find(name);
		}

		public static UnityEvent GetClick(GameObject btn)
		{
			MonoBehaviour obj = btn.GetComponents<MonoBehaviour>()[2];
			object? value = Property("OnPressed", obj).GetValue(obj);
			return (UnityEvent)((value is UnityEvent) ? value : null);
		}

		public static FieldInfo Field<T>(string name)
		{
			return AccessTools.Field(typeof(T), name);
		}

		public static FieldInfo Field(string name, object obj)
		{
			return AccessTools.Field(obj.GetType(), name);
		}

		public static PropertyInfo Property<T>(string name)
		{
			return AccessTools.Property(typeof(T), name);
		}

		public static PropertyInfo Property(string name, object obj)
		{
			return AccessTools.Property(obj.GetType(), name);
		}

		public static void Invoke<T>(string name, T obj, params object[] args)
		{
			AccessTools.Method(typeof(T), name, (Type[])null, (Type[])null).Invoke(obj, args);
		}
	}
	public class Version
	{
		public const string CURRENT = "1.2.22";

		public const string REPO = "xzxADIxzx/Join-and-kill-em-together";

		public const string GITHUB_API = "https://api.github.com";

		public const string TAG = "\"tag_name\": \"V";

		public const string NAME = "\"name\": \"";

		public static void Notify()
		{
			Bundle.Hud("version.host-outdated");
		}

		public static void Check4Update()
		{
			Fetch(delegate(bool done, string result)
			{
				if (done && Parse(result, out var latest, out var name) && latest != "1.2.22")
				{
					Bundle.Hud("version.outdated", false, "1.2.22", latest, name);
				}
			});
		}

		public static void Fetch(Action<bool, string> result)
		{
			Log.Info("Checking for updates...");
			UnityWebRequest request = UnityWebRequest.Get("https://api.github.com/repos/xzxADIxzx/Join-and-kill-em-together/releases");
			((AsyncOperation)request.SendWebRequest()).completed += delegate
			{
				result(request.isDone, request.downloadHandler.text);
			};
		}

		public static bool Parse(string result, out string latest, out string name)
		{
			latest = (name = "Failed to parse data ;(");
			int num = result.IndexOf("\"tag_name\": \"V");
			int num2 = result.IndexOf("\"name\": \"");
			if (num == -1 || num2 == -1)
			{
				return false;
			}
			latest = result.Substring(num += "\"tag_name\": \"V".Length, result.IndexOf('"', num) - num);
			name = result.Substring(num2 += "\"name\": \"".Length, result.IndexOf('"', num2) - num2);
			return true;
		}

		public static void Label(Transform parent)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			Rect r = new Rect(184f, 36f, 336f, 40f, Vector2.zero, Vector2.zero);
			UIB.Table("Version", parent, r, delegate(Transform table)
			{
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				UIB.Text("Jaket version is 1.2.22", table, r.ToText(), Color.grey, 24, (TextAnchor)4);
			});
		}
	}
}
namespace Jaket.World
{
	public class WorldAction
	{
		public readonly string Level;

		public readonly Action Action;

		public WorldAction(string level, Action action)
		{
			Level = level;
			Action = action;
			World.Actions.Add(this);
		}

		public void Run()
		{
			if (Tools.Scene == Level)
			{
				Action();
			}
		}
	}
	public class StaticAction : WorldAction
	{
		public StaticAction(string level, Action action)
			: base(level, action)
		{
		}

		public static StaticAction PlaceTorches(string level, Vector3 pos, float radius)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return new StaticAction(level, delegate
			{
				//IL_0023: 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_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				if (Tools.ResFind<Torch>().Length < 8)
				{
					GameObject val = GameAssets.Torch();
					for (float num = 308.57144f; num >= 0f; num -= 51.42857f)
					{
						float num2 = num * (MathF.PI / 180f);
						Object.Instantiate<GameObject>(val, pos + new Vector3(Mathf.Cos(num2), 0f, Mathf.Sin(num2)) * radius, Quaternion.Euler(0f, num / 7f, 0f)).GetComponentInChildren<Light>().intensity = 3f;
					}
				}
			});
		}

		public static StaticAction Find(string level, string name, Vector3 position, Action<GameObject> action)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return new StaticAction(level, delegate
			{
				Tools.ResFind<GameObject>((Predicate<GameObject>)((GameObject obj) => Tools.IsReal(obj) && obj.transform.position == position && ((Object)obj).name == name), action);
			});
		}

		public static StaticAction Patch(string level, string name, Vector3 position)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			return Find(level, name, position, delegate(GameObject obj)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Expected O, but got Unknown
				obj.AddComponent<ObjectActivator>().events = new UltrakillEvent();
			});
		}

		public static StaticAction Enable(string level, string name, Vector3 position)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			return Find(level, name, position, delegate(GameObject obj)
			{
				obj.SetActive(true);
			});
		}

		public static StaticAction Destroy(string level, string name, Vector3 position)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			return Find(level, name, position, Tools.Destroy);
		}
	}
	public class NetAction : WorldAction
	{
		public string Name;

		public Vector3 Position;

		public NetAction(string level, string name, Vector3 position, Action action)
			: base(level, action)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			Name = name;
			Position = position;
		}

		public static NetAction Sync(string level, string name, Vector3 position, Action<GameObject> action = null)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			return new NetAction(level, name, position, delegate
			{
				Tools.ResFind<GameObject>((Predicate<GameObject>)((GameObject obj) => Tools.IsReal(obj) && obj.transform.position == position && ((Object)obj).name == name), (Action<GameObject>)delegate(GameObject obj)
				{
					obj.SetActive(true);
					action?.Invoke(obj);
				});
			});
		}

		public static NetAction SyncButton(string level, string name, Vector3 position, Action<GameObject> action = null)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			NetAction net = Sync(level, name, position, delegate(GameObject obj)
			{
				Tools.GetClick(obj).Invoke();
				action?.Invoke(obj);
			});
			UnityAction val = default(UnityAction);
			StaticAction.Find(level, name, position, delegate(GameObject obj)
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Expected O, but got Unknown
				//IL_0024: Expected O, but got Unknown
				UnityEvent click = Tools.GetClick(obj);
				UnityAction obj2 = val;
				if (obj2 == null)
				{
					UnityAction val2 = delegate
					{
						if (LobbyController.IsOwner || !MonoSingleton<World>.Instance.Activated.Contains((byte)World.Actions.IndexOf(net)))
						{
							World.SyncActivation(net);
						}
					};
					UnityAction val3 = val2;
					val = val2;
					obj2 = val3;
				}
				click.AddListener(obj2);
			});
			return net;
		}
	}
	public class CyberGrind
	{
		public static int CurrentWave;

		public static ArenaPattern CurrentPattern;

		private static EndlessGrid grid => MonoSingleton<EndlessGrid>.Instance;

		private static NewMovement nm => MonoSingleton<NewMovement>.Instance;

		public static int PlayersAlive()
		{
			int amount = ((!nm.dead) ? 1 : 0);
			Networking.EachPlayer(delegate(RemotePlayer p)
			{
				amount += ((p.Health != 0) ? 1 : 0);
			});
			return amount;
		}

		public static void SyncPattern(ArenaPattern pattern)
		{
			Networking.Send(PacketType.CyberGrindAction, delegate(Writer w)
			{
				w.Int(grid.currentWave);
				w.String(pattern.heights);
				w.String(pattern.prefabs);
			}, null, 4096);
		}

		public static void LoadPattern(Reader r)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			CurrentWave = r.Int();
			((Component)((Component)grid.waveNumberText).transform.parent.parent).gameObject.SetActive(true);
			CurrentPattern = new ArenaPattern
			{
				heights = r.String(),
				prefabs = r.String()
			};
			LoadPattern(CurrentPattern);
		}

		public static void LoadPattern(ArenaPattern pattern)
		{
			Tools.Invoke<EndlessGrid>("NextWave", grid, Array.Empty<object>());
			Collider component = ((Component)grid).GetComponent<Collider>();
			if (component.enabled)
			{
				component.enabled = false;
				((Component)Tools.ObjFind("Everything").transform.Find("Timer")).gameObject.SetActive(true);
				return;
			}
			CrowdReactions instance = MonoSingleton<CrowdReactions>.Instance;
			instance.React(instance.cheerLong);
			if (nm.hp > 0)
			{
				MonoSingleton<WeaponCharges>.Instance.MaxCharges();
				nm.ResetHardDamage();
				nm.exploded = false;
				nm.GetHealth(999, true, false);
				nm.FullStamina();
			}
			else
			{
				MonoSingleton<Movement>.Instance.CyberRespawn();
			}
		}
	}
	public class Movement : MonoSingleton<Movement>
	{
		private readonly int mask = LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1));

		private readonly float[] emojiLength = new float[12]
		{
			2.458f, 4.708f, 1.833f, 2.875f, 0f, 9.083f, -1f, 12.125f, -1f, 3.292f,
			0f, -1f
		};

		public GameObject EmojiPreview;

		public float EmojiStart;

		public float HoldTime;

		public byte Emoji = byte.MaxValue;

		public byte Rps;

		public float SkateboardSpeed;

		public bool SlowsDown;

		public GameObject FallParticle;

		private readonly Vector3 start = new Vector3(0f, 6f, 0f);

		private readonly Vector3 end = new Vector3(0f, 0.1f, 0f);

		private Vector3 position;

		private Vector2 rotation;

		public Jaket.UI.Elements.Pointer Pointer;

		public Spray Spray;

		private static NewMovement nm => MonoSingleton<NewMovement>.Instance;

		private static FistControl fc => MonoSingleton<FistControl>.Instance;

		private static GunControl gc => MonoSingleton<GunControl>.Instance;

		private static CameraController cc => MonoSingleton<CameraController>.Instance;

		private static PlayerInput pi => MonoSingleton<InputManager>.Instance.InputSource;

		public static void Load()
		{
			Tools.Create<Movement>("Movement", (Transform)null);
			Events.OnLoaded += (Action)delegate
			{
				MonoSingleton<Movement>.Instance.StartEmoji(byte.MaxValue, updateState: false);
			};
			((MonoBehaviour)MonoSingleton<Movement>.Instance).InvokeRepeating("DeathScreenUpdate", 0f, 1f);
		}

		private void Update()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: 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_00b2: 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_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			if (Tools.Scene == "Main Menu")
			{
				return;
			}
			if (Input.GetKeyDown(Settings.ScrollUp))
			{
				MonoSingleton<Chat>.Instance.ScrollMessages(up: true);
			}
			if (Input.GetKeyDown(Settings.ScrollDown))
			{
				MonoSingleton<Chat>.Instance.ScrollMessages(up: false);
			}
			if (Jaket.UI.UI.Focused || MonoSingleton<Settings>.Instance.Rebinding)
			{
				return;
			}
			if (Input.GetKeyDown(Settings.Chat))
			{
				MonoSingleton<Chat>.Instance.Toggle();
			}
			if (Input.GetKeyDown(Settings.LobbyTab))
			{
				MonoSingleton<LobbyTab>.Instance.Toggle();
			}
			if (Input.GetKeyDown(Settings.PlayerList))
			{
				MonoSingleton<PlayerList>.Instance.Toggle();
			}
			if (Input.GetKeyDown(Settings.Settingz))
			{
				MonoSingleton<Settings>.Instance.Toggle();
			}
			if (Input.GetKeyDown(Settings.PlayerIndicators))
			{
				MonoSingleton<PlayerIndicators>.Instance.Toggle();
			}
			if (Input.GetKeyDown(Settings.PlayerInfo))
			{
				MonoSingleton<PlayerInfo>.Instance.Toggle();
			}
			if (Input.GetKey(Settings.EmojiWheel) && !CanvasSingleton<LobbyList>.Shown && !((Component)MonoSingleton<WeaponWheel>.Instance).gameObject.activeSelf)
			{
				HoldTime += Time.deltaTime;
				if (!CanvasSingleton<EmojiWheel>.Shown && HoldTime > 0.25f)
				{
					MonoSingleton<EmojiWheel>.Instance.Show();
				}
			}
			else
			{
				HoldTime = 0f;
				if (CanvasSingleton<EmojiWheel>.Shown)
				{
					MonoSingleton<EmojiWheel>.Instance.Hide();
				}
			}
			bool keyDown = Input.GetKeyDown(Settings.Pointer);
			bool keyDown2 = Input.GetKeyDown(Settings.Spray);
			RaycastHit hit = default(RaycastHit);
			if ((keyDown || keyDown2) && Physics.Raycast(((Component)cc).transform.position, ((Component)cc).transform.forward, ref hit, float.MaxValue, mask))
			{
				if (keyDown)
				{
					if ((Object)(object)Pointer != (Object)null)
					{
						Pointer.Lifetime = 4.5f;
					}
					Pointer = Jaket.UI.Elements.Pointer.Spawn(Networking.LocalPlayer.Team, ((RaycastHit)(ref hit)).point, ((RaycastHit)(ref hit)).normal);
				}
				if (keyDown2)
				{
					Spray = SprayManager.Spawn(((RaycastHit)(ref hit)).point, ((RaycastHit)(ref hit)).normal);
				}
				if (LobbyController.Online)
				{
					Networking.Send(keyDown ? PacketType.Point : PacketType.Spray, delegate(Writer w)
					{
						//IL_000b: Unknown result type (might be due to invalid IL or missing references)
						//IL_001c: Unknown result type (might be due to invalid IL or missing references)
						//IL_002d: Unknown result type (might be due to invalid IL or missing references)
						w.Id(SteamId.op_Implicit(Networking.LocalPlayer.Id));
						w.Vector(((RaycastHit)(ref hit)).point);
						w.Vector(((RaycastHit)(ref hit)).normal);
					}, null, 32);
				}
			}
			if (Input.GetKeyDown(Settings.SelfDestruction) && !Jaket.UI.UI.AnyDialog)
			{
				nm.GetHurt(1000, false, 0f, false, false, 0.35f, false);
			}
			if (Input.GetKeyDown((KeyCode)292))
			{
				MonoSingleton<InteractiveGuide>.Instance.Launch();
			}
		}

		private void LateUpdate()
		{
			//IL_0372: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_037c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_0309: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0411: Unknown result type (might be due to invalid IL or missing references)
			//IL_0412: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Unknown result type (might be due to invalid IL or missing references)
			//IL_042e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_043a: Unknown result type (might be due to invalid IL or missing references)
			//IL_043b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0473: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_060c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0611: Unknown result type (might be due to invalid IL or missing references)
			//IL_061f: Unknown result type (might be due to invalid IL or missing references)
			//IL_063a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0655: Unknown result type (might be due to invalid IL or missing references)
			//IL_065a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0668: Unknown result type (might be due to invalid IL or missing references)
			//IL_0677: Unknown result type (might be due to invalid IL or missing references)
			((Component)MonoSingleton<Skateboard>.Instance).gameObject.SetActive(Emoji == 11);
			Transform player;
			if (Emoji == 11 && !Jaket.UI.UI.AnyDialog)
			{
				SkateboardSpeed = Mathf.MoveTowards(SkateboardSpeed, 20f, (SlowsDown ? 28f : 12f) * Time.deltaTime);
				nm.boostCharge = Mathf.MoveTowards(nm.boostCharge, 300f, 70f * Time.deltaTime);
				if (pi.Dodge.WasPerformedThisFrame)
				{
					if (nm.boostCharge >= 100f || (MonoSingleton<AssistController>.Instance.majorEnabled && MonoSingleton<AssistController>.Instance.infiniteStamina))
					{
						SkateboardSpeed += 20f;
						NewMovement obj = nm;
						obj.boostCharge -= 100f;
						if (nm.boostCharge < 0f)
						{
							nm.boostCharge = 0f;
						}
						Object.Instantiate<GameObject>(nm.dodgeParticle, ((Component)nm).transform.position, ((Component)nm).transform.rotation);
						AudioSource.PlayClipAtPoint(nm.dodgeSound, ((Component)nm).transform.position);
					}
					else
					{
						Object.Instantiate<GameObject>(nm.staminaFailSound);
					}
				}
				if (SkateboardSpeed >= 70f && !SlowsDown)
				{
					SlowsDown = true;
					FallParticle = Object.Instantiate<GameObject>(nm.fallParticle, ((Component)nm).transform);
				}
				if (SkateboardSpeed <= 40f && SlowsDown)
				{
					SlowsDown = false;
					Object.Destroy((Object)(object)FallParticle);
				}
				player = ((Component)nm).transform;
				Rigidbody rb = nm.rb;
				Vector3 velocity = player.forward * SkateboardSpeed;
				velocity.y = nm.rb.velocity.y;
				rb.velocity = velocity;
				Check(player.position + player.forward * 1.2f);
				Check(player.position - player.forward * 1.2f);
				player.Rotate(Vector3.up * pi.Move.ReadValue<Vector2>().x * 120f * Time.deltaTime);
			}
			if (Emoji != byte.MaxValue)
			{
				if (!Jaket.UI.UI.AnyDialog)
				{
					rotation += pi.Look.ReadValue<Vector2>() * MonoSingleton<OptionsManager>.Instance.mouseSensitivity / 10f;
					rotation.y = Mathf.Clamp(rotation.y, 5f, 170f);
					if (Input.GetKey((KeyCode)32))
					{
						StartEmoji(byte.MaxValue);
					}
				}
				nm.rb.useGravity = true;
				Transform transform = ((Component)cc.cam).transform;
				Vector3 val = ((Component)nm).transform.position + Vector3.up;
				bool flag = Time.time - EmojiStart > emojiLength[Emoji] && emojiLength[Emoji] != -1f;
				position = Vector3.MoveTowards(position, flag ? end : start, 12f * Time.deltaTime);
				transform.position = val + position;
				transform.RotateAround(val, Vector3.left, rotation.y);
				transform.RotateAround(val, Vector3.up, rotation.x);
				transform.LookAt(val);
				RaycastHit val2 = default(RaycastHit);
				if (Physics.SphereCast(val, 0.25f, transform.position - val, ref val2, ((Vector3)(ref position)).magnitude, mask))
				{
					transform.position = ((RaycastHit)(ref val2)).point + 0.5f * ((RaycastHit)(ref val2)).normal;
				}
			}
			if (Tools.Scene != "Main Menu" && !nm.dead)
			{
				nm.rb.constraints = (RigidbodyConstraints)(Jaket.UI.UI.AnyDialog ? 126 : ((MonoSingleton<Movement>.Instance.Emoji == byte.MaxValue || MonoSingleton<Movement>.Instance.Emoji == 11) ? 112 : 122));
			}
			if (LobbyController.Offline)
			{
				return;
			}
			if (Settings.DisableFreezeFrames || Jaket.UI.UI.AnyDialog)
			{
				Time.timeScale = 1f;
			}
			if ((Object)(object)nm.ridingRocket != (Object)null)
			{
				nm.slamForce = 0f;
			}
			if (!LobbyController.CheatsAllowed && MonoSingleton<CheatsController>.Instance.cheatsEnabled)
			{
				MonoSingleton<CheatsController>.Instance.cheatsEnabled = false;
				((Component)((Component)MonoSingleton<CheatsManager>.Instance).transform.GetChild(0).GetChild(0)).gameObject.SetActive(false);
				CollectionExtensions.Do<ICheat>((IEnumerable<ICheat>)(Tools.Field<CheatsManager>("idToCheat").GetValue(MonoSingleton<CheatsManager>.Instance) as Dictionary<string, ICheat>).Values, (Action<ICheat>)MonoSingleton<CheatsManager>.Instance.DisableCheat);
				Bundle.Hud("lobby.cheats");
			}
			if (nm.dead && nm.endlessMode)
			{
				((Component)nm.blackScreen).gameObject.SetActive(true);
				nm.screenHud.SetActive(false);
				if (((Graphic)nm.blackScreen).color.a < 0.5f)
				{
					Image blackScreen = nm.blackScreen;
					Color color = ((Graphic)nm.blackScreen).color;
					color.a = ((Graphic)nm.blackScreen).color.a + 0.75f * Time.deltaTime;
					((Graphic)blackScreen).color = color;
					Text youDiedText = nm.youDiedText;
					color = ((Graphic)nm.youDiedText).color;
					color.a = ((Graphic)nm.blackScreen).color.a;
					((Graphic)youDiedText).color = color;
				}
			}
			void Check(Vector3 pos)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: 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_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				RaycastHit val3 = default(RaycastHit);
				if (Physics.Raycast(pos, Vector3.down, ref val3, 1.5f, mask) && ((RaycastHit)(ref val3)).distance > 0.8f)
				{
					Transform obj2 = player;
					Vector3 val4 = player.position;
					val4.y = ((RaycastHit)(ref val3)).point.y + 1.5f;
					obj2.position = val4;
				}
			}
		}

		private void DeathScreenUpdate()
		{
			((Behaviour)((Component)nm.youDiedText).GetComponents<MonoBehaviour>()[1]).enabled = !nm.endlessMode;
			if (nm.endlessMode)
			{
				int num = CyberGrind.PlayersAlive();
				nm.youDiedText.text = Bundle.Format("cg", num.ToString());
				FinalCyberRank componentInChildren = ((Component)nm).GetComponentInChildren<FinalCyberRank>();
				if (num == 0 && componentInChildren.savedTime == 0f)
				{
					componentInChildren.GameOver();
					Object.Destroy((Object)(object)((Component)nm.blackScreen).gameObject);
				}
			}
		}

		public void Respawn(Vector3 position, float rotation)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
			CameraController obj = cc;
			bool activated = (((Behaviour)nm).enabled = true);
			obj.activated = activated;
			((Component)nm).transform.position = position;
			nm.rb.velocity = Vector3.zero;
			if ((int)MonoSingleton<PlayerTracker>.Instance.playerType == 0)
			{
				cc.ResetCamera(rotation, 0f);
			}
			else
			{
				MonoSingleton<PlatformerMovement>.Instance.ResetCamera(rotation, 0f);
			}
			nm.Respawn();
			nm.GetHealth(0, true, false);
			cc.StopShake();
			nm.ActivatePlayer();
			if (Object.op_Implicit((Object)(object)MonoSingleton<World>.Instance.TunnelRoomba))
			{
				Transform transform = ((Component)nm).transform;
				Vector3 val = MonoSingleton<World>.Instance.TunnelRoomba.position;
				val.y = -112.5f;
				transform.position = val;
			}
		}

		public void CyberRespawn()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Respawn(new Vector3(0f, 80f, 62.5f), 0f);
		}

		public static void UpdateState()
		{
			bool anyDialog = Jaket.UI.UI.AnyDialog;
			bool anyMovementBlocking = Jaket.UI.UI.AnyMovementBlocking;
			ToggleCursor(anyDialog);
			ToggleHud(MonoSingleton<Movement>.Instance.Emoji == byte.MaxValue);
			NewMovement obj = nm;
			bool activated = (fc.activated = (gc.activated = !anyMovementBlocking));
			obj.activated = activated;
			cc.activated = !anyMovementBlocking && !CanvasSingleton<EmojiWheel>.Shown;
			if (anyMovementBlocking)
			{
				fc.NoFist();
			}
			else
			{
				fc.YesFist();
			}
			MonoSingleton<OptionsManager>.Instance.frozen = MonoSingleton<Movement>.Instance.Emoji != byte.MaxValue || CanvasSingleton<InteractiveGuide>.Shown;
			((Behaviour)MonoSingleton<Console>.Instance).enabled = MonoSingleton<Movement>.Instance.Emoji == byte.MaxValue;
		}

		private static void ToggleCursor(bool enable)
		{
			Cursor.visible = enable;
			Cursor.lockState = (CursorLockMode)((!enable) ? 1 : 0);
		}

		private static void ToggleHud(bool enable)
		{
			((Component)((Component)MonoSingleton<StyleHUD>.Instance).transform.parent).gameObject.SetActive(enable);
			((Component)fc).gameObject.SetActive(enable);
			((Component)gc).gameObject.SetActive(enable);
		}

		public void PreviewEmoji(byte id)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			EmojiPreview = Object.Instantiate<GameObject>(DollAssets.Preview, ((Component)nm).transform);
			EmojiPreview.transform.localPosition = new Vector3(0f, -1.5f, 0f);
			EmojiPreview.transform.localScale = new Vector3(2.18f, 2.18f, 2.18f);
			Animator component = ((Component)EmojiPreview.transform.GetChild(0)).GetComponent<Animator>();
			component.SetTrigger("Show Emoji");
			component.SetInteger("Emoji", (int)id);
			component.SetInteger("Rps", (int)Rps);
			Team team = Networking.LocalPlayer.Team;
			Material obj = ((Component)EmojiPreview.transform.GetChild(0).GetChild(4)).GetComponent<Renderer>().materials[1];
			Material val = ((Component)EmojiPreview.transform.GetChild(0).GetChild(3)).GetComponent<Renderer>().materials[0];
			Texture mainTexture = (val.mainTexture = DollAssets.WingTextures[(int)team]);
			obj.mainTexture = mainTexture;
			if (team == Team.Pink)
			{
				((Component)EmojiPreview.transform.GetChild(0).GetChild(0)).gameObject.SetActive(true);
			}
			if (id == 6)
			{
				((Component)EmojiPreview.transform.GetChild(0).GetChild(1).GetChild(7)).gameObject.SetActive(true);
			}
			if (id == 8)
			{
				EmojiPreview.transform.GetChild(0).GetChild(1).GetChild(6)
					.GetChild(10)
					.GetChild(0)
					.localEulerAngles = new Vector3(-20f, 0f, 0f);
			}
		}

		public void StartEmoji(byte id, bool updateState = true)
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
			EmojiStart = Time.time;
			Emoji = id;
			if (updateState)
			{
				UpdateState();
			}
			Object.Destroy((Object)(object)EmojiPreview);
			Object.Destroy((Object)(object)FallParticle);
			if (id != byte.MaxValue)
			{
				PreviewEmoji(id);
				nm.playerCollider.height = 3.5f;
				((Component)nm.gc).transform.localPosition = new Vector3(0f, -1.256f, 0f);
				rotation = new Vector2(cc.rotationY, cc.rotationX + 90f);
				position = default(Vector3);
				SkateboardSpeed = 0f;
				Bundle.Hud("emoji", silent: true);
				((MonoBehaviour)this).StopCoroutine("ClearEmoji");
				if (emojiLength[id] != -1f)
				{
					((MonoBehaviour)this).StartCoroutine("ClearEmoji");
				}
			}
		}

		public IEnumerator ClearEmoji()
		{
			yield return (object)new WaitForSeconds(emojiLength[Emoji] + 0.5f);
			StartEmoji(byte.MaxValue);
		}
	}
	public class RoomController : MonoBehaviour
	{
		public List<Door> Doors = new List<Door>();

		private bool exception;

		private Vector3 min;

		private Vector3 max;

		public int PlayersIn
		{
			get
			{
				int amount = 0;
				Networking.EachObserver(delegate(Vector3 obs)
				{
					//IL_0000: 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_0033: 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_0063: Unknown result type (might be due to invalid IL or missing references)
					//IL_007b: Unknown result type (might be due to invalid IL or missing references)
					if (obs.x > min.x && obs.y > min.y && obs.z > min.z && obs.x < max.x && obs.y < max.y && obs.z < max.z)
					{
						amount++;
					}
				});
				return amount;
			}
		}

		public static void Build(Transform room)
		{
			if ((Object)(object)room.Find("Net") == (Object)null)
			{
				Tools.Create<RoomController>("Net", room).Build();
			}
		}

		private void Build()
		{
			//IL_0034: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_008e: 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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			if (Array.Exists(GameAssets.RoomExceptions, (string ex) => ex == ((Object)((Component)this).transform.parent).name))
			{
				exception = true;
				return;
			}
			ExpandBoundsRecursively(((Component)this).transform.parent, 0);
			min -= Vector3.one * 10f;
			max += Vector3.one * 10f;
			Collider[] array = Physics.OverlapBox((min + max) / 2f, (max - min) / 2f, Quaternion.identity, 65536, (QueryTriggerInteraction)2);
			DoorController val2 = default(DoorController);
			Door item = default(Door);
			foreach (Collider val in array)
			{
				if (((Component)val).TryGetComponent<DoorController>(ref val2))
				{
					Doors.Add(((Component)((Component)val2).transform.parent).GetComponentInChildren<Door>());
				}
				else if (((Component)val).TryGetComponent<Door>(ref item))
				{
					Doors.Add(item);
				}
			}
			void ExpandBounds(Vector3 pos)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0001: 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_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0021: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d3: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				if (!(pos == Vector3.zero))
				{
					if (min == Vector3.zero || max == Vector3.zero)
					{
						min = (max = pos);
					}
					else
					{
						if (pos.x < min.x)
						{
							min.x = pos.x;
						}
						if (pos.x > max.x)
						{
							max.x = pos.x;
						}
						if (pos.y < min.y)
						{
							min.y = pos.y;
						}
						if (pos.y > max.y)
						{
							max.y = pos.y;
						}
						if (pos.z < min.z)
						{
							min.z = pos.z;
						}
						if (pos.z > max.z)
						{
							max.z = pos.z;
						}
					}
				}
			}
			void ExpandBoundsRecursively(Transform transform, int layer)
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Expected O, but got Unknown
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				if (++layer <= 4)
				{
					foreach (Transform item2 in transform)
					{
						Transform val3 = item2;
						if (((Component)val3).gameObject.activeSelf)
						{
							ExpandBounds(val3.position);
							ExpandBoundsRecursively(val3, layer);
						}
					}
				}
			}
		}

		private void OnDisable()
		{
			if (!LobbyController.Offline && (exception || PlayersIn > 0 || Doors.Exists((Door door) => (Object)(object)door != (Object)null && door.open)))
			{
				Events.Post(delegate
				{
					((Component)((Component)this).transform.parent).gameObject.SetActive(true);
				});
			}
		}
	}
	public class World : MonoSingleton<World>
	{
		public static List<WorldAction> Actions = new List<WorldAction>();

		public List<byte> Activated = new List<byte>();

		public List<HookPoint> HookPoints = new List<HookPoint>();

		public HookPoint LastSyncedPoint;

		public List<TramControl> Trams = new List<TramControl>();

		public Transform TunnelRoomba;

		public Hand Hand;

		public Leviathan Leviathan;

		public Minotaur Minotaur;

		public SecuritySystem[] SecuritySystem = new SecuritySystem[7];

		public Brain Brain;

		public static void Load()
		{
			Tools.Create<World>("World", (Transform)null);
			Events.OnLoaded += (Action)delegate
			{
				if (!Tools.Scene.StartsWith("Level 7"))
				{
					Tools.ResFind<Door>((Predicate<Door>)Tools.IsReal, (Action<Door>)delegate(Door door)
					{
						GameObject[] deactivatedRooms = door.deactivatedRooms;
						for (int j = 0; j < deactivatedRooms.Length; j++)
						{
							RoomController.Build(deactivatedRooms[j].transform);
						}
					});
				}
				ActivateArena[] array = Tools.ResFind<ActivateArena>();
				for (int i = 0; i < array.Length; i++)
				{
					((Component)array[i]).gameObject.layer = 16;
				}
				if (LobbyController.Online)
				{
					MonoSingleton<World>.Instance.Restore();
				}
			};
			Events.OnLobbyEntered += new Action(MonoSingleton<World>.Instance.Restore);
		}

		public void WriteData(Writer w)
		{
			w.String(Tools.Scene);
			w.String("1.2.22");
			w.Byte((byte)MonoSingleton<PrefsManager>.Instance.GetInt("difficulty", 0));
			w.Bytes(Activated.ToArray());
		}

		public void ReadData(Reader r)
		{
			Activated.Clear();
			Tools.Load(r.String());
			if (r.String() != "1.2.22")
			{
				Version.Notify();
				return;
			}
			MonoSingleton<PrefsManager>.Instance.SetInt("difficulty", (int)r.Byte());
			Activated.AddRange(r.Bytes(r.Length - r.Position));
		}

		public void Restore()
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			EachStatic(delegate(StaticAction sa)
			{
				sa.Run();
			});
			Activated.ForEach(delegate(byte index)
			{
				Actions[index].Run();
			});
			PlayerActivator val = Object.FindObjectOfType<PlayerActivator>();
			if (Object.op_Implicit((Object)(object)val))
			{
				Transform transform = ((Component)val).transform;
				transform.position += Vector3.up * 6f;
			}
			Find<TramControl>(Trams);
			Find<HookPoint>(HookPoints);
			HookPoints.ForEach(delegate(HookPoint p)
			{
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Expected O, but got Unknown
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Expected O, but got Unknown
				p.onHook.onActivate.AddListener((UnityAction)delegate
				{
					Sync(p, hooked: true);
				});
				p.onUnhook.onActivate.AddListener((UnityAction)delegate
				{
					Sync(p, hooked: false);
				});
			});
			static void Find<T>(List<T> list) where T : MonoBehaviour
			{
				list.Clear();
				Tools.ResFind<T>((Predicate<T>)Tools.IsReal, (Action<T>)list.Add);
				list.Sort(delegate(T t1, T t2)
				{
					//IL_000b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0010: Unknown result type (might be due to invalid IL or missing references)
					//IL_0026: Unknown result type (might be due to invalid IL or missing references)
					//IL_002b: Unknown result type (might be due to invalid IL or missing references)
					Vector3 position = ((Component)(object)t1).transform.position;
					float sqrMagnitude = ((Vector3)(ref position)).sqrMagnitude;
					position = ((Component)(object)t2).transform.position;
					return sqrMagnitude.CompareTo(((Vector3)(ref position)).sqrMagnitude);
				});
			}
			void Sync(HookPoint point, bool hooked)
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				byte index2 = (byte)HookPoints.IndexOf(point);
				if (Vector3.Distance(((Component)point).transform.position, MonoSingleton<HookArm>.Instance.hook.position) < 9f && index2 != byte.MaxValue && (Object)(object)point != (Object)(object)LastSyncedPoint)
				{
					Networking.Send(PacketType.ActivateObject, delegate(Writer w)
					{
						w.Byte(5);
						w.Byte(index2);
						w.Bool(hooked);
						Log.Debug($"[World] Sent new hook state: point#{index2} is {hooked}");
					});
				}
			}
		}

		public static void EachStatic(Action<StaticAction> cons)
		{
			Actions.ForEach(delegate(WorldAction action)
			{
				if (action is StaticAction obj)
				{
					cons(obj);
				}
			});
		}

		public static void EachNet(Action<NetAction> cons)
		{
			Actions.ForEach(delegate(WorldAction action)
			{
				if (action is NetAction obj)
				{
					cons(obj);
				}
			});
		}

		public void ReadAction(Reader r)
		{
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Invalid comparison between Unknown and I4
			switch (r.Byte())
			{
			case 0:
			{
				byte b3 = r.Byte();
				if (Actions[b3] is NetAction netAction)
				{
					Log.Debug("[World] Read the activation of the object " + netAction.Name + " in " + netAction.Level);
					Activated.Add(b3);
					netAction.Run();
				}
				break;
			}
			case 5:
			{
				byte b = r.Byte();
				bool flag = r.Bool();
				Log.Debug($"[World] Read a new state of point#{b}: {flag}");
				LastSyncedPoint = HookPoints[b];
				if (flag)
				{
					LastSyncedPoint.Hooked();
					break;
				}
				LastSyncedPoint.Unhooked();
				if ((int)LastSyncedPoint.type == 2)
				{
					LastSyncedPoint.SwitchPulled();
				}
				break;
			}
			case 6:
			{
				byte b2 = r.Byte();
				int num = r.Int();
				Log.Debug($"[World] Read a new speed of tram#{b2}: {num}");
				Trams[b2].currentSpeedStep = num;
				break;
			}
			case 1:
				Find<FinalDoor>(r.Vector(), delegate(FinalDoor d)
				{
					((Component)((Component)d).transform.Find("FinalDoorOpener")).gameObject.SetActive(true);
				});
				break;
			case 2:
				Find<Door>(r.Vector(), delegate(Door d)
				{
					d.Open(false, false);
				});
				break;
			case 3:
				Networking.EachEntity(delegate(Entity entity)
				{
					if (entity.Type == EntityType.Swordsmachine)
					{
						entity.Kill();
					}
				});
				break;
			case 4:
				Networking.EachEntity(delegate(Entity entity)
				{
					if (entity.Type == EntityType.Puppet)
					{
						entity.Kill();
					}
				});
				Find<BloodFiller>(r.Vector(), delegate(BloodFiller f)
				{
					f.InstaFill();
				});
				break;
			}
			static void Find<T>(Vector3 pos, Action<T> cons) where T : Component
			{
				//IL_0006: 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)
				Tools.ResFind<T>((Predicate<T>)((T door) => ((Component)door).transform.position == pos), cons);
			}
		}

		public static void SyncActivation(NetAction action)
		{
			Networking.Send(PacketType.ActivateObject, delegate(Writer w)
			{
				byte b = (byte)Actions.IndexOf(action);
				if (b != byte.MaxValue)
				{
					Log.Debug("[World] Sent the activation of the object " + action.Name + " in " + action.Level);
					MonoSingleton<World>.Instance.Activated.Add(b);
					w.Byte(0);
					w.Byte(b);
				}
			}, null, 2);
		}

		public static void SyncOpening(Component door, bool final = true)
		{
			Networking.Send(PacketType.ActivateObject, delegate(Writer w)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				w.Byte((byte)(final ? 1u : 2u));
				w.Vector(door.transform.position);
			}, null, 13);
		}

		public static void SyncDrop()
		{
			Networking.Send(PacketType.ActivateObject, delegate(Writer w)
			{
				w.Byte(3);
			}, null, 1);
		}

		public static void SyncTree(BloodFiller filler)
		{
			Networking.Send(PacketType.ActivateObject, delegate(Writer w)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				w.Byte(4);
				w.Vector(((Component)filler).transform.position);
			}, null, 13);
		}

		public static void SyncTram(TramControl tram)
		{
			if (LobbyController.Offline || Tools.Scene == "Level 7-1")
			{
				return;
			}
			byte index = (byte)MonoSingleton<World>.Instance.Trams.IndexOf(tram);
			if (index != byte.MaxValue)
			{
				Networking.Send(PacketType.ActivateObject, delegate(Writer w)
				{
					w.Byte(6);
					w.Byte(index);
					w.Int(tram.currentSpeedStep);
					Log.Debug($"[World] Sent the tram speed: tram#{index} {tram.currentSpeedStep}");
				}, null, 8);
			}
		}
	}
	public class WorldActionsList
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Action<GameObject> <>9__1_0;

			public static Action<GameObject> <>9__1_1;

			public static Action<GameObject> <>9__1_2;

			public static Action<GameObject> <>9__1_3;

			public static Action<GameObject> <>9__1_5;

			public static Action<GameObject> <>9__1_6;

			public static Action<GameObject> <>9__1_7;

			public static Action<GameObject> <>9__1_8;

			public static Action<GameObject> <>9__1_9;

			public static Action<GameObject> <>9__1_10;

			public static Action<GameObject> <>9__1_11;

			public static Action<GameObject> <>9__1_12;

			public static Action<GameObject> <>9__1_13;

			public static Action<GameObject> <>9__1_14;

			public static UnityAction <>9__1_45;

			public static Action<GameObject> <>9__1_15;

			public static Action<GameObject> <>9__1_16;

			public static Action<GameObject> <>9__1_17;

			public static Action<GameObject> <>9__1_18;

			public static Action<GameObject> <>9__1_19;

			public static Action<GameObject> <>9__1_20;

			public static Action<GameObject> <>9__1_21;

			public static Action<GameObject> <>9__1_22;

			public static Action<GameObject> <>9__1_23;

			public static Action<GameObject> <>9__1_24;

			public static Action<GameObject> <>9__1_25;

			public static Action<GameObject> <>9__1_26;

			public static Action<GameObject> <>9__1_27;

			public static Action<GameObject> <>9__1_28;

			public static Action<GameObject> <>9__1_29;

			public static Action<GameObject> <>9__1_30;

			public static Action<GameObject> <>9__1_31;

			public static Action<GameObject> <>9__1_32;

			public static Action<GameObject> <>9__1_33;

			public static Action<GameObject> <>9__1_34;

			public static Action<GameObject> <>9__1_35;

			public static Action<GameObject> <>9__1_36;

			public static Action<GameObject> <>9__1_37;

			public static Action<GameObject> <>9__1_38;

			public static Action<GameObject> <>9__1_39;

			public static Action<GameObject> <>9__1_40;

			public static Action<GameObject> <>9__1_41;

			public static Action<GameObject> <>9__1_42;

			public static Action<GameObject> <>9__1_43;

			internal void <Load>b__1_0(GameObject obj)
			{
				obj.SetActive(LobbyController.IsOwner);
			}

			internal void <Load>b__1_1(GameObject obj)
			{
				obj.SetActive(LobbyController.IsOwner);
				Tools.Destroy((Object)(object)obj.GetComponent<DoorController>());
			}

			internal void <Load>b__1_2(GameObject obj)
			{
				if (!LobbyController.IsOwner)
				{
					Tools.Destroy((Object)(object)obj);
				}
			}

			internal void <Load>b__1_3(GameObject obj)
			{
				obj.GetComponent<ObjectActivator>().Activate();
			}

			internal void <Load>b__1_5(GameObject obj)
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Expected O, but got Unknown
				<>c__DisplayClass1_0 CS$<>8__locals0 = new <>c__DisplayClass1_0
				{
					door = obj.GetComponent<Door>()
				};
				Door door = CS$<>8__locals0.door;
				if (door == null)
				{
					return;
				}
				door.onFullyOpened.AddListener((UnityAction)delegate
				{
					//IL_0006: Unknown result type (might be due to invalid IL or missing references)
					//IL_0010: Expected O, but got Unknown
					CS$<>8__locals0.door.onFullyOpened = new UnityEvent();
					HudMessageReceiver instance = MonoSingleton<HudMessageReceiver>.Instance;
					if (instance != null)
					{
						instance.SendHudMessage("What?", "", "", 0, true);
					}
					SamAPI.TryPlay("What?", Networking.LocalPlayer.Voice);
				});
			}

			internal void <Load>b__1_6(GameObject obj)
			{
				if (!(((Object)obj.transform.parent).name == "9 Nonstuff"))
				{
					for (int i = 1; i < obj.transform.childCount; i++)
					{
						Tools.Destroy((Object)(object)((Component)obj.transform.GetChild(i)).gameObject);
					}
					<Load>g__Fill|1_4($"MACHINE ID: V3#{Networking.LocalPlayer.Id.ToString().Substring(0, 3)}\r\nLOCATION: TERMINAL\r\nCURRENT OBJECTIVE: FUN\r\n\r\nAUTHORIZATION... <color=#32CD32>DONE</color>\r\n\r\n> Hello?\r\n<color=#FF341C>UNKNOWN COMMAND</color>\r\n\r\n> Please let me in :3\r\nOPENING ALL DOORS... <color=#32CD32>DONE</color>", 64, def: false, obj.transform.Find("PuzzleScreen"), new string[5] { "Text (TMP) (1)", "Button A", "Button B", "Button C", "Button D" });
				}
			}

			internal void <Load>b__1_7(GameObject obj)
			{
				Tools.Destroy((Object)(object)obj.GetComponent<ObjectActivator>());
			}

			internal void <Load>b__1_8(GameObject obj)
			{
				<Load>g__Fill|1_4("UwU", 256, def: true, obj.transform, new string[2] { "Text (TMP)", "Button (Closed)" });
			}

			internal void <Load>b__1_9(GameObject obj)
			{
				if (!LobbyController.IsOwner)
				{
					<Load>g__Fill|1_4("Only the host can do this!", 120, def: true, obj.transform, new string[2] { "Text (TMP)", "UsableButtons" });
				}
			}

			internal void <Load>b__1_10(GameObject obj)
			{
				((Component)obj.transform.parent.Find("BayDoor")).GetComponent<Door>().SimpleOpenOverride();
			}

			internal void <Load>b__1_11(GameObject obj)
			{
				Tools.Destroy((Object)(object)((Component)obj.transform.Find("Altar (Torch) Variant").GetChild(0)).gameObject);
			}

			internal void <Load>b__1_12(GameObject obj)
			{
				obj.GetComponent<Door>().Unlock();
			}

			internal void <Load>b__1_13(GameObject obj)
			{
				obj.GetComponent<Door>().Unlock();
			}

			internal void <Load>b__1_14(GameObject obj)
			{
				obj.GetComponent<Door>().Unlock();
			}

			internal void <Load>b__1_15(GameObject obj)
			{
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Expected O, but got Unknown
				UnityEvent onActivate = obj.GetComponent<ObjectActivator>().events.onActivate;
				object obj2 = <>9__1_45;
				if (obj2 == null)
				{
					UnityAction val = delegate
					{
						//IL_000f: Unknown result type (might be due to invalid IL or missing references)
						Teleporter.Teleport(new Vector3(-189f, -33.5f, 483.75f));
					};
					<>9__1_45 = val;
					obj2 = (object)val;
				}
				onActivate.AddListener((UnityAction)obj2);
			}

			internal void <Load>b__1_45()
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				Teleporter.Teleport(new Vector3(-189f, -33.5f, 483.75f));
			}

			internal void <Load>b__1_16(GameObject obj)
			{
				Tools.Destroy((Object)(object)obj.GetComponent<Collider>());
			}

			internal void <Load>b__1_17(GameObject obj)
			{
				Tools.ObjFind("Outdoors Areas/6 - Interior Garden/NightSkyActivator").SetActive(true);
			}

			internal void <Load>b__1_18(GameObject obj)
			{
				((Component)obj.transform.parent).gameObject.SetActive(true);
			}

			internal void <Load>b__1_19(GameObject obj)
			{
				obj.SetActive(LobbyController.IsOwner);
			}

			internal void <Load>b__1_20(GameObject obj)
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Expected O, but got Unknown
				//IL_0024: Expected O, but got Unknown
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Expected O, but got Unknown
				//IL_0031: Expected O, but got Unknown
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Expected O, but got Unknown
				<>c__DisplayClass1_1 CS$<>8__locals0 = new <>c__DisplayClass1_1
				{
					obj = obj
				};
				ObjectActivator obj2 = CS$<>8__locals0.obj.AddComponent<ObjectActivator>();
				UltrakillEvent val = new UltrakillEvent();
				UltrakillEvent val2 = val;
				obj2.events = val;
				UnityEvent val3 = new UnityEvent();
				UnityEvent val4 = val3;
				val2.onActivate = val3;
				val4.AddListener((UnityAction)delegate
				{
					CombinedBossBar component = CS$<>8__locals0.obj.GetComponent<CombinedBossBar>();
					for (int i = 0; i < component.enemies.Length; i++)
					{
						(MonoSingleton<World>.Instance.SecuritySystem[i] = ((Component)component.enemies[i]).gameObject.AddComponent<SecuritySystem>()).Type = (EntityType)(43 + i);
					}
				});
			}

			internal void <Load>b__1_21(GameObject obj)
			{
				obj.GetComponent<ObjectActivator>().Activate();
			}

			internal void <Load>b__1_22(GameObject obj)
			{
				obj.SetActive(LobbyController.IsOwner);
			}

			internal void <Load>b__1_23(GameObject obj)
			{
				obj.SetActive(LobbyController.IsOwner);
			}

			internal void <Load>b__1_24(GameObject obj)
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				obj.GetComponent<ObjectActivator>().Activate();
				Teleporter.Teleport(new Vector3(0f, 460f, 650f));
			}

			internal void <Load>b__1_25(GameObject obj)
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				obj.GetComponent<ObjectActivator>().Activate();
				Teleporter.Teleport(new Vector3(0f, 826.5f, 610f));
			}

			internal void <Load>b__1_26(GameObject obj)
			{
				((Component)obj.transform.parent).gameObject.SetActive(true);
				((Component)obj.transform.parent.parent).gameObject.SetActive(true);
			}

			internal void <Load>b__1_27(GameObject obj)
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				obj.transform.position = new Vector3(-40f, -10f, 102.5f);
			}

			internal void <Load>b__1_28(GameObject obj)
			{
				GameObject[] toDisActivateObjects = obj.GetComponent<ObjectActivator>().events.toDisActivateObjects;
				toDisActivateObjects[1] = (toDisActivateObjects[2] = null);
			}

			internal void <Load>b__1_29(GameObject obj)
			{
				Events.Post2(new <>c__DisplayClass1_2
				{
					obj = obj
				}.<Load>b__47);
			}

			internal void <Load>b__1_30(GameObject obj)
			{
				Tools.Destroy((Object)(object)((Component)obj.transform.Find("Altar (Blue Skull) Variant").GetChild(0)).gameObject);
			}

			internal void <Load>b__1_31(GameObject obj)
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				obj.transform.position = new Vector3(0f, 7.4f, 582.5f);
			}

			internal void <Load>b__1_32(GameObject obj)
			{
				if (!LobbyController.IsOwner)
				{
					obj.SetActive(false);
				}
			}

			internal void <Load>b__1_33(GameObject obj)
			{
				obj.GetComponent<ObjectActivator>().events.toDisActivateObjects[2] = null;
			}

			internal void <Load>b__1_34(GameObject obj)
			{
				obj.GetComponent<ObjectActivator>().events.toActivateObjects[4] = null;
			}

			internal void <Load>b__1_35(GameObject obj)
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				ObjectActivator component = obj.GetComponent<ObjectActivator>();
				component.events.onActivate = new UnityEvent();
				component.events.toActivateObjects[2] = null;
				component.events.toDisActivateObjects[1] = null;
				component.events.toDisActivateObjects[2] = null;
			}

			internal void <Load>b__1_36(GameObject obj)
			{
				((Component)obj.transform.parent.Find("GlobalLights (2)").Find("MetroWall (10)")).gameObject.SetActive(false);
				((Component)obj.transform.parent.Find("BossMusic")).gameObject.SetActive(false);
			}

			internal void <Load>b__1_37(GameObject obj)
			{
				((Component)obj.transform.GetChild(0)).gameObject.SetActive(true);
				((Component)obj.transform.parent.Find("EyeWithSocket")).gameObject.SetActive(false);
				Tools.ObjFind("Music 3").SetActive(false);
				MonoSingleton<StatsManager>.Instance.StopTimer();
			}

			internal void <Load>b__1_38(GameObject obj)
			{
				MonoSingleton<MusicManager>.Instance.StopMusic();
			}

			internal void <Load>b__1_39(GameObject obj)
			{
				((Component)obj.transform.parent).gameObject.SetActive(true);
				((Component)obj.transform.parent.parent.Find("Wall")).gameObject.SetActive(false);
			}

			internal void <Load>b__1_40(GameObject obj)
			{
				Transform obj2 = obj.transform.parent.Find("ExitBuilding");
				((Component)obj2).GetComponent<Door>().Close(false);
				((Component)obj2.Find("GrapplePoint (2)")).gameObject.SetActive(true);
			}

			internal void <Load>b__1_41(GameObject obj)
			{
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				((Component)obj.transform.parent.parent.parent.parent).gameObject.SetActive(true);
				Tools.GetClick(((Component)obj.transform.parent.Find("Screen").GetChild(0).GetChild(0)
					.GetChild(0)
					.GetChild(0)).gameObject).Invoke();
				Vector3 position = obj.transform.position;
				position.y = -112.5f;
				Teleporter.Teleport(position);
			}

			internal void <Load>b__1_42(GameObject obj)
			{
				((Component)obj.transform.parent.Find("Cube (2)")).gameObject.SetActive(false);
				Tools.ObjFind("Music 3").SetActive(false);
				((Component)obj.transform.parent.Find("Lights")).gameObject.SetActive(false);
				MonoSingleton<StatsManager>.Instance.StopTimer();
			}

			internal void <Load>b__1_43(GameObject obj)
			{
				((Component)obj.transform.parent.Find("Backwall")).gameObject.SetActive(false);
				Tools.ObjFind("BossMusics/Sisyphus").SetActive(false);
				Tools.ObjFind("IntroObjects/Decorations").SetActive(false);
				Tools.ObjFind("Rain").SetActive(false);
				MonoSingleton<StatsManager>.Instance.StopTimer();
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass1_0
		{
			public Door door;

			internal void <Load>b__44()
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Expected O, but got Unknown
				door.onFullyOpened = new UnityEvent();
				HudMessageReceiver instance = MonoSingleton<HudMessageReceiver>.Instance;
				if (instance != null)
				{
					instance.SendHudMessage("What?", "", "", 0, true);
				}
				SamAPI.TryPlay("What?", Networking.LocalPlayer.Voice);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass1_1
		{
			public GameObject obj;

			internal void <Load>b__46()
			{
				CombinedBossBar component = obj.GetComponent<CombinedBossBar>();
				for (int i = 0; i < component.enemies.Length; i++)
				{
					(MonoSingleton<World>.Instance.SecuritySystem[i] = ((Component)component.enemies[i]).gameObject.AddComponent<SecuritySystem>()).Type = (EntityType)(43 + i);
				}
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass1_2
		{
			public GameObject obj;

			internal void <Load>b__47()
			{
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				foreach (Transform item in this.obj.transform)
				{
					Transform obj = item.Find("Blockers");
					object obj2;
					if (obj == null)
					{
						obj2 = null;
					}
					else
					{
						Transform obj3 = obj.Find("Cube");
						obj2 = ((obj3 != null) ? ((Component)obj3).gameObject : null);
					}
					Tools.Destroy((Object)obj2);
				}
			}
		}

		public const string BASEMENT_TERMILA_TEXT = "MACHINE ID: V3#{0}\r\nLOCATION: TERMINAL\r\nCURRENT OBJECTIVE: FUN\r\n\r\nAUTHORIZATION... <color=#32CD32>DONE</color>\r\n\r\n> Hello?\r\n<color=#FF341C>UNKNOWN COMMAND</color>\r\n\r\n> Please let me in :3\r\nOPENING ALL DOORS... <color=#32CD32>DONE</color>";

		public static void Load()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: 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_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0409: Unknown result type (might be due to invalid IL or missing references)
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_048d: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_050b: Unknown result type (might be due to invalid IL or missing references)
			//IL_054a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0589: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0607: Unknown result type (might be due to invalid IL or missing references)
			//IL_0627: Unknown result type (might be due to invalid IL or missing references)
			//IL_0647: Unknown result type (might be due to invalid IL or missing references)
			//IL_0668: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0729: Unknown result type (might be due to invalid IL or missing references)
			//IL_0768: Unknown result type (might be due to invalid IL or missing references)
			//IL_0788: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0809: Unknown result type (might be due to invalid IL or missing references)
			//IL_082a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0869: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0908: Unknown result type (might be due to invalid IL or missing references)
			//IL_0946: Unknown result type (might be due to invalid IL or missing references)
			//IL_0989: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a14: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a57: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a9a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0add: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b20: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c50: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c74: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c98: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cbc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d04: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d28: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d4c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d94: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ddc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e00: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e48: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e90: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ed8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0efc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f20: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fa6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1015: Unknown result type (might be due to invalid IL or missing references)
			//IL_103a: Unknown result type (might be due to invalid IL or missing references)
			//IL_107d: Unknown result type (might be due to invalid IL or missing references)
			//IL_10c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_10e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1128: Unknown result type (might be due to invalid IL or missing references)
			//IL_116b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1190: Unknown result type (might be due to invalid IL or missing references)
			//IL_11b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_11da: Unknown result type (might be due to invalid IL or missing references)
			//IL_11ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_1242: Unknown result type (might be due to invalid IL or missing references)
			//IL_1267: Unknown result type (might be due to invalid IL or missing references)
			StaticAction.Find("Level 0-5", "Cube", new Vector3(182f, 4f, 382f), delegate(GameObject obj)
			{
				obj.SetActive(LobbyController.IsOwner);
			});
			NetAction.Sync("Level 0-5", "Cube", new Vector3(182f, 4f, 382f));
			NetAction.Sync("Level 0-5", "StatueActivator", new Vector3(212.5f, -6.5f, 394.5f));
			NetAction.Sync("Level 0-5", "StatueActivator", new Vector3(212.5f, -6.5f, 369.5f));
			NetAction.Sync("Level 0-5", "DelayedDoorActivation", new Vector3(175f, -6f, 382f));
			NetAction.Sync("Level 1-2", "Cube (1)", new Vector3(-61f, -21.5f, 400.5f));
			StaticAction.Find("Level 1-4", "Cube", new Vector3(0f, 11f, 612f), delegate(GameObject obj)
			{
				obj.SetActive(LobbyController.IsOwner);
				Tools.Destroy((Object)(object)obj.GetComponent<DoorController>());
			});
			StaticAction.Find("Level 1-4", "V2", new Vector3(0f, 6f, 648.5f), delegate(GameObject obj)
			{
				if (!LobbyController.IsOwner)
				{
					Tools.Destroy((Object)(object)obj);
				}
			});
			NetAction.Sync("Level 1-4", "Cube", new Vector3(0f, -19f, 612f), delegate(GameObject obj)
			{
				obj.GetComponent<ObjectActivator>().Activate();
			});
			StaticAction.Destroy("Level 5-1", "HudMessage", new Vector3(0f, -100f, 295.5f));
			StaticAction.Destroy("Level 5-1", "Door", new Vector3(218.5f, -41f, 234.5f));
			NetAction.Sync("Level 5-1", "CheckPointsUndisabler", new Vector3(0f, -50f, 350f));
			NetAction.Sync("Level 5-1", "DelayedActivator", new Vector3(-15f, 36f, 698f));
			NetAction.Sync("Level 5-1", "DelayedActivator", new Vector3(-15f, 38f, 778f));
			StaticAction.Find("Level 7-2", "Intro -> Outdoors", new Vector3(-115f, 55f, 419.5f), delegate(GameObject obj)
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Expected O, but got Unknown
				Door door = obj.GetComponent<Door>();
				Door obj9 = door;
				if (obj9 != null)
				{
					obj9.onFullyOpened.AddListener((UnityAction)delegate
					{
						//IL_0006: Unknown result type (might be due to invalid IL or missing references)
						//IL_0010: Expected O, but got Unknown
						door.onFullyOpened = new UnityEvent();
						HudMessageReceiver instance = MonoSingleton<HudMessageReceiver>.Instance;
						if (instance != null)
						{
							instance.SendHudMessage("What?", "", "", 0, true);
						}
						SamAPI.TryPlay("What?", Networking.LocalPlayer.Voice);
					});
				}
			});
			StaticAction.Find("Level 7-2", "9A", new Vector3(-23.5f, 37.75f, 806.25f), delegate(GameObject obj)
			{
				if (!(((Object)obj.transform.parent).name == "9 Nonstuff"))
				{
					for (int k = 1; k < obj.transform.childCount; k++)
					{
						Tools.Destroy((Object)(object)((Component)obj.transform.GetChild(k)).gameObject);
					}
					Fill($"MACHINE ID: V3#{Networking.LocalPlayer.Id.ToString().Substring(0, 3)}\r\nLOCATION: TERMINAL\r\nCURRENT OBJECTIVE: FUN\r\n\r\nAUTHORIZATION... <color=#32CD32>DONE</color>\r\n\r\n> Hello?\r\n<color=#FF341C>UNKNOWN COMMAND</color>\r\n\r\n> Please let me in :3\r\nOPENING ALL DOORS... <color=#32CD32>DONE</color>", 64, def: false, obj.transform.Find("PuzzleScreen"), new string[5] { "Text (TMP) (1)", "Button A", "Button B", "Button C", "Button D" });
				}
			});
			StaticAction.Find("Level 7-2", "Trigger", new Vector3(-218.5f, 65f, 836.5f), delegate(GameObject obj)
			{
				Tools.Destroy((Object)(object)obj.GetComponent<ObjectActivator>());
			});
			StaticAction.Find("Level 7-2", "PuzzleScreen (1)", new Vector3(-230.5f, 31.75f, 813.5f), delegate(GameObject obj)
			{
				Fill("UwU", 256, def: true, obj.transform, new string[2] { "Text (TMP)", "Button (Closed)" });
			});
			StaticAction.Find("Level 7-2", "PuzzleScreen (1)", new Vector3(-317.75f, 55.25f, 605.25f), delegate(GameObject obj)
			{
				if (!LobbyController.IsOwner)
				{
					Fill("Only the host can do this!", 120, def: true, obj.transform, new string[2] { "Text (TMP)", "UsableButtons" });
				}
			});
			StaticAction.Enable("Level 7-2", "0 - Door 1", new Vector3(46.5f, 26.75f, 753.75f));
			StaticAction.Enable("Level 7-2", "1.25 - Door 2", new Vector3(46.5f, 26.75f, 788.75f));
			StaticAction.Enable("Level 7-2", "2.25 - Door 3", new Vector3(46.5f, 26.75f, 823.75f));
			StaticAction.Enable("Level 7-2", "3.5 - Door 4", new Vector3(46.5f, 26.75f, 858.75f));
			NetAction.Sync("Level 7-2", "TowerDestruction", new Vector3(-119.75f, 34f, 552.25f));
			NetAction.Sync("Level 7-2", "DelayToClaw", new Vector3(-305.75f, 30f, 620.5f), delegate(GameObject obj)
			{
				((Component)obj.transform.parent.Find("BayDoor")).GetComponent<Door>().SimpleOpenOverride();
			});
			StaticAction.Find("Level 7-3", "1 - Dark Path", new Vector3(0f, -10f, 300f), delegate(GameObject obj)
			{
				Tools.Destroy((Object)(object)((Component)obj.transform.Find("Altar (Torch) Variant").GetChild(0)).gameObject);
			});
			StaticAction.Find("Level 7-3", "Door 1", new Vector3(-55.5f, -2.5f, 618.5f), delegate(GameObject obj)
			{
				obj.GetComponent<Door>().Unlock();
			});
			StaticAction.Find("Level 7-3", "Door 2", new Vector3(-75.5f, -12.5f, 568.5f), delegate(GameObject obj)
			{
				obj.GetComponent<Door>().Unlock();
			});
			StaticAction.Find("Level 7-3", "Door 1", new Vector3(-75.5f, -12.5f, 578.5f), delegate(GameObject obj)
			{
				obj.GetComponent<Door>().Unlock();
			});
			StaticAction.Find("Level 7-3", "12 - Grand Hall", new Vector3(-212.5f, -35f, 483.75f), delegate(GameObject obj)
			{
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Expected O, but got Unknown
				UnityEvent onActivate = obj.GetComponent<ObjectActivator>().events.onActivate;
				object obj8 = <>c.<>9__1_45;
				if (obj8 == null)
				{
					UnityAction val5 = delegate
					{
						//IL_000f: Unknown result type (might be due to invalid IL or missing references)
						Teleporter.Teleport(new Vector3(-189f, -33.5f, 483.75f));
					};
					<>c.<>9__1_45 = val5;
					obj8 = (object)val5;
				}
				onActivate.AddListener((UnityAction)obj8);
			});
			StaticAction.Find("Level 7-3", "ViolenceHallDoor", new Vector3(-148f, 7.5f, 276.25f), delegate(GameObject obj)
			{
				Tools.Destroy((Object)(object)obj.GetComponent<Collider>());
			});
			StaticAction.Destroy("Level 7-3", "Door 2", new Vector3(-95.5f, 7.5f, 298.75f));
			StaticAction.Destroy("Level 7-3", "ViolenceHallDoor (1)", new Vector3(-188f, 7.5f, 316.25f));
			NetAction.Sync("Level 7-3", "Opener", new Vector3(-170.5f, 0.5f, 480.75f));
			NetAction.Sync("Level 7-3", "Opener", new Vector3(-170.5f, 0.5f, 490.75f), delegate
			{
				Tools.ObjFind("Outdoors Areas/6 - Interior Garden/NightSkyActivator").SetActive(true);
			});
			NetAction.Sync("Level 7-3", "BigDoorOpener", new Vector3(-145.5f, -10f, 483.75f), delegate(GameObject obj)
			{
				((Component)obj.transform.parent).gameObject.SetActive(true);
			});
			StaticAction.Find("Level 7-4", "Trigger", new Vector3(0f, 495.25f, 713.25f), delegate(GameObject obj)
			{
				obj.SetActive(LobbyController.IsOwner);
			});
			StaticAction.Find("Level 7-4", "SecuritySystem", new Vector3(0f, 0f, 8.25f), delegate(GameObject obj)
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Expected O, but got Unknown
				//IL_0024: Expected O, but got Unknown
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Expected O, but got Unknown
				//IL_0031: Expected O, but got Unknown
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Expected O, but got Unknown
				ObjectActivator obj7 = obj.AddComponent<ObjectActivator>();
				UltrakillEvent val = new UltrakillEvent();
				UltrakillEvent val2 = val;
				obj7.events = val;
				UnityEvent val3 = new UnityEvent();
				UnityEvent val4 = val3;
				val2.onActivate = val3;
				val4.AddListener((UnityAction)delegate
				{
					CombinedBossBar component2 = obj.GetComponent<CombinedBossBar>();
					for (int j = 0; j < component2.enemies.Length; j++)
					{
						(MonoSingleton<World>.Instance.SecuritySystem[j] = ((Component)component2.enemies[j]).gameObject.AddComponent<SecuritySystem>()).Type = (EntityType)(43 + j);
					}
				});
			});
			StaticAction.Destroy("Level 7-4", "ArenaWalls", new Vector3(-26.5f, 470f, 763.75f));
			NetAction.Sync("Level 7-4", "Trigger", new Vector3(0f, 495.25f, 713.25f), delegate(GameObject obj)
			{
				obj.GetComponent<ObjectActivator>().Activate();
			});
			NetAction.Sync("Level 7-4", "ShieldDeactivator", new Vector3(0f, 477.5f, 724.25f));
			NetAction.Sync("Level 7-4", "DeathSequence", new Vector3(-2.5f, 472.5f, 724.25f));
			NetAction.SyncButton("Level 7-4", "Button", new Vector3(0f, 476.5f, 717.15f));
			StaticAction.Find("Level 7-4", "EntryTrigger", new Vector3(0f, 458.5f, 649.75f), delegate(GameObject obj)
			{
				obj.SetActive(LobbyController.IsOwner);
			});
			StaticAction.Find("Level 7-4", "BrainFightTrigger", new Vector3(6.999941f, 841.5f, 610.7503f), delegate(GameObject obj)
			{
				obj.SetActive(LobbyController.IsOwner);
			});
			NetAction.Sync("Level 7-4", "EntryTrigger", new Vector3(0f, 458.5f, 649.75f), delegate(GameObject obj)
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				obj.GetComponent<ObjectActivator>().Activate();
				Teleporter.Teleport(new Vector3(0f, 460f, 650f));
			});
			NetAction.Sync("Level 7-4", "Deactivator", new Vector3(0.75f, 550.5f, 622.75f));
			NetAction.Sync("Level 7-4", "BrainFightTrigger", new Vector3(6.999941f, 841.5f, 610.7503f), delegate(GameObject obj)
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				obj.GetComponent<ObjectActivator>().Activate();
				Teleporter.Teleport(new Vector3(0f, 826.5f, 610f));
			});
			NetAction.Sync("Level 7-4", "DelayedIdolSpawner", new Vector3(14.49993f, 914.25f, 639.7503f), delegate(GameObject obj)
			{
				((Component)obj.transform.parent).gameObject.SetActive(true);
				((Component)obj.transform.parent.parent).gameObject.SetActive(true);
			});
			StaticAction.Find("Endless", "Cube", new Vector3(-40f, 0.5f, 102.5f), delegate(GameObject obj)
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				obj.transform.position = new Vector3(-40f, -10f, 102.5f);
			});
			StaticAction.PlaceTorches("Level 4-3", new Vector3(0f, -10f, 310f), 3f);
			StaticAction.PlaceTorches("Level P-1", new Vector3(-0.84f, -10f, 16.4f), 2f);
			StaticAction.Find("Level 2-4", "DoorsActivator", new Vector3(425f, -10f, 650f), delegate(GameObject obj)
			{
				GameObject[] toDisActivateObjects = obj.GetComponent<ObjectActivator>().events.toDisActivateObjects;
				toDisActivateObjects[1] = (toDisActivateObjects[2] = null);
			});
			StaticAction.Find("Level 2-4", "3 - First Encounter", new Vector3(0f, -12f, 650f), delegate(GameObject obj)
			{
				Events.Post2(delegate
				{
					//IL_0019: Unknown result type (might be due to invalid IL or missing references)
					foreach (Transform item in obj.transform)
					{
						Transform obj4 = item.Find("Blockers");
						object obj5;
						if (obj4 == null)
						{
							obj5 = null;
						}
						else
						{
							Transform obj6 = obj4.Find("Cube");
							obj5 = ((obj6 != null) ? ((Component)obj6).gameObject : null);
						}
						Tools.Destroy((Object)obj5);
					}
				});
			});
			StaticAction.Find("Level 5-2", "6 (Secret)", new Vector3(-3.5f, -3f, 940.5f), delegate(GameObject obj)
			{
				Tools.Destroy((Object)(object)((Component)obj.transform.Find("Altar (Blue Skull) Variant").GetChild(0)).gameObject);
			});
			StaticAction.Find("Level 7-1", "Cube", new Vector3(0f, 3.4f, 582.5f), delegate(GameObject obj)
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				obj.transform.position = new Vector3(0f, 7.4f, 582.5f);
			});
			StaticAction.Find("Level 7-1", "ScreenActivator", new Vector3(-242.5f, -112f, 311f), delegate(GameObject obj)
			{
				if (!LobbyController.IsOwner)
				{
					obj.SetActive(false);
				}
			});
			StaticAction.Find("Level 7-1", "FightStart", new Vector3(-242.5f, 120f, -399.75f), delegate(GameObject obj)
			{
				obj.GetComponent<ObjectActivator>().events.toDisActivateObjects[2] = null;
			});
			StaticAction.Find("Level P-1", "Trigger", new Vector3(360f, -568.5f, 110f), delegate(GameObject obj)
			{
				obj.GetComponent<ObjectActivator>().events.toActivateObjects[4] = null;
			});
			StaticAction.Find("Level P-2", "FightActivator", new Vector3(-102f, -61.25f, -450f), delegate(GameObject obj)
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				ObjectActivator component = obj.GetComponent<ObjectActivator>();
				component.events.onActivate = new UnityEvent();
				component.events.toActivateObjects[2] = null;
				component.events.toDisActivateObjects[1] = null;
				component.events.toDisActivateObjects[2] = null;
			});
			StaticAction.Patch("Level 3-2", "OutroLightSound", new Vector3(-5f, -161f, 875f));
			StaticAction.Patch("Level 7-1", "Blockers", new Vector3(-242.5f, -115f, 314f));
			StaticAction.Patch("Level 7-1", "Wave 2", new Vector3(-242.5f, 0f, 0f));
			StaticAction.Enable("Level 4-2", "6A - Indoor Garden", new Vector3(-19f, 35f, 953.9481f));
			StaticAction.Enable("Level 4-2", "6B - Outdoor Arena", new Vector3(35f, 35f, 954f));
			StaticAction.Destroy("Level 2-3", "4 & 5 Fake", new Vector3(-26f, 12.5f, 375f));
			StaticAction.Destroy("Level 2-4", "Doorway Blockers", new Vector3(425f, -10f, 650f));
			StaticAction.Destroy("Level 2-4", "MetroBlockDoor (1)", new Vector3(425f, 27f, 615f));
			StaticAction.Destroy("Level 2-4", "MetroBlockDoor (2)", new Vector3(425f, 27f, 525f));
			StaticAction.Destroy("Level 3-2", "Door", new Vector3(-10f, -161f, 955f));
			StaticAction.Destroy("Level 4-2", "6A Activator", new Vector3(-79f, 45f, 954f));
			StaticAction.Destroy("Level 4-2", "6B Activator", new Vector3(116f, 19.5f, 954f));
			StaticAction.Destroy("Level 4-3", "Doorblocker", new Vector3(-59.5f, -35f, 676f));
			StaticAction.Destroy("Level 5-2", "Arena 1", new Vector3(87.5f, -53f, 1240f));
			StaticAction.Destroy("Level 5-2", "Arena 2", new Vector3(87.5f, -53f, 1240f));
			StaticAction.Destroy("Level 6-1", "Cage", new Vector3(168.5f, -130f, 140f));
			StaticAction.Destroy("Level 6-1", "Cube", new Vector3(102f, -165f, -503f));
			StaticAction.Destroy("Level 6-2", "Door", new Vector3(-179.5f, 20f, 350f));
			StaticAction.Destroy("Level 7-1", "SkullRed", new Vector3(-66.25f, 9.8f, 485f));
			StaticAction.Destroy("Level 7-1", "ViolenceArenaDoor", new Vector3(-120f, 0f, 530.5f));
			StaticAction.Destroy("Level 7-1", "Walkway Arena -> Stairway Up", new Vector3(80f, -25f, 590f));
			NetAction.Sync("Level 2-4", "DeadMinos", new Vector3(279.5f, -599f, 575f), delegate(GameObject obj)
			{
				((Component)obj.transform.parent.Find("GlobalLights (2)").Find("MetroWall (10)")).gameObject.SetActive(false);
				((Component)obj.transform.parent.Find("BossMusic")).gameObject.SetActive(false);
			});
			NetAction.Sync("Level 3-2", "OutroLightSound", new Vector3(-5f, -161f, 875f), delegate(GameObject obj)
			{
				((Component)obj.transform.GetChild(0)).gameObject.SetActive(true);
				((Component)obj.transform.parent.Find("EyeWithSocket")).gameObject.SetActive(false);
				Tools.ObjFind("Music 3").SetActive(false);
				MonoSingleton<StatsManager>.Instance.StopTimer();
			});
			NetAction.Sync("Level 4-2", "DoorOpeners", new Vector3(-1.5f, -18f, 774.5f));
			NetAction.Sync("Level 4-2", "DoorsOpener", new Vector3(40f, 5f, 813.5f));
			NetAction.Sync("Level 4-3", "DoorActivator", new Vector3(2.5f, -40f, 628f));
			NetAction.Sync("Level 4-3", "Trigger (Intro)", new Vector3(-104f, -20f, 676f));
			NetAction.Sync("Level 4-3", "Secret Tablet", new Vector3(-116.425f, -39.593f, 675.9866f), delegate
			{
				MonoSingleton<MusicManager>.Instance.StopMusic();
			});
			NetAction.Sync("Level 4-4", "Checkpoint Activator", new Vector3(177.5f, 663.5f, 243f), delegate(GameObject obj)
			{
				((Component)obj.transform.parent).gameObject.SetActive(true);
				((Component)obj