Decompiled source of RoRCheatPanel v1.1.0

plugins\RoRCheatPanel\RoRCheatPanel.Channel.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using HG;
using HarmonyLib;
using KinematicCharacterController;
using Rewired;
using RoR2;
using RoR2.CameraModes;
using RoR2.CharacterAI;
using RoR2.Networking;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("RoRCheatPanel.Channel")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.56.0")]
[assembly: AssemblyInformationalVersion("1.0.56")]
[assembly: AssemblyProduct("RoRCheatPanel.Channel")]
[assembly: AssemblyTitle("RoRCheatPanel.Channel")]
[assembly: AssemblyVersion("1.0.56.0")]
namespace RoRCheatPanel.Channel;

internal static class ButtonTips
{
	private static readonly Dictionary<string, string> Tips = new Dictionary<string, string>(StringComparer.Ordinal);

	private static bool _busy;

	public static void Install(Harmony harmony)
	{
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Expected O, but got Unknown
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Expected O, but got Unknown
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Expected O, but got Unknown
		Fill();
		MethodInfo[] methods = typeof(GUILayout).GetMethods(BindingFlags.Static | BindingFlags.Public);
		foreach (MethodInfo methodInfo in methods)
		{
			if (methodInfo.Name != "Button")
			{
				continue;
			}
			ParameterInfo[] parameters = methodInfo.GetParameters();
			if (parameters.Length == 0)
			{
				continue;
			}
			try
			{
				if (parameters[0].ParameterType == typeof(string))
				{
					bool flag = false;
					for (int j = 0; j < parameters.Length; j++)
					{
						if (parameters[j].ParameterType == typeof(GUILayoutOption[]) && parameters[j].Name == "options")
						{
							flag = true;
						}
					}
					if (flag)
					{
						bool flag2 = parameters.Length >= 2 && parameters[1].ParameterType == typeof(GUIStyle);
						harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(ButtonTips), flag2 ? "StyledPrefix" : "ButtonPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
					}
				}
				else if (parameters[0].ParameterType == typeof(GUIContent))
				{
					harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(ButtonTips), "ContentPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				}
			}
			catch (Exception ex)
			{
				Debug.LogWarning((object)("RoRCheatPanel button tips: " + ex.Message));
			}
		}
		MethodInfo methodInfo2 = AccessTools.TypeByName("RoRCheatPanel.Loc")?.GetMethod("T", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[1] { typeof(string) }, null);
		if (methodInfo2 != null)
		{
			harmony.Patch((MethodBase)methodInfo2, (HarmonyMethod)null, new HarmonyMethod(typeof(ButtonTips), "AfterLoc", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}

	public static bool ButtonPrefix(string text, GUILayoutOption[] options, ref bool __result)
	{
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Expected O, but got Unknown
		if (_busy)
		{
			return true;
		}
		string text2 = TeamWords.Apply(text, PanelFixes.SelectionIncludesOthers());
		string text3 = For(text);
		if (string.IsNullOrEmpty(text3))
		{
			if (text2 == text)
			{
				return true;
			}
			_busy = true;
			try
			{
				__result = GUILayout.Button(text2, options ?? Array.Empty<GUILayoutOption>());
			}
			finally
			{
				_busy = false;
			}
			return false;
		}
		_busy = true;
		try
		{
			__result = GUILayout.Button(new GUIContent(text2, text3), options ?? Array.Empty<GUILayoutOption>());
		}
		finally
		{
			_busy = false;
		}
		return false;
	}

	public static bool StyledPrefix(string text, GUIStyle style, GUILayoutOption[] options, ref bool __result)
	{
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Expected O, but got Unknown
		if (_busy)
		{
			return true;
		}
		string text2 = TeamWords.Apply(text, PanelFixes.SelectionIncludesOthers());
		string text3 = For(text);
		if (string.IsNullOrEmpty(text3))
		{
			if (text2 == text)
			{
				return true;
			}
			_busy = true;
			try
			{
				__result = GUILayout.Button(text2, style, options ?? Array.Empty<GUILayoutOption>());
			}
			finally
			{
				_busy = false;
			}
			return false;
		}
		_busy = true;
		try
		{
			__result = GUILayout.Button(new GUIContent(text2, text3), style, options ?? Array.Empty<GUILayoutOption>());
		}
		finally
		{
			_busy = false;
		}
		return false;
	}

	public static void ContentPrefix(GUIContent content)
	{
		if (content != null && !string.IsNullOrEmpty(content.text))
		{
			string text = For(content.text);
			if (!string.IsNullOrEmpty(text) && (string.IsNullOrEmpty(content.tooltip) || content.tooltip == content.text))
			{
				content.tooltip = text;
			}
		}
	}

	public static void AfterLoc(string key, ref string __result)
	{
		if (key == "hover_hint")
		{
			__result = Tr("Наведи курсор на кнопку, предмет или артефакт — всплывёт, что это делает.", "Hover a button, item, or artifact to see what it does.", "Pasa el cursor por un botón, objeto o artefacto para ver qué hace.");
		}
		else if (key == "fun_help")
		{
			__result = Tr("Бесполезное, но приятное. Часть кнопок — только хост. Наведи курсор на кнопку — всплывёт, что она делает.", "Useless, but fun. Some buttons need the host. Hover a button to see what it does.", "Inútil, pero divertido. Algunos botones necesitan anfitrión. Pasa el cursor por un botón para ver qué hace.");
		}
	}

	private static string For(string label)
	{
		if (string.IsNullOrEmpty(label))
		{
			return null;
		}
		Tips.TryGetValue(Lang() + "\n" + label, out var value);
		return value;
	}

	private static void Set(string lang, string label, string tip)
	{
		if (!string.IsNullOrEmpty(label))
		{
			Tips[lang + "\n" + label] = tip;
		}
	}

	private static void Add(string ruLabel, string enLabel, string esLabel, string ru, string en, string es)
	{
		Set("Ru", ruLabel, ru);
		Set("En", enLabel, en);
		Set("Es", esLabel, es);
	}

	private static void Hard(string label, string ru, string en, string es)
	{
		Set("Ru", label, ru);
		Set("En", label, en);
		Set("Es", label, es);
	}

	private static void Fill()
	{
		Add("Предметы", "Items", "Objetos", "Вкладка выдачи предметов выбранным игрокам.", "Tab for giving items to the selected players.", "Pestaña para dar objetos a los jugadores seleccionados.");
		Add("Снаряжение", "Equipment", "Equipo", "Вкладка снаряжения: надеть, снять, перезарядить.", "Equipment tab: equip, unequip, recharge.", "Pestaña de equipo: equipar, quitar, recargar.");
		Add("Пресеты", "Presets", "Presets", "Сохранённые наборы предметов из папки Presets.", "Saved item sets from the Presets folder.", "Conjuntos de objetos guardados en la carpeta Presets.");
		Add("Скиллы", "Skills", "Habilidades", "Смена умений выбранного персонажа.", "Change the selected survivor's skills.", "Cambiar las habilidades del superviviente seleccionado.");
		Add("Персонажи", "Characters", "Personajes", "Стать любым телом из каталога: выживший, монстр, дрон.", "Turn into any catalog body: survivor, monster, or drone.", "Convertirte en cualquier cuerpo del catálogo: superviviente, monstruo o dron.");
		Add("Ачивки", "Achievements", "Logros", "Выдача достижений. Себе — сразу, другим — если у них тоже стоит панель.", "Grant achievements. Yours apply immediately; others need this panel too.", "Dar logros. Los tuyos se aplican ya; a otros, solo si también tienen el panel.");
		Add("Ран", "Run", "Partida", "Сложность, скорость времени, артефакты и смена выжившего.", "Difficulty, time speed, artifacts, and survivor swap.", "Dificultad, velocidad del tiempo, artefactos y cambio de superviviente.");
		Add("Команды", "Teams", "Equipos", "Перевести выбранных в другую команду или убить команду.", "Move the selected players to another team, or kill a team.", "Pasar a los seleccionados a otro equipo, o matar un equipo.");
		Add("Хаос", "Chaos", "Caos", "Фановые кнопки: лут, размер, камера, ник, босс.", "Fun buttons: loot, size, camera, name, boss.", "Botones de caos: botín, tamaño, cámara, nombre, jefe.");
		Add("Инструменты", "Tools", "Herramientas", "Годмод, полёт, хил, телепорт, деньги, уровень и призыв.", "God mode, flight, heal, teleporter, money, level, and summons.", "God mode, vuelo, cura, teletransportador, dinero, nivel e invocaciones.");
		Add("О панели", "About", "Acerca de", "Язык, цвет панели, прозрачность и ссылка на канал.", "Language, panel color, opacity, and the channel link.", "Idioma, color del panel, opacidad y el enlace del canal.");
		Add("Игроки", "Players", "Jugadores", "Вкладка игроков: кик, бан, мут, годмод. В командах — вернуть выбранных в команду игроков.", "Players tab: boot, ban, mute, god mode. On Teams, this puts the selected players back on the player team.", "Pestaña de jugadores: echar, ban, mute, god. En Equipos, devuelve a los seleccionados al equipo de jugadores.");
		Add("Этапы", "Stages", "Etapas", "Вкладка перехода на карту. Как фильтр — показать обычные этапы в списке.", "Stage-travel tab. As a filter, show normal stages in the list.", "Pestaña para viajar de etapa. Como filtro, muestra las etapas normales en la lista.");
		Add("Монстры", "Monsters", "Monstruos", "В персонажах — показать монстров в списке. В командах — перевести выбранных в команду монстров.", "On Characters, show monsters in the list. On Teams, move the selected players to the monster team.", "En Personajes, muestra monstruos en la lista. En Equipos, pasa a los seleccionados al equipo de monstruos.");
		Add("Прочее", "Other", "Otros", "Показать или скрыть эту группу в списке: прочие тела или скрытые сцены.", "Show or hide this group in the list: other bodies, other items, or hidden scenes.", "Mostrar u ocultar este grupo en la lista: otros cuerpos, otros objetos o escenas ocultas.");
		Add("Другое", "Other", "Otros", "Показать предметы, которые не попали в обычные тиры.", "Show or hide this group in the list: other bodies, other items, or hidden scenes.", "Mostrar u ocultar este grupo en la lista: otros cuerpos, otros objetos o escenas ocultas.");
		Add("Случайный предмет", "Random item", "Objeto aleatorio", "Даёт выбранным игрокам один случайный предмет.", "Gives the selected players one random item.", "Da a los jugadores seleccionados un objeto al azar.");
		Add("10 случайных", "10 random", "10 aleatorios", "Даёт выбранным десять случайных предметов.", "Gives the selected players ten random items.", "Da a los seleccionados diez objetos al azar.");
		Add("Случайное снаряжение", "Random equipment", "Equipo aleatorio", "Надевает выбранным случайное снаряжение.", "Equips a random equipment on the selected players.", "Equipa un equipo al azar a los seleccionados.");
		Add("Случайный выживший", "Random survivor", "Superviviente aleatorio", "Меняет выбранных на случайного выжившего.", "Turns the selected players into a random survivor.", "Convierte a los seleccionados en un superviviente al azar.");
		Add("Дождь предметов", "Item rain", "Lluvia de objetos", "Роняет немного лута с неба рядом с тобой.", "Drops a little loot from the sky near you.", "Deja caer un poco de botín del cielo cerca de ti.");
		Add("Ливень", "Item storm", "Tormenta", "Роняет много лута с неба рядом с тобой.", "Drops a lot of loot from the sky near you.", "Deja caer mucho botín del cielo cerca de ti.");
		Add("Пнуть в небо", "Yeet", "Lanzar", "Подбрасывает выбранных высоко вверх.", "Launches the selected players high into the air.", "Lanza a los seleccionados muy arriba.");
		Add("Цитата", "Quote", "Cita", "Пишет случайную фразу в чат.", "Sends a random line to chat.", "Escribe una frase al azar en el chat.");
		Add("Дождь сундуков", "Chest rain", "Lluvia de cofres", "Ставит несколько сундуков вокруг тебя.", "Spawns a few chests around you.", "Pone algunos cofres a tu alrededor.");
		Add("Сундучный шторм", "Chest storm", "Tormenta de cofres", "Ставит очень много сундуков вокруг тебя.", "Spawns a lot of chests around you.", "Pone muchísimos cofres a tu alrededor.");
		Add("Случайный артефакт", "Random artifact", "Artefacto aleatorio", "Включает или выключает один случайный артефакт.", "Toggles one random artifact on or off.", "Activa o desactiva un artefacto al azar.");
		Add("Взрыв золота", "Gold explosion", "Explosión de oro", "Разбрасывает золото вокруг тебя.", "Scatters gold around you.", "Esparce oro a tu alrededor.");
		Add("Пинок", "Kick", "Patada", "Отталкивает игрока без урона.", "Knocks a player back without dealing damage.", "Empuja a un jugador sin hacerle daño.");
		Add("Пинок 10% HP", "Kick 10% HP", "Patada 10% HP", "Отталкивает игрока и снимает 10% здоровья.", "Knocks a player back and removes 10% health.", "Empuja a un jugador y le quita un 10% de vida.");
		Add("Я БОСС (с пафосом)", "I AM THE BOSS", "YO SOY EL JEFE", "Превращает выбранных в случайного босса и включает бессмертие. Диско-панель не трогает.", "Turns the selected players into a random boss and turns on god mode. Does not enable the disco panel.", "Convierte a los seleccionados en un jefe al azar y activa god mode. No enciende el panel disco.");
		Add("Кроха", "Tiny", "Mini", "Делает тело очень маленьким (масштаб 0.35).", "Makes the body very small (scale 0.35).", "Hace el cuerpo muy pequeño (escala 0.35).");
		Add("Норма", "Normal", "Normal", "Возвращает обычный размер тела. На вкладке снаряжения это же слово показывает обычное, не лунное, снаряжение.", "Sets body size back to normal. On the Equipment tab, the same word shows non-lunar gear.", "Devuelve el tamaño normal. En la pestaña Equipo, la misma palabra muestra el equipo que no es lunar.");
		Add("Обычное", "Normal", "Normal", "Показать в списке обычное снаряжение, не лунное.", "Sets body size back to normal. On the Equipment tab, the same word shows non-lunar gear.", "Devuelve el tamaño normal. En la pestaña Equipo, la misma palabra muestra el equipo que no es lunar.");
		Add("Гигант", "Giant", "Gigante", "Делает тело огромным (масштаб 3.2).", "Makes the body huge (scale 3.2).", "Hace el cuerpo enorme (escala 3.2).");
		Add("Титан", "Titan", "Titán", "Делает тело гигантским (масштаб 6).", "Makes the body gigantic (scale 6).", "Hace el cuerpo gigantesco (escala 6).");
		Add("Низкая гравитация", "Low gravity", "Gravedad baja", "Включает или выключает слабую гравитацию. Прыжки уносят далеко вверх.", "Toggles low gravity. Jumps carry you much higher.", "Activa o desactiva la gravedad baja. Los saltos suben mucho más.");
		Add("Диско-панель", "Disco panel", "Panel disco", "Панель начинает переливаться цветами. На персонажа не влияет.", "The panel cycles colors. It does not affect the character.", "El panel cambia de colores. No afecta al personaje.");
		Add("Третье лицо", "Third person", "Tercera persona", "Камера встаёт за спину. Дистанция — ползунок рядом.", "Puts the camera behind the character. Distance is the slider next to it.", "Pone la cámara detrás del personaje. La distancia es el control de al lado.");
		Add("Пьяная камера", "Drunk camera", "Cámara borracha", "Камера покачивается. Если картинка останется кривой, нажми «Восстановить камеру».", "The camera wobbles. If the view stays crooked, press Reset camera.", "La cámara se tambalea. Si la vista se queda torcida, pulsa Restaurar cámara.");
		Add("Восстановить камеру", "Reset camera", "Restaurar cámara", "Выравнивает камеру, если её перекосило после пьяного режима.", "Straightens the camera if drunk mode left it crooked.", "Endereza la cámara si el modo borracho la dejó torcida.");
		Add("Сменить ник", "Change name", "Cambiar nombre", "Ставит выбранным игрокам ник из поля слева.", "Sets the selected players' name to the text on the left.", "Pone a los seleccionados el nombre escrito a la izquierda.");
		Add("Я с луны", "From the moon", "De la luna", "Меняет ник на «я с луны».", "Changes the name to a moon line.", "Cambia el nombre a una frase de la luna.");
		Hard("БОСС", "Меняет ник на «БОСС». Это не превращение в босса.", "Changes the name to BOSS. This does not turn you into a boss.", "Cambia el nombre a JEFE. Esto no te convierte en un jefe.");
		Hard("60", "Вернуть поле зрения к обычным 60.", "Set the field of view back to 60.", "Devolver el campo de visión a 60.");
		Hard("8", "Вернуть дистанцию камеры от третьего лица к 8.", "Set the third-person camera distance back to 8.", "Devolver la distancia de la cámara en tercera persona a 8.");
		Hard("1x", "Вернуть скорость времени к обычной.", "Set the time speed back to normal.", "Devolver la velocidad del tiempo a la normal.");
		Hard("100", "Сделать панель полностью видимой (100%).", "Make the panel fully visible (100%).", "Dejar el panel totalmente visible (100%).");
		Hard("1", "Поставить количество выдачи на 1.", "Set the give amount to 1.", "Poner la cantidad a dar en 1.");
		Hard("10", "Поставить количество выдачи на 10.", "Set the give amount to 10.", "Poner la cantidad a dar en 10.");
		Hard("50", "Поставить количество выдачи на 50.", "Set the give amount to 50.", "Poner la cantidad a dar en 50.");
		Hard("-", "Уменьшить число на 1.", "Decrease the number by 1.", "Bajar el número en 1.");
		Hard("+", "Увеличить число на 1.", "Increase the number by 1.", "Subir el número en 1.");
		Hard("X", "Закрыть панель.", "Close the panel.", "Cerrar el panel.");
		Hard("Пылающий", "Красит выбранных в огненный цвет элиты. Бонуса элиты нет, только скин. Нажми ещё раз, чтобы снять.", "Paints the selected players with the blazing elite color. No elite bonus, skin only. Press again to clear.", "Pinta a los seleccionados con el color de élite llameante. Sin bonus, solo el skin. Pulsa otra vez para quitarlo.");
		Set("En", "Blazing", "Paints the selected players with the blazing elite color. No elite bonus, skin only. Press again to clear.");
		Set("Es", "Llameante", "Pinta a los seleccionados con el color de élite llameante. Sin bonus, solo el skin. Pulsa otra vez para quitarlo.");
		Add("Перегрузка", "Overloading", "Sobrecarga", "Красит выбранных в синий цвет элиты перегрузки. Бонуса нет, только скин. Нажми ещё раз, чтобы снять.", "Paints the selected players with the overloading elite color. No bonus, skin only. Press again to clear.", "Pinta a los seleccionados con el color de élite de sobrecarga. Sin bonus, solo el skin. Pulsa otra vez para quitarlo.");
		Add("Лёд", "Glacial", "Glacial", "Красит выбранных в ледяной цвет элиты. Бонуса нет, только скин. Нажми ещё раз, чтобы снять.", "Paints the selected players with the glacial elite color. No bonus, skin only. Press again to clear.", "Pinta a los seleccionados con el color de élite glacial. Sin bonus, solo el skin. Pulsa otra vez para quitarlo.");
		Add("Перетасовка", "Shuffle items", "Mezclar objetos", "Перемешивает предметы между выбранными игроками. Нужны хотя бы двое.", "Shuffles items between the selected players. Needs at least two.", "Mezcla los objetos entre los jugadores seleccionados. Hacen falta al menos dos.");
		Add("Все сюда", "All here", "Todos aquí", "Телепортирует монстров этого этапа к тебе.", "Teleports this stage's monsters to you.", "Teletransporta a ti a los monstruos de esta etapa.");
		Add("Салют", "Fireworks", "Fuegos", "Запускает фейерверк вокруг тебя и пишет фразу в чат.", "Sets off fireworks around you and sends a line to chat.", "Lanza fuegos artificiales a tu alrededor y escribe una frase en el chat.");
		Add("Сбросить хаос", "Reset chaos", "Resetear caos", "Возвращает тело до превращения в босса и выключает годмод, диско, низкую гравитацию, третье лицо и элитный цвет. Предметы и ник не трогает.", "Restores the body from before the boss transform and turns off god mode, disco, low gravity, third person, and elite colors. Items and the name stay.", "Devuelve el cuerpo de antes de ser jefe y apaga god mode, disco, gravedad baja, tercera persona y colores de élite. Los objetos y el nombre se quedan.");
		Add("Белые", "White", "Blancos", "Показать белые предметы в списке.", "Show white items in the list.", "Mostrar objetos blancos en la lista.");
		Add("Зелёные", "Green", "Verdes", "Показать зелёные предметы в списке.", "Show green items in the list.", "Mostrar objetos verdes en la lista.");
		Add("Красные", "Red", "Rojos", "Показать красные предметы в списке.", "Show red items in the list.", "Mostrar objetos rojos en la lista.");
		Add("Лунные", "Lunar", "Lunares", "Показать лунные предметы в списке.", "Show lunar items or lunar equipment in the list.", "Mostrar objetos lunares en la lista.");
		Add("Лунное", "Lunar", "Lunar", "Показать лунное снаряжение в списке.", "Show lunar items or lunar equipment in the list.", "Mostrar el equipo lunar en la lista.");
		Add("Босс", "Boss", "Jefe", "Показать боссовые предметы в списке.", "Show boss items in the list.", "Mostrar objetos de jefe en la lista.");
		Add("Воид", "Void", "Vacío", "Тема панели «Воид» или фильтр воид-предметов — смотря где кнопка.", "Show void items in the list.", "Mostrar objetos del vacío en la lista.");
		Hard("Void Fiend", "Сиреневая тема панели, цвет Воид Финда.", "Lavender panel theme, Void Fiend's color.", "Tema lavanda del panel, el color de Void Fiend.");
		Add("Еда", "Food", "Comida", "Показать еду в списке предметов.", "Show food items in the list.", "Mostrar comida en la lista de objetos.");
		Add("Скрытые", "Hidden", "Ocultos", "Показать скрытые предметы, которых нет в обычном списке.", "Show hidden items that are not in the normal list.", "Mostrar objetos ocultos que no están en la lista normal.");
		Add("Выдать все видимые", "Give all visible", "Dar todos los visibles", "Выдаёт все предметы из текущего фильтра выбранным игрокам, в выбранном количестве.", "Gives every item in the current filter to the selected players, using the chosen amount.", "Da todos los objetos del filtro actual a los seleccionados, en la cantidad elegida.");
		Add("Очистить инвентарь", "Clear inventory", "Vaciar inventario", "Удаляет все предметы у выбранных игроков.", "Removes every item from the selected players.", "Quita todos los objetos de los jugadores seleccionados.");
		Add("Убрать все", "Remove all", "Quitar todo", "Снимает все копии этого предмета у выбранных.", "Removes every copy of this item from the selected players.", "Quita todas las copias de este objeto a los seleccionados.");
		Add("Снять снаряжение", "Unequip", "Quitar equipo", "Снимает надетое снаряжение у выбранных.", "Unequips the selected players.", "Quita el equipo de los seleccionados.");
		Add("Мгновенная перезарядка", "Instant recharge", "Recarga instantánea", "Сразу заряжает снаряжение выбранных.", "Recharges the selected players' equipment immediately.", "Recarga al instante el equipo de los seleccionados.");
		Hard("Reset skills", "Возвращает умения персонажа к обычным для его тела.", "Restores the survivor's skills to the defaults for that body.", "Devuelve las habilidades a las normales de ese cuerpo.");
		Add("Сбросить кулдауны", "Reset cooldowns", "Resetear enfriamientos", "Сбрасывает перезарядку всех умений.", "Clears the cooldown on every skill.", "Quita el enfriamiento de todas las habilidades.");
		Add("Бесконечные скиллы", "Infinite skills", "Habilidades infinitas", "Умения больше не уходят на перезарядку, пока кнопка включена.", "Skills do not go on cooldown while this is on.", "Las habilidades no entran en enfriamiento mientras esto está activo.");
		Add("Выдать все ачивки", "Grant all achievements", "Dar todos los logros", "Открывает все достижения локальному профилю. Хост не нужен.", "Unlocks every achievement on the local profile. Host is not required.", "Desbloquea todos los logros del perfil local. No hace falta ser anfitrión.");
		Add("Все ачивки выбранным", "All ach. to selected", "Todos los logros a seleccionados", "Шлёт все достижения выбранным. Сработает, только если у них тоже стоит эта панель.", "Sends every achievement to the selected players. Works only if they also have this panel.", "Envía todos los logros a los seleccionados. Solo funciona si también tienen este panel.");
		Add("Создать из инвентаря", "Create from inventory", "Crear del inventario", "Сохраняет текущие предметы в новый пресет.", "Saves the current items as a new preset.", "Guarda los objetos actuales como un preset nuevo.");
		Add("Обновить список", "Refresh list", "Actualizar lista", "Перечитывает файлы пресетов с диска.", "Reloads preset files from disk.", "Vuelve a leer los presets del disco.");
		Add("Наложить", "Apply", "Aplicar", "Добавляет предметы пресета к тем, что уже есть.", "Adds the preset's items on top of what you already have.", "Añade los objetos del preset a los que ya tienes.");
		Add("Заменить инвентарь", "Replace inventory", "Reemplazar inventario", "Стирает предметы и ставит только то, что в пресете.", "Clears items and keeps only what is in the preset.", "Borra los objetos y deja solo los del preset.");
		Add("Удалить", "Delete", "Borrar", "Удаляет файл этого пресета.", "Deletes this preset file.", "Borra el archivo de este preset.");
		Add("Выжившие", "Survivors", "Supervivientes", "Показать выживших в списке персонажей.", "Show survivors in the character list.", "Mostrar supervivientes en la lista de personajes.");
		Add("Боссы", "Bosses", "Jefes", "Показать боссов в списке персонажей.", "Show bosses in the character list.", "Mostrar jefes en la lista de personajes.");
		Add("Дроны", "Drones", "Drones", "Показать дронов в списке персонажей.", "Show drones in the character list.", "Mostrar drones en la lista de personajes.");
		Add("Нейтралы", "Neutral", "Neutral", "Перевести выбранных в нейтральную команду: их никто не бьёт и они никого не бьют.", "Move the selected players to the neutral team: nobody fights them, and they fight nobody.", "Pasa a los seleccionados al equipo neutral: nadie les pega y ellos no pegan a nadie.");
		Add("Убить всех врагов", "Kill all enemies", "Matar enemigos", "Убивает всех врагов на текущей сцене.", "Kills every enemy on the current stage.", "Mata a todos los enemigos de la etapa actual.");
		Add("Убить команду", "Kill team", "Matar equipo", "Убивает всех, кто сейчас в выбранной команде.", "Kills everyone currently on the selected team.", "Mata a todos los que están ahora en el equipo elegido.");
		Hard("Kill", "Убить этого персонажа на сцене.", "Kill this character on the stage.", "Matar a este personaje en la escena.");
		Add("Интермиссии", "Intermissions", "Intermedios", "Показать промежуточные сцены, например базар и луну.", "Show in-between scenes, such as the bazaar and the moon.", "Mostrar escenas intermedias, como el bazar y la luna.");
		Add("Следующий", "Next", "Siguiente", "Назначить эту карту следующей после телепорта.", "Queue this stage as the next one after the teleporter.", "Poner esta etapa como la siguiente después del teletransportador.");
		Add("Сейчас", "Now", "Ahora", "Сразу загрузить эту карту, не дожидаясь телепорта.", "Load this stage immediately, without waiting for the teleporter.", "Cargar esta etapa ahora, sin esperar al teletransportador.");
		Add("Заморозить таймер рана", "Freeze run timer", "Congelar el temporizador", "Останавливает или снова запускает таймер забега. Скорость мира этим не ставится на паузу.", "Pauses or resumes the run timer. This does not freeze the world itself.", "Pausa o reanuda el temporizador de la partida. Esto no congela el mundo.");
		Add("Беск. снаряжение", "Inf. equipment", "Equipo inf.", "Снаряжение перезаряжается сразу, пока кнопка включена.", "Equipment recharges instantly while this is on.", "El equipo se recarga al instante mientras esto está activo.");
		Add("Полный хил", "Full heal", "Curar todo", "Восстанавливает здоровье выбранных до полного.", "Heals the selected players to full.", "Cura por completo a los jugadores seleccionados.");
		Add("Применить порталы", "Apply portals", "Aplicar portales", "Ставит на телепорт те порталы, которые включены кнопками выше.", "Places the portals that are toggled on above onto the teleporter.", "Pone en el teletransportador los portales que están activados arriba.");
		Add("Активировать", "Activate", "Activar", "Запускает телепорт на этой сцене, как будто к нему подошли.", "Starts the teleporter on this stage, as if someone walked up to it.", "Arranca el teletransportador de esta etapa, como si alguien se hubiera acercado.");
		Add("Зарядить", "Charge", "Cargar", "Сразу заполняет шкалу заряда телепорта.", "Fills the teleporter charge bar immediately.", "Llena al instante la barra de carga del teletransportador.");
		Add("Пинг", "Ping", "Ping", "Ставит пинг на телепорт, чтобы его было видно.", "Pings the teleporter so it is easy to see.", "Marca el teletransportador para que se vea.");
		Add("Выдать золото", "Give gold", "Dar oro", "Добавляет выбранным золото из поля выше.", "Adds the gold amount above to the selected players.", "Añade a los seleccionados el oro del campo de arriba.");
		Add("Выдать луну", "Give lunar", "Dar lunar", "Добавляет лунные монеты из поля выше.", "Adds the lunar coins from the field above.", "Añade las monedas lunares del campo de arriba.");
		Add("Уровень команды", "Team level", "Nivel del equipo", "Ставит уровень всей команды на число из поля выше.", "Sets the whole team's level to the number above.", "Pone el nivel de todo el equipo en el número de arriba.");
		Add("Прочитать текущие", "Read current", "Leer actuales", "Читает базовые статы тела в ползунки. Бонусы от предметов сюда не входят.", "Reads the body's base stats into the sliders. Item bonuses are not included.", "Lee las stats base del cuerpo en los controles. No incluye bonuses de objetos.");
		Hard("Apply changes", "Записывает значения ползунков статов в персонажа.", "Writes the stat sliders onto the character.", "Escribe los controles de stats en el personaje.");
		Add("Рядовые", "Grunts", "Comunes", "Показать в списке спавна обычных монстров, не боссов.", "Show regular monsters, not bosses, in the spawn list.", "Mostrar monstruos normales, no jefes, en la lista de invocación.");
		Add("Чемпионы", "Champions", "Campeones", "Показать в списке спавна боссов.", "Show bosses in the spawn list.", "Mostrar jefes en la lista de invocación.");
		Add("Без интеллекта", "No AI", "Sin IA", "Заспавненные стоят на месте, не атакуют и не взрываются сами.", "Spawned monsters stand still, do not attack, and do not detonate on their own.", "Los invocados se quedan quietos, no atacan y no explotan solos.");
		Add("Союзники", "Allies", "Aliados", "Монстры появляются в твоей команде и дерутся за тебя.", "Monsters spawn on your team and fight for you.", "Los monstruos aparecen en tu equipo y pelean por ti.");
		Add("Без лута", "No loot", "Sin botín", "С них не падает золото, опыт и боссовый предмет.", "They drop no gold, experience, or boss item.", "No sueltan oro, experiencia ni objeto de jefe.");
		Add("Спавн", "Spawn", "Invocar", "Вкладка спавна: NPC, предметы на землю, снаряжение и объекты карты. Настройки интеллекта, команды и лута сверху.", "Spawn tab: NPCs, ground items, equipment, and map objects. AI, team, and loot settings are at the top.", "Pestaña de invocación: PNJ, objetos en el suelo, equipo y cosas del mapa. Arriba están la IA, el equipo y el botín.");
		Add("НПС", "NPCs", "PNJ", "Список всех, кого можно вызвать: рядовые, боссы, дроны и выжившие.", "Everyone you can summon: grunts, bosses, drones, and survivors.", "Todos los que se pueden invocar: comunes, jefes, drones y supervivientes.");
		Add("На 4", "Set 4", "A 4", "Вернуть обычное лобби на 4 человека.", "Back to a normal 4-player lobby.", "Volver a una sala normal de 4.");
		Add("На 8", "Set 8", "A 8", "Лобби на 8 человек. Запиши, потом создавай сервер.", "8-player lobby. Apply it, then create the server.", "Sala de 8. Guárdala y luego crea el servidor.");
		Add("На 16", "Set 16", "A 16", "Лобби на 16 человек, потолок самой игры.", "16-player lobby, the game's own ceiling.", "Sala de 16, el tope de la propia partida.");
		Add("Клавиша", "Key", "Tecla", "Ждёт новую комбинацию. Можно с Ctrl, Shift или Alt. Escape отменяет.", "Waits for a new shortcut. Ctrl, Shift, or Alt work. Escape cancels.", "Espera una combinación nueva. Valen Ctrl, Shift o Alt. Escape cancela.");
		Add("Сброс", "Clear", "Borrar", "Снимает эту клавишу.", "Clears this shortcut.", "Quita esta tecla.");
		Add("Развернуть", "Restore", "Abrir", "Снова открывает панель.", "Opens the panel again.", "Vuelve a abrir el panel.");
		Add("Записать лобби", "Apply lobby", "Guardar sala", "Пишет число в размер лобби, слоты сервера и точки появления. Делай это в главном меню до создания сервера.", "Writes the number into the lobby size, server slots, and spawn points. Do this in the main menu before creating the server.", "Escribe el número en el tamaño de la sala, los huecos del servidor y los puntos de aparición. Hazlo en el menú principal antes de crear el servidor.");
		Add("Убрать вызванное", "Clear spawned", "Quitar invocado", "Удаляет NPC, лут и объекты, которые появились из этой вкладки.", "Removes the NPCs, loot, and objects this tab spawned.", "Quita los PNJ, el botín y los objetos que invocó esta pestaña.");
		Add("Перед собой", "In front", "Delante", "Ставит вызванное перед персонажем.", "Places the spawn in front of you.", "Pone lo invocado delante del personaje.");
		Add("Под ноги", "At feet", "A los pies", "Ставит вызванное прямо у ног.", "Places the spawn at your feet.", "Pone lo invocado a tus pies.");
		Add("Кольцо", "Ring", "Anillo", "Ставит вызванное кольцом вокруг персонажа.", "Places the spawn in a ring around you.", "Pone lo invocado en un anillo a tu alrededor.");
		Add("Без элиты", "No elite", "Sin élite", "Обычный цвет модели, без элитного скина.", "Normal model color, no elite skin.", "Color normal del modelo, sin skin de élite.");
		Add("Огонь", "Fire", "Fuego", "Только огненный цвет элиты, без бонуса.", "Blazing elite color only, no bonus.", "Solo el color de élite de fuego, sin bonus.");
		Add("Молния", "Lightning", "Rayo", "Только синий цвет элиты, без бонуса.", "Overloading elite color only, no bonus.", "Solo el color de élite de rayo, sin bonus.");
		Add("Объекты", "Objects", "Cosas", "Сундуки, бочки, святилища и прочие объекты карты.", "Chests, barrels, shrines, and other map objects.", "Cofres, barriles, santuarios y demás objetos del mapa.");
		Add("Спавн", "Spawn", "Invocar", "Создаёт выбранного монстра перед тобой, столько раз, сколько стоит в количестве.", "Creates that monster in front of you, as many times as the count says.", "Crea ese monstruo delante de ti, tantas veces como diga la cantidad.");
		Add("Армия", "Army", "Ejército", "Призывает толпу союзников через игровой призыв армии.", "Summons a crowd of allies through the in-game army call.", "Invoca una muchedumbre de aliados con la llamada de ejército del juego.");
		Hard("Godmode", "Бессмертие выбранных. Выключи — и урон снова проходит, ждать смену этапа не нужно.", "Selected players cannot die. Turn it off and damage works again, without waiting for a stage change.", "Los seleccionados no pueden morir. Al apagarlo, el daño vuelve a funcionar, sin esperar un cambio de etapa.");
		Hard("Noclip", "Полёт сквозь стены: WASD, Space вверх, Q вниз, Shift быстрее.", "Fly through walls: WASD, Space up, Q down, Shift faster.", "Vuela a través de las paredes: WASD, Space arriba, Q abajo, Shift más rápido.");
		Hard("Gold", "После «Применить порталы» на телепорте будет портал в золотой берег.", "After Apply portals, the teleporter gets a gold coast portal.", "Después de Aplicar portales, el teletransportador tendrá un portal a la costa de oro.");
		Hard("Bazaar", "После «Применить порталы» будет портал в базар.", "After Apply portals, the teleporter gets a bazaar portal.", "Después de Aplicar portales, habrá un portal al bazar.");
		Hard("Celestial", "После «Применить порталы» будет портал на небесный остров.", "After Apply portals, the teleporter gets a celestial portal.", "Después de Aplicar portales, habrá un portal celestial.");
		Hard("Hidden Realm", "После «Применить порталы» будет портал в скрытое царство.", "After Apply portals, the teleporter gets a hidden realm portal.", "Después de Aplicar portales, habrá un portal al reino oculto.");
		Hard("Scan area", "Ищет интерактивные объекты рядом и пишет, что нашёл.", "Looks for nearby interactables and reports what it found.", "Busca objetos interactivos cerca y dice qué encontró.");
		Hard("Gummy Clone", "Призывает клонов-мармеладок, как снаряжение клона.", "Summons gummy clones, the same way the clone equipment does.", "Invoca clones de gominola, igual que el equipo del clon.");
		Hard("Drone Backup", "Призывает дронов, как снаряжение запаса дронов.", "Summons drones, the same way the drone backup equipment does.", "Invoca drones, igual que el equipo de reserva de drones.");
		Add("Выгнать", "Boot", "Echar", "Выкидывает игрока с сервера. Себя выгнать нельзя.", "Removes the player from the server. You cannot boot yourself.", "Echa al jugador del servidor. No puedes echarte a ti.");
		Add("Бан", "Ban", "Ban", "Банит игрока: зайти снова не сможет, пока не разбанишь.", "Bans the player. They cannot rejoin until you unban them.", "Banea al jugador. No podrá volver hasta que lo desbanees.");
		Add("Разбан", "Unban", "Desbanear", "Снимает бан, игрок снова может зайти.", "Removes the ban so the player can join again.", "Quita el ban para que el jugador pueda entrar otra vez.");
		Add("Мут", "Mute", "Mute", "Глушит или возвращает чат этого игрока.", "Mutes or unmutes this player's chat.", "Silencia o devuelve el chat de este jugador.");
		Add("Заморозка", "Freeze", "Congelar", "Останавливает этого игрока на месте. Это не таймер забега.", "Freezes this player in place. This is not the run timer.", "Deja a este jugador quieto. Esto no es el temporizador de la partida.");
		Add("Сказать", "Say", "Decir", "Пишет текст из поля в общий чат.", "Sends the text from the field to chat.", "Escribe en el chat el texto del campo.");
		Add("Выбранных ко мне", "Selected to me", "Seleccionados a mí", "Телепортирует отмеченных игроков к тебе.", "Teleports the checked players to you.", "Teletransporta a ti a los jugadores marcados.");
		Add("Всех ко мне", "Everyone to me", "Todos a mí", "Телепортирует всех остальных игроков к тебе.", "Teleports every other player to you.", "Teletransporta a ti a todos los demás jugadores.");
		Add("Ко мне", "To me", "A mí", "Телепортирует этого игрока к тебе.", "Teleports this player to you.", "Teletransporta a este jugador hacia ti.");
		Add("К нему", "Go to", "Ir a", "Телепортирует тебя к этому игроку.", "Teleports you to this player.", "Te teletransporta hasta este jugador.");
		Add("Да", "Yes", "Sí", "Подтвердить действие.", "Confirm the action.", "Confirmar la acción.");
		Add("Нет", "No", "No", "Отменить действие.", "Cancel the action.", "Cancelar la acción.");
		Add("Обновить каталоги", "Refresh catalogs", "Actualizar catálogos", "Заново читает предметы, карты и тела из игры.", "Rereads items, stages, and bodies from the game.", "Vuelve a leer objetos, etapas y cuerpos del juego.");
		Hard("Русский", "Переключить панель на русский.", "Switch the panel to Russian.", "Cambiar el panel al ruso.");
		Hard("English", "Переключить панель на английский.", "Switch the panel to English.", "Cambiar el panel al inglés.");
		Hard("Español", "Переключить панель на испанский.", "Switch the panel to Spanish.", "Cambiar el panel al español.");
		Add("Ночь", "Night", "Noche", "Тёмная тема панели.", "Dark panel theme.", "Tema oscuro del panel.");
		Add("Коммандо", "Commando", "Commando", "Оранжевая тема панели, цвет Коммандо.", "Orange panel theme, Commando's color.", "Tema naranja del panel, el color de Commando.");
		Add("Охотница", "Huntress", "Huntress", "Красная тема панели, цвет Охотницы.", "Red panel theme, Huntress's color.", "Tema rojo del panel, el color de Huntress.");
		Add("Изобретательница", "Artificer", "Artificer", "Синяя тема панели, цвет Изобретательницы.", "Blue panel theme, Artificer's color.", "Tema azul del panel, el color de Artificer.");
		Add("Акрид", "Acrid", "Acrid", "Зелёная тема панели, цвет Акрида.", "Green panel theme, Acrid's color.", "Tema verde del panel, el color de Acrid.");
		Hard("REX", "Бирюзовая тема панели, цвет REX.", "Teal panel theme, REX's color.", "Tema turquesa del panel, el color de REX.");
		Add("Рейлганнер", "Railgunner", "Railgunner", "Фиолетовая тема панели, цвет Рейлганнера.", "Purple panel theme, Railgunner's color.", "Tema morado del panel, el color de Railgunner.");
		Add("Погрузчик", "Loader", "Loader", "Золотая тема панели, цвет Погрузчика.", "Gold panel theme, Loader's color.", "Tema dorado del panel, el color de Loader.");
		Add("Бандит", "Bandit", "Bandit", "Розовая тема панели, цвет Бандита.", "Pink panel theme, Bandit's color.", "Tema rosa del panel, el color de Bandit.");
		Add("God", "God", "God", "Бессмертие этого игрока. Выключи — и урон снова проходит.", "This player cannot die. Turn it off and damage works again.", "Este jugador no puede morir. Al apagarlo, el daño vuelve a funcionar.");
		Add("Инвентарь", "Inventory", "Inventario", "Предметы выбранного игрока: снять, задать стак, скопировать или обменять.", "The selected player's items: remove, set the stack, copy, or swap.", "Objetos del jugador elegido: quitar, fijar la pila, copiar o cambiar.");
		Add("Предмет −", "Item −", "Objeto −", "Предыдущий предмет в инвентаре выбранного.", "Previous item in the selected inventory.", "Objeto anterior del inventario elegido.");
		Add("Предмет +", "Item +", "Objeto +", "Следующий предмет в инвентаре выбранного.", "Next item in the selected inventory.", "Siguiente objeto del inventario elegido.");
		Add("Снять 1", "Remove 1", "Quitar 1", "Убирает одну штуку текущего предмета.", "Removes one of the current item.", "Quita una unidad del objeto actual.");
		Add("Задать стак", "Set stack", "Fijar pila", "Ставит количество текущего предмета из поля слева.", "Sets the current item's count from the field on the left.", "Pone la cantidad del objeto actual según el campo de la izquierda.");
		Add("Копировать", "Copy", "Copiar", "Копирует предметы первого выбранного остальным выбранным.", "Copies the first selected player's items to the other selected players.", "Copia los objetos del primero a los demás seleccionados.");
		Add("Обменять", "Swap", "Cambiar", "Меняет инвентари двух первых выбранных.", "Swaps the inventories of the first two selected players.", "Intercambia los inventarios de los dos primeros elegidos.");
		Add("Враги", "Enemies", "Enemigos", "Куда смотрят враги, их команда и призыв боссов.", "Where enemies look, their team, and boss summons.", "Adónde miran los enemigos, su equipo y la invocación de jefes.");
		Add("Целиться в выбранного", "Aim at selected", "Apuntar al elegido", "Живые враги выбирают целью выбранного игрока.", "Living enemies target the selected player.", "Los enemigos vivos apuntan al jugador elegido.");
		Add("Без цели", "No target", "Sin objetivo", "Выключает интеллект живым врагам, пока кнопка включена.", "Turns off living enemies' AI while this stays on.", "Apaga la IA de los enemigos vivos mientras siga activo.");
		Add("Команда игрока", "Player team", "Equipo jugador", "Переводит живых врагов в команду игроков.", "Moves living enemies onto the player team.", "Pasa a los enemigos vivos al equipo de los jugadores.");
		Add("Команда монстров", "Monster team", "Equipo monstruo", "Возвращает их в команду монстров.", "Sends them back to the monster team.", "Los devuelve al equipo de los monstruos.");
		Add("Дождь боссов", "Boss rain", "Lluvia de jefes", "Призывает несколько боссов рядом с тобой.", "Summons several bosses near you.", "Invoca varios jefes cerca de ti.");
		Add("Воскресить", "Revive", "Revivir", "Поднимает этого игрока, если он умер в текущем забеге.", "Brings this player back if they died during the current run.", "Levanta a este jugador si murió en la partida actual.");
		Add("Воскресить мёртвых", "Revive the dead", "Revivir a los muertos", "Поднимает всех игроков, которые уже умерли в этом забеге.", "Brings back every player who has already died this run.", "Levanta a todos los jugadores que ya murieron en esta partida.");
		Add("Диско-панель", "Disco panel", "Panel disco", "Панель переливается цветом. На игру не влияет.", "The panel cycles colors. It does not affect the game.", "El panel cambia de color. No afecta a la partida.");
		Add("Восстановить камеру", "Reset camera", "Restaurar cámara", "Возвращает поле зрения и дистанцию камеры к обычным.", "Returns the field of view and camera distance to normal.", "Devuelve el campo de visión y la distancia de la cámara a lo normal.");
		Add("Кроха", "Tiny", "Mini", "Маленький масштаб модели и камера чуть дальше.", "A small model scale, and the camera moves out a little.", "Escala pequeña del modelo, y la cámara se aleja un poco.");
		Add("Норма", "Normal", "Normal", "Обычный размер модели и обычная камера.", "Normal model size and the normal camera.", "Tamaño normal del modelo y cámara normal.");
		Add("Гигант", "Giant", "Gigante", "Крупная модель. Камера отъезжает, чтобы персонаж влез в кадр.", "A large model. The camera backs up so the character fits.", "Modelo grande. La cámara retrocede para que el personaje quepa.");
		Add("Титан", "Titan", "Titán", "Очень крупная модель и далёкая камера.", "A very large model and a far camera.", "Modelo enorme y cámara lejana.");
		Add("Большое тело", "Large body", "Cuerpo grande", "Меняет выбранных на крупное тело из каталога. Это видят все.", "Turns the selected players into a large catalog body. Everyone sees it.", "Convierte a los elegidos en un cuerpo grande del catálogo. Todos lo ven.");
		Add("Маленькое тело", "Small body", "Cuerpo pequeño", "Меняет выбранных на маленькое тело из каталога. Это видят все.", "Turns the selected players into a small catalog body. Everyone sees it.", "Convierte a los elegidos en un cuerpo pequeño del catálogo. Todos lo ven.");
		Add("Вернуть выжившего", "Restore survivor", "Volver al superviviente", "Возвращает выбранным их исходного выжившего.", "Returns the selected players to their original survivor.", "Devuelve a los elegidos su superviviente original.");
		Add("Выдать золото", "Give gold", "Dar oro", "Добавляет золото из поля выбранным и в общую казну команды.", "Adds the gold from the field to the selected players and the team purse.", "Suma el oro del campo a los elegidos y a la bolsa del equipo.");
	}

	private static string Lang()
	{
		object obj = Type.GetType("RoRCheatPanel.Loc, RoRCheatPanel")?.GetField("Current", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null);
		if (obj == null)
		{
			return "Ru";
		}
		return obj.ToString();
	}

	private static string Tr(string ru, string en, string es)
	{
		string text = Lang();
		if (!(text == "En"))
		{
			if (text == "Es")
			{
				return es;
			}
			return ru;
		}
		return en;
	}
}
internal static class CameraFraming
{
	public const float MinDistance = 0f;

	public const float MaxDistance = 30f;

	public static float DistanceForBody(float scale)
	{
		if (float.IsNaN(scale))
		{
			scale = 1f;
		}
		if (scale < 0.2f)
		{
			scale = 0.2f;
		}
		if (scale > 8f)
		{
			scale = 8f;
		}
		if (scale >= 0.92f && scale <= 1.05f)
		{
			return 0f;
		}
		if (scale < 0.92f)
		{
			return Clamp(1.4f + (1f - scale) * 1.6f, 1.4f, 4f);
		}
		return Clamp((scale - 1f) * 3.4f, 0f, 30f);
	}

	public static float ClampDistance(float distance)
	{
		if (float.IsNaN(distance))
		{
			return 0f;
		}
		return Clamp(distance, 0f, 30f);
	}

	private static float Clamp(float value, float min, float max)
	{
		if (value < min)
		{
			return min;
		}
		if (value > max)
		{
			return max;
		}
		return value;
	}
}
[BepInPlugin("com.rorcheatpanel.channel", "RoR Cheat Panel Channel", "1.0.56")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public sealed class ChannelPlugin : BaseUnityPlugin
{
	public const string PluginGuid = "com.rorcheatpanel.channel";

	public const string PluginName = "RoR Cheat Panel Channel";

	public const string PluginVersion = "1.0.56";

	public const string YoutubeUrl = "https://www.youtube.com/@Silans";

	public const string SiteUrl = "https://ror-cheat-panel.netlify.app";

	public const string ShownVersion = "1.1";

	private const int FlattenFrames = 24;

	private static readonly Type CheatRuntimeType = Type.GetType("RoRCheatPanel.CheatRuntime, RoRCheatPanel");

	private static readonly FieldInfo DrunkField = ((CheatRuntimeType != null) ? CheatRuntimeType.GetField("DrunkCamera", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);

	private static readonly FieldInfo ThirdPersonField = ((CheatRuntimeType != null) ? CheatRuntimeType.GetField("ThirdPerson", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);

	private static readonly FieldInfo FovField = ((CheatRuntimeType != null) ? CheatRuntimeType.GetField("Fov", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);

	private static readonly FieldInfo GodModeField = ((CheatRuntimeType != null) ? CheatRuntimeType.GetField("GodMode", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);

	private static readonly FieldInfo FreezeField = ((CheatRuntimeType != null) ? CheatRuntimeType.GetField("FreezeStopwatch", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);

	private static readonly FieldInfo TimeScaleField = ((CheatRuntimeType != null) ? CheatRuntimeType.GetField("TimeScale", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);

	private static readonly FieldInfo BodyScaleField = ((CheatRuntimeType != null) ? CheatRuntimeType.GetField("BodyScale", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);

	private static readonly FieldInfo DistanceField = ((CheatRuntimeType != null) ? CheatRuntimeType.GetField("ThirdPersonDistance", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);

	private static readonly FieldInfo DesiredStateField = AccessTools.Field(typeof(CameraRigController), "desiredCameraState");

	private static readonly FieldInfo LerpStateField = AccessTools.Field(typeof(CameraRigController), "lerpCameraState");

	private static readonly FieldInfo LerpTimeField = AccessTools.Field(typeof(CameraRigController), "lerpCameraTime");

	private static Texture2D _tex;

	private static Texture2D _siteTex;

	private static Texture2D _pixel;

	private static Font _toastFont;

	private static Font _kissFont;

	private static bool _tried;

	private static bool _siteTried;

	private static int _flattenFrames;

	private static bool _wasDrunk;

	private static bool _applying;

	private static bool _lookHeld;

	private static Quaternion _heldRot = Quaternion.identity;

	private static bool _mouseOff;

	private static bool _mouseWasOn = true;

	private static FieldInfo _toastField;

	private static FieldInfo _toastUntilField;

	private static Type _themeType;

	private static readonly List<HealthComponent> GodApplied = new List<HealthComponent>();

	private static bool _godWasOn;

	private static float _lastDistance = 8f;

	private static bool _distanceInit;

	private static bool _tpWasOn;

	private static bool _haveFpRot;

	private static Quaternion _fpRot = Quaternion.identity;

	private static int _seatFrames;

	private static float _savedLook = -1f;

	internal static bool DistanceDriven;

	internal static bool FirstPerson;

	private static bool _stockDistanceCleared;

	private static ConfigEntry<float> PanelOpacity;

	private static ConfigFile _ownConfig;

	private static Texture2D _solid;

	private void Awake()
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Expected O, but got Unknown
		_ownConfig = ((BaseUnityPlugin)this).Config;
		Harmony harmony = new Harmony("com.rorcheatpanel.channel");
		Safe("opacity", BindPanelOpacity);
		Safe("spawn", delegate
		{
			MonsterSpawn.Install(harmony);
		});
		Safe("about", delegate
		{
			PatchAboutTab(harmony);
		});
		Safe("extras", delegate
		{
			FunExtras.Install(harmony);
		});
		Safe("survivors", delegate
		{
			SurvivorGrid.Install(harmony);
		});
		Safe("tips", delegate
		{
			ButtonTips.Install(harmony);
		});
		Safe("lobby", delegate
		{
			LobbySize.Install(harmony);
		});
		Safe("chrome", delegate
		{
			PanelChrome.Install(harmony);
		});
		Safe("menu", delegate
		{
			MenuTidy.Install(harmony);
		});
		Safe("fixes", delegate
		{
			PanelFixes.Install(harmony);
		});
		Safe("noclip", delegate
		{
			RemoteNoclip.Install(harmony);
		});
		Safe("cloak", delegate
		{
			EnemyCloak.Install(harmony, ((BaseUnityPlugin)this).Config);
		});
		Safe("lists", delegate
		{
			ListFavorites.Install(harmony);
		});
		Safe("artifacts", delegate
		{
			IconWarmup.Install(harmony);
		});
		Safe("host", delegate
		{
			HostVanilla.Install(harmony);
		});
		Safe("drunk", delegate
		{
			PatchDrunkRemoval(harmony);
		});
		Safe("fun", delegate
		{
			PatchFunTab(harmony);
		});
		Safe("window", delegate
		{
			PatchWindowAlpha(harmony);
		});
		Safe("toast", delegate
		{
			PatchToast(harmony);
		});
		Safe("god", delegate
		{
			PatchGodMode(harmony);
		});
		Safe("tick", delegate
		{
			Patch(harmony, "RoRCheatPanel.CheatRuntime", "Tick", "AfterRuntimeTick");
		});
		Safe("camera pin", delegate
		{
			PatchPrefix(harmony, "RoRCheatPanel.CheatRuntime", "ClearCameraOverlay", "SkipDrunkPositionPin");
		});
		Safe("camera restore", delegate
		{
			Patch(harmony, "RoRCheatPanel.CheatRuntime", "RestoreCamera", "AfterRestoreCamera");
		});
		Safe("late tick", delegate
		{
			Patch(harmony, "RoRCheatPanel.CheatRuntime", "LateTick", "AfterLateTick");
		});
		Safe("camera late", delegate
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			MethodInfo methodInfo = AccessTools.Method(typeof(CameraRigController), "LateUpdate", (Type[])null, (Type[])null);
			if (methodInfo != null)
			{
				harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(typeof(ChannelPlugin), "AfterRigLateUpdate", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
		});
		Safe("camera state", delegate
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			MethodInfo methodInfo = AccessTools.Method(typeof(CameraRigController), "SetCameraState", (Type[])null, (Type[])null);
			if (methodInfo != null)
			{
				harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(typeof(ChannelPlugin), "AfterSetCameraState", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
		});
		Safe("look", delegate
		{
			PatchLook(harmony);
		});
		Safe("camera early", delegate
		{
			//IL_0037: 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_0059: Expected O, but got Unknown
			//IL_0059: Expected O, but got Unknown
			MethodInfo methodInfo = AccessTools.Method(typeof(CameraRigController), "EarlyUpdate", (Type[])null, (Type[])null);
			if (methodInfo != null)
			{
				harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(ChannelPlugin), "BeforeCameraDistance", (Type[])null), new HarmonyMethod(typeof(ChannelPlugin), "AfterRigLateUpdate", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
		});
		((BaseUnityPlugin)this).Logger.LogInfo((object)"RoR Cheat Panel Channel 1.0.56 loaded.");
	}

	private static void PatchGodMode(Harmony harmony)
	{
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Expected O, but got Unknown
		MethodInfo methodInfo = ((CheatRuntimeType != null) ? CheatRuntimeType.GetMethod("ApplyGodMode", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);
		if (methodInfo == null)
		{
			Debug.LogWarning((object)"[RoRCheatPanel.Channel] missing CheatRuntime.ApplyGodMode");
		}
		else
		{
			harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(ChannelPlugin), "ApplyGodModePrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}

	private static bool ApplyGodModePrefix()
	{
		if (ReadBool(GodModeField))
		{
			_godWasOn = true;
			CharacterBody val = LocalBody();
			HealthComponent val2 = (((Object)(object)val != (Object)null) ? val.healthComponent : null);
			if ((Object)(object)val2 != (Object)null)
			{
				val2.godMode = true;
				if (!GodApplied.Contains(val2))
				{
					GodApplied.Add(val2);
				}
			}
			return false;
		}
		if (_godWasOn || GodApplied.Count > 0)
		{
			ClearAppliedGodMode();
		}
		return false;
	}

	private static void ClearAppliedGodMode()
	{
		for (int i = 0; i < GodApplied.Count; i++)
		{
			HealthComponent val = GodApplied[i];
			if ((Object)(object)val != (Object)null)
			{
				val.godMode = false;
			}
		}
		GodApplied.Clear();
		_godWasOn = false;
	}

	private static CharacterBody LocalBody()
	{
		LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
		if (firstLocalUser == null)
		{
			return null;
		}
		if ((Object)(object)firstLocalUser.cachedBody != (Object)null)
		{
			return firstLocalUser.cachedBody;
		}
		NetworkUser currentNetworkUser = firstLocalUser.currentNetworkUser;
		if (!((Object)(object)currentNetworkUser != (Object)null))
		{
			return null;
		}
		return currentNetworkUser.GetCurrentBody();
	}

	private static void PatchToast(Harmony harmony)
	{
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Expected O, but got Unknown
		Type type = Type.GetType("RoRCheatPanel.UI.UiHelpers, RoRCheatPanel");
		MethodInfo methodInfo = ((type != null) ? type.GetMethod("DrawToast", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);
		if (methodInfo == null)
		{
			Debug.LogWarning((object)"[RoRCheatPanel.Channel] missing UiHelpers.DrawToast");
			return;
		}
		_toastField = type.GetField("_toast", BindingFlags.Static | BindingFlags.NonPublic);
		_toastUntilField = type.GetField("_toastUntil", BindingFlags.Static | BindingFlags.NonPublic);
		_themeType = Type.GetType("RoRCheatPanel.UiTheme, RoRCheatPanel");
		harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(ChannelPlugin), "DrawThemedToastPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
	}

	private static bool DrawThemedToastPrefix()
	{
		DrawThemedToast();
		return false;
	}

	private static void DrawThemedToast()
	{
		//IL_0105: 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_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: 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_0158: 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_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		//IL_018e: Expected O, but got Unknown
		//IL_019a: 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_01c6: 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_01e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fb: Expected O, but got Unknown
		//IL_0219: Unknown result type (might be due to invalid IL or missing references)
		//IL_0226: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Expected O, but got Unknown
		//IL_022b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_023f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Expected O, but got Unknown
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_0250: Unknown result type (might be due to invalid IL or missing references)
		//IL_0252: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: Unknown result type (might be due to invalid IL or missing references)
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		//IL_0299: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_02eb: 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_0315: Unknown result type (might be due to invalid IL or missing references)
		//IL_031c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0323: Unknown result type (might be due to invalid IL or missing references)
		//IL_0332: Unknown result type (might be due to invalid IL or missing references)
		//IL_035c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0368: 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_0383: Unknown result type (might be due to invalid IL or missing references)
		//IL_0395: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0400: Unknown result type (might be due to invalid IL or missing references)
		//IL_040c: Unknown result type (might be due to invalid IL or missing references)
		//IL_043c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0443: Unknown result type (might be due to invalid IL or missing references)
		string text = ((_toastField != null) ? (_toastField.GetValue(null) as string) : null);
		float num = ((_toastUntilField != null && _toastUntilField.GetValue(null) is float num2) ? num2 : 0f);
		if (!string.IsNullOrEmpty(text) && !(Time.realtimeSinceStartup > num))
		{
			if ((Object)(object)_toastFont == (Object)null)
			{
				_toastFont = Font.CreateDynamicFontFromOSFont(new string[3] { "Segoe UI", "Arial", "Tahoma" }, 15);
			}
			SplitToast(text, out var title, out var subtitle);
			float num3 = num - Time.realtimeSinceStartup;
			float num4 = 1f;
			if (num3 < 0.4f)
			{
				num4 = Mathf.Clamp01(num3 / 0.4f);
			}
			else if (num3 > 2.9f)
			{
				num4 = Mathf.Clamp01((3.2f - num3) / 0.25f);
			}
			Color val = ThemeColor("Accent", new Color(0.38f, 0.58f, 0.88f));
			Color color = ThemeColor("Window", new Color(0.12f, 0.14f, 0.2f, 0.97f));
			color.a = 0.92f * num4;
			val.a = num4;
			GUIStyle val2 = new GUIStyle(GUI.skin.label)
			{
				alignment = (TextAnchor)4,
				fontStyle = (FontStyle)1,
				fontSize = 16,
				wordWrap = false,
				clipping = (TextClipping)0,
				font = _toastFont
			};
			val2.normal.textColor = new Color(Mathf.Lerp(1f, val.r, 0.35f), Mathf.Lerp(1f, val.g, 0.35f), Mathf.Lerp(1f, val.b, 0.35f), num4);
			GUIStyle val3 = new GUIStyle(val2)
			{
				fontStyle = (FontStyle)0,
				fontSize = 13
			};
			val3.normal.textColor = new Color(0.92f, 0.93f, 0.96f, 0.88f * num4);
			Vector2 val4 = val2.CalcSize(new GUIContent(title));
			Vector2 val5 = (string.IsNullOrEmpty(subtitle) ? Vector2.zero : val3.CalcSize(new GUIContent(subtitle)));
			float num5 = Mathf.Clamp(Mathf.Max(val4.x, val5.x) + 44f, 260f, (float)Screen.width - 48f);
			float num6 = 18f + val4.y + (string.IsNullOrEmpty(subtitle) ? 0f : (val5.y + 2f));
			float num7 = ((float)Screen.width - num5) * 0.5f;
			float num8 = 14f;
			Texture2D val6 = Pixel();
			Color color2 = GUI.color;
			GUI.color = new Color(0f, 0f, 0f, 0.35f * num4);
			GUI.DrawTexture(new Rect(num7 + 3f, num8 + 4f, num5, num6), (Texture)(object)val6);
			GUI.color = new Color(val.r, val.g, val.b, 0.95f * num4);
			GUI.DrawTexture(new Rect(num7 - 2f, num8 - 2f, num5 + 4f, num6 + 4f), (Texture)(object)val6);
			GUI.color = color;
			GUI.DrawTexture(new Rect(num7, num8, num5, num6), (Texture)(object)val6);
			GUI.color = val;
			GUI.DrawTexture(new Rect(num7, num8, 4f, num6), (Texture)(object)val6);
			GUI.DrawTexture(new Rect(num7 + num5 - 4f, num8, 4f, num6), (Texture)(object)val6);
			GUI.DrawTexture(new Rect(num7, num8 + num6 - 3f, num5, 3f), (Texture)(object)val6);
			GUI.color = color2;
			Rect val7 = default(Rect);
			((Rect)(ref val7))..ctor(num7 + 14f, num8 + 8f, num5 - 28f, val4.y);
			GUI.Label(val7, title, val2);
			if (!string.IsNullOrEmpty(subtitle))
			{
				GUI.Label(new Rect(num7 + 14f, ((Rect)(ref val7)).yMax + 1f, num5 - 28f, val5.y), subtitle, val3);
			}
		}
	}

	private static void SplitToast(string text, out string title, out string subtitle)
	{
		int num = text.IndexOf(" — ", StringComparison.Ordinal);
		if (num < 0)
		{
			num = text.IndexOf(" - ", StringComparison.Ordinal);
		}
		if (num > 0)
		{
			title = text.Substring(0, num).Trim();
			subtitle = text.Substring(num + 3).Trim();
		}
		else
		{
			title = text;
			subtitle = null;
		}
	}

	private static Color ThemeColor(string name, Color fallback)
	{
		//IL_0040: 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_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		PropertyInfo propertyInfo = ((_themeType != null) ? _themeType.GetProperty(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);
		if (propertyInfo != null)
		{
			object value = propertyInfo.GetValue(null);
			if (value is Color)
			{
				return (Color)value;
			}
		}
		return fallback;
	}

	private static Texture2D Pixel()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected O, but got Unknown
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)_pixel != (Object)null)
		{
			return _pixel;
		}
		_pixel = new Texture2D(1, 1, (TextureFormat)4, false);
		((Texture)_pixel).wrapMode = (TextureWrapMode)1;
		_pixel.SetPixel(0, 0, Color.white);
		_pixel.Apply();
		return _pixel;
	}

	private static void PatchAboutTab(Harmony harmony)
	{
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Expected O, but got Unknown
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Expected O, but got Unknown
		Type type = Type.GetType("RoRCheatPanel.UI.Tabs.AboutTab, RoRCheatPanel");
		if (type == null)
		{
			Debug.LogWarning((object)"[RoRCheatPanel.Channel] missing AboutTab");
			return;
		}
		MethodInfo method = type.GetMethod("Draw", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
		if (method != null)
		{
			harmony.Patch((MethodBase)method, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(typeof(ChannelPlugin), "DrawTranspiler", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null);
		}
		MethodInfo method2 = type.GetMethod("DrawChannelLink", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
		if (method2 != null)
		{
			harmony.Patch((MethodBase)method2, new HarmonyMethod(typeof(ChannelPlugin), "SkipExistingChannel", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}

	private static void BindPanelOpacity()
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		PanelOpacity = ConfigFileForPanel().Bind<float>("UI", "PanelOpacity", 1f, new ConfigDescription("Panel opacity. 1 = solid, 0.25 = more transparent.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 1f), Array.Empty<object>()));
	}

	private static ConfigFile ConfigFileForPanel()
	{
		Type type = Type.GetType("RoRCheatPanel.Plugin, RoRCheatPanel");
		object? obj = ((!(type != null)) ? null : type.GetProperty("Instance", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null));
		BaseUnityPlugin val = (BaseUnityPlugin)((obj is BaseUnityPlugin) ? obj : null);
		if (val != null)
		{
			return val.Config;
		}
		return _ownConfig;
	}

	private static void PatchFunTab(Harmony harmony)
	{
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Expected O, but got Unknown
		Type type = Type.GetType("RoRCheatPanel.UI.Tabs.FunTab, RoRCheatPanel");
		MethodInfo methodInfo = ((type != null) ? type.GetMethod("Draw", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);
		if (methodInfo == null)
		{
			Debug.LogWarning((object)"[RoRCheatPanel.Channel] missing FunTab.Draw");
		}
		else
		{
			harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(typeof(ChannelPlugin), "FunTabTranspiler", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}

	private static IEnumerable<CodeInstruction> FunTabTranspiler(IEnumerable<CodeInstruction> instructions)
	{
		MethodInfo endHorizontal = AccessTools.Method(typeof(GUILayout), "EndHorizontal", Type.EmptyTypes, (Type[])null);
		MethodInfo reset = AccessTools.Method(typeof(ChannelPlugin), "DrawDistanceReset", (Type[])null, (Type[])null);
		bool afterDistance = false;
		foreach (CodeInstruction ins in instructions)
		{
			if (ins.opcode == OpCodes.Ldstr && ins.operand as string == "fun_tpv_dist")
			{
				afterDistance = true;
			}
			if (afterDistance && endHorizontal != null && CodeInstructionExtensions.Calls(ins, endHorizontal))
			{
				yield return new CodeInstruction(OpCodes.Call, (object)reset);
				afterDistance = false;
			}
			yield return ins;
		}
	}

	private static void DrawDistanceReset()
	{
		if (GUILayout.Button("0", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) }))
		{
			AcceptDistance(0f);
		}
	}

	private static void PatchWindowAlpha(Harmony harmony)
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Expected O, but got Unknown
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Expected O, but got Unknown
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Expected O, but got Unknown
		Type type = Type.GetType("RoRCheatPanel.UI.CheatWindow, RoRCheatPanel");
		MethodInfo methodInfo = ((type != null) ? type.GetMethod("OnGUI", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);
		if (methodInfo == null)
		{
			Debug.LogWarning((object)"[RoRCheatPanel.Channel] missing CheatWindow.OnGUI");
			return;
		}
		HarmonyMethod val = new HarmonyMethod(typeof(ChannelPlugin), "OnGuiTranspiler", (Type[])null);
		harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(typeof(ChannelPlugin), "AfterPanelGui", (Type[])null), val, (HarmonyMethod)null, (HarmonyMethod)null);
		MethodInfo method = type.GetMethod("Draw", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
		if (method != null)
		{
			harmony.Patch((MethodBase)method, new HarmonyMethod(typeof(ChannelPlugin), "PaintWindowBackdrop", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}

	private static IEnumerable<CodeInstruction> OnGuiTranspiler(IEnumerable<CodeInstruction> instructions)
	{
		MethodInfo setter = AccessTools.PropertySetter(typeof(GUI), "backgroundColor");
		MethodInfo apply = AccessTools.Method(typeof(ChannelPlugin), "ApplyPanelAlpha", (Type[])null, (Type[])null);
		bool patched = false;
		foreach (CodeInstruction ins in instructions)
		{
			if (ins.opcode == OpCodes.Ldstr && ins.operand as string == "3.6.3")
			{
				ins.operand = "1.1";
			}
			yield return ins;
			if (!patched && setter != null && CodeInstructionExtensions.Calls(ins, setter))
			{
				yield return new CodeInstruction(OpCodes.Call, (object)apply);
				patched = true;
			}
		}
	}

	private static void ApplyPanelAlpha()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: 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)
		Color backgroundColor = GUI.backgroundColor;
		backgroundColor.a = Mathf.Clamp((PanelOpacity != null) ? PanelOpacity.Value : 1f, 0.25f, 1f);
		GUI.backgroundColor = backgroundColor;
	}

	private static void PaintWindowBackdrop()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Invalid comparison between Unknown and I4
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		if (Event.current != null && (int)Event.current.type == 7 && (Type.GetType("RoRCheatPanel.UI.CheatWindow, RoRCheatPanel")?.GetField("_rect", BindingFlags.Static | BindingFlags.NonPublic))?.GetValue(null) is Rect val && !(((Rect)(ref val)).width < 8f) && !(((Rect)(ref val)).height < 8f))
		{
			Color color = ThemePlate();
			color.a = Mathf.Clamp((PanelOpacity != null) ? PanelOpacity.Value : 1f, 0.25f, 1f);
			Color color2 = GUI.color;
			GUI.color = color;
			GUI.DrawTexture(new Rect(0f, -28f, ((Rect)(ref val)).width, ((Rect)(ref val)).height + 28f), (Texture)(object)SolidPixel(), (ScaleMode)0, true);
			GUI.color = color2;
		}
	}

	private static Color ThemePlate()
	{
		//IL_0058: 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_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: 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)
		object obj = (CheatRuntimeType?.GetField("Disco", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))?.GetValue(null);
		bool flag = default(bool);
		int num;
		if (obj is bool)
		{
			flag = (bool)obj;
			num = 1;
		}
		else
		{
			num = 0;
		}
		if (((uint)num & (flag ? 1u : 0u)) != 0)
		{
			return Color.HSVToRGB(Time.unscaledTime * 0.12f % 1f, 0.55f, 0.55f);
		}
		obj = (Type.GetType("RoRCheatPanel.UiTheme, RoRCheatPanel")?.GetProperty("Window", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))?.GetValue(null, null);
		if (obj is Color)
		{
			return (Color)obj;
		}
		return new Color(0.16f, 0.18f, 0.24f, 1f);
	}

	private static Texture2D SolidPixel()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected O, but got Unknown
		//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)
		if ((Object)(object)_solid != (Object)null)
		{
			return _solid;
		}
		_solid = new Texture2D(4, 4, (TextureFormat)4, false);
		Color[] array = (Color[])(object)new Color[16];
		for (int i = 0; i < array.Length; i++)
		{
			array[i] = Color.white;
		}
		_solid.SetPixels(array);
		_solid.Apply();
		((Object)_solid).hideFlags = (HideFlags)61;
		((Texture)_solid).wrapMode = (TextureWrapMode)1;
		((Texture)_solid).filterMode = (FilterMode)0;
		return _solid;
	}

	private static void AfterPanelGui()
	{
		PanelFixes.DrawFreeTooltip();
	}

	private static bool SkipExistingChannel()
	{
		return false;
	}

	private static IEnumerable<CodeInstruction> DrawTranspiler(IEnumerable<CodeInstruction> instructions)
	{
		MethodInfo endScroll = AccessTools.Method(typeof(GUILayout), "EndScrollView", Type.EmptyTypes, (Type[])null);
		MethodInfo footer = AccessTools.Method(typeof(ChannelPlugin), "DrawSettingsFooter", (Type[])null, (Type[])null);
		foreach (CodeInstruction ins in instructions)
		{
			if (ins.opcode == OpCodes.Ldstr && ins.operand as string == "RoR Cheat Panel  3.6.3")
			{
				ins.operand = "RoR Cheat Panel  1.1";
			}
			if (endScroll != null && CodeInstructionExtensions.Calls(ins, endScroll))
			{
				yield return new CodeInstruction(OpCodes.Call, (object)footer);
			}
			yield return ins;
		}
	}

	private static void DrawSettingsFooter()
	{
		DrawOpacitySlider();
		if (!PanelChrome.HotkeysReplaced)
		{
			PanelChrome.DrawHotkeys();
		}
		DrawLink();
	}

	private static void DrawOpacitySlider()
	{
		float num = ((PanelOpacity != null) ? Mathf.Clamp(PanelOpacity.Value, 0.25f, 1f) : 1f);
		int percent = Mathf.RoundToInt(num * 100f);
		GUILayout.BeginVertical(GUIStyle.op_Implicit("box"), Array.Empty<GUILayoutOption>());
		GUILayout.Label(OpacityTitle(), Array.Empty<GUILayoutOption>());
		GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
		GUILayout.Label(OpacityValue(percent), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(170f) });
		float value = GUILayout.HorizontalSlider(num, 0.25f, 1f, Array.Empty<GUILayoutOption>());
		if (GUILayout.Button("100", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) }))
		{
			value = 1f;
		}
		GUILayout.EndHorizontal();
		GUILayout.EndVertical();
		if (PanelOpacity != null)
		{
			PanelOpacity.Value = value;
		}
	}

	private static string OpacityTitle()
	{
		string text = CurrentLang();
		if (!(text == "En"))
		{
			if (text == "Es")
			{
				return "Transparencia del panel";
			}
			return "Прозрачность панели";
		}
		return "Panel transparency";
	}

	private static string OpacityValue(int percent)
	{
		string text = CurrentLang();
		if (!(text == "En"))
		{
			if (text == "Es")
			{
				return "Visibilidad " + percent + "%";
			}
			return "Вид " + percent + "%";
		}
		return "Visibility " + percent + "%";
	}

	private static string CurrentLang()
	{
		Type type = Type.GetType("RoRCheatPanel.Loc, RoRCheatPanel");
		object obj = ((!(type != null)) ? null : (type.GetProperty("Current", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null) ?? type.GetField("Current", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null)));
		if (obj == null)
		{
			return "Ru";
		}
		return obj.ToString();
	}

	private void LateUpdate()
	{
		FunExtras.LateApply();
		MonsterSpawn.Tick();
	}

	private void Update()
	{
		HoldMouseWhilePanelOpen();
		HoldLookSensitivity();
		if (ReadBool(ThirdPersonField))
		{
			ThirdPersonField.SetValue(null, false);
		}
		TrackThirdPerson();
		TickSeat();
		LobbySize.Tick();
		PanelFixes.TickNames();
		IconWarmup.Tick();
		SyncDistanceToggle();
		if (_flattenFrames > 0)
		{
			FlattenLocal();
			_flattenFrames--;
		}
	}

	private static void Safe(string name, Action action)
	{
		try
		{
			action();
		}
		catch (Exception ex)
		{
			Debug.LogError((object)("[RoRCheatPanel.Channel] " + name + " failed: " + ex));
		}
	}

	private static void PatchLook(Harmony harmony)
	{
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Expected O, but got Unknown
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Expected O, but got Unknown
		Type type = Type.GetType("RoR2.CameraModes.CameraModePlayerBasic, RoR2");
		MethodInfo methodInfo = ((type != null) ? type.GetMethod("ApplyLookInputInternal", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) : null);
		if (methodInfo != null)
		{
			harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(ChannelPlugin), "SkipLookWhilePanelOpen", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
		else
		{
			Debug.LogWarning((object)"[RoRCheatPanel.Channel] missing ApplyLookInputInternal");
		}
		Type type2 = Type.GetType("RoR2.CameraModes.CameraModeBase, RoR2");
		if (type2 == null)
		{
			return;
		}
		MethodInfo[] methods = type2.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		foreach (MethodInfo methodInfo2 in methods)
		{
			if (!(methodInfo2.Name != "ApplyLookInput"))
			{
				harmony.Patch((MethodBase)methodInfo2, new HarmonyMethod(typeof(ChannelPlugin), "SkipLookWhilePanelOpen", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
		}
	}

	private static void PatchPrefix(Harmony harmony, string typeName, string method, string prefix)
	{
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Expected O, but got Unknown
		Type type = Type.GetType(typeName + ", RoRCheatPanel");
		MethodInfo methodInfo = ((type != null) ? type.GetMethod(method, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);
		if (methodInfo == null)
		{
			Debug.LogWarning((object)("[RoRCheatPanel.Channel] missing " + typeName + "." + method));
		}
		else
		{
			harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(ChannelPlugin), prefix, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}

	private static void Patch(Harmony harmony, string typeName, string method, string postfix)
	{
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Expected O, but got Unknown
		Type type = Type.GetType(typeName + ", RoRCheatPanel");
		MethodInfo methodInfo = ((type != null) ? type.GetMethod(method, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) : null);
		if (methodInfo == null)
		{
			Debug.LogWarning((object)("[RoRCheatPanel.Channel] missing " + typeName + "." + method));
		}
		else
		{
			harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(typeof(ChannelPlugin), postfix, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}

	private static bool ReadBool(FieldInfo field)
	{
		bool flag = default(bool);
		int num;
		if (field != null)
		{
			object value = field.GetValue(null);
			if (value is bool)
			{
				flag = (bool)value;
				num = 1;
			}
			else
			{
				num = 0;
			}
		}
		else
		{
			num = 0;
		}
		return (byte)((uint)num & (flag ? 1u : 0u)) != 0;
	}

	private static float ReadFov()
	{
		if (FovField != null && FovField.GetValue(null) is float num)
		{
			return Mathf.Clamp(num, 30f, 140f);
		}
		return 60f;
	}

	private static void BeginFlatten()
	{
		_flattenFrames = 24;
		FlattenLocal();
	}

	private static void AfterRestoreCamera()
	{
		FirstPerson = false;
		DistanceDriven = false;
		_stockDistanceCleared = true;
		AcceptDistance(0f);
		if (FovField != null)
		{
			FovField.SetValue(null, 60f);
		}
		SeatFirstPerson(resetFov: true);
		SnapCameraToBody();
	}

	private static void AfterRuntimeTick()
	{
		RepairTimeScale();
		RepairStopwatch();
		EnemyCloak.Tick();
		HostVanilla.Tick();
	}

	private static void RepairTimeScale()
	{
		float num = ((TimeScaleField != null && TimeScaleField.GetValue(null) is float num2) ? num2 : 1f);
		if (float.IsNaN(num) || num <= 0f)
		{
			num = 1f;
			TimeScaleField?.SetValue(null, num);
		}
		num = Mathf.Clamp(num, 0.1f, 3f);
		if (float.IsNaN(Time.timeScale) || Time.timeScale <= 0f)
		{
			Time.timeScale = num;
			Time.fixedDeltaTime = 0.02f * num;
		}
	}

	private static void RepairStopwatch()
	{
		if (NetworkServer.active && !((Object)(object)Run.instance == (Object)null))
		{
			bool flag = ReadBool(FreezeField);
			if (flag || !PauseWhileOpen() || !WindowOpened())
			{
				Run.instance.SetForcePauseRunStopwatch(flag);
			}
		}
	}

	private static bool PauseWhileOpen()
	{
		Type type = Type.GetType("RoRCheatPanel.CheatConfig, RoRCheatPanel");
		object obj = ((!(type != null)) ? null : type.GetField("PauseStopwatchOnOpen", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null));
		object obj2 = obj?.GetType().GetProperty("Value")?.GetValue(obj);
		bool flag = default(bool);
		int num;
		if (obj2 is bool)
		{
			flag = (bool)obj2;
			num = 1;
		}
		else
		{
			num = 0;
		}
		return (byte)((uint)num & (flag ? 1u : 0u)) != 0;
	}

	private static void HoldMouseWhilePanelOpen()
	{
		LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
		Mouse val = ((firstLocalUser != null && firstLocalUser.inputPlayer != null) ? firstLocalUser.inputPlayer.controllers.Mouse : null);
		if (val == null)
		{
			return;
		}
		if (WindowOpened())
		{
			if (!_mouseOff)
			{
				_mouseWasOn = ((Controller)val).enabled;
				_mouseOff = true;
			}
			((Controller)val).enabled = false;
		}
		else if (_mouseOff)
		{
			((Controller)val).enabled = _mouseWasOn;
			_mouseOff = false;
		}
	}

	private static void HoldLookSensitivity()
	{
		LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
		UserProfile val = ((firstLocalUser != null) ? firstLocalUser.userProfile : null);
		FieldInfo fieldInfo = ((object)val)?.GetType().GetField("mouseLookSensitivity", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		if (fieldInfo == null || fieldInfo.FieldType != typeof(float))
		{
			return;
		}
		if (WindowOpened())
		{
			if (_savedLook < 0f)
			{
				_savedLook = (float)fieldInfo.GetValue(val);
			}
			fieldInfo.SetValue(val, 0f);
		}
		else if (!(_savedLook < 0f))
		{
			fieldInfo.SetValue(val, _savedLook);
			_savedLook = -1f;
		}
	}

	private static void TrackThirdPerson()
	{
		//IL_0029: 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)
		bool num = ReadBool(ThirdPersonField);
		if (num && !_tpWasOn)
		{
			CameraRigController val = LocalRig();
			if ((Object)(object)val != (Object)null)
			{
				_fpRot = val.currentCameraState.rotation;
				_haveFpRot = true;
			}
		}
		if (!num && _tpWasOn)
		{
			SeatFirstPerson(resetFov: false);
		}
		_tpWasOn = num;
	}

	private static void TickSeat()
	{
		if (_seatFrames <= 0 || ReadBool(ThirdPersonField))
		{
			return;
		}
		CameraRigController val = LocalRig();
		if (!((Object)(object)val == (Object)null))
		{
			if (FirstPerson)
			{
				SetInstanceCameraDistance(val, 0f);
			}
			_seatFrames--;
		}
	}

	private static void SeatFirstPerson(bool resetFov)
	{
		ThirdPersonField?.SetValue(null, false);
		_tpWasOn = false;
		_seatFrames = 12;
		((CheatRuntimeType != null) ? CheatRuntimeType.GetField("_camOverlayOn", BindingFlags.Static | BindingFlags.NonPublic) : null)?.SetValue(null, false);
		if (resetFov)
		{
			FovField?.SetValue(null, 60f);
			CameraRigController val = LocalRig();
			if ((Object)(object)val != (Object)null)
			{
				val.baseFov = 60f;
			}
		}
		CameraRigController val2 = LocalRig();
		if (!((Object)(object)val2 == (Object)null) && FirstPerson)
		{
			SetInstanceCameraDistance(val2, 0f);
		}
	}

	private static void ApplySeatedLook(CameraRigController rig)
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//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_0019: 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_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: 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)
		//IL_006e: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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_00c1: 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_0080: 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)
		//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_00e9: 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_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: 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_0178: 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_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_019d: Unknown result type (might be due to invalid IL or missing references)
		LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
		CharacterBody val = ((firstLocalUser != null) ? firstLocalUser.cachedBody : null);
		Vector3 look = (_haveFpRot ? (_fpRot * Vector3.forward) : Vector3.forward);
		Vector3 val2;
		if (!_haveFpRot && (Object)(object)val != (Object)null)
		{
			if ((Object)(object)val.inputBank != (Object)null)
			{
				Vector3 aimDirection = val.inputBank.aimDirection;
				if (((Vector3)(ref aimDirection)).sqrMagnitude > 

plugins\RoRCheatPanel\RoRCheatPanel.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HG;
using HarmonyLib;
using KinematicCharacterController;
using RoR2;
using RoR2.Networking;
using RoR2.Skills;
using RoRCheatPanel.UI;
using RoRCheatPanel.UI.Tabs;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Networking;
using UnityEngine.Sprites;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("RoRCheatPanel")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("3.6.3.0")]
[assembly: AssemblyInformationalVersion("3.6.3")]
[assembly: AssemblyProduct("RoRCheatPanel")]
[assembly: AssemblyTitle("RoRCheatPanel")]
[assembly: AssemblyVersion("3.6.3.0")]
namespace RoRCheatPanel
{
	internal class AdminClientMessage : MessageBase
	{
		public byte Op;

		public string Data;

		public override void Serialize(NetworkWriter writer)
		{
			writer.Write(Op);
			writer.Write(Data ?? "");
		}

		public override void Deserialize(NetworkReader reader)
		{
			Op = reader.ReadByte();
			Data = reader.ReadString();
		}
	}
	internal static class AdminNet
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Action<NetworkClient> <>9__5_0;

			public static NetworkMessageDelegate <>9__10_0;

			internal void <Init>b__5_0(NetworkClient _)
			{
				RegisterClient();
			}

			internal void <RegisterServer>b__10_0(NetworkMessage _)
			{
			}
		}

		public const byte GrantAch = 1;

		public const byte GrantAllAch = 2;

		private const short MsgId = 19971;

		private static bool _inited;

		private static bool _clientHandler;

		public static void Init()
		{
			if (!_inited)
			{
				_inited = true;
				NetworkManagerSystem.onStartClientGlobal += delegate
				{
					RegisterClient();
				};
				NetworkManagerSystem.onStartServerGlobal += RegisterServer;
				RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(TryRegisterNow));
			}
		}

		public static bool SendGrant(NetworkUser user, string achievementId)
		{
			return Send(user, 1, achievementId ?? "");
		}

		public static bool SendGrantAll(NetworkUser user)
		{
			return Send(user, 2, "");
		}

		private static bool Send(NetworkUser user, byte op, string data)
		{
			if (!Object.op_Implicit((Object)(object)user) || !NetworkServer.active)
			{
				return false;
			}
			NetworkConnection connectionToClient = ((NetworkBehaviour)user).connectionToClient;
			if (connectionToClient == null)
			{
				return false;
			}
			NetworkServer.SendToClient(connectionToClient.connectionId, (short)19971, (MessageBase)(object)new AdminClientMessage
			{
				Op = op,
				Data = data
			});
			return true;
		}

		private static void TryRegisterNow()
		{
			if (NetworkServer.active)
			{
				RegisterServer();
			}
			RegisterClient();
		}

		private static void RegisterServer()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			object obj = <>c.<>9__10_0;
			if (obj == null)
			{
				NetworkMessageDelegate val = delegate
				{
				};
				<>c.<>9__10_0 = val;
				obj = (object)val;
			}
			NetworkServer.RegisterHandler((short)19971, (NetworkMessageDelegate)obj);
		}

		private static void RegisterClient()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			NetworkManagerSystem singleton = NetworkManagerSystem.singleton;
			NetworkClient val = (Object.op_Implicit((Object)(object)singleton) ? ((NetworkManager)singleton).client : null);
			if (val != null && !_clientHandler)
			{
				val.RegisterHandler((short)19971, new NetworkMessageDelegate(OnClient));
				_clientHandler = true;
			}
		}

		private static void OnClient(NetworkMessage netMsg)
		{
			AdminClientMessage adminClientMessage = netMsg.ReadMessage<AdminClientMessage>();
			if (adminClientMessage == null)
			{
				return;
			}
			if (adminClientMessage.Op == 1)
			{
				AchievementDef achievementDef = AchievementManager.GetAchievementDef(adminClientMessage.Data);
				if (achievementDef != null)
				{
					GameUtil.GrantAchievement(achievementDef);
				}
			}
			else if (adminClientMessage.Op == 2)
			{
				GameUtil.GrantAllAchievements();
			}
		}
	}
	internal static class CatalogHub
	{
		private struct Snapshot
		{
			public int Items;

			public int Equipment;

			public int Scenes;

			public int Bodies;

			public int Skills;

			public int Artifacts;

			public int Survivors;

			public int Achievements;

			public int Tiers;

			public int Difficulties;
		}

		private static bool _hooked;

		private static float _nextPoll;

		private static FieldInfo _difficultyDefs;

		public static int Stamp { get; private set; }

		public static bool Ready { get; private set; }

		public static int Items { get; private set; }

		public static int Equipment { get; private set; }

		public static int Scenes { get; private set; }

		public static int Bodies { get; private set; }

		public static int Skills { get; private set; }

		public static int Artifacts { get; private set; }

		public static int Survivors { get; private set; }

		public static int Achievements { get; private set; }

		public static int Tiers { get; private set; }

		public static int Difficulties { get; private set; }

		public static void Init()
		{
			if (!_hooked)
			{
				_hooked = true;
				RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(Refresh));
				RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(Refresh));
				((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)Refresh);
				((ResourceAvailability)(ref EquipmentCatalog.availability)).CallWhenAvailable((Action)Refresh);
				((ResourceAvailability)(ref ArtifactCatalog.availability)).CallWhenAvailable((Action)Refresh);
				((ResourceAvailability)(ref SceneCatalog.availability)).CallWhenAvailable((Action)Refresh);
				((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)Refresh);
				((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)Refresh);
				((ResourceAvailability)(ref UnlockableCatalog.availability)).CallWhenAvailable((Action)Refresh);
				((ResourceAvailability)(ref PickupCatalog.availability)).CallWhenAvailable((Action)Refresh);
				((ResourceAvailability)(ref AchievementManager.availability)).CallWhenAvailable((Action)Refresh);
				((ResourceAvailability)(ref SkillCatalog.skillsDefined)).CallWhenAvailable((Action)Refresh);
				Refresh();
			}
		}

		public static void Tick()
		{
			if (!(Time.unscaledTime < _nextPoll))
			{
				_nextPoll = Time.unscaledTime + 2f;
				Refresh();
			}
		}

		public static void ForceRefresh()
		{
			Apply(ReadSnapshot(), force: true);
		}

		public static int DifficultySlotCount()
		{
			try
			{
				if (_difficultyDefs == null)
				{
					_difficultyDefs = typeof(DifficultyCatalog).GetField("difficultyDefs", BindingFlags.Static | BindingFlags.NonPublic);
				}
				DifficultyDef[] array = ((_difficultyDefs != null) ? (_difficultyDefs.GetValue(null) as DifficultyDef[]) : null);
				if (array != null && array.Length != 0)
				{
					return array.Length;
				}
			}
			catch
			{
			}
			return 11;
		}

		private static void Refresh()
		{
			Apply(ReadSnapshot(), force: false);
		}

		private static Snapshot ReadSnapshot()
		{
			return new Snapshot
			{
				Items = Safe(() => ItemCatalog.itemCount),
				Equipment = Safe(() => EquipmentCatalog.equipmentCount),
				Scenes = Safe(() => SceneCatalog.sceneDefCount),
				Bodies = Safe(() => BodyCatalog.bodyCount),
				Skills = CountSkills(),
				Artifacts = Safe(() => ArtifactCatalog.artifactCount),
				Survivors = Safe(() => SurvivorCatalog.survivorCount),
				Achievements = Safe(() => AchievementManager.achievementCount),
				Tiers = Safe(() => ItemTierCatalog.itemCount),
				Difficulties = DifficultySlotCount()
			};
		}

		private static void Apply(Snapshot snap, bool force)
		{
			if (!force && snap.Items == Items && snap.Equipment == Equipment && snap.Scenes == Scenes && snap.Bodies == Bodies && snap.Skills == Skills && snap.Artifacts == Artifacts && snap.Survivors == Survivors && snap.Achievements == Achievements && snap.Tiers == Tiers && snap.Difficulties == Difficulties)
			{
				Ready = snap.Items > 0 && snap.Scenes > 0 && snap.Bodies > 0;
				return;
			}
			Items = snap.Items;
			Equipment = snap.Equipment;
			Scenes = snap.Scenes;
			Bodies = snap.Bodies;
			Skills = snap.Skills;
			Artifacts = snap.Artifacts;
			Survivors = snap.Survivors;
			Achievements = snap.Achievements;
			Tiers = snap.Tiers;
			Difficulties = snap.Difficulties;
			Ready = Items > 0 && Scenes > 0 && Bodies > 0;
			Stamp++;
			if (Plugin.Log != null)
			{
				Plugin.Log.LogInfo((object)("Catalogs live: items=" + Items + " equip=" + Equipment + " scenes=" + Scenes + " bodies=" + Bodies + " skills=" + Skills + " artifacts=" + Artifacts + " survivors=" + Survivors + " ach=" + Achievements));
			}
		}

		private static int CountSkills()
		{
			try
			{
				IEnumerable<SkillDef> allSkillDefs = SkillCatalog.allSkillDefs;
				if (allSkillDefs == null)
				{
					return 0;
				}
				int num = 0;
				foreach (SkillDef item in allSkillDefs)
				{
					if (Object.op_Implicit((Object)(object)item))
					{
						num++;
					}
				}
				return num;
			}
			catch
			{
				return 0;
			}
		}

		private static int Safe(Func<int> read)
		{
			try
			{
				return read();
			}
			catch
			{
				return 0;
			}
		}
	}
	internal static class CheatConfig
	{
		public static ConfigEntry<KeyboardShortcut> OpenKey;

		public static ConfigEntry<KeyboardShortcut> OpenKeyAlt;

		public static ConfigEntry<KeyboardShortcut> ScanKey;

		public static ConfigEntry<KeyboardShortcut> GummyKey;

		public static ConfigEntry<KeyboardShortcut> DronesKey;

		public static ConfigEntry<KeyboardShortcut> ArmyKey;

		public static ConfigEntry<KeyboardShortcut> GodModeKey;

		public static ConfigEntry<KeyboardShortcut> ChargeTeleporterKey;

		public static ConfigEntry<KeyboardShortcut> NoclipKey;

		public static ConfigEntry<float> NoclipSpeed;

		public static ConfigEntry<float> UiScale;

		public static ConfigEntry<bool> UnlockCursor;

		public static ConfigEntry<bool> PauseStopwatchOnOpen;

		public static ConfigEntry<bool> ShowHiddenItems;

		public static ConfigEntry<int> DefaultItemQuantity;

		public static ConfigEntry<PanelLanguage> UiLanguage;

		public static ConfigEntry<PanelTheme> UiTheme;

		public static void Bind(ConfigFile config)
		{
			//IL_001e: 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_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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_0103: 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_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			OpenKey = config.Bind<KeyboardShortcut>("Hotkeys", "OpenPanel", new KeyboardShortcut((KeyCode)291, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), "Open / close the panel.");
			OpenKeyAlt = config.Bind<KeyboardShortcut>("Hotkeys", "OpenPanelAlt", new KeyboardShortcut((KeyCode)277, Array.Empty<KeyCode>()), "Second open / close bind.");
			ScanKey = config.Bind<KeyboardShortcut>("Hotkeys", "ScanArea", new KeyboardShortcut((KeyCode)118, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), "Scan interactables.");
			GummyKey = config.Bind<KeyboardShortcut>("Hotkeys", "GummyClone", new KeyboardShortcut((KeyCode)98, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), "Spawn a gummy clone.");
			DronesKey = config.Bind<KeyboardShortcut>("Hotkeys", "DroneBackup", new KeyboardShortcut((KeyCode)110, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), "Spawn gunner drones.");
			ArmyKey = config.Bind<KeyboardShortcut>("Hotkeys", "SpawnArmy", new KeyboardShortcut((KeyCode)109, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), "Spawn army. Changed from Ctrl+C to avoid copy conflict.");
			GodModeKey = config.Bind<KeyboardShortcut>("Hotkeys", "GodMode", new KeyboardShortcut((KeyCode)103, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), "Toggle godmode.");
			ChargeTeleporterKey = config.Bind<KeyboardShortcut>("Hotkeys", "ChargeTeleporter", new KeyboardShortcut((KeyCode)116, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), "Charge the teleporter.");
			NoclipKey = config.Bind<KeyboardShortcut>("Hotkeys", "Noclip", new KeyboardShortcut((KeyCode)102, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), "Toggle noclip / fly.");
			NoclipSpeed = config.Bind<float>("Movement", "NoclipSpeed", 22f, "Noclip fly speed. Hold Shift to triple it.");
			UiScale = config.Bind<float>("UI", "Scale", 1f, "IMGUI scale. 0.75 - 1.5 is typical.");
			UnlockCursor = config.Bind<bool>("UI", "UnlockCursor", true, "Show and unlock the cursor while the panel is open.");
			PauseStopwatchOnOpen = config.Bind<bool>("UI", "PauseRunStopwatch", false, "Pause the run timer while the panel is open (host only).");
			ShowHiddenItems = config.Bind<bool>("Items", "ShowHiddenByDefault", false, "Show hidden / unused items in catalogs.");
			DefaultItemQuantity = config.Bind<int>("Items", "DefaultQuantity", 1, "Default stack size in the Items tab.");
			UiLanguage = config.Bind<PanelLanguage>("UI", "Language", PanelLanguage.Ru, "Panel language: Ru, En, Es. Also used for item/artifact names and descriptions.");
			UiTheme = config.Bind<PanelTheme>("UI", "Theme", PanelTheme.Night, "Panel color theme.");
		}
	}
	internal static class CheatRuntime
	{
		public static bool GodMode;

		public static bool InfiniteSkills;

		public static bool InfiniteEquipment;

		public static float TimeScale = 1f;

		public static bool FreezeStopwatch;

		public static bool Noclip;

		public static float NoclipSpeed = 22f;

		public static bool Disco;

		public static bool LowGravity;

		public static float BodyScale = 1f;

		public static float Fov = 60f;

		public static bool ThirdPerson;

		public static bool DrunkCamera;

		public static float ThirdPersonDistance = 8f;

		private static bool _camOverlayOn;

		private static Vector3 _savedCamPos;

		private static Quaternion _savedCamRot;

		private static readonly Dictionary<CharacterMotor, float> LowGravSaved = new Dictionary<CharacterMotor, float>();

		private const float MoonJumpMeters = 26f;

		private static bool _noclipEnabledOnMotor;

		private static CharacterMotor _noclipMotor;

		private static CursorLockMode _savedLock;

		private static bool _savedCursorVisible;

		private static bool _cursorOverridden;

		private static bool _stopwatchOverridden;

		public static void ToggleGodMode()
		{
			GodMode = !GodMode;
			ApplyGodMode();
			UiHelpers.Toast(GodMode ? Loc.T("god_on") : Loc.T("god_off"));
		}

		public static void ToggleNoclip()
		{
			Noclip = !Noclip;
			if (!Noclip)
			{
				RestoreNoclip(_noclipMotor);
				NoclipBounds.Tick(noclipOn: false);
			}
			UiHelpers.Toast(Noclip ? Loc.T("noclip_on") : Loc.T("noclip_off"));
		}

		public static void Tick()
		{
			ApplyGodMode();
			ApplyInfinite();
			ApplyNoclip();
			PlayerAdmin.Tick();
			ApplyLowGravity();
			ApplyBodyScale();
			ClearCameraOverlay();
			ApplyFov();
			ApplyTimeScale();
			ApplyCursor();
			ApplyStopwatch();
		}

		public static void OnWindowClosed()
		{
			RestoreCursor();
			RestoreStopwatch();
		}

		private static void ApplyNoclip()
		{
			CharacterBody localBody = GameUtil.LocalBody;
			CharacterMotor val = (Object.op_Implicit((Object)(object)localBody) ? localBody.characterMotor : null);
			if (!Noclip)
			{
				RestoreNoclip(_noclipMotor);
				NoclipBounds.Tick(noclipOn: false);
				return;
			}
			NoclipBounds.Tick(noclipOn: true);
			if (Object.op_Implicit((Object)(object)val))
			{
				if (!_noclipEnabledOnMotor || (Object)(object)_noclipMotor != (Object)(object)val)
				{
					RestoreNoclip(_noclipMotor);
					EnableNoclip(val);
					_noclipMotor = val;
					_noclipEnabledOnMotor = true;
				}
				Fly(localBody, val);
			}
		}

		private static void EnableNoclip(CharacterMotor motor)
		{
			//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_001d: Unknown result type (might be due to invalid IL or missing references)
			//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_0037: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)motor))
			{
				CharacterFlightParameters flightParameters = motor.flightParameters;
				flightParameters.channeledFlightGranterCount++;
				motor.flightParameters = flightParameters;
				CharacterGravityParameters gravityParameters = motor.gravityParameters;
				gravityParameters.channeledAntiGravityGranterCount++;
				motor.gravityParameters = gravityParameters;
				if (Object.op_Implicit((Object)(object)((BaseCharacterController)motor).Motor))
				{
					((BaseCharacterController)motor).Motor.SetCapsuleCollisionsActivation(false);
					((BaseCharacterController)motor).Motor.SetMovementCollisionsSolvingActivation(false);
					((BaseCharacterController)motor).Motor.SetGroundSolvingActivation(false);
				}
			}
		}

		private static void RestoreNoclip(CharacterMotor motor)
		{
			//IL_0017: 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_001d: 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_003a: 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)
			//IL_0040: 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)
			if (!_noclipEnabledOnMotor)
			{
				_noclipMotor = null;
				return;
			}
			if (Object.op_Implicit((Object)(object)motor))
			{
				CharacterFlightParameters flightParameters = motor.flightParameters;
				if (flightParameters.channeledFlightGranterCount > 0)
				{
					flightParameters.channeledFlightGranterCount--;
				}
				motor.flightParameters = flightParameters;
				CharacterGravityParameters gravityParameters = motor.gravityParameters;
				if (gravityParameters.channeledAntiGravityGranterCount > 0)
				{
					gravityParameters.channeledAntiGravityGranterCount--;
				}
				motor.gravityParameters = gravityParameters;
				if (Object.op_Implicit((Object)(object)((BaseCharacterController)motor).Motor))
				{
					((BaseCharacterController)motor).Motor.SetCapsuleCollisionsActivation(true);
					((BaseCharacterController)motor).Motor.SetMovementCollisionsSolvingActivation(true);
					((BaseCharacterController)motor).Motor.SetGroundSolvingActivation(true);
				}
			}
			_noclipEnabledOnMotor = false;
			_noclipMotor = null;
		}

		private static void Fly(CharacterBody body, CharacterMotor motor)
		{
			//IL_0060: 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_0053: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_0074: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_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_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: 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_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: 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_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: 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_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			Camera val = ((GameUtil.LocalUser != null && Object.op_Implicit((Object)(object)GameUtil.LocalUser.cameraRigController)) ? GameUtil.LocalUser.cameraRigController.sceneCam : null);
			Vector3 val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).transform.forward : (Object.op_Implicit((Object)(object)body.characterDirection) ? body.characterDirection.forward : ((Component)body).transform.forward));
			Vector3 val3 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).transform.right : Vector3.Cross(Vector3.up, val2));
			Vector3 val4 = Vector3.zero;
			if (Input.GetKey((KeyCode)119))
			{
				val4 += val2;
			}
			if (Input.GetKey((KeyCode)115))
			{
				val4 -= val2;
			}
			if (Input.GetKey((KeyCode)97))
			{
				val4 -= val3;
			}
			if (Input.GetKey((KeyCode)100))
			{
				val4 += val3;
			}
			if (Input.GetKey((KeyCode)32) || Input.GetKey((KeyCode)101))
			{
				val4 += Vector3.up;
			}
			if (Input.GetKey((KeyCode)113))
			{
				val4 += Vector3.down;
			}
			motor.velocity = Vector3.zero;
			if (!(((Vector3)(ref val4)).sqrMagnitude < 0.0001f))
			{
				float num = NoclipSpeed;
				if (CheatConfig.NoclipSpeed != null)
				{
					num = CheatConfig.NoclipSpeed.Value;
				}
				if (Input.GetKey((KeyCode)304) || Input.GetKey((KeyCode)303))
				{
					num *= 3f;
				}
				Vector3 val5 = ((Vector3)(ref val4)).normalized * num * Time.unscaledDeltaTime;
				Vector3 val6 = ((Component)body).transform.position + val5;
				if (Object.op_Implicit((Object)(object)((BaseCharacterController)motor).Motor))
				{
					((BaseCharacterController)motor).Motor.SetPosition(val6, true);
				}
				else
				{
					((Component)body).transform.position = val6;
				}
			}
		}

		private static void ApplyGodMode()
		{
			if (!GodMode)
			{
				return;
			}
			foreach (NetworkUser item in GameUtil.Targets())
			{
				CharacterBody val = (Object.op_Implicit((Object)(object)item) ? item.GetCurrentBody() : null);
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent))
				{
					val.healthComponent.godMode = true;
				}
			}
		}

		private static void ApplyInfinite()
		{
			if ((!InfiniteSkills && !InfiniteEquipment) || !GameUtil.IsHost)
			{
				return;
			}
			foreach (NetworkUser item in GameUtil.Targets())
			{
				CharacterBody val = (Object.op_Implicit((Object)(object)item) ? item.GetCurrentBody() : null);
				if (InfiniteSkills && Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.skillLocator))
				{
					GenericSkill[] allSkills = val.skillLocator.AllSkills;
					foreach (GenericSkill val2 in allSkills)
					{
						if (Object.op_Implicit((Object)(object)val2))
						{
							val2.stock = val2.maxStock;
							val2.cooldownScale = 0f;
						}
					}
				}
				if (InfiniteEquipment && Object.op_Implicit((Object)(object)item.master) && Object.op_Implicit((Object)(object)item.master.inventory))
				{
					item.master.inventory.DeductActiveEquipmentCooldown(999f);
				}
			}
		}

		private static void ApplyTimeScale()
		{
			float num = Mathf.Clamp(TimeScale, 0.05f, 5f);
			if (Mathf.Abs(Time.timeScale - num) > 0.001f)
			{
				Time.timeScale = num;
				Time.fixedDeltaTime = 0.02f * num;
			}
		}

		public static void ResetTimeScale()
		{
			TimeScale = 1f;
			Time.timeScale = 1f;
			Time.fixedDeltaTime = 0.02f;
		}

		private static void ApplyCursor()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			if (!CheatWindow.Opened || !CheatConfig.UnlockCursor.Value)
			{
				RestoreCursor();
				return;
			}
			if (!_cursorOverridden)
			{
				_savedLock = Cursor.lockState;
				_savedCursorVisible = Cursor.visible;
				_cursorOverridden = true;
			}
			Cursor.lockState = (CursorLockMode)0;
			Cursor.visible = true;
		}

		private static void RestoreCursor()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (_cursorOverridden)
			{
				Cursor.lockState = _savedLock;
				Cursor.visible = _savedCursorVisible;
				_cursorOverridden = false;
			}
		}

		private static void ApplyStopwatch()
		{
			if (!CheatConfig.PauseStopwatchOnOpen.Value || !CheatWindow.Opened || !GameUtil.IsHost || !Object.op_Implicit((Object)(object)Run.instance))
			{
				RestoreStopwatch();
				return;
			}
			Run.instance.NetworkisRunStopwatchForcePaused = true;
			_stopwatchOverridden = true;
		}

		private static void RestoreStopwatch()
		{
			if (!_stopwatchOverridden || !Object.op_Implicit((Object)(object)Run.instance))
			{
				_stopwatchOverridden = false;
				return;
			}
			if (!FreezeStopwatch)
			{
				Run.instance.NetworkisRunStopwatchForcePaused = false;
			}
			_stopwatchOverridden = false;
		}

		private static void ApplyLowGravity()
		{
			if (!LowGravity || Noclip)
			{
				RestoreLowGrav();
				return;
			}
			HashSet<CharacterMotor> hashSet = new HashSet<CharacterMotor>();
			foreach (NetworkUser item in GameUtil.Targets())
			{
				CharacterBody val = (Object.op_Implicit((Object)(object)item) ? item.GetCurrentBody() : null);
				CharacterMotor val2 = (Object.op_Implicit((Object)(object)val) ? val.characterMotor : null);
				if (Object.op_Implicit((Object)(object)val2))
				{
					hashSet.Add(val2);
					if (!LowGravSaved.ContainsKey(val2))
					{
						LowGravSaved[val2] = ((val2.gravityScale <= 0.01f) ? 1f : val2.gravityScale);
					}
					val2.gravityScale = MoonGravityScale(val);
				}
			}
			if (LowGravSaved.Count == hashSet.Count)
			{
				return;
			}
			List<CharacterMotor> list = new List<CharacterMotor>();
			foreach (KeyValuePair<CharacterMotor, float> item2 in LowGravSaved)
			{
				if (!Object.op_Implicit((Object)(object)item2.Key) || !hashSet.Contains(item2.Key))
				{
					list.Add(item2.Key);
				}
			}
			foreach (CharacterMotor item3 in list)
			{
				if (Object.op_Implicit((Object)(object)item3))
				{
					item3.gravityScale = LowGravSaved[item3];
				}
				LowGravSaved.Remove(item3);
			}
		}

		private static float MoonGravityScale(CharacterBody body)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			float num = ((Object.op_Implicit((Object)(object)body) && body.jumpPower > 1f) ? body.jumpPower : 15f);
			float num2 = Mathf.Abs(Physics.gravity.y);
			if (num2 < 1f)
			{
				num2 = 9.81f;
			}
			return Mathf.Clamp(num * num / 52f / num2, 0.12f, 0.45f);
		}

		private static void RestoreLowGrav()
		{
			if (LowGravSaved.Count == 0)
			{
				return;
			}
			foreach (KeyValuePair<CharacterMotor, float> item in LowGravSaved)
			{
				if (Object.op_Implicit((Object)(object)item.Key))
				{
					item.Key.gravityScale = item.Value;
				}
			}
			LowGravSaved.Clear();
		}

		private static void ApplyBodyScale()
		{
			//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)
			float num = Mathf.Clamp(BodyScale, 0.2f, 8f);
			foreach (NetworkUser item in GameUtil.Targets())
			{
				CharacterBody val = (Object.op_Implicit((Object)(object)item) ? item.GetCurrentBody() : null);
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.modelLocator) && Object.op_Implicit((Object)(object)val.modelLocator.modelTransform))
				{
					val.modelLocator.modelTransform.localScale = Vector3.one * num;
				}
			}
		}

		private static void ApplyFov()
		{
			LocalUser localUser = GameUtil.LocalUser;
			if (localUser != null && Object.op_Implicit((Object)(object)localUser.cameraRigController))
			{
				float num = Mathf.Clamp(Fov, 30f, 140f);
				if (DrunkCamera)
				{
					num += Mathf.Sin(Time.unscaledTime * 2.6f) * 11f;
				}
				localUser.cameraRigController.baseFov = num;
			}
		}

		public static void LateTick()
		{
			//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_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_007f: 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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: 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_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: 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)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			if (!ThirdPerson && !DrunkCamera)
			{
				return;
			}
			Camera val = SceneCam();
			if (!Object.op_Implicit((Object)(object)val))
			{
				return;
			}
			_savedCamPos = ((Component)val).transform.position;
			_savedCamRot = ((Component)val).transform.rotation;
			_camOverlayOn = true;
			CharacterBody localBody = GameUtil.LocalBody;
			if (ThirdPerson && Object.op_Implicit((Object)(object)localBody))
			{
				Vector3 val2 = (Object.op_Implicit((Object)(object)localBody.inputBank) ? localBody.inputBank.aimDirection : ((Component)localBody).transform.forward);
				if (((Vector3)(ref val2)).sqrMagnitude < 0.001f)
				{
					val2 = ((Component)localBody).transform.forward;
				}
				Vector3 val3 = localBody.corePosition + Vector3.up * 1.1f;
				float num = Mathf.Clamp(ThirdPersonDistance, 3f, 18f);
				Vector3 val4 = val3 - ((Vector3)(ref val2)).normalized * num + Vector3.up * 0.35f;
				((Component)val).transform.position = val4;
				((Component)val).transform.rotation = Quaternion.LookRotation(val3 - val4, Vector3.up);
			}
			if (DrunkCamera)
			{
				float unscaledTime = Time.unscaledTime;
				((Component)val).transform.Rotate(Mathf.Sin(unscaledTime * 1.8f) * 0.55f, Mathf.Sin(unscaledTime * 1.15f) * 0.45f, Mathf.Sin(unscaledTime * 2.4f) * 7.5f, (Space)1);
			}
		}

		public static void RestoreCamera()
		{
			//IL_0055: 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_0062: 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_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: 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)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			DrunkCamera = false;
			ThirdPerson = false;
			Fov = 60f;
			ClearCameraOverlay();
			LocalUser localUser = GameUtil.LocalUser;
			CameraRigController val = ((localUser != null) ? localUser.cameraRigController : null);
			if (Object.op_Implicit((Object)(object)val))
			{
				val.baseFov = 60f;
			}
			Camera val2 = SceneCam();
			if (Object.op_Implicit((Object)(object)val2))
			{
				Vector3 localEulerAngles = ((Component)val2).transform.localEulerAngles;
				((Component)val2).transform.localEulerAngles = new Vector3(localEulerAngles.x, localEulerAngles.y, 0f);
			}
			CharacterBody localBody = GameUtil.LocalBody;
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)localBody))
			{
				Vector3 aim = (Object.op_Implicit((Object)(object)localBody.inputBank) ? localBody.inputBank.aimDirection : ((Component)localBody).transform.forward);
				if (((Vector3)(ref aim)).sqrMagnitude > 0.001f)
				{
					RecenterRig(val, aim);
				}
			}
			UiHelpers.Toast(Loc.T("fun_cam_reset_ok"));
		}

		private static void ClearCameraOverlay()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if (_camOverlayOn)
			{
				Camera val = SceneCam();
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).transform.position = _savedCamPos;
					((Component)val).transform.rotation = _savedCamRot;
				}
				_camOverlayOn = false;
			}
		}

		private static void RecenterRig(CameraRigController rig, Vector3 aim)
		{
			//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_0061: 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_006a: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)rig))
			{
				Type type = ((object)rig).GetType();
				MethodInfo methodInfo = type.GetMethod("SetPitchYawFromLookVector", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) ?? type.GetMethod("SetPitchYaw", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				if (methodInfo != null && methodInfo.GetParameters().Length == 1)
				{
					methodInfo.Invoke(rig, new object[1] { aim });
					return;
				}
				Quaternion val = Quaternion.LookRotation(aim);
				Vector3 eulerAngles = ((Quaternion)(ref val)).eulerAngles;
				float value = ((eulerAngles.x > 180f) ? (eulerAngles.x - 360f) : eulerAngles.x);
				TrySetMember(rig, type, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, "pitch", value);
				TrySetMember(rig, type, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, "yaw", eulerAngles.y);
			}
		}

		private static void TrySetMember(object target, Type type, BindingFlags flags, string name, float value)
		{
			FieldInfo fieldInfo = type.GetField(name, flags) ?? type.GetField("_" + name, flags);
			if (fieldInfo != null && fieldInfo.FieldType == typeof(float))
			{
				fieldInfo.SetValue(target, value);
				return;
			}
			PropertyInfo property = type.GetProperty(name, flags);
			if (property != null && property.CanWrite && property.PropertyType == typeof(float))
			{
				property.SetValue(target, value);
			}
		}

		private static Camera SceneCam()
		{
			LocalUser localUser = GameUtil.LocalUser;
			CameraRigController val = ((localUser != null) ? localUser.cameraRigController : null);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return null;
			}
			return val.sceneCam;
		}
	}
	internal enum BodyKind
	{
		Survivor,
		Monster,
		Boss,
		Drone,
		Other
	}
	internal static class GameUtil
	{
		public static readonly List<NetworkUser> SelectedUsers = new List<NetworkUser>();

		private static MethodInfo _fireScanner;

		private static MethodInfo _fireGummy;

		private static MethodInfo _fireDrones;

		private static bool _methodsResolved;

		private static readonly Regex RichTag = new Regex("<[^>]+>", RegexOptions.Compiled);

		public static bool IsHost => NetworkServer.active;

		public static bool InRun => (Object)(object)Run.instance != (Object)null;

		public static LocalUser LocalUser => LocalUserManager.GetFirstLocalUser();

		public static NetworkUser LocalNetworkUser
		{
			get
			{
				LocalUser localUser = LocalUser;
				if (localUser != null && Object.op_Implicit((Object)(object)localUser.currentNetworkUser))
				{
					return localUser.currentNetworkUser;
				}
				CharacterBody val = ((localUser != null) ? localUser.cachedBody : null);
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.master))
				{
					foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList)
					{
						if (Object.op_Implicit((Object)(object)readOnlyInstances) && (Object)(object)readOnlyInstances.master == (Object)(object)val.master)
						{
							return readOnlyInstances;
						}
					}
				}
				if (NetworkUser.readOnlyLocalPlayersList != null && NetworkUser.readOnlyLocalPlayersList.Count > 0)
				{
					return NetworkUser.readOnlyLocalPlayersList[0];
				}
				return null;
			}
		}

		public static CharacterBody LocalBody
		{
			get
			{
				LocalUser localUser = LocalUser;
				if (localUser != null && Object.op_Implicit((Object)(object)localUser.cachedBody))
				{
					return localUser.cachedBody;
				}
				NetworkUser localNetworkUser = LocalNetworkUser;
				if (!Object.op_Implicit((Object)(object)localNetworkUser))
				{
					return null;
				}
				return localNetworkUser.GetCurrentBody();
			}
		}

		public static CharacterMaster LocalMaster
		{
			get
			{
				LocalUser localUser = LocalUser;
				if (localUser != null && Object.op_Implicit((Object)(object)localUser.cachedMaster))
				{
					return localUser.cachedMaster;
				}
				NetworkUser localNetworkUser = LocalNetworkUser;
				if (!Object.op_Implicit((Object)(object)localNetworkUser))
				{
					return null;
				}
				return localNetworkUser.master;
			}
		}

		public static string Lang(string token)
		{
			if (string.IsNullOrEmpty(token))
			{
				return "";
			}
			try
			{
				string text = Language.GetString(token, Loc.GameCode);
				if (string.IsNullOrEmpty(text) || text == token)
				{
					text = Language.GetString(token);
				}
				if (string.IsNullOrEmpty(text) || text == token)
				{
					return token;
				}
				return StripRich(text);
			}
			catch
			{
				return token;
			}
		}

		public static string StripRich(string text)
		{
			if (string.IsNullOrEmpty(text))
			{
				return "";
			}
			return RichTag.Replace(text, "").Trim();
		}

		public static string Description(ItemDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "";
			}
			return JoinTip(DisplayName(def), Lang(def.pickupToken), Lang(def.descriptionToken));
		}

		public static string Description(EquipmentDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "";
			}
			return JoinTip(DisplayName(def), Lang(def.pickupToken), Lang(def.descriptionToken));
		}

		public static string Description(ArtifactDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "";
			}
			return JoinTip(DisplayName(def), Lang(def.descriptionToken));
		}

		public static string Description(SkillDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "";
			}
			return JoinTip(DisplayName(def), Lang(def.skillDescriptionToken));
		}

		public static string Description(AchievementDef def)
		{
			if (def == null)
			{
				return "";
			}
			return JoinTip(DisplayName(def), Lang(def.descriptionToken));
		}

		public static string Description(SurvivorDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "";
			}
			return JoinTip(DisplayName(def), Lang(def.descriptionToken));
		}

		public static string Description(SceneDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "";
			}
			return JoinTip(DisplayName(def), Lang(def.loreToken));
		}

		private static string JoinTip(params string[] parts)
		{
			string text = "";
			foreach (string text2 in parts)
			{
				if (!string.IsNullOrWhiteSpace(text2) && text.IndexOf(text2, StringComparison.Ordinal) < 0)
				{
					if (text.Length > 0)
					{
						text += "\n";
					}
					text += text2;
				}
			}
			return text;
		}

		public static string DisplayName(ItemDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "?";
			}
			string text = Lang(def.nameToken);
			if (!string.IsNullOrEmpty(text))
			{
				return text;
			}
			return ((Object)def).name;
		}

		public static string DisplayName(EquipmentDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "?";
			}
			string text = Lang(def.nameToken);
			if (!string.IsNullOrEmpty(text))
			{
				return text;
			}
			return ((Object)def).name;
		}

		public static string DisplayName(SkillDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "?";
			}
			string text = Lang(def.skillNameToken);
			if (!string.IsNullOrEmpty(text) && text != def.skillNameToken)
			{
				return text;
			}
			if (!string.IsNullOrEmpty(def.skillName))
			{
				return def.skillName;
			}
			return def.name;
		}

		public static string DisplayName(AchievementDef def)
		{
			if (def == null)
			{
				return "?";
			}
			string text = Lang(def.nameToken);
			if (!string.IsNullOrEmpty(text))
			{
				return text;
			}
			return def.identifier;
		}

		public static string DisplayName(SceneDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "?";
			}
			string text = Lang(def.nameToken);
			if (!string.IsNullOrEmpty(text))
			{
				return text;
			}
			return def.cachedName;
		}

		public static string DisplayName(ArtifactDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "?";
			}
			string text = Lang(def.nameToken);
			if (!string.IsNullOrEmpty(text))
			{
				return text;
			}
			return def.cachedName;
		}

		public static string DisplayName(SurvivorDef def)
		{
			if (!Object.op_Implicit((Object)(object)def))
			{
				return "?";
			}
			string text = Lang(def.displayNameToken);
			if (!string.IsNullOrEmpty(text))
			{
				return text;
			}
			return def.cachedName;
		}

		public static string DisplayName(CharacterBody body)
		{
			if (!Object.op_Implicit((Object)(object)body))
			{
				return "?";
			}
			string text = Lang(body.baseNameToken);
			if (!string.IsNullOrEmpty(text) && text != body.baseNameToken)
			{
				return text;
			}
			string displayName = body.GetDisplayName();
			if (!string.IsNullOrEmpty(displayName))
			{
				return displayName;
			}
			return ((Object)body).name;
		}

		public static string Description(CharacterBody body)
		{
			if (!Object.op_Implicit((Object)(object)body))
			{
				return "";
			}
			return JoinTip(DisplayName(body), Lang(body.subtitleNameToken), ((Object)body).name);
		}

		public static string BodyKindLabel(GameObject prefab, CharacterBody body)
		{
			return ClassifyBody(prefab, body) switch
			{
				BodyKind.Survivor => Loc.T("chars_survivors"), 
				BodyKind.Boss => Loc.T("chars_bosses"), 
				BodyKind.Drone => Loc.T("chars_drones"), 
				BodyKind.Monster => Loc.T("chars_monsters"), 
				_ => Loc.T("chars_other"), 
			};
		}

		public static BodyKind ClassifyBody(GameObject prefab, CharacterBody body)
		{
			if (Object.op_Implicit((Object)(object)prefab) && Object.op_Implicit((Object)(object)SurvivorCatalog.FindSurvivorDefFromBody(prefab)))
			{
				return BodyKind.Survivor;
			}
			string n = (Object.op_Implicit((Object)(object)prefab) ? ((Object)prefab).name : (Object.op_Implicit((Object)(object)body) ? ((Object)body).name : ""));
			if (NameLooksLikeDrone(n))
			{
				return BodyKind.Drone;
			}
			if (Object.op_Implicit((Object)(object)body) && body.isChampion)
			{
				return BodyKind.Boss;
			}
			if (NameLooksLikeOther(n))
			{
				return BodyKind.Other;
			}
			return BodyKind.Monster;
		}

		private static bool NameLooksLikeDrone(string n)
		{
			return ContainsAny(n, "Drone", "Turret", "MegaDrone", "EquipmentDrone", "EmergencyDrone", "FlameDrone");
		}

		private static bool NameLooksLikeOther(string n)
		{
			return ContainsAny(n, "Display", "Pod", "Corpse", "Dead", "Fake", "Temp", "Projectile", "Joint", "WeakPoint", "HurtBox", "Spectator", "Attachment", "Dummy");
		}

		private static bool ContainsAny(string text, params string[] parts)
		{
			if (string.IsNullOrEmpty(text))
			{
				return false;
			}
			for (int i = 0; i < parts.Length; i++)
			{
				if (text.IndexOf(parts[i], StringComparison.OrdinalIgnoreCase) >= 0)
				{
					return true;
				}
			}
			return false;
		}

		public static IEnumerable<NetworkUser> AllUsers()
		{
			if (NetworkUser.readOnlyInstancesList == null)
			{
				yield break;
			}
			foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList)
			{
				if (Object.op_Implicit((Object)(object)readOnlyInstances))
				{
					yield return readOnlyInstances;
				}
			}
		}

		public static IEnumerable<NetworkUser> Targets()
		{
			CleanupSelected();
			if (SelectedUsers.Count > 0)
			{
				foreach (NetworkUser selectedUser in SelectedUsers)
				{
					yield return selectedUser;
				}
				yield break;
			}
			NetworkUser localNetworkUser = LocalNetworkUser;
			if (Object.op_Implicit((Object)(object)localNetworkUser))
			{
				yield return localNetworkUser;
			}
		}

		public static void CleanupSelected()
		{
			for (int num = SelectedUsers.Count - 1; num >= 0; num--)
			{
				if (!Object.op_Implicit((Object)(object)SelectedUsers[num]))
				{
					SelectedUsers.RemoveAt(num);
				}
			}
		}

		public static bool RequireHost(string action)
		{
			if (IsHost)
			{
				return true;
			}
			UiHelpers.Toast(Loc.F("need_host", action));
			return false;
		}

		public static void GiveItem(ItemDef def, int count)
		{
			if (!Object.op_Implicit((Object)(object)def) || count == 0 || !RequireHost(Loc.T("act_items")))
			{
				return;
			}
			foreach (NetworkUser item in Targets())
			{
				Inventory val = (Object.op_Implicit((Object)(object)item.master) ? item.master.inventory : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					if (count > 0)
					{
						val.GiveItemPermanent(def, count);
					}
					else
					{
						val.RemoveItemPermanent(def, -count);
					}
				}
			}
			UiHelpers.Toast(((count > 0) ? "+" : "") + count + " " + DisplayName(def));
		}

		public static void ClearInventory()
		{
			if (!RequireHost(Loc.T("act_clear")))
			{
				return;
			}
			foreach (NetworkUser item in Targets())
			{
				Inventory val = (Object.op_Implicit((Object)(object)item.master) ? item.master.inventory : null);
				if (!Object.op_Implicit((Object)(object)val))
				{
					continue;
				}
				for (int i = 0; i < ItemCatalog.itemCount; i++)
				{
					ItemDef itemDef = ItemCatalog.GetItemDef((ItemIndex)i);
					if (Object.op_Implicit((Object)(object)itemDef))
					{
						int itemCountPermanent = val.GetItemCountPermanent(itemDef);
						if (itemCountPermanent > 0)
						{
							val.RemoveItemPermanent(itemDef, itemCountPermanent);
						}
					}
				}
			}
			UiHelpers.Toast(Loc.T("inv_cleared"));
		}

		public static void GiveAllVisibleItems(Predicate<ItemDef> filter, int count)
		{
			if (!RequireHost(Loc.T("act_all_items")))
			{
				return;
			}
			int num = 0;
			for (int i = 0; i < ItemCatalog.itemCount; i++)
			{
				ItemDef itemDef = ItemCatalog.GetItemDef((ItemIndex)i);
				if (!Object.op_Implicit((Object)(object)itemDef) || (filter != null && !filter(itemDef)))
				{
					continue;
				}
				foreach (NetworkUser item in Targets())
				{
					Inventory val = (Object.op_Implicit((Object)(object)item.master) ? item.master.inventory : null);
					if (Object.op_Implicit((Object)(object)val))
					{
						val.GiveItemPermanent(itemDef, count);
					}
				}
				num++;
			}
			UiHelpers.Toast(Loc.F("given_items", num));
		}

		public static void SetEquipment(EquipmentDef def)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			if (!RequireHost(Loc.T("act_equip")))
			{
				return;
			}
			foreach (NetworkUser item in Targets())
			{
				Inventory val = (Object.op_Implicit((Object)(object)item.master) ? item.master.inventory : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					val.SetEquipmentIndex((EquipmentIndex)((!Object.op_Implicit((Object)(object)def)) ? (-1) : ((int)def.equipmentIndex)), (Object)(object)def == (Object)null);
				}
			}
			UiHelpers.Toast(Object.op_Implicit((Object)(object)def) ? DisplayName(def) : Loc.T("equip_off"));
		}

		public static void RechargeEquipment()
		{
			if (!RequireHost(Loc.T("act_recharge")))
			{
				return;
			}
			foreach (NetworkUser item in Targets())
			{
				Inventory val = (Object.op_Implicit((Object)(object)item.master) ? item.master.inventory : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					val.DeductActiveEquipmentCooldown(9999f);
					val.RestockActiveEquipmentCharges(99);
				}
			}
			UiHelpers.Toast(Loc.T("equip_recharged"));
		}

		public static void SetSkill(SkillDef def, SkillSlot slot)
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)def) || !RequireHost(Loc.T("act_skill")))
			{
				return;
			}
			foreach (NetworkUser item in Targets())
			{
				CharacterBody currentBody = item.GetCurrentBody();
				SkillLocator val = (Object.op_Implicit((Object)(object)currentBody) ? currentBody.skillLocator : null);
				GenericSkill val2 = (Object.op_Implicit((Object)(object)val) ? val.GetSkill(slot) : null);
				if (Object.op_Implicit((Object)(object)val2))
				{
					val2.SetBaseSkill(def);
				}
			}
			UiHelpers.Toast(SlotLabel(slot) + " = " + DisplayName(def));
		}

		public static void ResetSkills()
		{
			if (!RequireHost(Loc.T("act_reset_skills")))
			{
				return;
			}
			foreach (NetworkUser item in Targets())
			{
				CharacterBody currentBody = item.GetCurrentBody();
				if (Object.op_Implicit((Object)(object)currentBody) && Object.op_Implicit((Object)(object)currentBody.skillLocator))
				{
					currentBody.skillLocator.ResetSkills();
				}
			}
			UiHelpers.Toast(Loc.T("skills_reset"));
		}

		public static void ResetSkillCooldowns()
		{
			if (!RequireHost(Loc.T("act_reset_cd")))
			{
				return;
			}
			foreach (NetworkUser item in Targets())
			{
				CharacterBody currentBody = item.GetCurrentBody();
				SkillLocator val = (Object.op_Implicit((Object)(object)currentBody) ? currentBody.skillLocator : null);
				if (!Object.op_Implicit((Object)(object)val))
				{
					continue;
				}
				GenericSkill[] allSkills = val.AllSkills;
				foreach (GenericSkill val2 in allSkills)
				{
					if (Object.op_Implicit((Object)(object)val2))
					{
						val2.Reset();
						val2.stock = val2.maxStock;
					}
				}
			}
			UiHelpers.Toast(Loc.T("cd_reset"));
		}

		public unsafe static string SlotLabel(SkillSlot slot)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected I4, but got Unknown
			return (int)slot switch
			{
				0 => "M1", 
				1 => "M2", 
				2 => "Shift", 
				3 => "R", 
				_ => ((object)(*(SkillSlot*)(&slot))/*cast due to .constrained prefix*/).ToString(), 
			};
		}

		public static void GrantAchievement(AchievementDef def, bool toast = true)
		{
			if (def == null)
			{
				return;
			}
			LocalUser localUser = LocalUser;
			if (localUser == null)
			{
				if (toast)
				{
					UiHelpers.Toast(Loc.T("no_profile"));
				}
				return;
			}
			UserAchievementManager userAchievementManager = AchievementManager.GetUserAchievementManager(localUser);
			if (userAchievementManager != null)
			{
				userAchievementManager.GrantAchievement(def);
			}
			if (localUser.userProfile != null && !string.IsNullOrEmpty(def.unlockableRewardIdentifier))
			{
				UnlockableDef unlockableDef = UnlockableCatalog.GetUnlockableDef(def.unlockableRewardIdentifier);
				if (Object.op_Implicit((Object)(object)unlockableDef))
				{
					localUser.userProfile.GrantUnlockable(unlockableDef);
				}
			}
			if (toast)
			{
				UiHelpers.Toast(Loc.F("ach_one", DisplayName(def)));
			}
		}

		public unsafe static void GrantAllAchievements()
		{
			//IL_0002: 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)
			//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)
			int num = 0;
			GenericStaticEnumerable<AchievementDef, Enumerator> allAchievementDefs = AchievementManager.allAchievementDefs;
			Enumerator enumerator = allAchievementDefs.GetEnumerator();
			try
			{
				while (((Enumerator)(ref enumerator)).MoveNext())
				{
					AchievementDef current = ((Enumerator)(ref enumerator)).Current;
					if (current != null)
					{
						GrantAchievement(current, toast: false);
						num++;
					}
				}
			}
			finally
			{
				((IDisposable)(*(Enumerator*)(&enumerator))/*cast due to .constrained prefix*/).Dispose();
			}
			UiHelpers.Toast(Loc.F("ach_many", num));
		}

		public static void GrantAchievementToTargets(AchievementDef def)
		{
			if (def == null)
			{
				return;
			}
			CleanupSelected();
			int num = 0;
			int num2 = 0;
			foreach (NetworkUser item in Targets())
			{
				if ((Object)(object)item == (Object)(object)LocalNetworkUser)
				{
					GrantAchievement(def, toast: false);
					num++;
				}
				else if (IsHost && AdminNet.SendGrant(item, def.identifier))
				{
					num2++;
				}
			}
			if (num2 > 0)
			{
				UiHelpers.Toast(Loc.F("admin_ach_sent", DisplayName(def)));
			}
			else if (num > 0)
			{
				UiHelpers.Toast(Loc.F("ach_one", DisplayName(def)));
			}
			else
			{
				UiHelpers.Toast(Loc.T("admin_need_sel"));
			}
		}

		public static void GrantAllAchievementsToTargets()
		{
			CleanupSelected();
			int num = 0;
			bool flag = false;
			foreach (NetworkUser item in Targets())
			{
				if ((Object)(object)item == (Object)(object)LocalNetworkUser)
				{
					GrantAllAchievements();
					flag = true;
				}
				else if (IsHost && AdminNet.SendGrantAll(item))
				{
					num++;
				}
			}
			if (num > 0)
			{
				UiHelpers.Toast(Loc.F("admin_ach_sent", num));
			}
			else if (!flag)
			{
				UiHelpers.Toast(Loc.T("admin_need_sel"));
			}
		}

		public static void SetTeam(TeamIndex team)
		{
			//IL_0039: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			if (!RequireHost(Loc.T("act_team")))
			{
				return;
			}
			foreach (NetworkUser item in Targets())
			{
				if (Object.op_Implicit((Object)(object)item.master))
				{
					item.master.teamIndex = team;
				}
				CharacterBody currentBody = item.GetCurrentBody();
				if (Object.op_Implicit((Object)(object)currentBody) && Object.op_Implicit((Object)(object)currentBody.teamComponent))
				{
					currentBody.teamComponent.teamIndex = team;
				}
			}
			UiHelpers.Toast(Loc.F("team_set", team));
		}

		public static void KillMaster(CharacterMaster master)
		{
			if (Object.op_Implicit((Object)(object)master) && RequireHost(Loc.T("act_kill")))
			{
				master.TrueKill();
			}
		}

		public static void KillTeam(TeamIndex team)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			if (!RequireHost(Loc.T("act_kill_team")))
			{
				return;
			}
			ReadOnlyCollection<TeamComponent> teamMembers = TeamComponent.GetTeamMembers(team);
			int num = 0;
			if (teamMembers != null)
			{
				foreach (TeamComponent item in new List<TeamComponent>(teamMembers))
				{
					if (Object.op_Implicit((Object)(object)item) && Object.op_Implicit((Object)(object)item.body) && Object.op_Implicit((Object)(object)item.body.master))
					{
						item.body.master.TrueKill();
						num++;
					}
				}
			}
			UiHelpers.Toast(Loc.F("killed", team, num));
		}

		public static void KillEnemies()
		{
			KillTeam((TeamIndex)2);
			KillTeam((TeamIndex)4);
			KillTeam((TeamIndex)3);
		}

		public static void SetNextStage(SceneDef scene)
		{
			if (Object.op_Implicit((Object)(object)scene) && InRun && RequireHost(Loc.T("act_stage")))
			{
				Run.instance.nextStageScene = scene;
				UiHelpers.Toast(Loc.F("next_stage", DisplayName(scene)));
			}
		}

		public static void TravelNow(SceneDef scene)
		{
			if (Object.op_Implicit((Object)(object)scene) && InRun && RequireHost(Loc.T("act_travel")))
			{
				Run.instance.nextStageScene = scene;
				if (Object.op_Implicit((Object)(object)Stage.instance))
				{
					Stage.instance.BeginAdvanceStage(scene);
				}
				else
				{
					Run.instance.AdvanceStage(scene);
				}
				UiHelpers.Toast(Loc.F("travel", DisplayName(scene)));
			}
		}

		public static void SetDifficulty(DifficultyIndex index)
		{
			//IL_001e: 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)
			if (InRun && RequireHost(Loc.T("act_diff")))
			{
				Run.instance.selectedDifficulty = index;
				Run.instance.RecalculateDifficultyCoefficent();
				UiHelpers.Toast(Loc.F("diff_set", index));
			}
		}

		public static void SetArtifact(ArtifactDef def, bool enabled)
		{
			if (Object.op_Implicit((Object)(object)def) && !((Object)(object)RunArtifactManager.instance == (Object)null) && RequireHost(Loc.T("act_art")))
			{
				RunArtifactManager.instance.SetArtifactEnabledServer(def, enabled);
			}
		}

		public static void GiveMoney(int amount)
		{
			if (!RequireHost(Loc.T("act_money")))
			{
				return;
			}
			foreach (NetworkUser item in Targets())
			{
				if (Object.op_Implicit((Object)(object)item.master))
				{
					item.master.GiveMoney((uint)Mathf.Max(0, amount));
				}
			}
			if (Object.op_Implicit((Object)(object)TeamManager.instance))
			{
				TeamManager.instance.GiveTeamMoney((TeamIndex)1, amount);
			}
			UiHelpers.Toast(Loc.F("gold_plus", amount));
		}

		public static void GiveLunar(uint amount)
		{
			foreach (NetworkUser item in Targets())
			{
				item.AwardLunarCoins(amount);
			}
			UiHelpers.Toast(Loc.F("lunar_plus", amount));
		}

		public static void SetTeamLevel(uint level)
		{
			if (Object.op_Implicit((Object)(object)TeamManager.instance) && RequireHost(Loc.T("act_level")))
			{
				TeamManager.instance.SetTeamLevel((TeamIndex)1, level);
				UiHelpers.Toast(Loc.F("level_set", level));
			}
		}

		public static void HealFull()
		{
			//IL_0066: 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)
			if (!RequireHost(Loc.T("act_heal")))
			{
				return;
			}
			foreach (NetworkUser item in Targets())
			{
				CharacterBody currentBody = item.GetCurrentBody();
				HealthComponent val = (Object.op_Implicit((Object)(object)currentBody) ? currentBody.healthComponent : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					val.Networkhealth = val.fullHealth;
					val.Networkshield = currentBody.maxShield;
					val.Heal(val.fullCombinedHealth, default(ProcChainMask), true);
				}
			}
			UiHelpers.Toast(Loc.T("healed"));
		}

		public static void ApplyStats(CharacterBody body, float health, float shield, float damage, float attack, float move, float regen, float crit, float jump, int jumps)
		{
			if (Object.op_Implicit((Object)(object)body) && RequireHost(Loc.T("act_stats")))
			{
				body.baseMaxHealth = Mathf.Max(1f, health);
				body.baseMaxShield = Mathf.Max(0f, shield);
				body.baseDamage = Mathf.Max(0f, damage);
				body.baseAttackSpeed = Mathf.Max(0.01f, attack);
				body.baseMoveSpeed = Mathf.Max(0f, move);
				body.baseRegen = regen;
				body.baseCrit = crit;
				body.baseJumpPower = jump;
				body.baseJumpCount = Mathf.Max(0, jumps);
				body.RecalculateStats();
				if (Object.op_Implicit((Object)(object)body.healthComponent))
				{
					body.healthComponent.Networkhealth = body.maxHealth;
					body.healthComponent.Networkshield = body.maxShield;
				}
				UiHelpers.Toast(Loc.T("stats_ok"));
			}
		}

		public static void TransformSurvivor(SurvivorDef survivor)
		{
			if (Object.op_Implicit((Object)(object)survivor) && Object.op_Implicit((Object)(object)survivor.bodyPrefab) && RequireHost(Loc.T("act_survivor")))
			{
				TransformBodyPrefab(survivor.bodyPrefab, DisplayName(survivor));
			}
		}

		public static void TransformBodyPrefab(GameObject prefab, string displayName = null)
		{
			//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_002a: Invalid comparison between Unknown and I4
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)prefab) || !RequireHost(Loc.T("act_survivor")))
			{
				return;
			}
			string text = ((Object)prefab).name;
			BodyIndex val = BodyCatalog.FindBodyIndex(prefab);
			if ((int)val != -1)
			{
				string bodyName = BodyCatalog.GetBodyName(val);
				if (!string.IsNullOrEmpty(bodyName))
				{
					text = bodyName;
				}
			}
			CharacterBody component = prefab.GetComponent<CharacterBody>();
			foreach (NetworkUser item in Targets())
			{
				if (Object.op_Implicit((Object)(object)item.master))
				{
					item.master.bodyPrefab = prefab;
					item.master.TransformBody(text);
					CopyPrefabSkills(item.master.GetBody(), component);
				}
			}
			if (string.IsNullOrEmpty(displayName))
			{
				displayName = DisplayName(component);
			}
			UiHelpers.Toast(Loc.F("body_set", displayName));
		}

		private static void CopyPrefabSkills(CharacterBody dest, CharacterBody src)
		{
			if (Object.op_Implicit((Object)(object)dest) && Object.op_Implicit((Object)(object)src) && Object.op_Implicit((Object)(object)dest.skillLocator) && Object.op_Implicit((Object)(object)src.skillLocator))
			{
				TryCopySkill(dest.skillLocator.primary, src.skillLocator.primary);
				TryCopySkill(dest.skillLocator.secondary, src.skillLocator.secondary);
				TryCopySkill(dest.skillLocator.utility, src.skillLocator.utility);
				TryCopySkill(dest.skillLocator.special, src.skillLocator.special);
			}
		}

		private static void TryCopySkill(GenericSkill dest, GenericSkill src)
		{
			if (Object.op_Implicit((Object)(object)dest) && Object.op_Implicit((Object)(object)src) && Object.op_Implicit((Object)(object)src.skillDef))
			{
				dest.SetBaseSkill(src.skillDef);
			}
		}

		public static void SetPortalFlags(bool gold, bool shop, bool ms, bool hidden)
		{
			TeleporterInteraction instance = TeleporterInteraction.instance;
			if (Object.op_Implicit((Object)(object)instance) && RequireHost(Loc.T("act_portals")))
			{
				instance.shouldAttemptToSpawnGoldshoresPortal = gold;
				instance.shouldAttemptToSpawnShopPortal = shop;
				instance.shouldAttemptToSpawnMSPortal = ms;
				instance.shouldAttemptToSpawnHiddenRealmsPortal = hidden;
				UiHelpers.Toast(Loc.T("portals_ok"));
			}
		}

		public static void ActivateTeleporter()
		{
			TeleporterInteraction instance = TeleporterInteraction.instance;
			CharacterBody localBody = LocalBody;
			if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)localBody) && RequireHost(Loc.T("act_tp_on")))
			{
				Interactor component = ((Component)localBody).GetComponent<Interactor>();
				if (Object.op_Implicit((Object)(object)component))
				{
					instance.OnInteractionBegin(component);
				}
				instance.NetworkisActivated = true;
				UiHelpers.Toast(Loc.T("tp_on"));
			}
		}

		public static void ChargeTeleporter()
		{
			TeleporterInteraction instance = TeleporterInteraction.instance;
			if (!Object.op_Implicit((Object)(object)instance) || !RequireHost(Loc.T("act_tp_charge")))
			{
				return;
			}
			HoldoutZoneController holdoutZoneController = instance.holdoutZoneController;
			if (Object.op_Implicit((Object)(object)holdoutZoneController))
			{
				if (Object.op_Implicit((Object)(object)instance.bossGroup) && Object.op_Implicit((Object)(object)instance.bossGroup.combatSquad) && instance.bossGroup.combatSquad.memberCount > 0)
				{
					holdoutZoneController.Network_charge = 0.99f;
				}
				else
				{
					holdoutZoneController.FullyChargeHoldoutZone();
				}
			}
			UiHelpers.Toast(Loc.T("tp_charged"));
		}

		public static void PingTeleporter()
		{
			//IL_005b: 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_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			TeleporterInteraction instance = TeleporterInteraction.instance;
			CharacterMaster localMaster = LocalMaster;
			if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)localMaster))
			{
				PingerController val = ((Component)localMaster).GetComponent<PingerController>() ?? (Object.op_Implicit((Object)(object)LocalBody) ? ((Component)LocalBody).GetComponent<PingerController>() : null);
				if (!Object.op_Implicit((Object)(object)val))
				{
					UiHelpers.Toast(Loc.T("no_pinger"));
					return;
				}
				PingInfo val2 = new PingInfo
				{
					active = true,
					origin = ((Component)instance).transform.position,
					normal = Vector3.up,
					targetNetworkIdentity = ((Component)instance).GetComponent<NetworkIdentity>()
				};
				val.CallCmdPing(val2);
				UiHelpers.Toast(Loc.T("tp_ping"));
			}
		}

		public static void ScanArea()
		{
			InvokeEquipmentFire("FireScanner", ref _fireScanner, "Скан");
		}

		public static void SpawnGummyClone()
		{
			InvokeEquipmentFire("FireGummyClone", ref _fireGummy, "Gummy Clone");
		}

		public static void SpawnDroneBackup()
		{
			InvokeEquipmentFire("FireDroneBackup", ref _fireDrones, "Дроны");
		}

		public static void SpawnArmy()
		{
			if (RequireHost(Loc.T("act_army")))
			{
				for (int i = 0; i < 3; i++)
				{
					SpawnGummyClone();
				}
				for (int j = 0; j < 4; j++)
				{
					SpawnDroneBackup();
				}
				UiHelpers.Toast(Loc.T("army_ok"));
			}
		}

		private static void InvokeEquipmentFire(string methodName, ref MethodInfo cached, string label)
		{
			if (!RequireHost(label))
			{
				return;
			}
			ResolveFireMethods();
			CharacterBody localBody = LocalBody;
			EquipmentSlot val = (Object.op_Implicit((Object)(object)localBody) ? localBody.equipmentSlot : null);
			if (!Object.op_Implicit((Object)(object)val) || cached == null)
			{
				UiHelpers.Toast(Loc.F("call_fail", label));
				return;
			}
			try
			{
				cached.Invoke(val, null);
				UiHelpers.Toast(label);
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)(methodName + " failed: " + ex.Message));
				UiHelpers.Toast(Loc.F("call_err", label));
			}
		}

		private static void ResolveFireMethods()
		{
			if (!_methodsResolved)
			{
				_methodsResolved = true;
				Type? typeFromHandle = typeof(EquipmentSlot);
				_fireScanner = typeFromHandle.GetMethod("FireScanner", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				_fireGummy = typeFromHandle.GetMethod("FireGummyClone", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				_fireDrones = typeFromHandle.GetMethod("FireDroneBackup", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			}
		}

		public static string UserLabel(NetworkUser user, int index)
		{
			if (!Object.op_Implicit((Object)(object)user))
			{
				return "Player " + index;
			}
			string text = (string.IsNullOrEmpty(user.userName) ? ("Player " + index) : user.userName);
			if ((Object)(object)user == (Object)(object)LocalNetworkUser)
			{
				text += Loc.T("you");
			}
			return text;
		}

		public static void TeleportSelectedToLocal()
		{
			CleanupSelected();
			if (SelectedUsers.Count == 0)
			{
				UiHelpers.Toast(Loc.T("tp_need_player"));
			}
			else
			{
				TeleportUsersToLocal(SelectedUsers);
			}
		}

		public static void TeleportAllToLocal()
		{
			TeleportUsersToLocal(AllUsers());
		}

		public static void TeleportUserToLocal(NetworkUser user)
		{
			if (Object.op_Implicit((Object)(object)user))
			{
				TeleportUsersToLocal((IEnumerable<NetworkUser>)(object)new NetworkUser[1] { user });
			}
		}

		public static void TeleportLocalToUser(NetworkUser user)
		{
			//IL_004b: 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_0060: 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_006a: 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_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_0080: Unknown result type (might be due to invalid IL or missing references)
			if (RequireHost(Loc.T("act_player_tp")))
			{
				CharacterBody localBody = LocalBody;
				CharacterBody val = (Object.op_Implicit((Object)(object)user) ? user.GetCurrentBody() : null);
				if (!Object.op_Implicit((Object)(object)localBody) || !Object.op_Implicit((Object)(object)val))
				{
					UiHelpers.Toast(Loc.T("tp_need_body"));
					return;
				}
				Vector3 position = val.footPosition + ((Component)val).transform.forward * -2.2f + Vector3.up * 0.4f;
				MoveBody(localBody, position);
				UiHelpers.Toast(Loc.F("tp_me_ok", UserLabel(user, 0)));
			}
		}

		private static void TeleportUsersToLocal(IEnumerable<NetworkUser> users)
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: 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)
			//IL_00a7: 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)
			if (!RequireHost(Loc.T("act_player_tp")))
			{
				return;
			}
			CharacterBody localBody = LocalBody;
			if (!Object.op_Implicit((Object)(object)localBody))
			{
				UiHelpers.Toast(Loc.T("tp_need_body"));
				return;
			}
			int num = 0;
			foreach (NetworkUser user in users)
			{
				if (Object.op_Implicit((Object)(object)user) && !((Object)(object)user == (Object)(object)LocalNetworkUser))
				{
					CharacterBody currentBody = user.GetCurrentBody();
					if (Object.op_Implicit((Object)(object)currentBody))
					{
						Vector3 val = Quaternion.Euler(0f, (float)num * 45f, 0f) * Vector3.forward * 2.4f;
						MoveBody(currentBody, localBody.footPosition + val + Vector3.up * 0.4f);
						num++;
					}
				}
			}
			UiHelpers.Toast((num > 0) ? Loc.F("tp_players_ok", num) : Loc.T("tp_no_others"));
		}

		private static void MoveBody(CharacterBody body, Vector3 position)
		{
			//IL_000a: 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)
			if (Object.op_Implicit((Object)(object)body))
			{
				TeleportHelper.TeleportBody(body, position);
				if (Object.op_Implicit((Object)(object)body.characterMotor) && Object.op_Implicit((Object)(object)((BaseCharacterController)body.characterMotor).Motor))
				{
					((BaseCharacterController)body.characterMotor).Motor.SetPosition(position, true);
				}
			}
		}

		public static void GiveRandomItem(int stacks)
		{
			if (RequireHost(Loc.T("act_items")))
			{
				ItemDef val = RandomVisibleItem();
				if (!Object.op_Implicit((Object)(object)val))
				{
					UiHelpers.Toast(Loc.T("fun_empty"));
				}
				else
				{
					GiveItem(val, Mathf.Max(1, stacks));
				}
			}
		}

		public static void GiveRandomEquipment()
		{
			if (!RequireHost(Loc.T("act_equip")))
			{
				return;
			}
			List<EquipmentDef> list = new List<EquipmentDef>();
			for (int i = 0; i < EquipmentCatalog.equipmentCount; i++)
			{
				EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef((EquipmentIndex)i);
				if (Object.op_Implicit((Object)(object)equipmentDef))
				{
					list.Add(equipmentDef);
				}
			}
			if (list.Count == 0)
			{
				UiHelpers.Toast(Loc.T("fun_empty"));
			}
			else
			{
				SetEquipment(list[Random.Range(0, list.Count)]);
			}
		}

		public static void RainPickups(int count)
		{
			//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_0056: 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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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 (!RequireHost(Loc.T("act_items")))
			{
				return;
			}
			CharacterBody localBody = LocalBody;
			if (!Object.op_Implicit((Object)(object)localBody))
			{
				UiHelpers.Toast(Loc.T("no_body"));
				return;
			}
			int num = 0;
			Vector3 val4 = default(Vector3);
			for (int i = 0; i < count; i++)
			{
				ItemDef val = RandomVisibleItem();
				if (Object.op_Implicit((Object)(object)val))
				{
					PickupIndex val2 = PickupCatalog.FindPickupIndex(val.itemIndex);
					Vector3 val3 = localBody.footPosition + Vector3.up * 10f + new Vector3(Random.Range(-7f, 7f), Random.Range(0f, 4f), Random.Range(-7f, 7f));
					((Vector3)(ref val4))..ctor(Random.Range(-6f, 6f), Random.Range(-2f, 2f), Random.Range(-6f, 6f));
					PickupDropletController.CreatePickupDroplet(val2, val3, val4);
					num++;
				}
			}
			UiHelpers.Toast(Loc.F("fun_rain_ok", num));
		}

		public static void RandomSurvivor()
		{
			if (!RequireHost(Loc.T("act_survivor")))
			{
				return;
			}
			List<SurvivorDef> list = new List<SurvivorDef>();
			foreach (SurvivorDef allSurvivorDef in SurvivorCatalog.allSurvivorDefs)
			{
				if (Object.op_Implicit((Object)(object)allSurvivorDef) && !allSurvivorDef.hidden && Object.op_Implicit((Object)(object)allSurvivorDef.bodyPrefab))
				{
					list.Add(allSurvivorDef);
				}
			}
			if (list.Count == 0)
			{
				UiHelpers.Toast(Loc.T("fun_empty"));
			}
			else
			{
				TransformSurvivor(list[Random.Range(0, list.Count)]);
			}
		}

		public static void LaunchUp(float force)
		{
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			if (!RequireHost(Loc.T("act_stats")))
			{
				return;
			}
			foreach (NetworkUser item in Targets())
			{
				CharacterBody val = (Object.op_Implicit((Object)(object)item) ? item.GetCurrentBody() : null);
				CharacterMotor val2 = (Object.op_Implicit((Object)(object)val) ? val.characterMotor : null);
				if (Object.op_Implicit((Object)(object)val2))
				{
					if (Object.op_Implicit((Object)(object)((BaseCharacterController)val2).Motor))
					{
						((BaseCharacterController)val2).Motor.ForceUnground(0.1f);
					}
					val2.velocity = new Vector3(val2.velocity.x, force, val2.velocity.z);
				}
			}
			UiHelpers.Toast(Loc.T("fun_yeet"));
		}

		public static void FunnyKick(bool takeHealth)
		{
			if (!RequireHost(Loc.T("act_stats")))
			{
				return;
			}
			CleanupSelected();
			int num = 0;
			foreach (NetworkUser item in KickTargets())
			{
				if (TryFunnyKick(item, takeHealth))
				{
					num++;
				}
			}
			UiHelpers.Toast(Loc.F(takeHealth ? "fun_kick_hp_ok" : "fun_kick_ok", num));
		}

		public static void FunnyKickUser(NetworkUser user, bool takeHealth)
		{
			if (Object.op_Implicit((Object)(object)user) && RequireHost(Loc.T("act_stats")) && TryFunnyKick(user, takeHealth))
			{
				UiHelpers.Toast(Loc.F(takeHealth ? "fun_kick_hp_ok" : "fun_kick_ok", 1));
			}
		}

		private static IEnumerable<NetworkUser> KickTargets()
		{
			if (SelectedUsers.Count > 0)
			{
				foreach (NetworkUser selectedUser in SelectedUsers)
				{
					yield return selectedUser;
				}
				yield break;
			}
			int others = 0;
			foreach (NetworkUser item in AllUsers())
			{
				if (Object.op_Implicit((Object)(object)item) && !((Object)(object)item == (Object)(object)LocalNetworkUser))
				{
					others++;
					yield return item;
				}
			}
			if (others == 0 && Object.op_Implicit((Object)(object)LocalNetworkUser))
			{
				yield return LocalNetworkUser;
			}
		}

		private static bool TryFunnyKick(NetworkUser user, bool takeHealth)
		{
			//IL_0051: 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_006a: 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_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: 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_00ad: 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_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)
			CharacterBody val = (Object.op_Implicit((Object)(object)user) ? user.GetCurrentBody() : null);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return false;
			}
			CharacterMotor characterMotor = val.characterMotor;
			if (Object.op_Implicit((Object)(object)characterMotor))
			{
				if (Object.op_Implicit((Object)(object)((BaseCharacterController)characterMotor).Motor))
				{
					((BaseCharacterController)characterMotor).Motor.ForceUnground(0.1f);
				}
				Vector3 val2 = ((Component)val).transform.right * Random.Range(-2.2f, 2.2f);
				Vector3 val3 = -((Component)val).transform.forward * Random.Range(1.2f, 3.2f);
				characterMotor.velocity = new Vector3(val2.x + val3.x, Random.Range(11f, 15f), val2.z + val3.z);
			}
			if (takeHealth && Object.op_Implicit((Object)(object)val.healthComponent))
			{
				HealthComponent healthComponent = val.healthComponent;
				float num = Mathf.Max(1f, val.maxHealth * 0.1f);
				float networkhealth = Mathf.Max(1f, healthComponent.health - num);
				healthComponent.Networkhealth = networkhealth;
			}
			PlayKickSound(((Component)val).gameObject);
			return true;
		}

		private static void PlayKickSound(GameObject go)
		{
			if (Object.op_Implicit((Object)(object)go))
			{
				Util.PlaySound("Play_item_proc_behemoth", go);
				Util.PlaySound("Play_char_merc_m1", go);
				Util.PlaySound("Play_item_use_tonic", go);
			}
		}

		public static void ToastJoke()
		{
			UiHelpers.Toast(Loc.T("fun_q" + Random.Range(0, 8)));
		}

		public static void ToggleRandomArtifact()
		{
			if ((Object)(object)RunArtifactManager.instance == (Object)null || !RequireHost(Loc.T("act_art")))
			{
				return;
			}
			List<ArtifactDef> list = new List<ArtifactDef>();
			for (int i = 0; i < ArtifactCatalog.artifactCount; i++)
			{
				ArtifactDef artifactDef = ArtifactCatalog.GetArtifactDef((ArtifactIndex)i);
				if (Object.op_Implicit((Object)(object)artifactDef))
				{
					list.Add(artifactDef);
				}
			}
			if (list.Count == 0)
			{
				UiHelpers.Toast(Loc.T("fun_empty"));
				return;
			}
			ArtifactDef val = list[Random.Range(0, list.Count)];
			bool flag = !RunArtifactManager.instance.IsArtifactEnabled(val);
			SetArtifact(val, flag);
			UiHelpers.Toast((flag ? "+ " : "- ") + DisplayName(val));
		}

		public static void RainChests(int count)
		{
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: 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_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: 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_014c: Expected O, but got Unknown
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Expected O, but got Unknown
			//IL_0181: 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_01a3: Unknown result type (might be due to invalid IL or missing references)
			if (!RequireHost(Loc.T("act_army")))
			{
				return;
			}
			CharacterBody localBody = LocalBody;
			if (!Object.op_Implicit((Object)(object)localBody))
			{
				UiHelpers.Toast(Loc.T("no_body"));
				return;
			}
			List<InteractableSpawnCard> list = new List<InteractableSpawnCard>();
			InteractableSpawnCard[] array = Resources.FindObjectsOfTypeAll<InteractableSpawnCard>();
			foreach (InteractableSpawnCard val in array)
			{
				if (Object.op_Implicit((Object)(object)val) && ContainsAny(((Object)val).name ?? "", "Chest", "Barrel", "TripleShop", "Scrapper", "Casino", "LunarShop", "CategoryChest"))
				{
					list.Add(val);
				}
			}
			if (list.Count == 0)
			{
				UiHelpers.Toast(Loc.T("fun_empty"));
				return;
			}
			int num = 0;
			Xoroshiro128Plus rng = RoR2Application.rng;
			for (int j = 0; j < count; j++)
			{
				InteractableSpawnCard val2 = list[Random.Range(0, list.Count)];
				Vector3 val3 = localBody.footPosition + new Vector3(Random.Range(-10f, 10f), Random.Range(6f, 14f), Random.Range(-10f, 10f));
				DirectorPlacementRule val4 = new DirectorPlacementRule
				{
					placementMode = (PlacementMode)0,
					position = val3
				};
				DirectorSpawnRequest val5 = new DirectorSpawnRequest((SpawnCard)(object)val2, val4, rng);
				GameObject val6 = (Object.op_Implicit((Object)(object)DirectorCore.instance) ? DirectorCore.instance.TrySpawnObject(val5) : null);
				if (!Object.op_Implicit((Object)(object)val6))
				{
					val6 = ((SpawnCard)val2).DoSpawn(val3, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f), val5).spawnedInstance;
				}
				if (Object.op_Implicit((Object)(object)val6))
				{
					num++;
				}
			}
			PlayFunnySound(((Component)localBody).gameObject);
			UiHelpers.Toast(Loc.F("fun_chests_ok", num));
		}

		public static void GoldExplosion()
		{
			//IL_0053: 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_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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			if (!RequireHost(Loc.T("act_money")))
			{
				return;
			}
			CharacterBody localBody = LocalBody;
			if (!Object.op_Implicit((Object)(object)localBody))
			{
				UiHelpers.Toast(Loc.T("no_body"));
				return;
			}
			GiveMoney(750);
			GameObject val = FindMoneyPackPrefab();
			if (Object.op_Implicit((Object)(object)val))
			{
				for (int i = 0; i < 16; i++)
				{
					Vector3 val2 = localBody.corePosition + Vector3.up * 1.2f;
					GameObject val3 = Object.Instantiate<GameObject>(val, val2, Random.rotation);
					if (Object.op_Implicit((Object)(object)val3) && NetworkServer.active)
					{
						NetworkServer.Spawn(val3);
					}
					Rigidbody val4 = (Object.op_Implicit((Object)(object)val3) ? val3.GetComponent<Rigidbody>() : null);
					if (Object.op_Implicit((Object)(object)val4))
					{
						val4.velocity = Random.onUnitSphere * 18f + Vector3.up * 10f;
					}
				}
			}
			else
			{
				RainPickups(18);
			}
			LaunchUp(28f);
			PlayFunnySound(((Component)localBody).gameObject);
			UiHelpers.Toast(Loc.T("fun_gold_ok"));
		}

		public static void SetPlayerNick(string nick)
		{
			if (string.IsNullOrWhiteSpace(nick))
			{
				UiHelpers.Toast(Loc.T("fun_nick_empty"));
				return;
			}
			nick = nick.Trim();
			if (nick.Length > 24)
			{
				nick = nick.Substring(0, 24);
			}
			NetworkUser localNetworkUser = LocalNetworkUser;
			if (Object.op_Implicit((Object)(object)localNetworkUser))
			{
				try
				{
					localNetworkUser.userName = nick;
				}
				catch
				{
					(typeof(NetworkUser).GetField("userName") ?? typeof(NetworkUser).GetField("<userName>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic))?.SetValue(localNetworkUser, nick);
				}
			}
			LocalUser localUser = LocalUser;
			if (localUser != null && localUser.userProfile != null)
			{
				try
				{
					localUser.userProfile.name = nick;
				}
				catch
				{
				}
			}
			Chat.AddMessage(Loc.F("fun_nick_ok", nick));
			UiHelpers.Toast(Loc.F("fun_nick_ok", nick));
		}

		public static void BecomeBoss()
		{
			if (!RequireHost(Loc.T("act_survivor")))
			{
				return;
			}
			CharacterBody localBody = LocalBody;
			List<GameObject> list = new List<GameObject>();
			int bodyCount = BodyCatalog.bodyCount;
			for (int i = 0; i < bodyCount; i++)
			{
				GameObject bodyPrefab = BodyCatalog.GetBodyPrefab((BodyIndex)i);
				CharacterBody bodyPrefabBodyComponent = BodyCatalog.GetBodyPrefabBodyComponent((BodyIndex)i);
				if (Object.op_Implicit((Object)(object)bodyPrefab) && Object.op_Implicit((Object)(object)bodyPrefabBodyComponent) && bodyPrefabBodyComponent.isChampion && !NameLooksLikeOther(((Object)bodyPrefab).name))
				{
					list.Add(bodyPrefab);
				}
			}
			if (list.Count > 0)
			{
				TransformBodyPrefab(list[Random.Range(0, list.Count)]);
			}
			CheatRuntime.GodMode = true;
			CheatRuntime.Disco = true;
			CheatRuntime.BodyScale = 2.4f;
			if (Object.op_Implicit((Object)(object)localBody))
			{
				PlayBossFanfare(((Component)localBody).gameObject);
			}
			Chat.AddMessage(Loc.T("fun_boss_chat"));
			UiHelpers.Toast(Loc.T("fun_boss_ok"));
		}

		private static GameObject FindMoneyPackPrefab()
		{
			GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
			foreach (GameObject val in array)
			{
				if (Object.op_Implicit((Object)(object)val) && ContainsAny(((Object)val).name ?? "", "BonusMoneyPack", "MoneyPickup", "MoneyPack"))
				{
					return val;
				}
			}
			return null;
		}

		private static void PlayFunnySound(GameObject go)
		{
			if (Object.op_Implicit((Object)(object)go))
			{
				Util.PlaySound("Play_UI_achievement", go);
				Util.PlaySound("Play_item_use_tonic", go);
			}
		}

		private static void PlayBossFanfare(GameObject go)
		{
			if (Object.op_Implicit((Object)(object)go))
			{
				Util.PlaySound("Play_UI_achievement", go);
				Util.PlaySound("Play_moonBrother_spawn", go);
				Util.PlaySound("Play_captain_shift_ready", go);
				Util.PlaySound("Play_env_hiddenLab_unlock", go);
			}
		}

		private static ItemDef RandomVisibleItem()
		{
			List<ItemDef> list = new List<ItemDef>();
			for (int i = 0; i < ItemCatalog.itemCount; i++)
			{
				ItemDef itemDef = ItemCatalog.GetItemDef((ItemIndex)i);
				if (Object.op_Implicit((Object)(object)itemDef) && !itemDef.hidden)
				{
					list.Add(itemDef);
				}
			}
			if (list.Count == 0)
			{
				return null;
			}
			return list[Random.Range(0, list.Count)];
		}

		public static bool Matches(string query, params string[] parts)
		{
			if (string.IsNullOrWhiteSpace(query))
			{
				return true;
			}
			string value = query.Trim();
			foreach (string text in parts)
			{
				if (!string.IsNullOrEmpty(text) && text.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0)
				{
					return true;
				}
			}
			return false;
		}

		public static string TierLabel(ItemTier tier)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected I4, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			switch ((int)tier)
			{
			case 0:
				return Loc.T("tier_white");
			case 1:
				return Loc.T("tier_green");
			case 2:
				return Loc.T("tier_red");
			case 3:
				return Loc.T("tier_lunar");
			case 4:
				return Loc.T("tier_boss");
			case 6:
			case 7:
			case 8:
			case 9:
				return Loc.T("tier_void");
			case 10:
				return Loc.T("tier_food");
			default:
				try
				{
					ItemTierDef itemTierDef = ItemTierCatalog.GetItemTierDef(tier);
					if (Object.op_Implicit((Object)(object)itemTierDef) && !string.IsNullOrEmpty(((Object)itemTierDef).name))
					{
						return ((Object)itemTierDef).name;
					}
				}
				catch
				{
				}
				return Loc.T("tier_other");
			}
		}

		public static Color TierColor(ItemTier tier)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected I4, but got Unknown
			//IL_0046: 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_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: 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)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: 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_00f8: Unknown result type (might be due to invalid IL or missing references)
			switch ((int)tier)
			{
			case 0:
				return new Color(0.85f, 0.85f, 0.85f);
			case 1:
				return new Color(0.45f, 0.9f, 0.45f);
			case 2:
				return new Color(1f, 0.35f, 0.35f);
			case 3:
				return new Color(0.45f, 0.75f, 1f);
			case 4:
				return new Color(1f, 0.85f, 0.3f);
			case 6:
			case 7:
			case 8:
			case 9:
				return new Color(0.75f, 0.4f, 1f);
			case 10:
				return new Color(1f, 0.6f, 0.25f);
			default:
				try
				{
					ItemTierDef itemTierDef = ItemTierCatalog.GetItemTierDef(tier);
					if (Object.op_Implicit((Object)(object)itemTierDef))
					{
						return Color32.op_Implicit(ColorCatalog.GetColor(itemTierDef.colorIndex));
					}
				}
				catch
				{
				}
				return Color.gray;
			}
		}
	}
	internal static class HudClickBlocker
	{
		private static readonly List<GraphicRaycaster> Raycasters = new List<GraphicRaycaster>();

		private static readonly List<bool> RaycasterWasEnabled = new List<bool>();

		private static readonly List<EventSystem> EventSystems = new List<EventSystem>();

		private static bool _blocked;

		private static float _nextScan;

		public static void Tick(bool blockHud)
		{
			if (blockHud)
			{
				Block();
			}
			else
			{
				Restore();
			}
		}

		private static void Block()
		{
			if (_blocked && Time.unscaledTime < _nextScan)
			{
				KeepDisabled();
				return;
			}
			Restore();
			GraphicRaycaster[] array = Object.FindObjectsOfType<GraphicRaycaster>();
			foreach (GraphicRaycaster val in array)
			{
				if (Object.op_Implicit((Object)(object)val))
				{
					Raycasters.Add(val);
					RaycasterWasEnabled.Add(((Behaviour)val).enabled);
					if (((Behaviour)val).enabled)
					{
						((Behaviour)val).enabled = false;
					}
				}
			}
			EventSystem[] array2 = Object.FindObjectsOfType<EventSystem>();
			foreach (EventSystem val2 in array2)
			{
				if (Object.op_Implicit((Object)(object)val2))
				{
					EventSystems.Add(val2);
					val2.sendNavigationEvents = false;
				}
			}
			_blocked = true;
			_nextScan = Time.unscaledTime + 2f;
		}

		private static void KeepDisabled()
		{
			for (int i = 0; i < Raycasters.Count; i++)
			{
				if (Object.op_Implicit((Object)(object)Raycasters[i]) && ((Behaviour)Raycasters[i]).enabled)
				{
					((Behaviour)Raycasters[i]).enabled = false;
				}
			}
		}

		private static void Restore()
		{
			if (!_blocked && Raycasters.Count == 0 && EventSystems.Count == 0)
			{
				return;
			}
			for (int i = 0; i < Raycasters.Count; i++)
			{
				if (Object.op_Implicit((Object)(object)Raycasters[i]) && RaycasterWasEnabled[i])
				{
					((Behaviour)Raycasters[i]).enabled = true;
				}
			}
			for (int j = 0; j < EventSystems.Count; j++)
			{
				if (Object.op_Implicit((Object)(object)EventSystems[j]))
				{
					EventSystems[j].sendNavigationEvents = true;
				}
			}
			Raycasters.Clear();
			RaycasterWasEnabled.Clear();
			EventSystems.Clear();
			_blocked = false;
			_nextScan = 0f;
		}
	}
	internal enum PanelLanguage
	{
		Ru,
		En,
		Es
	}
	internal static class Loc
	{
		public static PanelLanguage Current = PanelLanguage.Ru;

		public static int Generation;

		private static readonly Dictionary<PanelLanguage, Dictionary<string, string>> Table = new Dictionary<PanelLanguage, Dictionary<string, string>>
		{
			[PanelLanguage.Ru] = Ru(),
			[PanelLanguage.En] = En(),
			[PanelLanguage.Es] = Es()
		};

		public static string GameCode => Current switch
		{
			PanelLanguage.En => "en", 
			PanelLanguage.Es => "es", 
			_ => "ru", 
		};

		public static string T(string key)
		{
			if (Table.TryGetValue(Current, out var value) && value.TryGetValue(key, out var value2))
			{
				return value2;
			}
			if (Table[PanelLanguage.En].TryGetValue(key, out var value3))
			{
				return value3;
			}
			return key;
		}

		public static string F(string key, params object[] args)
		{
			return string.Format(T(key), args);
		}

		public static void Set(PanelLa