Decompiled source of Troll mod v1.0.2

TrollMod.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalCompanyTrollMenuMod.Component;
using LethalCompanyTrollMenuMod.helpers;
using LethalCompanyTrollMenuMod.tabs;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("TrollMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("TrollMod")]
[assembly: AssemblyTitle("TrollMod")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LethalCompanyTrollMenuMod
{
	internal enum MessageType
	{
		ERROR,
		SUCCESS,
		INFO
	}
	internal class Message
	{
		public MessageType type = MessageType.INFO;

		public string message;

		public string copybuffer;

		public Message(string message, MessageType type)
		{
			this.message = message;
			this.type = type;
			copybuffer = message;
		}

		public Message(string message, MessageType type, string copybuffer)
		{
			this.message = message;
			this.type = type;
			this.copybuffer = copybuffer;
		}
	}
	internal class TrollConsole : MonoBehaviour
	{
		public static TrollConsole Instance;

		public static bool showConsole = false;

		public static List<Message> messages = new List<Message>();

		private static Vector2 scrollViewVector = Vector2.zero;

		private static KeyCode key = (KeyCode)283;

		private void OnGUI()
		{
			//IL_0062: 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_006c: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			if (!showConsole)
			{
				return;
			}
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(0f, 0f, 400f, (float)(messages.Count * 30));
			scrollViewVector = GUI.BeginScrollView(new Rect((float)(Screen.width - Screen.width / 2), (float)(Screen.height - Screen.height / 2), (float)(Screen.width / 2), (float)(Screen.height / 2)), scrollViewVector, val);
			int num = 0;
			Rect val2 = default(Rect);
			foreach (Message message in messages)
			{
				((Rect)(ref val2))..ctor(0f, (float)num, (float)Screen.width, 25f);
				num += 25;
				switch (message.type)
				{
				case MessageType.ERROR:
					GUI.Label(val2, "[ERROR] " + message.message, TrollMenuStyle.errorStyle);
					break;
				case MessageType.SUCCESS:
					GUI.Label(val2, "[SUCCESS] " + message.message, TrollMenuStyle.successStyle);
					break;
				case MessageType.INFO:
					GUI.Label(val2, "[INFO] " + message.message, TrollMenuStyle.infoStyle);
					break;
				}
				if ((int)Event.current.type == 0 && Event.current.button == 0 && ((Rect)(ref val2)).Contains(Event.current.mousePosition))
				{
					GUIUtility.systemCopyBuffer = message.copybuffer;
					if (message.copybuffer.StartsWith("http"))
					{
						Process.Start(message.copybuffer);
					}
				}
			}
			GUI.EndScrollView();
		}

		private void Update()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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)
			KeyboardShortcut val = new KeyboardShortcut(key, Array.Empty<KeyCode>());
			if (((KeyboardShortcut)(ref val)).IsUp())
			{
				showConsole = !showConsole;
			}
		}

		public static void DisplayMessage(string message, MessageType type = MessageType.INFO)
		{
			DisplayMessage(message, message, type);
		}

		public static void DisplayMessage(string message, string copybuffer, MessageType type = MessageType.INFO)
		{
			if (type == MessageType.ERROR)
			{
				showConsole = true;
			}
			if (messages.Count > 1000)
			{
				messages.RemoveAt(0);
			}
			messages.Add(new Message(message, type, copybuffer));
			scrollViewVector.y = messages.Count * 30;
		}

		private void Awake()
		{
			TrollMenu.mls.LogInfo((object)"LOADED CONSOLE");
			GetRequest("https://thunderstore.io/api/experimental/package/TrollNation/Troll_mod/", checkVersion);
		}

		private void checkVersion(string response)
		{
			response = response.Replace(" ", "");
			string value = Regex.Match(response, "\"version_number\"[ ]*:[ ]*\"[0-9\\.]+\"").Value;
			TrollMenu.mls.LogInfo((object)("Version : " + value));
			value = value.Replace("\"", "");
			value = value.Split(new char[1] { ':' })[1];
			if (value != "1.0.2")
			{
				showConsole = true;
				DisplayMessage("You have version (1.0.2)");
				DisplayMessage("There is a new version of the mod available (" + value + ")", MessageType.SUCCESS);
				DisplayMessage("You can download it at https://thunderstore.io/c/lethal-company/p/TrollNation/Troll_mod/", "https://thunderstore.io/c/lethal-company/p/TrollNation/Troll_mod/", MessageType.SUCCESS);
				DisplayMessage("You can click the link to copy it");
				DisplayMessage("You can close this by pressing " + ((object)(KeyCode)(ref key)).ToString());
			}
		}

		private async Task GetRequest(string uri, Action<string> success = null, Action<int> failed = null)
		{
			HttpClient client = new HttpClient();
			try
			{
				HttpResponseMessage response = await client.GetAsync(uri);
				if (response.IsSuccessStatusCode)
				{
					string responseBody = await response.Content.ReadAsStringAsync();
					success?.Invoke(responseBody);
				}
				else
				{
					failed?.Invoke((int)response.StatusCode);
				}
			}
			catch (HttpRequestException val)
			{
				HttpRequestException val2 = val;
				HttpRequestException e = val2;
				failed?.Invoke(-1);
				TrollMenu.mls.LogError((object)("Exception: " + ((Exception)(object)e).Message));
			}
			finally
			{
				((IDisposable)client)?.Dispose();
			}
		}
	}
	[BepInPlugin("Nico78916.TrollMenu", "Lethal Company Troll Menu", "1.0.2")]
	public class TrollMenu : BaseUnityPlugin
	{
		[HarmonyPatch]
		public class EnemyAIUpdatePatch
		{
			private static void Postfix(EnemyAI __instance)
			{
				if (AliveEnemies.frozenEnemies.ContainsKey(__instance) && AliveEnemies.frozenEnemies[__instance])
				{
					__instance.agent.speed = 0f;
				}
			}

			private static bool Prefix(EnemyAI __instance)
			{
				return true;
			}
		}

		private const string modGUID = "Nico78916.TrollMenu";

		private const string modName = "Lethal Company Troll Menu";

		public const string modVersion = "1.0.2";

		private readonly Harmony harmony = new Harmony("Nico78916.TrollMenu");

		public static PlayerControllerB playerRef;

		internal static TabManager Window;

		private static GameObject obj;

		public static Dictionary<string, EnemyType> insideEnemies = new Dictionary<string, EnemyType>();

		public static Dictionary<string, EnemyType> outsideEnemies = new Dictionary<string, EnemyType>();

		public static Dictionary<string, AnomalyType> anomalies = new Dictionary<string, AnomalyType>();

		public static Dictionary<string, SpawnableMapObject> deadlyobjects = new Dictionary<string, SpawnableMapObject>();

		public static bool isInGame = false;

		public static EnemyVent[] enemyVentsCache = (EnemyVent[])(object)new EnemyVent[0];

		public static GameObject[] outsideSpawn = (GameObject[])(object)new GameObject[0];

		public static RoundManager roundManager;

		public static Dictionary<string, PlayerControllerB> alivePlayers = new Dictionary<string, PlayerControllerB>();

		public static Dictionary<string, PlayerControllerB> deadPlayers = new Dictionary<string, PlayerControllerB>();

		public static Dictionary<string, PlayerControllerB> allPlayers = new Dictionary<string, PlayerControllerB>();

		public static List<EnemyAI> stoppedEnemies = new List<EnemyAI>();

		private static RandomMapObject[] randomMapObjects = (RandomMapObject[])(object)new RandomMapObject[0];

		public static ManualLogSource mls { get; private set; }

		public static List<EnemyAI> aliveEnemies
		{
			get
			{
				if (!isInGame || (Object)(object)roundManager == (Object)null)
				{
					return new List<EnemyAI>();
				}
				return roundManager.SpawnedEnemies;
			}
		}

		private Assembly getGameAssembly()
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			string location = executingAssembly.Location;
			string[] array = location.Split(new char[1] { '\\' });
			int num = Array.IndexOf(array, "Lethal Company");
			List<string> list = new List<string>();
			for (int i = 0; i <= num; i++)
			{
				list.Add(array[i]);
			}
			list.Add("Lethal Company_Data");
			list.Add("Managed");
			list.Add("Assembly-CSharp.dll");
			string text = string.Join("\\", list.ToArray());
			mls.LogInfo((object)text);
			return Assembly.LoadFile(text);
		}

		private void Awake()
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Expected O, but got Unknown
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Expected O, but got Unknown
			mls = Logger.CreateLogSource("TrollMenu");
			mls.LogInfo((object)"Loaded Nico78916.TrollMenu. Patching.");
			harmony.PatchAll(typeof(TrollMenu));
			mls = ((BaseUnityPlugin)this).Logger;
			mls.LogInfo((object)"Creating Menu");
			TrollMenu.obj = new GameObject("TrollMenu");
			Object.DontDestroyOnLoad((Object)(object)TrollMenu.obj);
			((Object)TrollMenu.obj).hideFlags = (HideFlags)61;
			TrollMenu.obj.AddComponent<TabManager>();
			TrollMenu.obj.AddComponent<TrollConsole>();
			Window = TrollMenu.obj.GetComponent<TabManager>();
			TrollMenuStyle.Awake();
			IEnumerable<Type> enumerable = from t in getGameAssembly().GetTypes()
				where t.IsSubclassOf(typeof(EnemyAI))
				select t;
			mls.LogInfo((object)(enumerable.Count() + " subclasses of EnemyAI found"));
			foreach (Type item in enumerable)
			{
				mls.LogInfo((object)("Found " + item.Name + " as subclass of EnemyAI"));
				Harmony obj = harmony;
				MethodInfo methodInfo = AccessTools.Method(item, "Update", (Type[])null, (Type[])null);
				HarmonyMethod val = new HarmonyMethod(typeof(EnemyAIUpdatePatch), "Postfix", (Type[])null);
				obj.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(EnemyAIUpdatePatch), "Prefix", (Type[])null), val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
			MethodInfo[] methods = typeof(EnemyAI).GetMethods(BindingFlags.Instance | BindingFlags.NonPublic);
			MethodInfo[] array = methods;
			foreach (MethodInfo methodInfo2 in array)
			{
				mls.LogInfo((object)methodInfo2.Name);
			}
		}

		public EnemyAI[] FindAliveEnemies()
		{
			if (!isInGame)
			{
				return (EnemyAI[])(object)new EnemyAI[0];
			}
			return Object.FindObjectsOfType<EnemyAI>();
		}

		[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
		[HarmonyPrefix]
		public static bool LoadNewLevelPatch(ref RoundManager __instance)
		{
			roundManager = __instance;
			roundManager.mapPropsContainer = GameObject.FindGameObjectWithTag("MapPropsContainer");
			EnemyType[] array = Resources.FindObjectsOfTypeAll<EnemyType>();
			EnemyType[] array2 = array;
			foreach (EnemyType val in array2)
			{
				if (val.isOutsideEnemy)
				{
					if (!outsideEnemies.ContainsKey(((Object)val).name))
					{
						outsideEnemies.Add(((Object)val).name, val);
					}
				}
				else if (!insideEnemies.ContainsKey(((Object)val).name))
				{
					insideEnemies.Add(((Object)val).name, val);
				}
				mls.LogInfo((object)("Added " + ((Object)val).name + " (" + (val.isOutsideEnemy ? "outside" : "inside") + ") to the list"));
			}
			mls.LogInfo((object)("Found " + array.Length + " EnemyType"));
			EnemyType[] array3 = array;
			foreach (EnemyType val2 in array3)
			{
				mls.LogInfo((object)("\t" + val2.enemyName));
			}
			return true;
		}

		[HarmonyPatch(typeof(RoundManager), "SpawnScrapInLevel")]
		[HarmonyPrefix]
		public static bool SpawnScrapInLevelPatch(ref RoundManager __instance)
		{
			if (ScrapMenu.randomValue)
			{
				mls.LogError((object)"Random Scrap Value is activated");
				mls.LogInfo((object)("Min Scrap Value: " + ScrapMenu.minScrapValue));
				mls.LogInfo((object)("Max Scrap Value: " + ScrapMenu.maxScrapValue));
				__instance.currentLevel.maxTotalScrapValue = ScrapMenu.maxScrapValue;
				__instance.currentLevel.minTotalScrapValue = ScrapMenu.minScrapValue;
			}
			if (ScrapMenu.randomAmount)
			{
				mls.LogError((object)"Random Scrap Amount is activated");
				mls.LogInfo((object)("Min Scrap: " + ScrapMenu.minScrap));
				mls.LogInfo((object)("Max Scrap: " + ScrapMenu.maxScrap));
				__instance.currentLevel.minScrap = ScrapMenu.minScrap;
				__instance.currentLevel.maxScrap = ScrapMenu.maxScrap;
			}
			if (!ScrapMenu.randomAmount && !ScrapMenu.randomValue)
			{
				mls.LogError((object)"No Scrap changes detected");
			}
			return true;
		}

		[HarmonyPatch(typeof(RoundManager), "GeneratedFloorPostProcessing")]
		[HarmonyPostfix]
		public static void GeneratedFloorPostProcessingPatch(ref RoundManager __instance)
		{
			randomMapObjects = Object.FindObjectsOfType<RandomMapObject>();
			mls.LogError((object)("Found " + randomMapObjects.Length + " RandomMapObject"));
			SpawnableMapObject[] spawnableMapObjects = __instance.spawnableMapObjects;
			mls.LogInfo((object)("Found " + spawnableMapObjects.Length + " SpawnableMapObject"));
			SpawnableMapObject[] array = spawnableMapObjects;
			foreach (SpawnableMapObject val in array)
			{
				mls.LogInfo((object)("Found " + ((Object)val.prefabToSpawn).name));
				if (!deadlyobjects.ContainsKey(((Object)val.prefabToSpawn).name))
				{
					deadlyobjects.Add(((Object)val.prefabToSpawn).name, val);
				}
			}
		}

		[HarmonyPatch(typeof(ItemDropship), "ShipLeave")]
		[HarmonyPostfix]
		public static void OnShipLeave()
		{
			mls.LogInfo((object)"Ship left");
			SpawnMenu.currentPlayer = null;
		}

		[HarmonyPatch(typeof(EnemyAI), "Start")]
		[HarmonyPrefix]
		public static bool EnemyAIStartPatch(ref EnemyAI __instance)
		{
			return true;
		}

		private static void SpawnInsideEnemy(EnemyType enemy, EnemyVent vent)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			SpawnEnemy(enemy, ((Component)vent).transform.position, isOutside: false);
		}

		public static void SpawnInsideEnemy(EnemyType enemy)
		{
			enemyVentsCache = Object.FindObjectsOfType<EnemyVent>();
			if ((Object)(object)enemy == (Object)null)
			{
				mls.LogError((object)"Enemy is null");
				return;
			}
			if ((Object)(object)enemy.enemyPrefab == (Object)null)
			{
				mls.LogError((object)"Enemy Prefab is null");
				return;
			}
			if (enemy.isOutsideEnemy)
			{
				mls.LogError((object)"Enemy is outside enemy");
				return;
			}
			if (enemyVentsCache.Length == 0)
			{
				mls.LogError((object)"No vents found");
				return;
			}
			EnemyVent val = enemyVentsCache[Random.Range(0, enemyVentsCache.Length)];
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Vent is null");
			}
			else
			{
				SpawnInsideEnemy(enemy, val);
			}
		}

		public static void SpawnOutsideEnemy(EnemyType enemy)
		{
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			outsideSpawn = GameObject.FindGameObjectsWithTag("OutsideAINode");
			if ((Object)(object)enemy == (Object)null)
			{
				mls.LogError((object)"Enemy is null");
				return;
			}
			if ((Object)(object)enemy.enemyPrefab == (Object)null)
			{
				mls.LogError((object)"Enemy Prefab is null");
				return;
			}
			if (!enemy.isOutsideEnemy)
			{
				mls.LogError((object)"Enemy is inside enemy");
				return;
			}
			if (outsideSpawn.Length == 0)
			{
				mls.LogError((object)"No outside spawn found");
				return;
			}
			GameObject[] array = outsideSpawn;
			if (array == null)
			{
				mls.LogError((object)"No spawnPoints");
				return;
			}
			Vector3 randomNavMeshPositionInRadius = roundManager.GetRandomNavMeshPositionInRadius(array[roundManager.AnomalyRandom.Next(0, array.Length)].transform.position, 4f, default(NavMeshHit));
			int num = 0;
			bool flag = false;
			for (int i = 0; i < array.Length - 1; i++)
			{
				for (int j = 0; j < roundManager.spawnDenialPoints.Length; j++)
				{
					flag = true;
					if ((double)Vector3.Distance(randomNavMeshPositionInRadius, roundManager.spawnDenialPoints[j].transform.position) < 16.0)
					{
						num = (num + 1) % array.Length;
						randomNavMeshPositionInRadius = roundManager.GetRandomNavMeshPositionInRadius(array[num].transform.position, 4f, default(NavMeshHit));
						flag = false;
						break;
					}
				}
				if (flag)
				{
					break;
				}
			}
			SpawnEnemy(enemy, randomNavMeshPositionInRadius, isOutside: true);
		}

		public static EnemyAI SpawnEnemy(EnemyType enemy, Vector3 position, bool isOutside)
		{
			//IL_000e: 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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			GameObject enemyPrefab = enemy.enemyPrefab;
			GameObject val = Object.Instantiate<GameObject>(enemy.enemyPrefab, position, Quaternion.Euler(Vector3.zero));
			val.SetActive(false);
			EnemyAI component = val.GetComponent<EnemyAI>();
			roundManager.SpawnedEnemies.Add(component);
			EnemyType enemyType = val.GetComponent<EnemyAI>().enemyType;
			enemyType.numberSpawned++;
			component.isOutside = isOutside;
			val.SetActive(true);
			val.gameObject.GetComponentInChildren<NetworkObject>().Spawn(true);
			string[] obj = new string[7] { "Spawned ", enemy.enemyName, " at ", null, null, null, null };
			Vector3 val2 = position;
			obj[3] = ((object)(Vector3)(ref val2)).ToString();
			obj[4] = "(";
			obj[5] = (isOutside ? "outside" : "inside");
			obj[6] = ")";
			TrollConsole.DisplayMessage(string.Concat(obj), MessageType.SUCCESS);
			return component;
		}

		public static void SpawnEnemyInsideNearPlayer(EnemyType enemy, PlayerControllerB player)
		{
			TrollConsole.DisplayMessage("Spawning " + enemy.enemyName + " near " + player.playerUsername);
			enemyVentsCache = Object.FindObjectsOfType<EnemyVent>();
			if ((Object)(object)enemy == (Object)null)
			{
				mls.LogError((object)"Enemy is null");
				return;
			}
			if ((Object)(object)enemy.enemyPrefab == (Object)null)
			{
				mls.LogError((object)"Enemy Prefab is null");
				return;
			}
			if (enemy.isOutsideEnemy)
			{
				mls.LogError((object)"Enemy is outside enemy");
				return;
			}
			if (enemyVentsCache.Length == 0)
			{
				mls.LogError((object)"No vents found");
				return;
			}
			if (!player.isInsideFactory)
			{
				mls.LogError((object)"The player isn't inside");
				return;
			}
			EnemyVent val = enemyVentsCache.OrderBy((EnemyVent x) => Vector3.Distance(((Component)x).transform.position, ((Component)player).transform.position)).First();
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Vent is null");
			}
			else
			{
				SpawnInsideEnemy(enemy, val);
			}
		}

		public static void SpawnEnemyOutsideNearPlayer(EnemyType enemy, PlayerControllerB player)
		{
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			TrollConsole.DisplayMessage("Spawning " + enemy.enemyName + " near " + player.playerUsername);
			outsideSpawn = GameObject.FindGameObjectsWithTag("OutsideAINode");
			if ((Object)(object)enemy == (Object)null)
			{
				mls.LogError((object)"Enemy is null");
				return;
			}
			if ((Object)(object)enemy.enemyPrefab == (Object)null)
			{
				mls.LogError((object)"Enemy Prefab is null");
				return;
			}
			if (!enemy.isOutsideEnemy)
			{
				mls.LogError((object)"Enemy is inside enemy");
				return;
			}
			if (outsideSpawn.Length == 0)
			{
				mls.LogError((object)"No outside spawn found");
				return;
			}
			GameObject[] array = outsideSpawn;
			if (array == null)
			{
				mls.LogError((object)"No spawnPoints");
				return;
			}
			Vector3 position = array.OrderBy((GameObject x) => Vector3.Distance(x.transform.position, ((Component)player).transform.position)).First().transform.position;
			Vector3 randomNavMeshPositionInRadius = roundManager.GetRandomNavMeshPositionInRadius(position, 4f, default(NavMeshHit));
			int num = 0;
			bool flag = false;
			for (int i = 0; i < array.Length - 1; i++)
			{
				for (int j = 0; j < roundManager.spawnDenialPoints.Length; j++)
				{
					flag = true;
					if ((double)Vector3.Distance(randomNavMeshPositionInRadius, roundManager.spawnDenialPoints[j].transform.position) < 16.0)
					{
						num = (num + 1) % array.Length;
						randomNavMeshPositionInRadius = roundManager.GetRandomNavMeshPositionInRadius(array[num].transform.position, 4f, default(NavMeshHit));
						flag = false;
						break;
					}
				}
				if (flag)
				{
					break;
				}
			}
			SpawnEnemy(enemy, randomNavMeshPositionInRadius, isOutside: false);
		}

		public static void SpawnHostileObjectAtPosition(SpawnableMapObject obj, Vector3 pos)
		{
			//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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(obj.prefabToSpawn, pos, Quaternion.identity, roundManager.mapPropsContainer.transform);
			val.transform.eulerAngles = ((!obj.spawnFacingAwayFromWall) ? new Vector3(val.transform.eulerAngles.x, (float)roundManager.AnomalyRandom.Next(0, 360), val.transform.eulerAngles.z) : new Vector3(0f, roundManager.YRotationThatFacesTheFarthestFromPosition(pos + Vector3.up * 0.2f, 25f, 6), 0f));
			val.GetComponent<NetworkObject>().Spawn(true);
			TrollConsole.DisplayMessage("Spawned " + ((Object)obj.prefabToSpawn).name, MessageType.SUCCESS);
		}

		public static void SpawnHostileObjectAtRandomPos(SpawnableMapObject obj)
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			GameObject[] insideAINodes = roundManager.insideAINodes;
			if (obj == null)
			{
				mls.LogError((object)"SpawnableMapObject is null");
				return;
			}
			GameObject val = insideAINodes[roundManager.AnomalyRandom.Next(0, insideAINodes.Length)];
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"RandomMapObject is null");
				return;
			}
			Vector3 randomNavMeshPositionInRadius = roundManager.GetRandomNavMeshPositionInRadius(val.transform.position, 100f, default(NavMeshHit));
			SpawnHostileObjectAtPosition(obj, randomNavMeshPositionInRadius);
		}

		public static void SpawnHostileObjectNearPlayer(SpawnableMapObject obj, PlayerControllerB ply)
		{
			if (!ply.isInsideFactory)
			{
				mls.LogError((object)"Player isn't inside the factory");
			}
			else
			{
				SpawnHostileObjectNearPlayer(obj, ply, 50);
			}
		}

		public static void SpawnHostileObjectNearPlayer(SpawnableMapObject obj, PlayerControllerB ply, int range)
		{
			//IL_003b: 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_004a: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			if (!ply.isInsideFactory)
			{
				mls.LogError((object)"Player isn't inside the factory");
				TrollConsole.DisplayMessage("Player isn't inside the factory", MessageType.ERROR);
				return;
			}
			Vector3 randomNavMeshPositionInRadius = roundManager.GetRandomNavMeshPositionInRadius(((Component)ply).transform.position, (float)range, default(NavMeshHit));
			string name = ((Object)obj.prefabToSpawn).name;
			Vector3 val = randomNavMeshPositionInRadius;
			TrollConsole.DisplayMessage("Position of " + name + " = " + ((object)(Vector3)(ref val)).ToString());
			TrollConsole.DisplayMessage("Spawning " + ((Object)obj.prefabToSpawn).name + " at " + Vector3.Distance(randomNavMeshPositionInRadius, ((Component)ply).transform.position) + "m from " + ply.playerUsername);
			SpawnHostileObjectAtPosition(obj, randomNavMeshPositionInRadius);
		}

		public static Vector3 GetPositionBehind(Vector3 pos, Vector3 forward, float distance = 10f, NavMeshHit navHit = default(NavMeshHit))
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//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_0015: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: 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)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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)
			Vector3 val = pos - ((Vector3)(ref forward)).normalized * distance;
			float y = val.y;
			val = Random.insideUnitSphere * distance + val;
			val.y = y;
			if (NavMesh.SamplePosition(val, ref navHit, distance, -1))
			{
				return ((NavMeshHit)(ref navHit)).position;
			}
			TrollConsole.DisplayMessage("Unable to get position behind! Returning old pos", MessageType.ERROR);
			return pos;
		}
	}
	internal class TrollMenuStyle : MonoBehaviour
	{
		public static GUIStyle menuStyle = new GUIStyle();

		public static GUIStyle buttonStyle = new GUIStyle();

		public static GUIStyle labelStyle = new GUIStyle();

		public static GUIStyle toggleStyle = new GUIStyle();

		public static GUIStyle hScrollStyle = new GUIStyle();

		public static GUIStyle errorLabel = new GUIStyle();

		public static GUIStyle errorStyle = new GUIStyle();

		public static GUIStyle successStyle = new GUIStyle();

		public static GUIStyle infoStyle = new GUIStyle();

		private static Texture2D CreateTexture(int width, int height, Color col)
		{
			//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)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			Color[] array = (Color[])(object)new Color[width * height];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = col;
			}
			Texture2D val = new Texture2D(width, height);
			val.SetPixels(array);
			val.Apply();
			return val;
		}

		public static void Awake()
		{
			InitTextures();
		}

		public static void InitTextures()
		{
			//IL_000b: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: 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)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0312: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_0352: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			menuStyle.normal.textColor = Color.white;
			menuStyle.normal.background = CreateTexture(2, 2, new Color(0f, 0f, 0f, 0f));
			menuStyle.fontSize = 18;
			((Object)menuStyle.normal.background).hideFlags = (HideFlags)61;
			buttonStyle.normal.textColor = Color.white;
			buttonStyle.fontSize = 18;
			labelStyle.normal.textColor = Color.white;
			labelStyle.fontSize = 25;
			labelStyle.normal.background = CreateTexture(2, 2, new Color(0f, 0f, 0f, 0f));
			((Object)labelStyle.normal.background).hideFlags = (HideFlags)61;
			toggleStyle.normal.textColor = Color.white;
			toggleStyle.fontSize = 18;
			hScrollStyle.normal.textColor = Color.white;
			hScrollStyle.normal.background = CreateTexture(2, 2, new Color(0f, 0f, 0f, 0f));
			((Object)hScrollStyle.normal.background).hideFlags = (HideFlags)61;
			errorLabel.normal.textColor = Color.red;
			errorLabel.onNormal.textColor = Color.red;
			errorLabel.normal.background = CreateTexture(2, 2, new Color(0f, 0f, 0f, 0f));
			errorLabel.fontSize = 18;
			errorStyle.normal.textColor = Color.red;
			errorStyle.onNormal.textColor = Color.red;
			errorStyle.normal.background = CreateTexture(2, 2, new Color(0f, 0f, 0f, 0f));
			errorStyle.fontSize = 20;
			errorStyle.active.background = CreateTexture(2, 2, new Color(1f, 1f, 1f, 0.2f));
			successStyle.normal.textColor = Color.green;
			successStyle.onNormal.textColor = Color.green;
			successStyle.normal.background = CreateTexture(2, 2, new Color(0f, 0f, 0f, 0f));
			successStyle.fontSize = 20;
			successStyle.active.background = CreateTexture(2, 2, new Color(1f, 1f, 1f, 0.2f));
			infoStyle.normal.textColor = Color.white;
			infoStyle.onNormal.textColor = Color.white;
			infoStyle.normal.background = CreateTexture(2, 2, new Color(0f, 0f, 0f, 0f));
			infoStyle.fontSize = 20;
			infoStyle.active.background = CreateTexture(2, 2, new Color(1f, 1f, 1f, 0.2f));
		}
	}
}
namespace LethalCompanyTrollMenuMod.tabs
{
	internal class AliveEnemies
	{
		private static Dictionary<string, int> modes = new Dictionary<string, int>
		{
			{ "Kill", 0 },
			{ "Teleport to", 1 },
			{ "Freeze", 2 },
			{ "1 HP", 3 },
			{ "Heal", 4 }
		};

		private static Select<int> modeSelect = null;

		private static int selectedMode = 0;

		private static PlayerControllerB selectedPlayer = null;

		private static Select<PlayerControllerB> playerSelect = null;

		private static Rect enemyListView = new Rect(0f, 0f, 100f, 100f);

		private static Rect enemyListViewRect = new Rect(0f, 0f, 100f, 200f);

		private static Vector2 enemyListViewVector = Vector2.zero;

		private static ManualLogSource log = TrollMenu.mls;

		private static Dictionary<EnemyAI, int> enemiesDefaultHP = new Dictionary<EnemyAI, int>();

		private static Dictionary<EnemyAI, float> enemiesDefaultSpeed = new Dictionary<EnemyAI, float>();

		public static Dictionary<EnemyAI, bool> frozenEnemies = new Dictionary<EnemyAI, bool>();

		public static Dictionary<EnemyAI, bool> teleportEnemy = new Dictionary<EnemyAI, bool>();

		public static void OnMenuOpened()
		{
			log.LogInfo((object)"Menu opened");
			if (modeSelect == null)
			{
				log.LogWarning((object)"modeSelect is null");
				modeSelect = new Select<int>(modes);
				modeSelect.SetDefault(0);
			}
			if ((Object)(object)StartOfRound.Instance != (Object)null)
			{
				log.LogInfo((object)"StartOfRound found");
			}
			else
			{
				log.LogInfo((object)"StartOfRound not found");
			}
		}

		private static void trigger(EnemyAI enemy)
		{
			switch (selectedMode)
			{
			case 0:
				Kill(enemy);
				break;
			case 1:
				TeleportToEnemy(enemy);
				break;
			case 2:
				Freeze(enemy);
				break;
			case 3:
				MakeOneHit(enemy);
				break;
			case 4:
				Heal(enemy);
				break;
			case 5:
				TeleportEnemyToPlayer(enemy, selectedPlayer);
				break;
			}
		}

		public static void Draw(Rect wr)
		{
			//IL_0025: 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_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			int num = 50;
			GUI.Label(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, 25f), "Alive Enemies");
			num += 25;
			selectedMode = modeSelect.Draw(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, 200f, 25f));
			num += modes.Count * 25;
			if ((Object)(object)TrollMenu.roundManager == (Object)null)
			{
				return;
			}
			enemyListView = new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, ((Rect)(ref wr)).height - (float)num);
			enemyListViewRect = new Rect(0f, 0f, ((Rect)(ref enemyListView)).width, (float)(25 * TrollMenu.roundManager.SpawnedEnemies.Count));
			enemyListViewVector = GUI.BeginScrollView(enemyListView, enemyListViewVector, enemyListViewRect);
			if (TrollMenu.roundManager.SpawnedEnemies.Count == 0)
			{
				GUI.Label(new Rect(0f, 0f, 200f, 30f), "No enemies alive", TrollMenuStyle.errorLabel);
				GUI.EndScrollView();
				return;
			}
			int num2 = 0;
			foreach (EnemyAI spawnedEnemy in TrollMenu.roundManager.SpawnedEnemies)
			{
				if (!spawnedEnemy.isEnemyDead)
				{
					if (!enemiesDefaultHP.ContainsKey(spawnedEnemy))
					{
						enemiesDefaultHP.Add(spawnedEnemy, spawnedEnemy.enemyHP);
					}
					if (!enemiesDefaultSpeed.ContainsKey(spawnedEnemy))
					{
						enemiesDefaultSpeed.Add(spawnedEnemy, spawnedEnemy.agent.speed);
					}
					if (GUI.Button(new Rect(0f, (float)num2, ((Rect)(ref enemyListViewRect)).width, 25f), ((Object)spawnedEnemy).name.Replace("(Clone)", " " + Math.Round(Vector3.Distance(((Component)StartOfRound.Instance.localPlayerController).transform.position, spawnedEnemy.serverPosition)) + "m")))
					{
						trigger(spawnedEnemy);
					}
					num2 += 25;
				}
			}
			GUI.EndScrollView();
		}

		private static void Kill(EnemyAI enemy)
		{
			if (!enemy.enemyType.canDie)
			{
				RoundManager.Instance.DespawnEnemyOnServer(((NetworkBehaviour)enemy).NetworkObject);
				TrollConsole.DisplayMessage("Made " + ((Object)enemy).name + " despawn", MessageType.SUCCESS);
			}
			else
			{
				enemy.KillEnemy(true);
				TrollConsole.DisplayMessage("Killed " + ((Object)enemy).name, MessageType.SUCCESS);
			}
		}

		private static void TeleportEnemyToPlayer(EnemyAI enemy, PlayerControllerB ply)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_005e: 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)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)enemy == (Object)null)
			{
				TrollConsole.DisplayMessage("No enemy selected", MessageType.ERROR);
				return;
			}
			if ((Object)(object)ply == (Object)null)
			{
				TrollConsole.DisplayMessage("No player selected", MessageType.ERROR);
				return;
			}
			Vector3 positionBehind = TrollMenu.GetPositionBehind(((Component)ply).transform.position, ((Component)ply).transform.forward);
			((Component)enemy).transform.position = positionBehind;
			enemy.moveTowardsDestination = false;
			TrollConsole.DisplayMessage("Teleported " + ((Object)enemy).name + " behind " + ply.playerUsername + " at " + Vector3.Distance(((Component)enemy).transform.position, ((Component)ply).transform.position), MessageType.SUCCESS);
		}

		private static void TeleportToEnemy(EnemyAI enemy)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
			localPlayerController.isInsideFactory = !enemy.isOutside;
			((Component)localPlayerController).transform.position = TrollMenu.roundManager.GetRandomNavMeshPositionInRadius(((Component)enemy).transform.position, 10f, default(NavMeshHit));
			TrollConsole.DisplayMessage("Teleported " + localPlayerController.playerUsername + " to " + ((Object)enemy).name, MessageType.SUCCESS);
		}

		private static void Freeze(EnemyAI enemy)
		{
			if (frozenEnemies[enemy])
			{
				frozenEnemies[enemy] = false;
				TrollConsole.DisplayMessage("Unfroze " + ((Object)enemy).name, MessageType.SUCCESS);
			}
			else
			{
				frozenEnemies[enemy] = true;
				TrollConsole.DisplayMessage("Froze " + ((Object)enemy).name, MessageType.SUCCESS);
			}
		}

		private static void MakeOneHit(EnemyAI enemy)
		{
			enemy.enemyHP = 1;
			TrollConsole.DisplayMessage("Made " + ((Object)enemy).name + " one hit to kill", MessageType.SUCCESS);
		}

		private static void Heal(EnemyAI enemy)
		{
			enemy.enemyHP = enemiesDefaultHP[enemy];
			TrollConsole.DisplayMessage("Healed " + ((Object)enemy).name, MessageType.SUCCESS);
		}
	}
	internal class DeadlyItems
	{
		public static Select<int> spawnMode = null;

		public static int currentMode = 0;

		public static Select<PlayerControllerB> playerSelect = null;

		public static PlayerControllerB currentPlayer = null;

		public static int range = 10;

		public static string rangeString = range.ToString();

		public static void OnMenuOpened()
		{
			if (TrollMenu.isInGame)
			{
				if (spawnMode == null)
				{
					Dictionary<string, int> opts = new Dictionary<string, int>
					{
						{ "Random Spawn", 0 },
						{ "Spawn Near Player", 1 },
						{ "Spawn Near Random Player", 2 }
					};
					spawnMode = new Select<int>(opts);
					spawnMode.SetDefault(0);
				}
				if (playerSelect == null)
				{
					playerSelect = new Select<PlayerControllerB>(TrollMenu.allPlayers);
				}
			}
		}

		public static void Draw(Rect wr)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			int num = 50;
			GUI.Label(new Rect(((Rect)(ref wr)).x + 10f, ((Rect)(ref wr)).y + (float)num, 200f, 30f), "Deadly Items", TrollMenuStyle.labelStyle);
			num += 30;
			currentMode = spawnMode.Draw(new Rect(((Rect)(ref wr)).x + 10f, ((Rect)(ref wr)).y + (float)num, 200f, 30f));
			num += 90;
			currentPlayer = playerSelect.Draw(new Rect(((Rect)(ref wr)).x + ((Rect)(ref wr)).width + 10f, ((Rect)(ref wr)).y, 200f, 30f));
			GUI.Label(new Rect(((Rect)(ref wr)).x + 10f, ((Rect)(ref wr)).y + (float)num, 200f, 25f), "Near Player Range: ");
			rangeString = GUI.TextField(new Rect(((Rect)(ref wr)).x + 200f, ((Rect)(ref wr)).y + (float)num, 100f, 30f), rangeString);
			if (rangeString != "")
			{
				if (int.TryParse(rangeString, out var result))
				{
					range = result;
				}
				else
				{
					range = 10;
				}
			}
			rangeString = range.ToString();
			foreach (KeyValuePair<string, SpawnableMapObject> deadlyobject in TrollMenu.deadlyobjects)
			{
				num += 30;
				if (GUI.Button(new Rect(((Rect)(ref wr)).x + 5f, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width - 10f, 25f), deadlyobject.Key))
				{
					if (currentMode == 0)
					{
						TrollConsole.DisplayMessage("Spawning " + deadlyobject.Key + "at random position");
						TrollMenu.SpawnHostileObjectAtRandomPos(deadlyobject.Value);
					}
					else if (currentMode == 1)
					{
						TrollConsole.DisplayMessage("Spawning " + deadlyobject.Key + "at " + currentPlayer.playerUsername + " position");
						TrollMenu.SpawnHostileObjectNearPlayer(deadlyobject.Value, currentPlayer, range);
					}
					else if (currentMode == 2)
					{
						PlayerControllerB[] array = TrollMenu.alivePlayers.Values.ToArray();
						PlayerControllerB val = array[TrollMenu.roundManager.AnomalyRandom.Next(0, array.Length)];
						TrollConsole.DisplayMessage("Spawning " + deadlyobject.Key + "at " + val.playerUsername + " position");
						TrollMenu.SpawnHostileObjectNearPlayer(deadlyobject.Value, val, range);
					}
				}
			}
		}
	}
	public class ScrapMenu
	{
		public static bool randomValue = false;

		public static bool randomAmount = false;

		public static int minScrap = 0;

		public static int maxScrap = 100;

		public static int minScrapValue = 0;

		public static int maxScrapValue = 1000;

		private static string minScrapStr = minScrap.ToString();

		private static string maxScrapStr = maxScrap.ToString();

		private static string minScrapValueStr = minScrapValue.ToString();

		private static string maxScrapValueStr = maxScrapValue.ToString();

		public static void Draw(Rect wr)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: 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)
			int num = 50;
			int num2 = 100;
			GUI.Label(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, 25f), "Scrap Menu");
			num += 25;
			GUI.Label(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, 25f), "Every change will be applied on next day", TrollMenuStyle.errorLabel);
			num += 25;
			randomValue = GUI.Toggle(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, 25f), randomValue, "Activate Random");
			num += 25;
			if (randomValue)
			{
				GUI.Label(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, 25f), "Min Scrap");
				minScrapStr = GUI.TextField(new Rect(((Rect)(ref wr)).x + (float)num2, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width - (float)(num2 + 5), 25f), minScrapStr);
				num += 25;
				GUI.Label(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, 25f), "Max Scrap");
				maxScrapStr = GUI.TextField(new Rect(((Rect)(ref wr)).x + (float)num2, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width - (float)(num2 + 5), 25f), maxScrapStr);
				try
				{
					if (minScrapStr != "")
					{
						minScrap = int.Parse(minScrapStr);
					}
					if (maxScrapStr != "")
					{
						maxScrap = int.Parse(maxScrapStr);
					}
					if (maxScrap < 0)
					{
						maxScrap = 0;
					}
					if (minScrap < 0)
					{
						minScrap = 0;
					}
					if (minScrap > maxScrap)
					{
						minScrap = maxScrap;
					}
					if (maxScrap < minScrap)
					{
						maxScrap = minScrap;
					}
				}
				catch (Exception ex)
				{
					TrollMenu.mls.LogError((object)"Error while parsing custom values");
					TrollMenu.mls.LogError((object)ex.Message);
				}
				num += 25;
			}
			num2 = 0;
			randomAmount = GUI.Toggle(new Rect(((Rect)(ref wr)).x + (float)num2, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, 25f), randomAmount, "Activate Custom Value");
			num += 25;
			num2 = 100;
			if (!randomAmount)
			{
				return;
			}
			GUI.Label(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, 25f), "Min Scrap Value");
			minScrapValueStr = GUI.TextField(new Rect(((Rect)(ref wr)).x + (float)num2, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width - (float)(num2 + 5), 25f), minScrapValueStr.ToString());
			num += 25;
			GUI.Label(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, 25f), "Max Scrap Value");
			maxScrapValueStr = GUI.TextField(new Rect(((Rect)(ref wr)).x + (float)num2, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width - (float)(num2 + 5), 25f), maxScrapValueStr.ToString());
			try
			{
				if (minScrapValueStr != "")
				{
					minScrapValue = int.Parse(minScrapValueStr);
				}
				if (maxScrapValueStr != "")
				{
					maxScrapValue = int.Parse(maxScrapValueStr);
				}
				if (maxScrapValue < 0)
				{
					maxScrapValue = 0;
				}
				if (minScrapValue < 0)
				{
					minScrapValue = 0;
				}
				if (minScrapValue > maxScrapValue)
				{
					minScrapValue = maxScrapValue;
				}
				if (maxScrapValue < minScrapValue)
				{
					maxScrapValue = minScrapValue;
				}
			}
			catch (Exception ex2)
			{
				TrollMenu.mls.LogError((object)"Error while parsing custom values");
				TrollMenu.mls.LogError((object)ex2.Message);
			}
		}
	}
	internal class SpawnMenu
	{
		private static Vector2 scrollViewVector = Vector2.zero;

		private static Rect scrollRect = new Rect(0f, 0f, 100f, 100f);

		public static PlayerControllerB currentPlayer = null;

		public static List<bool> plyToggle = new List<bool>();

		public static List<bool> lastToggleState = new List<bool>();

		public static Select<PlayerControllerB> playerSelect = null;

		private static Dictionary<string, int> spawnType = new Dictionary<string, int>
		{
			{ "Random Spawn", 0 },
			{ "Spawn Near Player", 1 },
			{ "Spawn Near Random Player", 2 },
			{ "Spawn Behind Player", 3 },
			{ "Spawn Behind Random Player", 4 }
		};

		private static Select<int> spawnSelect = null;

		private static int selected = 0;

		public static void OnMenuOpened()
		{
			if (TrollMenu.isInGame)
			{
				if (playerSelect == null)
				{
					playerSelect = new Select<PlayerControllerB>(TrollMenu.allPlayers);
				}
				if (spawnSelect == null)
				{
					spawnSelect = new Select<int>(spawnType);
					spawnSelect.SetDefault(0);
				}
			}
		}

		public static void Draw(Rect wr)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: 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_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			int num = 75;
			GUI.Label(new Rect(((Rect)(ref wr)).x, (float)num, ((Rect)(ref wr)).width, 25f), "Spawn Menu");
			num += 25;
			selected = spawnSelect.Draw(new Rect(((Rect)(ref wr)).x, (float)num, 200f, 25f));
			num += 130;
			scrollRect = new Rect(0f, 0f, ((Rect)(ref wr)).width, (float)(100 + 30 * TrollMenu.outsideEnemies.Count + 30 * TrollMenu.insideEnemies.Count));
			scrollViewVector = GUI.BeginScrollView(new Rect(((Rect)(ref wr)).x, (float)num, ((Rect)(ref wr)).width, ((Rect)(ref wr)).height - (float)num), scrollViewVector, scrollRect);
			GUI.Label(new Rect(0f, 0f, ((Rect)(ref wr)).width, 25f), "Outside Enemies");
			int num2 = 25;
			foreach (KeyValuePair<string, EnemyType> outsideEnemy in TrollMenu.outsideEnemies)
			{
				string key = outsideEnemy.Key;
				EnemyType value = outsideEnemy.Value;
				if (GUI.Button(new Rect(0f, (float)num2, ((Rect)(ref wr)).width, 25f), key))
				{
					PlayerControllerB randomPlayer = GetRandomPlayer();
					switch (selected)
					{
					case 1:
						TrollMenu.SpawnEnemyOutsideNearPlayer(value, currentPlayer);
						break;
					case 2:
						TrollMenu.SpawnEnemyOutsideNearPlayer(value, randomPlayer);
						break;
					case 3:
						SpawnEnemyBehindPlayer(value, currentPlayer);
						break;
					case 4:
						SpawnEnemyBehindPlayer(value, randomPlayer);
						break;
					default:
						TrollMenu.SpawnOutsideEnemy(value);
						break;
					}
				}
				num2 += 30;
			}
			num2 += 25;
			GUI.Label(new Rect(0f, (float)num2, ((Rect)(ref wr)).width, 25f), "Inside Enemies");
			num2 += 25;
			foreach (KeyValuePair<string, EnemyType> insideEnemy in TrollMenu.insideEnemies)
			{
				string key2 = insideEnemy.Key;
				EnemyType value2 = insideEnemy.Value;
				if (GUI.Button(new Rect(0f, (float)num2, ((Rect)(ref wr)).width, 25f), key2))
				{
					PlayerControllerB randomPlayer2 = GetRandomPlayer();
					switch (selected)
					{
					case 1:
						TrollMenu.SpawnEnemyInsideNearPlayer(value2, currentPlayer);
						break;
					case 2:
						TrollMenu.SpawnEnemyInsideNearPlayer(value2, randomPlayer2);
						break;
					case 3:
						SpawnEnemyBehindPlayer(value2, currentPlayer);
						break;
					case 4:
						SpawnEnemyBehindPlayer(value2, randomPlayer2);
						break;
					default:
						TrollMenu.SpawnInsideEnemy(value2);
						break;
					}
				}
				num2 += 30;
			}
			GUI.EndScrollView();
			GUI.Box(new Rect(((Rect)(ref wr)).x + ((Rect)(ref wr)).width, ((Rect)(ref wr)).y, ((Rect)(ref wr)).width, (float)(30 * GetPlayer().Length)), "Select a player");
			if (TrollMenu.allPlayers.Count == 0)
			{
				GUI.Label(new Rect(((Rect)(ref wr)).x + ((Rect)(ref wr)).width, ((Rect)(ref wr)).y + 25f, ((Rect)(ref wr)).width, 25f), "No players found");
			}
			else
			{
				currentPlayer = playerSelect.Draw(new Rect(((Rect)(ref wr)).x + ((Rect)(ref wr)).width, ((Rect)(ref wr)).y + 25f, ((Rect)(ref wr)).width, 25f));
			}
		}

		private static PlayerControllerB GetRandomPlayer()
		{
			PlayerControllerB[] player = GetPlayer();
			PlayerControllerB val = player[TrollMenu.roundManager.AnomalyRandom.Next(0, player.Length)];
			if ((Object)(object)val == (Object)null)
			{
				val = ((!((Object)(object)currentPlayer == (Object)null)) ? currentPlayer : GetPlayer()[0]);
			}
			return val;
		}

		private static PlayerControllerB[] GetPlayer()
		{
			return StartOfRound.Instance.allPlayerScripts;
		}

		public static void CreatePlayerMenu(Rect wr)
		{
			//IL_0005: 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)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			int num2 = 0;
			GUI.Box(wr, "Player Menu");
			num += 25;
			PlayerControllerB[] player = GetPlayer();
			if (plyToggle.Count != player.Length)
			{
				plyToggle.Clear();
				lastToggleState.Clear();
				for (num2 = 0; num2 < player.Length; num2++)
				{
					plyToggle.Add(item: false);
					lastToggleState.Add(item: false);
				}
			}
			if (player == null || player.Length == 0)
			{
				GUI.Label(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, 25f), "No players found");
				return;
			}
			num2 = 0;
			PlayerControllerB[] array = player;
			foreach (PlayerControllerB val in array)
			{
				plyToggle[num2] = GUI.Toggle(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num, ((Rect)(ref wr)).width, 25f), plyToggle[num2], val.playerUsername);
				num += 30;
				num2++;
			}
			for (num2 = 0; num2 < plyToggle.Count; num2++)
			{
				if (plyToggle[num2] == lastToggleState[num2])
				{
					continue;
				}
				if (plyToggle[num2])
				{
					for (int j = 0; j < plyToggle.Count; j++)
					{
						if (j != num2)
						{
							plyToggle[j] = false;
						}
					}
					currentPlayer = player[num2];
				}
				lastToggleState[num2] = plyToggle[num2];
			}
			if (!plyToggle.Contains(item: true))
			{
				currentPlayer = null;
			}
		}

		private static void SpawnEnemyBehindPlayer(EnemyType enemy, PlayerControllerB ply)
		{
			//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)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: 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)
			if ((Object)(object)enemy == (Object)null)
			{
				TrollConsole.DisplayMessage("No enemy selected", MessageType.ERROR);
				return;
			}
			if ((Object)(object)ply == (Object)null)
			{
				TrollConsole.DisplayMessage("No player selected", MessageType.ERROR);
				return;
			}
			TrollConsole.DisplayMessage("Spawning " + ((Object)enemy).name + " behind " + ply.playerUsername + "(" + (ply.isInsideFactory ? "Inside" : "Outside") + ")");
			Vector3 positionBehind = TrollMenu.GetPositionBehind(((Component)ply).transform.position, ((Component)ply).transform.forward);
			EnemyAI val = TrollMenu.SpawnEnemy(enemy, positionBehind, !ply.isInsideFactory);
			val.destination = ((Component)ply).transform.position;
			val.moveTowardsDestination = true;
		}
	}
}
namespace LethalCompanyTrollMenuMod.Component
{
	internal class TabManager : MonoBehaviour
	{
		private Rect wr = new Rect(20f, 20f, 500f, 800f);

		private int toolbarInt = 0;

		private Type[] toolBarTypes = null;

		private string[] toolbarStrings = new string[1] { "No tabs spotted" };

		private bool showMenu = false;

		public static bool showMessage;

		private string scene = "";

		private Type[] getTabs()
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			Type[] types = executingAssembly.GetTypes();
			List<Type> list = new List<Type>();
			Type[] array = types;
			foreach (Type type in array)
			{
				if (type.Namespace == "LethalCompanyTrollMenuMod.tabs" && !type.Name.Contains("<"))
				{
					list.Add(type);
				}
			}
			return list.ToArray();
		}

		private void OnGUI()
		{
			//IL_0028: 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)
			//IL_0033: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			if (showMenu)
			{
				wr = new Rect(20f, 20f, 500f, 800f);
				GUI.Box(wr, "Troll Menu");
				toolbarInt = GUI.Toolbar(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + 25f, ((Rect)(ref wr)).width, 25f), toolbarInt, toolbarStrings);
				Type type = toolBarTypes[toolbarInt];
				object[] parameters = new object[1] { wr };
				type.GetMethod("Draw").Invoke(null, parameters);
			}
		}

		private void Awake()
		{
			TrollMenu.mls.LogInfo((object)"LOADED MENU");
			Type[] tabs = getTabs();
			toolbarStrings = tabs.Select((Type x) => x.Name).ToArray();
			toolBarTypes = tabs;
		}

		private string CurrentScene()
		{
			//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 activeScene = SceneManager.GetActiveScene();
			return ((Scene)(ref activeScene)).name;
		}

		private void Update()
		{
			//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)
			KeyboardShortcut val = new KeyboardShortcut((KeyCode)282, Array.Empty<KeyCode>());
			if (((KeyboardShortcut)(ref val)).IsUp() && (TrollMenu.isInGame || showMenu))
			{
				showMenu = !showMenu;
				if (showMenu)
				{
					TrollMenu.allPlayers.Clear();
					PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
					foreach (PlayerControllerB val2 in allPlayerScripts)
					{
						TrollMenu.allPlayers.Add(val2.playerUsername, val2);
					}
					Type[] array = toolBarTypes;
					foreach (Type type in array)
					{
						if (type.GetMethod("OnMenuOpened") != null)
						{
							type.GetMethod("OnMenuOpened").Invoke(null, null);
						}
					}
				}
			}
			if (CurrentScene() != scene)
			{
				scene = CurrentScene();
				TrollMenu.isInGame = scene == "SampleSceneRelay";
				SpawnMenu.currentPlayer = null;
				SpawnMenu.playerSelect.SetToDefault();
				DeadlyItems.currentPlayer = null;
				DeadlyItems.playerSelect.SetToDefault();
			}
		}

		private void OnDestroy()
		{
			TrollMenu.mls.LogError((object)"UNLOADED MENU");
		}
	}
}
namespace LethalCompanyTrollMenuMod.helpers
{
	internal class Select<T>
	{
		private Dictionary<string, T> opts;

		private bool[] old;

		private bool[] current;

		private T defaultValue = default(T);

		private int defaultIndex = -1;

		public Select(Dictionary<string, T> opts)
		{
			this.opts = opts;
			old = new bool[opts.Count];
			current = new bool[opts.Count];
			for (int i = 0; i < opts.Count; i++)
			{
				old[i] = false;
				current[i] = false;
			}
		}

		public void SetDefault(T value)
		{
			defaultValue = value;
			defaultIndex = opts.Values.ToList().IndexOf(value);
		}

		public void SetToDefault()
		{
			for (int i = 0; i < opts.Count; i++)
			{
				old[i] = false;
				current[i] = false;
			}
			if (defaultValue != null)
			{
				current[defaultIndex] = true;
			}
		}

		public T Draw(Rect wr)
		{
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			if (opts.Count == 0)
			{
				return defaultValue;
			}
			int num = 0;
			if (old.Length != opts.Count)
			{
				old = new bool[opts.Count];
				current = new bool[opts.Count];
				for (num = 0; num < opts.Count; num++)
				{
					old[num] = false;
					current[num] = false;
				}
				return defaultValue;
			}
			T result = defaultValue;
			int num2 = 0;
			num = 0;
			T[] array = opts.Values.ToArray();
			foreach (KeyValuePair<string, T> opt in opts)
			{
				current[num] = GUI.Toggle(new Rect(((Rect)(ref wr)).x, ((Rect)(ref wr)).y + (float)num2, ((Rect)(ref wr)).width, 25f), current[num], opt.Key);
				num2 += 25;
				num++;
			}
			for (num = 0; num < current.Length; num++)
			{
				if (current[num] == old[num])
				{
					continue;
				}
				if (current[num])
				{
					for (int i = 0; i < current.Length; i++)
					{
						if (i != num)
						{
							current[i] = false;
							old[i] = false;
						}
					}
				}
				old[num] = current[num];
			}
			List<bool> list = current.ToList();
			int num3 = list.IndexOf(item: true);
			if (num3 != -1)
			{
				result = array[num3];
			}
			if (!current.Contains(value: true))
			{
				if (defaultValue != null)
				{
					current[defaultIndex] = true;
				}
				result = defaultValue;
			}
			return result;
		}
	}
}