Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of OmniModMenu v1.0.0
plugins/OmniModMenu.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using AK.Wwise; using BepInEx; using BepInEx.Configuration; using HG; using HarmonyLib; using KinematicCharacterController; using Rewired; using RoR2; using RoR2.CameraModes; using RoR2.ConVar; using RoR2.ExpansionManagement; using RoR2.Networking; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace RoR2ModMenu; internal class BindAction { public string id; public string en; public string ru; public string uk; public ConfigEntry<KeyCode> k1; public ConfigEntry<KeyCode> k2; public KeyCode d1; public KeyCode d2; public Action run; public KeyCode Get(int slot) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (slot != 0) { return k2.Value; } return k1.Value; } public void Set(int slot, KeyCode k) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (slot == 0) { k1.Value = k; } else { k2.Value = k; } } } internal class PendingBind { public int action; public int slot; public KeyCode key; public string holders; public bool gameConflict; } [BepInPlugin("user.omni.modmenu", "Omni Mod Menu", "1.0.0")] public class ModMenu : BaseUnityPlugin { private class Feat { public string name; public string en; public int tab = -1; public Action act; public Func<bool> on; } private delegate void RowDraw(Entry e, Rect r); private const int TPlayer = 0; private const int TPlayers = 1; private const int TItems = 2; private const int TEquip = 3; private const int TChar = 4; private const int TTele = 5; private const int TDrones = 6; private const int TSpawn = 7; private const int TStats = 8; private const int TScan = 9; private const int TWorld = 10; private const int TMusic = 11; private const int TSet = 12; private readonly List<BindAction> binds = new List<BindAction>(); private int bwAction = -1; private int bwSlot; private PendingBind pend; private Dictionary<KeyCode, List<string>> gameKeys = new Dictionary<KeyCode, List<string>>(); private float gameKeysAt = -100f; private readonly List<PortalInfo> portals = new List<PortalInfo>(); private bool hideGameHud; private bool hudApplied; private object volMsx; private Dictionary<string, double> durations; private ConfigEntry<bool> cfgFps; private ConfigEntry<bool> cfgFpsOutline; private ConfigEntry<int> cfgFpsMode; private ConfigEntry<int> cfgFpsColorMode; private ConfigEntry<int> cfgFpsPos; private ConfigEntry<int> cfgFpsSize; private ConfigEntry<string> cfgFpsHex; private readonly List<float> frameTimes = new List<float>(600); private float fpsCur; private float fpsAvg; private float fpsMin; private float fpsMax; private float fpsLow1; private float frameMs; private float fpsNext; private float fpsAccum; private int fpsFrames; private ConfigEntry<bool> cfgPing; private ConfigEntry<int> cfgPingMode; private ConfigEntry<int> cfgPingPos; private readonly List<float> pingSamples = new List<float>(240); private float pingCur; private float pingAvg; private float pingMin; private float pingMax; private float pingJitter; private float pingNext; private readonly Dictionary<int, PlayerMods> pmods = new Dictionary<int, PlayerMods>(); private static ModMenu I; private Harmony harmony; private bool ncPrimary; private bool ncSecondary; private bool ncUtility; private bool ncSpecial; private bool ncEquip; private Transform tpCache; private float kickArmedUntil; private int kickArmedId; private readonly List<ControllerMap> blockedMaps = new List<ControllerMap>(); private bool inputBlocked; private bool aimbot; private bool aimVisible = true; private float aimFov = 25f; private float aimRange = 120f; private float aimSmooth = 0.3f; private MethodInfo aimSetter; private bool espEnemies; private bool espPlayers; private bool snapEnemies; private bool snapPlayers; private bool snapItems; private static readonly Color colEnemy = new Color(1f, 0.3f, 0.3f); private static readonly Color colBoss = new Color(1f, 0.75f, 0.2f); private static readonly Color colPlayer = new Color(0.3f, 1f, 0.45f); private static readonly Color colAlly = new Color(0.35f, 0.85f, 1f); private string globalSearch = ""; private static readonly string[] LangCodes = new string[12] { "en", "uk", "ru", "de", "es", "fr", "it", "pt", "tr", "ja", "ko", "zh" }; private static readonly string[] LangNames = new string[12] { "English", "Українська", "Русский", "Deutsch", "Español", "Français", "Italiano", "Português (BR)", "Türkçe", "日本語", "한국어", "简体中文" }; private int lang; private readonly Dictionary<string, string>[] packs = new Dictionary<string, string>[LangCodes.Length]; private ConfigEntry<string> cfgLang; private ConfigEntry<float> cfgScale; private ConfigEntry<float> cfgOpacity; private ConfigEntry<int> cfgTheme; private ConfigEntry<int> cfgBgTheme; private ConfigEntry<int> cfgHudMode; private ConfigEntry<int> cfgHudCorner; private ConfigEntry<bool> cfgHud; private ConfigEntry<string> cfgAccentHex; private ConfigEntry<string> cfgBgHex; private ConfigEntry<string> cfgGradAHex; private ConfigEntry<string> cfgGradBHex; private bool god; private bool infJumps; private bool fly; private bool noclip; private bool freeInteract; private bool noEnemies; private float flySpeed = 20f; private float timeScale = 1f; private bool flyWasActive; private bool gravityOff; private bool noclipApplied; private int savedLayers; private float[] hpMul = new float[4] { 1f, 1f, 1f, 1f }; private float[] dmgMul = new float[4] { 1f, 1f, 1f, 1f }; private float speedMul = 1f; private float atkSpeedMul = 1f; private float jumpMul = 1f; private readonly Dictionary<int, float[]> origStats = new Dictionary<int, float[]>(); private List<Entry> items; private List<Entry> equips; private List<Entry> survivors; private List<Entry> allBodies; private List<Entry> enemies; private List<Entry> drones; private List<Entry> scenes; private bool catalogsBuilt; private readonly List<ScanItem> scan = new List<ScanItem>(); private float nextScan; private bool espOn; private bool espInteract = true; private bool espPickups = true; private bool espContents = true; private float espRange = 150f; private string espFilter = ""; private string status = ""; private float statusUntil; private readonly HashSet<MPEventSystem> cursorHeld = new HashSet<MPEventSystem>(); private readonly Dictionary<string, Sprite> refCache = new Dictionary<string, Sprite>(); private MusicTrackDef musicOverride; private List<Entry> tracks; private readonly Dictionary<List<Entry>, float> lockChecked = new Dictionary<List<Entry>, float>(); private bool open; private Rect win = new Rect(60f, 30f, 1000f, 720f); private bool dragging; private bool resizing; private Vector2 dragOff; private int tab; private readonly Vector2[] scrolls = (Vector2[])(object)new Vector2[20]; private float listViewH = 400f; private string itemSearch = ""; private string equipSearch = ""; private string charSearch = ""; private string droneSearch = ""; private string enemySearch = ""; private string sceneSearch = ""; private string scanSearch = ""; private string musicSearch = ""; private string countStr = "1"; private int count = 1; private string moneyStr = "10000"; private int tierMask = 127; private bool ownedOnly; private bool showAllBodies; private int tpSub; private int spawnTeam = 2; private static readonly Color cText = new Color(0.92f, 0.94f, 0.98f, 1f); private static readonly Color cDim = new Color(0.58f, 0.63f, 0.72f, 1f); private static readonly Color cOff = new Color(0.45f, 0.46f, 0.5f, 1f); private Color cBg = new Color(0.075f, 0.085f, 0.115f); private Color cPanel; private Color cBtn; private Color cBtnHover; private Color cChip; private Color cChipOn; private Color cChipOnHover; private Color cField; private Color cFieldFocus; private Color cTileInner; private Color cRowA; private Color cRowB; private Color cAccent = new Color(0.22f, 0.62f, 0.95f); private Color cAccentHover; private Color cAccent2; private string themeSig = ""; private static readonly Color[] presetAccent = (Color[])(object)new Color[7] { new Color(0.22f, 0.62f, 0.95f), new Color(0.9f, 0.25f, 0.3f), new Color(0.18f, 0.76f, 0.5f), new Color(0.62f, 0.4f, 0.95f), new Color(0.98f, 0.68f, 0.15f), new Color(0.96f, 0.38f, 0.68f), new Color(0.75f, 0.78f, 0.85f) }; private static readonly Color[] gradA = (Color[])(object)new Color[3] { new Color(1f, 0.55f, 0.2f), new Color(0.2f, 0.6f, 1f), new Color(0.65f, 0.3f, 1f) }; private static readonly Color[] gradB = (Color[])(object)new Color[3] { new Color(0.95f, 0.25f, 0.55f), new Color(0.15f, 0.85f, 0.7f), new Color(0.1f, 0.9f, 1f) }; private static readonly Color[] bgPreset = (Color[])(object)new Color[6] { new Color(0.075f, 0.085f, 0.115f), new Color(0.03f, 0.03f, 0.035f), new Color(0.115f, 0.115f, 0.125f), new Color(0.045f, 0.075f, 0.16f), new Color(0.045f, 0.105f, 0.085f), new Color(0.125f, 0.055f, 0.085f) }; private GUISkin defaultSkin; private GUISkin skin; private GUIStyle sWin; private GUIStyle sPanel; private GUIStyle sBtn; private GUIStyle sBtnAccent; private GUIStyle sBtnOff; private GUIStyle sTab; private GUIStyle sTabOn; private GUIStyle sLabel; private GUIStyle sDim; private GUIStyle sTitle; private GUIStyle sHeader; private GUIStyle sWrap; private GUIStyle sField; private GUIStyle sSwitch; private GUIStyle sChip; private GUIStyle sEsp; private GUIStyle sEspBg; private GUIStyle sSmallBtn; private GUIStyle sFlat; private GUIStyle sFlatSm; private GUIStyle sDot; private Texture2D tCursor; private Texture2D tGrad; private readonly List<Texture2D> texPool = new List<Texture2D>(); private static FieldInfo optType; private static FieldInfo optValue; private static readonly Color[] tierColors = (Color[])(object)new Color[7] { new Color(0.88f, 0.88f, 0.88f), new Color(0.45f, 0.85f, 0.45f), new Color(0.95f, 0.35f, 0.35f), new Color(0.95f, 0.85f, 0.3f), new Color(0.45f, 0.7f, 1f), new Color(0.78f, 0.48f, 0.95f), new Color(0.6f, 0.62f, 0.68f) }; private int selPlayer; private int plSub; private string plItemSearch = ""; private string plEquipSearch = ""; private string plMoneyStr = "10000"; private static readonly Color fpsGreen = new Color(0.2f, 1f, 0.35f); private GUIStyle sFps; private int xrayMask = 255; private bool AllSkillsNoCd { get { if (ncPrimary && ncSecondary && ncUtility) { return ncSpecial; } return false; } set { ncPrimary = (ncSecondary = (ncUtility = (ncSpecial = value))); } } private PlayerCharacterMasterController Pcmc { get { if (PlayerCharacterMasterController.instances.Count <= 0) { return null; } return PlayerCharacterMasterController.instances[0]; } } private CharacterMaster Master { get { PlayerCharacterMasterController pcmc = Pcmc; if (!((Object)(object)pcmc != (Object)null)) { return null; } return pcmc.master; } } private CharacterBody Body { get { CharacterMaster master = Master; if (!((Object)(object)master != (Object)null)) { return null; } return master.GetBody(); } } private void AddBind(string id, string en, string ru, string uk, KeyCode d1, KeyCode d2, Action run) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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) BindAction bindAction = new BindAction(); bindAction.id = id; bindAction.en = en; bindAction.ru = ru; bindAction.uk = uk; bindAction.d1 = d1; bindAction.d2 = d2; bindAction.run = run; bindAction.k1 = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", id + "_primary", d1, "Primary key for: " + en); bindAction.k2 = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", id + "_secondary", d2, "Secondary key for: " + en); binds.Add(bindAction); } private void InitBinds() { AddBind("menu", "Open / close menu", "Открыть / закрыть меню", "Відкрити / закрити меню", (KeyCode)277, (KeyCode)0, delegate { open = !open; }); AddBind("god", "God mode", "Бессмертие", "Безсмертя", (KeyCode)0, (KeyCode)0, delegate { god = !god; }); AddBind("fly", "Fly", "Полёт", "Політ", (KeyCode)0, (KeyCode)0, delegate { fly = !fly; }); AddBind("noclip", "Noclip", "Ноуклип", "Ноуклип", (KeyCode)0, (KeyCode)0, delegate { noclip = !noclip; }); AddBind("jumps", "Infinite jumps", "Бесконечные прыжки", "Нескінченні стрибки", (KeyCode)0, (KeyCode)0, delegate { infJumps = !infJumps; }); AddBind("cooldown", "No skill cooldowns", "Без перезарядки умений", "Без перезарядки вмінь", (KeyCode)0, (KeyCode)0, delegate { AllSkillsNoCd = !AllSkillsNoCd; }); AddBind("aimbot", "Aimbot", "Аимбот", "Аімбот", (KeyCode)0, (KeyCode)0, delegate { aimbot = !aimbot; }); AddBind("free", "Free purchases", "Бесплатные покупки", "Безкоштовні покупки", (KeyCode)0, (KeyCode)0, delegate { freeInteract = !freeInteract; }); AddBind("xray", "X-ray", "Рентген", "Рентген", (KeyCode)0, (KeyCode)0, delegate { espOn = !espOn; }); AddBind("hud", "Active features overlay", "Список активных функций", "Список активних функцій", (KeyCode)0, (KeyCode)0, delegate { cfgHud.Value = !cfgHud.Value; }); AddBind("heal", "Full heal", "Полное лечение", "Повне лікування", (KeyCode)0, (KeyCode)0, HealFull); AddBind("hidehud", "Hide HUD", "Скрыть HUD", "Сховати HUD", (KeyCode)0, (KeyCode)0, delegate { hideGameHud = !hideGameHud; }); AddBind("fps", "FPS counter", "Счётчик FPS", "Лічильник FPS", (KeyCode)0, (KeyCode)0, delegate { cfgFps.Value = !cfgFps.Value; }); AddBind("ping", "Ping counter", "Счётчик пинга", "Лічильник пінгу", (KeyCode)0, (KeyCode)0, delegate { cfgPing.Value = !cfgPing.Value; }); } private static string KeyText(KeyCode k) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) if ((int)k != 0) { return ((object)k).ToString(); } return "-"; } private static bool Down(KeyCode k) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) if ((int)k != 0) { return Input.GetKeyDown(k); } return false; } private void ProcessHotkeys() { //IL_0055: 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) if (bwAction >= 0 || pend != null) { return; } bool flag = open && GUIUtility.keyboardControl != 0; for (int i = 0; i < binds.Count; i++) { BindAction bindAction = binds[i]; if ((!flag || !(bindAction.id != "menu")) && (Down(bindAction.k1.Value) || Down(bindAction.k2.Value))) { bindAction.run(); } } } private string BindName(BindAction b) { return T(b.en, b.ru, b.uk); } private void RefreshGameKeys() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) if (Time.unscaledTime < gameKeysAt + 3f) { return; } gameKeysAt = Time.unscaledTime; Dictionary<KeyCode, List<string>> dictionary = new Dictionary<KeyCode, List<string>>(); try { LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); if (firstLocalUser != null && firstLocalUser.inputPlayer != null) { foreach (ControllerMap map in firstLocalUser.inputPlayer.controllers.maps.GetMaps((ControllerType)0, 0)) { foreach (ActionElementMap allMap in map.AllMaps) { if ((int)allMap.keyCode != 0) { InputAction action = ReInput.mapping.GetAction(allMap.actionId); string item = ((action == null) ? "?" : (string.IsNullOrEmpty(action.descriptiveName) ? action.name : action.descriptiveName)); if (!dictionary.TryGetValue(allMap.keyCode, out var value)) { value = new List<string>(); dictionary[allMap.keyCode] = value; } if (!value.Contains(item)) { value.Add(item); } } } } } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Reading game key bindings failed: " + ex.Message)); } gameKeys = dictionary; } private string Holders(KeyCode key, int skipAction, int skipSlot, out bool game) { //IL_0014: 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) RefreshGameKeys(); List<string> list = new List<string>(); game = gameKeys.TryGetValue(key, out var value); if (game) { list.Add(T("Game", "Игра", "Гра") + ": " + string.Join(", ", value.ToArray())); } for (int i = 0; i < binds.Count; i++) { for (int j = 0; j < 2; j++) { if ((i != skipAction || j != skipSlot) && binds[i].Get(j) == key) { list.Add(T("Mod", "Мод", "Мод") + ": " + BindName(binds[i])); } } } return string.Join("; ", list.ToArray()); } private void HandleBindCapture() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 //IL_0019: 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_0044: Invalid comparison between Unknown and I4 //IL_0049: 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) //IL_009a: 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) Event current = Event.current; if (bwAction < 0 || (int)current.type != 4 || (int)current.keyCode == 0) { return; } current.Use(); int num = bwAction; int num2 = bwSlot; bwAction = -1; if ((int)current.keyCode != 27) { bool game; string text = Holders(current.keyCode, num, num2, out game); if (text.Length == 0) { binds[num].Set(num2, current.keyCode); return; } PendingBind pendingBind = new PendingBind(); pendingBind.action = num; pendingBind.slot = num2; pendingBind.key = current.keyCode; pendingBind.holders = text; pendingBind.gameConflict = game; pend = pendingBind; } } private void ConfirmPending() { //IL_00a0: 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_0045: Unknown result type (might be due to invalid IL or missing references) if (pend == null) { return; } for (int i = 0; i < binds.Count; i++) { for (int j = 0; j < 2; j++) { if ((i != pend.action || j != pend.slot) && binds[i].Get(j) == pend.key) { binds[i].Set(j, (KeyCode)0); } } } binds[pend.action].Set(pend.slot, pend.key); pend = null; } private void ResetBind(int i) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) binds[i].k1.Value = binds[i].d1; binds[i].k2.Value = binds[i].d2; } private void ResetAllBinds() { for (int i = 0; i < binds.Count; i++) { ResetBind(i); } } private string PortalName(SceneExitController sx) { string text = ((Object)((Component)sx).gameObject).name.Replace("(Clone)", "").Trim(); string text2 = ((text.IndexOf("Shop", StringComparison.OrdinalIgnoreCase) >= 0) ? T("Blue portal (Bazaar)", "Синий портал (Базар)", "Синій портал (Базар)") : ((text.IndexOf("Goldshores", StringComparison.OrdinalIgnoreCase) >= 0) ? T("Gold portal (Gilded Coast)", "Золотой портал (Золотой берег)", "Золотий портал (Золотий берег)") : ((text.IndexOf("MS", StringComparison.Ordinal) >= 0 || text.IndexOf("Moon", StringComparison.OrdinalIgnoreCase) >= 0) ? T("Celestial portal", "Небесный портал", "Небесний портал") : ((text.IndexOf("Void", StringComparison.OrdinalIgnoreCase) < 0) ? (T("Portal", "Портал", "Портал") + " (" + text + ")") : T("Void portal", "Портал Пустоты", "Портал Порожнечі"))))); SceneDef val = null; try { val = sx.destinationScene; } catch (Exception) { } if ((Object)(object)val == (Object)null && sx.useRunNextStageScene && (Object)(object)Run.instance != (Object)null) { val = Run.instance.nextStageScene; } if ((Object)(object)val != (Object)null && !string.IsNullOrEmpty(val.nameToken)) { text2 = text2 + " -> " + Language.GetString(val.nameToken); } return text2; } private void RefreshPortals(Vector3 me) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) portals.Clear(); SceneExitController[] array = Object.FindObjectsOfType<SceneExitController>(); foreach (SceneExitController val in array) { if (!((Object)(object)val == (Object)null) && ((Component)val).gameObject.activeInHierarchy && !((Object)(object)((Component)val).GetComponent<TeleporterInteraction>() != (Object)null)) { PortalInfo portalInfo = new PortalInfo(); portalInfo.go = ((Component)val).gameObject; portalInfo.name = PortalName(val); portalInfo.dist = Vector3.Distance(me, ((Component)val).transform.position); portals.Add(portalInfo); } } portals.Sort((PortalInfo a, PortalInfo b) => a.dist.CompareTo(b.dist)); } private void TeleportToPortal(PortalInfo p) { //IL_002a: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_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_0076: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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) CharacterBody body = Body; if (!((Object)(object)body == (Object)null) && !((Object)(object)p.go == (Object)null)) { Vector3 position = p.go.transform.position; Vector3 val = body.corePosition - position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = Vector3.forward; } ((Vector3)(ref val)).Normalize(); TeleportMe(position + val * 6f + Vector3.up * 2f, p.name); } } private void KillAllEnemies(bool bossesOnly) { //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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Invalid comparison between Unknown and I4 //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Invalid comparison between Unknown and I4 //IL_009d: 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) CharacterBody body = Body; GameObject val = (((Object)(object)body != (Object)null) ? ((Component)body).gameObject : null); int num = 0; foreach (CharacterBody item in CharacterBody.readOnlyInstancesList.ToList()) { if ((Object)(object)item == (Object)null || (Object)(object)item.teamComponent == (Object)null) { continue; } TeamIndex teamIndex = item.teamComponent.teamIndex; if ((int)teamIndex != 1 && (int)teamIndex != 0 && (int)teamIndex != -1) { HealthComponent healthComponent = item.healthComponent; if (!((Object)(object)healthComponent == (Object)null) && healthComponent.alive && (!bossesOnly || item.isChampion || item.isBoss)) { healthComponent.Suicide(val, val, default(DamageTypeCombo)); num++; } } } Say(T("Enemies killed: ", "Убито врагов: ", "Вбито ворогів: ") + num); } private void NextStage() { if ((Object)(object)Run.instance != (Object)null && (Object)(object)Run.instance.nextStageScene != (Object)null) { Run.instance.AdvanceStage(Run.instance.nextStageScene); } else { Cmd("next_stage"); } } private void ApplyGameHud() { if (hideGameHud == hudApplied) { return; } try { ((BaseConVar)HUD.cvHudEnable).SetString(hideGameHud ? "0" : "1"); hudApplied = hideGameHud; } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("hud_enable: " + ex.Message)); hideGameHud = hudApplied; } } private object VolumeConVar() { if (volMsx == null) { FieldInfo field = typeof(AudioManager).GetField("cvVolumeMsx", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { volMsx = field.GetValue(null); } } return volMsx; } private float MusicVolume() { try { object obj = VolumeConVar(); if (obj != null) { string s = (string)obj.GetType().GetMethod("GetString", Type.EmptyTypes).Invoke(obj, null); if (float.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { return result; } } } catch (Exception) { } return 100f; } private void SetMusicVolume(float v) { try { object obj = VolumeConVar(); obj?.GetType().GetMethod("SetString", new Type[1] { typeof(string) }).Invoke(obj, new object[1] { v.ToString("0.#", CultureInfo.InvariantCulture) }); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("music volume: " + ex.Message)); } } private string TrackLength(MusicTrackDef d) { if (durations == null) { durations = new Dictionary<string, double>(); try { string path = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "music_durations.json"); if (File.Exists(path)) { foreach (KeyValuePair<string, string> item in ParseFlatJson(File.ReadAllText(path))) { if (double.TryParse(item.Value, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { durations[item.Key] = result; } } } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("music_durations.json: " + ex.Message)); } } if ((Object)(object)d == (Object)null || d.states == null) { return ""; } State[] states = d.states; foreach (State val in states) { try { if (val != null && (durations.TryGetValue(((BaseType)val).Id.ToString(), out var value) || durations.TryGetValue(((BaseType)val).Name ?? "", out value))) { int num = (int)Math.Round(value); return "~" + num / 60 + ":" + (num % 60).ToString("00"); } } catch (Exception) { } } return ""; } private void SampleFps() { if (!cfgFps.Value) { return; } float unscaledDeltaTime = Time.unscaledDeltaTime; if (unscaledDeltaTime <= 0f) { return; } if (frameTimes.Count >= 600) { frameTimes.RemoveAt(0); } frameTimes.Add(unscaledDeltaTime); fpsFrames++; fpsAccum += unscaledDeltaTime; if (Time.unscaledTime < fpsNext) { return; } fpsNext = Time.unscaledTime + 0.25f; fpsCur = (float)fpsFrames / Mathf.Max(fpsAccum, 0.0001f); frameMs = fpsAccum / (float)Mathf.Max(fpsFrames, 1) * 1000f; fpsFrames = 0; fpsAccum = 0f; if (cfgFpsMode.Value == 1 && frameTimes.Count > 0) { List<float> list = frameTimes.OrderBy((float x) => x).ToList(); float num = list.Average(); fpsAvg = 1f / num; fpsMax = 1f / list[0]; fpsMin = 1f / list[list.Count - 1]; int index = Mathf.Clamp((int)((float)list.Count * 0.99f), 0, list.Count - 1); fpsLow1 = 1f / list[index]; } } private void SamplePing() { if (!cfgPing.Value || Time.unscaledTime < pingNext) { return; } pingNext = Time.unscaledTime + 0.25f; float item = 0f; try { NetworkManagerSystem singleton = NetworkManagerSystem.singleton; if ((Object)(object)singleton != (Object)null) { float filteredClientRttFrame = singleton.filteredClientRttFrame; item = ((filteredClientRttFrame > 10f) ? filteredClientRttFrame : (filteredClientRttFrame * 1000f)); } } catch (Exception) { } pingCur = item; if (pingSamples.Count >= 240) { pingSamples.RemoveAt(0); } pingSamples.Add(item); if (cfgPingMode.Value != 1 || pingSamples.Count <= 0) { return; } pingAvg = pingSamples.Average(); pingMin = pingSamples.Min(); pingMax = pingSamples.Max(); float num = 0f; foreach (float pingSample in pingSamples) { float num2 = pingSample; num += (num2 - pingAvg) * (num2 - pingAvg); } pingJitter = Mathf.Sqrt(num / (float)pingSamples.Count); } private PlayerMods ModsFor(CharacterMaster m) { int instanceID = ((Object)m).GetInstanceID(); if (!pmods.TryGetValue(instanceID, out var value)) { value = new PlayerMods(); pmods[instanceID] = value; } return value; } private string PlayerName(PlayerCharacterMasterController p) { string text = ""; try { NetworkUser networkUser = p.networkUser; if ((Object)(object)networkUser != (Object)null) { text = networkUser.userName; } } catch (Exception) { } if (string.IsNullOrEmpty(text)) { try { text = p.GetDisplayName(); } catch (Exception) { } } if (!string.IsNullOrEmpty(text)) { return text; } return "?"; } private void PlayersTick() { foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { CharacterMaster master = instance.master; if ((Object)(object)master == (Object)null || (Object)(object)master == (Object)(object)Master) { continue; } CharacterBody body = master.GetBody(); if (!((Object)(object)body == (Object)null) && !((Object)(object)body.healthComponent == (Object)null)) { PlayerMods playerMods = ModsFor(master); if (playerMods.god || body.healthComponent.godMode) { body.healthComponent.godMode = playerMods.god; } } } } private void KillPlayer(CharacterMaster m) { //IL_0035: 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) CharacterBody body = m.GetBody(); if ((Object)(object)body != (Object)null && (Object)(object)body.healthComponent != (Object)null && body.healthComponent.alive) { body.healthComponent.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); } } private void RevivePlayer(CharacterMaster m) { if ((Object)(object)m.GetBody() == (Object)null) { m.RespawnExtraLife(); } } private void HealPlayer(CharacterMaster m) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = m.GetBody(); if ((Object)(object)body != (Object)null && (Object)(object)body.healthComponent != (Object)null) { body.healthComponent.HealFraction(1f, default(ProcChainMask)); } } private void InitHarmony() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown I = this; try { harmony = new Harmony("user.omni.modmenu"); MethodInfo methodInfo = AccessTools.Method(typeof(HealthComponent), "TakeDamage", (Type[])null, (Type[])null); MethodInfo method = typeof(ModMenu).GetMethod("TakeDamagePre", BindingFlags.Static | BindingFlags.NonPublic); harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(method), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Harmony patch failed (crit damage multiplier disabled): " + ex.Message)); } } private void ShutdownHarmony() { try { if (harmony != null) { harmony.UnpatchSelf(); } } catch (Exception) { } I = null; } private static void TakeDamagePre(HealthComponent __instance, DamageInfo damageInfo) { ModMenu i = I; if ((Object)(object)i == (Object)null || damageInfo == null || !damageInfo.crit || (Object)(object)damageInfo.attacker == (Object)null) { return; } CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>(); if (!((Object)(object)component == (Object)null) && component.isPlayerControlled && !((Object)(object)component.master == (Object)null)) { PlayerMods playerMods = i.ModsFor(component.master); if (playerMods.critDmg != 1f) { damageInfo.damage *= playerMods.critDmg; } } } private void TickCooldowns(CharacterBody body) { SkillLocator skillLocator = body.skillLocator; if ((Object)(object)skillLocator != (Object)null) { if (ncPrimary) { Refill(skillLocator.primary); } if (ncSecondary) { Refill(skillLocator.secondary); } if (ncUtility) { Refill(skillLocator.utility); } if (ncSpecial) { Refill(skillLocator.special); } } if (ncEquip && (Object)(object)body.inventory != (Object)null) { body.inventory.DeductActiveEquipmentCooldown(100f); } } private void EnforceNoclip() { //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_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) CharacterBody body = Body; CharacterMotor val = (((Object)(object)body != (Object)null) ? body.characterMotor : null); if ((Object)(object)val == (Object)null || (Object)(object)((BaseCharacterController)val).Motor == (Object)null) { return; } if (noclip) { int value = ((LayerMask)(ref ((BaseCharacterController)val).Motor.CollidableLayers)).value; if (value != 0) { savedLayers = value; ((BaseCharacterController)val).Motor.CollidableLayers = LayerMask.op_Implicit(0); } noclipApplied = true; } else if (noclipApplied) { if (((LayerMask)(ref ((BaseCharacterController)val).Motor.CollidableLayers)).value == 0 && savedLayers != 0) { ((BaseCharacterController)val).Motor.CollidableLayers = LayerMask.op_Implicit(savedLayers); } noclipApplied = false; } } private void FixedUpdate() { EnforceNoclip(); } private void LateUpdate() { EnforceNoclip(); } private void ClearInventory(Inventory inv) { if (!((Object)(object)inv == (Object)null)) { RemoveAllItems(inv); inv.SetEquipmentIndex((EquipmentIndex)(-1)); Say(T("Inventory cleared", "Инвентарь очищен", "Інвентар очищено")); } } private string ExpansionLock(Entry e) { //IL_0033: 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_00ab: Unknown result type (might be due to invalid IL or missing references) Run instance = Run.instance; if ((Object)(object)instance == (Object)null || e == null || e.data == null) { return null; } try { object data = e.data; ItemDef val = (ItemDef)((data is ItemDef) ? data : null); if ((Object)(object)val != (Object)null && instance.IsItemExpansionLocked(val.itemIndex)) { return T("DLC disabled in this run", "DLC выключено в этом забеге", "DLC вимкнено в цьому забігу"); } object data2 = e.data; EquipmentDef val2 = (EquipmentDef)((data2 is EquipmentDef) ? data2 : null); if ((Object)(object)val2 != (Object)null && instance.IsEquipmentExpansionLocked(val2.equipmentIndex)) { return T("DLC disabled in this run", "DLC выключено в этом забеге", "DLC вимкнено в цьому забігу"); } object data3 = e.data; DroneDef val3 = (DroneDef)((data3 is DroneDef) ? data3 : null); if ((Object)(object)val3 != (Object)null && instance.IsDroneExpansionLocked(val3.droneIndex)) { return T("DLC disabled in this run", "DLC выключено в этом забеге", "DLC вимкнено в цьому забігу"); } } catch (Exception) { } return null; } private Transform FindTeleporterNow() { TeleporterInteraction instance = TeleporterInteraction.instance; if ((Object)(object)instance != (Object)null) { return ((Component)instance).transform; } TeleporterInteraction val = Object.FindObjectOfType<TeleporterInteraction>(); if (!((Object)(object)val != (Object)null)) { return null; } return ((Component)val).transform; } private Transform FindTeleporter() { return tpCache; } private void TeleportToTeleporter() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) Transform val = FindTeleporterNow(); CharacterBody body = Body; if ((Object)(object)val == (Object)null || (Object)(object)body == (Object)null) { Say(T("No teleporter on this stage", "На этой локации нет телепортера", "На цій локації немає телепорта")); return; } Vector3 val2 = body.corePosition - val.position; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = Vector3.forward; } ((Vector3)(ref val2)).Normalize(); TeleportMe(val.position + val2 * 5f + Vector3.up * 2f, T("teleporter", "телепортер", "телепорт")); } private void KickPlayer(PlayerCharacterMasterController p) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown try { NetworkUser networkUser = p.networkUser; NetworkConnection val = (((Object)(object)networkUser != (Object)null) ? ((NetworkBehaviour)networkUser).connectionToClient : null); if (val == null) { Say(T("Cannot kick this player", "Не удалось кикнуть игрока", "Не вдалося кікнути гравця")); return; } NetworkManagerSystem.singleton.ServerKickClient(val, (BaseKickReason)new SimpleLocalizedKickReason("KICK_REASON_KICK", new string[0])); Say(T("Kicked: ", "Кикнут: ", "Кікнуто: ") + PlayerName(p)); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("kick: " + ex.Message)); Say(T("Cannot kick this player", "Не удалось кикнуть игрока", "Не вдалося кікнути гравця")); } } private bool MouseOverMenu() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) if (!open) { return false; } float value = cfgScale.Value; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref win)).x * value, ((Rect)(ref win)).y * value, ((Rect)(ref win)).width * value, ((Rect)(ref win)).height * value); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y); return ((Rect)(ref val)).Contains(val2); } private void UpdateInputBlock() { bool flag = open && (MouseOverMenu() || bwAction >= 0 || pend != null); if (flag != inputBlocked) { SetInputBlocked(flag); } } private void SetInputBlocked(bool on) { try { LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); Player val = ((firstLocalUser != null) ? firstLocalUser.inputPlayer : null); if (on && val != null) { blockedMaps.Clear(); foreach (ControllerMap allMap in val.controllers.maps.GetAllMaps()) { if (allMap.enabled) { allMap.enabled = false; blockedMaps.Add(allMap); } } inputBlocked = true; return; } foreach (ControllerMap blockedMap in blockedMaps) { blockedMap.enabled = true; } blockedMaps.Clear(); inputBlocked = false; } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("input block: " + ex.Message)); blockedMaps.Clear(); inputBlocked = false; } } private static bool IsHostile(CharacterBody me, CharacterBody b) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0041: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)b == (Object)null || (Object)(object)b == (Object)(object)me || (Object)(object)b.teamComponent == (Object)null || (Object)(object)me.teamComponent == (Object)null) { return false; } TeamIndex teamIndex = b.teamComponent.teamIndex; if ((int)teamIndex == 0 || (int)teamIndex == -1 || teamIndex == me.teamComponent.teamIndex) { return false; } return true; } private static Vector3 AimPointOf(CharacterBody b) { //IL_003b: 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) //IL_0031: 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)b.mainHurtBox != (Object)null && (Object)(object)b.mainHurtBox.collider != (Object)null) { Bounds bounds = b.mainHurtBox.collider.bounds; return ((Bounds)(ref bounds)).center; } return b.corePosition; } private void AimbotTick(CharacterBody me) { //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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) if (!aimbot || MouseOverMenu()) { return; } ReadOnlyCollection<CameraRigController> readOnlyInstancesList = CameraRigController.readOnlyInstancesList; if (readOnlyInstancesList.Count == 0) { return; } CameraRigController val = readOnlyInstancesList[0]; if ((Object)(object)val == (Object)null || (Object)(object)val.sceneCam == (Object)null || !val.isControlAllowed) { return; } Vector3 position = ((Component)val.sceneCam).transform.position; Vector3 forward = ((Component)val.sceneCam).transform.forward; CharacterBody val2 = null; float num = aimFov; Vector3 val3 = Vector3.zero; foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (!IsHostile(me, readOnlyInstances) || (Object)(object)readOnlyInstances.healthComponent == (Object)null || !readOnlyInstances.healthComponent.alive) { continue; } Vector3 val4 = AimPointOf(readOnlyInstances); Vector3 val5 = val4 - position; if (((Vector3)(ref val5)).magnitude > aimRange) { continue; } float num2 = Vector3.Angle(forward, val5); if (num2 > num) { continue; } if (aimVisible) { LayerIndex world = LayerIndex.world; if (Physics.Linecast(position, val4, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask))) { continue; } } val2 = readOnlyInstances; num = num2; val3 = val4; } if (!((Object)(object)val2 == (Object)null)) { Vector3 val6 = val3 - position; Vector3 dir = Vector3.Slerp(forward, ((Vector3)(ref val6)).normalized, 1f - Mathf.Clamp(aimSmooth, 0f, 0.95f)); SetAimDirection(val, dir); } } private void SetAimDirection(CameraRigController crc, Vector3 dir) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) try { CameraModeBase cameraMode = crc.cameraMode; if (cameraMode == null) { return; } object obj = cameraMode.DebugGetInstanceData(crc); if (obj != null) { if (aimSetter == null || aimSetter.DeclaringType != obj.GetType()) { aimSetter = obj.GetType().GetMethod("SetPitchYawFromLookVector", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (aimSetter != null) { aimSetter.Invoke(obj, new object[1] { dir }); } } } catch (Exception) { } } private void DrawLine(Vector2 a, Vector2 b, Color c, float w) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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) if ((int)Event.current.type == 7) { Matrix4x4 matrix = GUI.matrix; Color color = GUI.color; GUI.color = c; float num = Mathf.Atan2(b.y - a.y, b.x - a.x) * 57.29578f; Vector2 val = b - a; float magnitude = ((Vector2)(ref val)).magnitude; GUIUtility.RotateAroundPivot(num, a); GUI.DrawTexture(new Rect(a.x, a.y - w / 2f, magnitude, w), (Texture)(object)Texture2D.whiteTexture); GUI.matrix = matrix; GUI.color = color; } } private void DrawBoxOutline(Rect r, Color c) { //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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_00ad: 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) Color color = GUI.color; GUI.color = c; GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 1.5f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - 1.5f, ((Rect)(ref r)).width, 1.5f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, 1.5f, ((Rect)(ref r)).height), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref r)).xMax - 1.5f, ((Rect)(ref r)).y, 1.5f, ((Rect)(ref r)).height), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; } private bool ScreenBounds(Camera cam, CharacterBody b, out Rect rect) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) rect = default(Rect); Bounds bounds = default(Bounds); ((Bounds)(ref bounds))..ctor(b.corePosition, Vector3.one * Mathf.Max(b.radius, 0.5f) * 2f); bool flag = false; if ((Object)(object)b.hurtBoxGroup != (Object)null && b.hurtBoxGroup.hurtBoxes != null) { HurtBox[] hurtBoxes = b.hurtBoxGroup.hurtBoxes; foreach (HurtBox val in hurtBoxes) { if (!((Object)(object)val == (Object)null) && !((Object)(object)val.collider == (Object)null)) { if (!flag) { bounds = val.collider.bounds; flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val.collider.bounds); } } } } float num = float.MaxValue; float num2 = float.MaxValue; float num3 = float.MinValue; float num4 = float.MinValue; for (int j = 0; j < 8; j++) { Vector3 val2 = ((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3((float)(((j & 1) != 0) ? 1 : (-1)), (float)(((j & 2) != 0) ? 1 : (-1)), (float)(((j & 4) != 0) ? 1 : (-1)))); Vector3 val3 = cam.WorldToScreenPoint(val2); if (val3.z <= 0f) { return false; } float num5 = (float)Screen.height - val3.y; num = Mathf.Min(num, val3.x); num3 = Mathf.Max(num3, val3.x); num2 = Mathf.Min(num2, num5); num4 = Mathf.Max(num4, num5); } rect = new Rect(num, num2, num3 - num, num4 - num2); return true; } private void DrawEntityEsp() { //IL_002f: 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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Invalid comparison between Unknown and I4 //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Invalid comparison between Unknown and I4 //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0357: 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_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) Camera cam = GetCam(); if ((Object)(object)cam == (Object)null) { return; } CharacterBody body = Body; Vector3 val = (((Object)(object)body != (Object)null) ? body.corePosition : ((Component)cam).transform.position); Vector2 a = default(Vector2); ((Vector2)(ref a))..ctor((float)Screen.width / 2f, (float)Screen.height); int num = 0; Rect val4 = default(Rect); foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if ((Object)(object)readOnlyInstances == (Object)null || (Object)(object)readOnlyInstances == (Object)(object)body || (Object)(object)readOnlyInstances.healthComponent == (Object)null || !readOnlyInstances.healthComponent.alive || (Object)(object)readOnlyInstances.teamComponent == (Object)null) { continue; } bool isPlayerControlled = readOnlyInstances.isPlayerControlled; bool flag = !isPlayerControlled && (int)readOnlyInstances.teamComponent.teamIndex == 1; TeamIndex teamIndex = readOnlyInstances.teamComponent.teamIndex; bool flag2 = !isPlayerControlled && !flag && (int)teamIndex != 0 && (int)teamIndex != -1; bool num2; if (!isPlayerControlled && !flag) { if (!flag2) { continue; } num2 = !espEnemies; } else { num2 = !espPlayers; } if (num2) { continue; } float num3 = Vector3.Distance(val, readOnlyInstances.corePosition); if (num3 > espRange || !ScreenBounds(cam, readOnlyInstances, out var rect) || ((Rect)(ref rect)).xMax < 0f || ((Rect)(ref rect)).x > (float)Screen.width || ((Rect)(ref rect)).yMax < 0f || ((Rect)(ref rect)).y > (float)Screen.height) { continue; } Color val2 = (isPlayerControlled ? colPlayer : (flag ? colAlly : ((readOnlyInstances.isChampion || readOnlyInstances.isBoss) ? colBoss : colEnemy))); if ((isPlayerControlled || flag) ? snapPlayers : snapEnemies) { DrawLine(a, new Vector2(((Rect)(ref rect)).center.x, ((Rect)(ref rect)).yMax), val2, 1.5f); } if ((int)Event.current.type == 7) { DrawBoxOutline(rect, val2); HealthComponent healthComponent = readOnlyInstances.healthComponent; float num4 = Mathf.Clamp01(healthComponent.health / Mathf.Max(healthComponent.fullHealth, 1f)); Color color = GUI.color; GUI.color = new Color(0f, 0f, 0f, 0.6f); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x - 6f, ((Rect)(ref rect)).y, 3f, ((Rect)(ref rect)).height), (Texture)(object)Texture2D.whiteTexture); GUI.color = Color.Lerp(Color.red, Color.green, num4); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x - 6f, ((Rect)(ref rect)).yMax - ((Rect)(ref rect)).height * num4, 3f, ((Rect)(ref rect)).height * num4), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; string text = readOnlyInstances.GetDisplayName(); if (isPlayerControlled) { PlayerCharacterMasterController val3 = (((Object)(object)readOnlyInstances.master != (Object)null) ? readOnlyInstances.master.playerCharacterMasterController : null); if ((Object)(object)val3 != (Object)null) { text = PlayerName(val3) + " (" + text + ")"; } } Color contentColor = GUI.contentColor; GUI.contentColor = val2; ((Rect)(ref val4))..ctor(((Rect)(ref rect)).center.x - 120f, ((Rect)(ref rect)).y - 20f, 240f, 18f); GUIStyle val5 = sEsp; TextAnchor alignment = val5.alignment; val5.alignment = (TextAnchor)1; GUI.Label(val4, text + " " + num3.ToString("0") + "m", val5); val5.alignment = alignment; GUI.contentColor = contentColor; } if (++num >= 100) { break; } } } private List<Feat> BuildFeatures() { List<Feat> l = new List<Feat>(); string[] array = TabNames(); string[] array2 = new string[13] { "Player", "Players", "Items", "Equipment", "Character", "Teleport", "Drones", "Spawn", "Stats", "Scanner", "World", "Music", "Settings" }; for (int i = 0; i < array.Length; i++) { int num = i; l.Add(new Feat { name = T("Open tab: ", "Открыть вкладку: ", "Відкрити вкладку: ") + array[i], en = "tab " + array2[i], tab = num }); } Action<string, string, string, string, Func<bool>, Action> action = delegate(string en, string ru, string uk, string tabHint, Func<bool> on, Action act) { l.Add(new Feat { name = T(en, ru, uk), en = en + " " + tabHint, act = act, on = on }); }; action("God mode", "Бессмертие", "Безсмертя", "player", () => god, delegate { god = !god; }); action("Fly", "Полёт", "Політ", "player", () => fly, delegate { fly = !fly; }); action("Noclip", "Ноуклип", "Ноуклип", "player", () => noclip, delegate { noclip = !noclip; }); action("Infinite jumps", "Бесконечные прыжки", "Нескінченні стрибки", "player", () => infJumps, delegate { infJumps = !infJumps; }); action("No skill cooldowns", "Без перезарядки умений", "Без перезарядки вмінь", "player", () => AllSkillsNoCd, delegate { AllSkillsNoCd = !AllSkillsNoCd; }); action("Free purchases", "Бесплатные покупки", "Безкоштовні покупки", "player", () => freeInteract, delegate { freeInteract = !freeInteract; }); action("Aimbot", "Аимбот", "Аімбот", "player aim", () => aimbot, delegate { aimbot = !aimbot; }); action("Full heal", "Полное лечение", "Повне лікування", "player", null, HealFull); action("Clear inventory", "Очистить инвентарь", "Очистити інвентар", "player items", null, delegate { CharacterBody body = Body; if ((Object)(object)body != (Object)null) { ClearInventory(body.inventory); } }); action("X-ray", "Рентген", "Рентген", "scanner esp", () => espOn, delegate { espOn = !espOn; }); action("Enemy ESP", "ESP врагов", "ESP ворогів", "scanner wallhack monsters", () => espEnemies, delegate { espEnemies = !espEnemies; }); action("Player ESP", "ESP игроков", "ESP гравців", "scanner wallhack players", () => espPlayers, delegate { espPlayers = !espPlayers; }); action("Charge teleporter instantly", "Мгновенно зарядить телепортер", "Миттєво зарядити телепорт", "world", null, ChargeTeleporter); action("Open all chests", "Открыть все сундуки", "Відкрити всі скрині", "world", null, OpenAllChests); action("Kill all enemies", "Убить всех врагов", "Вбити всіх ворогів", "world", null, delegate { KillAllEnemies(bossesOnly: false); }); action("Kill bosses only", "Убить только боссов", "Вбити лише босів", "world", null, delegate { KillAllEnemies(bossesOnly: true); }); action("Next stage", "Следующая локация", "Наступна локація", "world", null, NextStage); action("To teleporter", "К телепортеру", "До телепорта", "teleport portal boss", null, TeleportToTeleporter); action("Hide HUD", "Скрыть HUD", "Сховати HUD", "settings screenshot", () => hideGameHud, delegate { hideGameHud = !hideGameHud; }); action("FPS counter", "Счётчик FPS", "Лічильник FPS", "settings", () => cfgFps.Value, delegate { cfgFps.Value = !cfgFps.Value; }); action("Ping counter", "Счётчик пинга", "Лічильник пінгу", "settings", () => cfgPing.Value, delegate { cfgPing.Value = !cfgPing.Value; }); action("Reset to default", "Сбросить на стандартную", "Скинути на стандартну", "music", null, ResetMusic); foreach (BindAction bind in binds) { l.Add(new Feat { name = T("Hotkey: ", "Клавиша: ", "Клавіша: ") + BindName(bind), en = "hotkey " + bind.en, tab = 12 }); } return l; } private List<Entry> BuildSearchResults(string q) { //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) q = q.Trim().ToLowerInvariant(); List<Entry> res = new List<Entry>(); if (q.Length == 0) { return res; } string[] cat = new string[8] { T("Functions", "Функции", "Функції"), T("Items", "Предметы", "Предмети"), T("Equipment", "Снаряжение", "Спорядження"), T("Characters", "Персонажи", "Персонажі"), T("Drones", "Дроны", "Дрони"), T("Enemies", "Враги", "Вороги"), T("Stages", "Локации", "Локації"), T("Music", "Музыка", "Музика") }; Action<int, List<Entry>> action = delegate(int c, List<Entry> src) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (src != null) { List<Entry> list2 = src.Where((Entry e) => e.search.IndexOf(q, StringComparison.Ordinal) >= 0).Take(25).ToList(); if (list2.Count != 0) { Entry item = new Entry { header = true, name = cat[c], color = Color.white }; res.Add(item); foreach (Entry item3 in list2) { Entry item2 = new Entry { name = item3.name, color = item3.color, tex = item3.tex, uv = item3.uv, data = item3.data, prefab = item3.prefab, search = item3.search, sub = cat[c], extra = item3.extra, lockWhy = item3.lockWhy, group = c }; res.Add(item2); } } } }; List<Feat> list = (from f in BuildFeatures() where (f.name + " " + f.en).ToLowerInvariant().IndexOf(q, StringComparison.Ordinal) >= 0 select f).Take(25).ToList(); if (list.Count > 0) { Entry entry = new Entry(); entry.header = true; entry.name = cat[0]; entry.color = Color.white; res.Add(entry); foreach (Feat item4 in list) { Entry entry2 = new Entry(); entry2.name = item4.name; entry2.data = item4; entry2.group = 0; entry2.color = Color.white; entry2.sub = ((item4.on != null) ? (item4.on() ? "ON" : "OFF") : ""); res.Add(entry2); } } action(1, items); action(2, equips); action(3, survivors); action(4, drones); action(5, enemies); action(6, scenes); action(7, tracks); return res; } private string T(string en, string ru, string uk) { switch (lang) { case 0: return en; case 1: return uk; case 2: return ru; default: { Dictionary<string, string> pack = GetPack(lang); if (pack != null && pack.TryGetValue(en, out var value) && !string.IsNullOrEmpty(value)) { return value; } return en; } } } private Dictionary<string, string> GetPack(int i) { if (packs[i] != null) { return packs[i]; } packs[i] = new Dictionary<string, string>(); try { string path = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "lang"); string text = Path.Combine(path, LangCodes[i] + ".json"); if (File.Exists(text)) { packs[i] = ParseFlatJson(File.ReadAllText(text, Encoding.UTF8)); } else { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Language pack not found: " + text)); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Language pack " + LangCodes[i] + ": " + ex.Message)); } return packs[i]; } private static string JsonString(string s, ref int i) { StringBuilder stringBuilder = new StringBuilder(); i++; while (i < s.Length) { char c = s[i++]; if (c == '"') { break; } if (c == '\\' && i < s.Length) { char c2 = s[i++]; switch (c2) { case 'n': stringBuilder.Append('\n'); break; case 't': stringBuilder.Append('\t'); break; case 'r': stringBuilder.Append('\r'); break; case 'b': stringBuilder.Append('\b'); break; case 'f': stringBuilder.Append('\f'); break; case 'u': if (i + 4 <= s.Length) { stringBuilder.Append((char)Convert.ToInt32(s.Substring(i, 4), 16)); i += 4; } break; default: stringBuilder.Append(c2); break; } } else { stringBuilder.Append(c); } } return stringBuilder.ToString(); } private static Dictionary<string, string> ParseFlatJson(string s) { Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.Ordinal); int i = 0; while (i < s.Length) { for (; i < s.Length && s[i] != '"'; i++) { } if (i >= s.Length) { break; } string key = JsonString(s, ref i); for (; i < s.Length && s[i] != ':'; i++) { } for (i++; i < s.Length && char.IsWhiteSpace(s[i]); i++) { } if (i >= s.Length) { break; } string value; if (s[i] == '"') { value = JsonString(s, ref i); } else { int num = i; for (; i < s.Length && s[i] != ',' && s[i] != '}'; i++) { } value = s.Substring(num, i - num).Trim(); } dictionary[key] = value; } return dictionary; } private static int MapGameLanguage(string name) { if (string.IsNullOrEmpty(name)) { return 0; } string text = name.ToLowerInvariant(); if (text.StartsWith("ru")) { return 2; } if (text.StartsWith("uk")) { return 1; } if (text.StartsWith("de")) { return 3; } if (text.StartsWith("es")) { return 4; } if (text.StartsWith("fr")) { return 5; } if (text.StartsWith("it")) { return 6; } if (text.StartsWith("pt")) { return 7; } if (text.StartsWith("tr")) { return 8; } if (text.StartsWith("ja")) { return 9; } if (text.StartsWith("ko")) { return 10; } if (text.StartsWith("zh")) { return 11; } return 0; } private void UpdateLanguage() { string value = cfgLang.Value; if (value == "auto") { string name = ""; try { name = Language.currentLanguageName; } catch (Exception) { } lang = MapGameLanguage(name); } else { int num = Array.IndexOf(LangCodes, value); lang = ((num >= 0) ? num : 0); } } private void SetLanguage(int i) { lang = i; cfgLang.Value = LangCodes[i]; } private void Awake() { //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Expected O, but got Unknown //IL_0341: Unknown result type (might be due to invalid IL or missing references) cfgLang = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Language", "auto", "auto = follow the game's language until you pick one in Settings; otherwise a language code (en, uk, ru, de, es, fr, it, pt, tr, ja, ko, zh)"); cfgScale = ((BaseUnityPlugin)this).Config.Bind<float>("Interface", "UiScale", 1f, "UI scale"); cfgOpacity = ((BaseUnityPlugin)this).Config.Bind<float>("Interface", "UiOpacity", 0.96f, "Window background opacity"); cfgTheme = ((BaseUnityPlugin)this).Config.Bind<int>("Interface", "Theme", 0, "Accent color theme index"); cfgBgTheme = ((BaseUnityPlugin)this).Config.Bind<int>("Interface", "Background", 0, "Background theme index"); cfgAccentHex = ((BaseUnityPlugin)this).Config.Bind<string>("Interface", "CustomAccent", "38A0F2", "Custom accent color (hex)"); cfgBgHex = ((BaseUnityPlugin)this).Config.Bind<string>("Interface", "CustomBackground", "13161E", "Custom background color (hex)"); cfgGradAHex = ((BaseUnityPlugin)this).Config.Bind<string>("Interface", "CustomGradientA", "FF8A3D", "Custom gradient color A (hex)"); cfgGradBHex = ((BaseUnityPlugin)this).Config.Bind<string>("Interface", "CustomGradientB", "E83E8C", "Custom gradient color B (hex)"); cfgHud = ((BaseUnityPlugin)this).Config.Bind<bool>("Hud", "Enabled", false, "Show the list of active features in a screen corner"); cfgHudMode = ((BaseUnityPlugin)this).Config.Bind<int>("Hud", "Mode", 1, "0 = only while the menu is open, 1 = always"); cfgHudCorner = ((BaseUnityPlugin)this).Config.Bind<int>("Hud", "Corner", 0, "0 = top-left, 1 = top-right, 2 = bottom-left, 3 = bottom-right"); cfgFps = ((BaseUnityPlugin)this).Config.Bind<bool>("Fps", "Enabled", false, "Show an FPS counter (also while the menu is hidden)"); cfgFpsMode = ((BaseUnityPlugin)this).Config.Bind<int>("Fps", "Mode", 0, "0 = simple, 1 = detailed"); cfgFpsColorMode = ((BaseUnityPlugin)this).Config.Bind<int>("Fps", "ColorMode", 0, "0 = green, 1 = menu accent color, 2 = custom"); cfgFpsHex = ((BaseUnityPlugin)this).Config.Bind<string>("Fps", "CustomColor", "33FF59", "Custom FPS counter color (hex)"); cfgFpsOutline = ((BaseUnityPlugin)this).Config.Bind<bool>("Fps", "Outline", false, "Draw an outline around the FPS counter text"); cfgFpsSize = ((BaseUnityPlugin)this).Config.Bind<int>("Fps", "Size", 18, "FPS counter font size"); cfgFpsPos = ((BaseUnityPlugin)this).Config.Bind<int>("Fps", "Position", 0, "0 TL, 1 TC, 2 TR, 3 BL, 4 BC, 5 BR"); cfgPing = ((BaseUnityPlugin)this).Config.Bind<bool>("Ping", "Enabled", false, "Show a ping counter (also while the menu is hidden)"); cfgPingMode = ((BaseUnityPlugin)this).Config.Bind<int>("Ping", "Mode", 0, "0 = simple, 1 = detailed"); cfgPingPos = ((BaseUnityPlugin)this).Config.Bind<int>("Ping", "Position", 2, "0 TL, 1 TC, 2 TR, 3 BL, 4 BC, 5 BR"); InitBinds(); InitHarmony(); CharacterBody.onBodyStartGlobal += OnBodyStart; MusicController.pickTrackHook += new PickTrackDelegate(PickTrack); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Omni Mod Menu loaded. Press " + KeyText(binds[0].k1.Value) + " in game.")); } private void OnDestroy() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown CharacterBody.onBodyStartGlobal -= OnBodyStart; MusicController.pickTrackHook -= new PickTrackDelegate(PickTrack); if (hudApplied) { hideGameHud = false; ApplyGameHud(); } if (inputBlocked) { SetInputBlocked(on: false); } ShutdownHarmony(); } private void Say(string s) { status = s; statusUntil = Time.unscaledTime + 4f; } private void Cmd(string cmd) { LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); Console.instance.SubmitCmd((firstLocalUser != null) ? firstLocalUser.currentNetworkUser : null, cmd, false); } private void Update() { //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0157: 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_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) UpdateLanguage(); ProcessHotkeys(); UpdateCursor(); UpdateInputBlock(); ApplyGameHud(); SampleFps(); SamplePing(); PlayersTick(); if ((espOn || freeInteract || (open && (tab == 5 || tab == 9))) && Time.unscaledTime >= nextScan) { nextScan = Time.unscaledTime + 0.5f; RefreshScan(); } CharacterBody body = Body; if ((Object)(object)body == (Object)null) { return; } HealthComponent healthComponent = body.healthComponent; if ((Object)(object)healthComponent != (Object)null && (god || healthComponent.godMode)) { healthComponent.godMode = god; } CharacterMotor characterMotor = body.characterMotor; if ((Object)(object)characterMotor == (Object)null) { return; } if (infJumps && !characterMotor.isGrounded && Input.GetKeyDown((KeyCode)32)) { characterMotor.jumpCount = 0; } TickCooldowns(body); AimbotTick(body); EnforceNoclip(); if ((fly || noclip) && (Object)(object)body.inputBank != (Object)null) { float num = (Input.GetKey((KeyCode)304) ? 2f : 1f); Vector3 moveVector = body.inputBank.moveVector; Vector3 aimDirection = body.inputBank.aimDirection; float num2 = (Input.GetKey((KeyCode)32) ? 1f : 0f) - (Input.GetKey((KeyCode)306) ? 1f : 0f); Vector3 velocity = moveVector * flySpeed * num; velocity.y = (num2 + aimDirection.y * ((Vector3)(ref moveVector)).magnitude) * flySpeed * num; CharacterGravityParameters gravityParameters = characterMotor.gravityParameters; if (gravityParameters.channeledAntiGravityGranterCount < 1) { gravityParameters.channeledAntiGravityGranterCount = 1; characterMotor.gravityParameters = gravityParameters; gravityOff = true; } characterMotor.disableAirControlUntilCollision = false; characterMotor.velocity = velocity; flyWasActive = true; } else if (flyWasActive) { if (gravityOff) { CharacterGravityParameters gravityParameters2 = characterMotor.gravityParameters; gravityParameters2.channeledAntiGravityGranterCount = 0; characterMotor.gravityParameters = gravityParameters2; } gravityOff = false; flyWasActive = false; } } private static void Refill(GenericSkill s) { if ((Object)(object)s != (Object)null && s.stock < s.maxStock) { s.stock = s.maxStock; } } private void UpdateCursor() { if (open) { foreach (MPEventSystem readOnlyInstances in MPEventSystem.readOnlyInstancesList) { if (!((Object)(object)readOnlyInstances == (Object)null) && !cursorHeld.Contains(readOnlyInstances)) { readOnlyInstances.cursorOpenerCount += 1; cursorHeld.Add(readOnlyInstances); } } return; } if (cursorHeld.Count <= 0) { return; } foreach (MPEventSystem item in cursorHeld) { if ((Object)(object)item != (Object)null && item.cursorOpenerCount > 0) { item.cursorOpenerCount -= 1; } } cursorHeld.Clear(); } private int Category(CharacterBody b) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 if (b.isPlayerControlled) { return 0; } if ((Object)(object)b.teamComponent != (Object)null && (int)b.teamComponent.teamIndex == 1) { return 1; } if (b.isChampion || b.isBoss) { return 3; } return 2; } private void OnBodyStart(CharacterBody b) { if ((Object)(object)b != (Object)null) { ApplyTo(b, heal: true); } } private void ApplyTo(CharacterBody b, bool heal) { //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) int instanceID = ((Object)b).GetInstanceID(); if (!origStats.TryGetValue(instanceID, out var value)) { value = new float[7] { b.baseMaxHealth, b.baseDamage, b.baseMoveSpeed, b.baseAttackSpeed, b.baseJumpPower, b.baseArmor, b.baseCrit }; origStats[instanceID] = value; } int num = Category(b); float num2 = value[0] * hpMul[num]; float num3 = value[1] * dmgMul[num]; float num4 = value[2]; float num5 = value[3]; float num6 = value[4]; float num7 = value[5]; float num8 = value[6]; if (num == 0) { CharacterMaster master = b.master; if ((Object)(object)master != (Object)null && (Object)(object)master == (Object)(object)Master) { num4 *= speedMul; num5 *= atkSpeedMul; num6 *= jumpMul; } if ((Object)(object)master != (Object)null) { PlayerMods playerMods = ModsFor(master); num2 *= playerMods.hp; num3 *= playerMods.dmg; num4 *= playerMods.spd; num5 *= playerMods.atk; num6 *= playerMods.jump; num7 += playerMods.armor; num8 += playerMods.critChance; } } bool flag = !Mathf.Approximately(num2, b.baseMaxHealth); if (flag || !Mathf.Approximately(num3, b.baseDamage) || !Mathf.Approximately(num4, b.baseMoveSpeed) || !Mathf.Approximately(num5, b.baseAttackSpeed) || !Mathf.Approximately(num6, b.baseJumpPower) || !Mathf.Approximately(num7, b.baseArmor) || !Mathf.Approximately(num8, b.baseCrit)) { b.baseMaxHealth = num2; b.baseDamage = num3; b.baseMoveSpeed = num4; b.baseAttackSpeed = num5; b.baseJumpPower = num6; b.baseArmor = num7; b.baseCrit = num8; b.RecalculateStats(); if (heal && flag && (Object)(object)b.healthComponent != (Object)null) { b.healthComponent.HealFraction(1f, default(ProcChainMask)); } } } private void ApplyAll() { List<int> list = origStats.Keys.ToList(); foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (!((Object)(object)readOnlyInstances == (Object)null)) { list.Remove(((Object)readOnlyInstances).GetInstanceID()); ApplyTo(readOnlyInstances, heal: true); } } foreach (int item in list) { origStats.Remove(item); } } private void GiveMoney(uint amount) { CharacterMaster master = Master; if (!((Object)(object)master == (Object)null)) { master.GiveMoney(amount); Say("+$" + amount); } } private void GiveLunar(uint amount) { LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); if (firstLocalUser != null && firstLocalUser.userProfile != null) { UserProfile userProfile = firstLocalUser.userProfile; userProfile.coins += amount; Say("+" + amount + " " + T("lunar coins", "лунных монет", "місячних монет")); } } private void GiveLevels(int n) { if (!((Object)(object)TeamManager.instance == (Object)null)) { for (int i = 0; i < n; i++) { ulong num = TeamManager.instance.GetTeamNextLevelExperience((TeamIndex)1) - TeamManager.instance.GetTeamExperience((TeamIndex)1); TeamManager.instance.GiveTeamExperience((TeamIndex)1, num); } Say("+" + n + " " + T("levels", "ур.", "рів.")); } } private void HealFull() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = Body; if ((Object)(object)body != (Object)null && (Object)(object)body.healthComponent != (Object)null) { body.healthComponent.HealFraction(1f, default(ProcChainMask)); } } private void GiveItem(Inventory inv, Entry e, int n) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002b: 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_0045: Unknown result type (might be due to invalid IL or missing references) ItemDef val = (ItemDef)e.data; if ((Object)(object)inv == (Object)null) { return; } if (n > 0) { inv.GiveItemPermanent(val.itemIndex, n); } else { int itemCountPermanent = inv.GetItemCountPermanent(val.itemIndex); int num = Math.Min(itemCountPermanent, -n); if (num > 0) { inv.RemoveItemPermanent(val.itemIndex, num); } } Say(((n > 0) ? "+" : "") + n + " " + e.name); } private void RemoveAllItems(Inventory inv) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0036: 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) if ((Object)(object)inv == (Object)null || items == null) { return; } foreach (Entry item in items) { ItemDef val = (ItemDef)item.data; int itemCountPermanent = inv.GetItemCountPermanent(val.itemIndex); if (itemCountPermanent > 0) { inv.RemoveItemPermanent(val.itemIndex, itemCountPermanent); } } Say(T("All items removed", "Все предметы удалены", "Усі предмети видалено")); } private void SetEquipment(Inventory inv, EquipmentIndex idx, string name) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 //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_0021: 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_002b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)inv == (Object)null) { return; } inv.SetEquipmentIndex(idx); try { if ((int)idx != -1 && inv.GetEquipment(0u).equipmentIndex != idx) { EquipmentLocation zero = EquipmentLocation.zero; inv.SetEquipmentIndex(idx, ref zero); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("SetEquipment fallback: " + ex.Message)); } Say(T("Equipment: ", "Снаряжение: ", "Спорядження: ") + name); } private void SwitchCharacter(Entry e) { CharacterMaster master = Master; if (!((Object)(object)master == (Object)null) && !((Object)(object)e.prefab == (Object)null)) { GameObject prefab = e.prefab; object data = e.data; string text = LockReason(prefab, (SurvivorDef)((data is SurvivorDef) ? data : null)); if (text != null) { Say(e.name + ": " + text); return; } master.TransformBody(((Object)e.prefab).name); Say(T("Character: ", "Персонаж: ", "Персонаж: ") + e.name); } } private void TeleportMe(Vector3 pos, string name) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = Body; if (!((Object)(object)body == (Object)null)) { TeleportHelper.TeleportBody(body, pos); Say(T("Teleported: ", "Телепорт: ", "Телепорт: ") + name); } } private void GoToStage(Entry e) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown if ((Object)(object)Run.instance == (Object)null) { Say(T("Start a run first", "Сначала начните забег", "Спочатку почніть забіг")); } else { Run.instance.AdvanceStage((SceneDef)e.data); } } private Vector3 AimPoint(CharacterBody b) { //IL_001c: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (((Object)(object)b.inputBank != (Object)null) ? b.inputBank.aimOrigin : b.corePosition); Vector3 val2 = (((Object)(object)b.inputBank != (Object)null) ? b.inputBank.aimDirection : ((Component)b).transform.forward); LayerIndex world = LayerIndex.world; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val, val2, ref val3, 200f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask))) { return ((RaycastHit)(ref val3)).point + Vector3.up * 1.5f; } return val + val2 * 10f; } private void Summon(GameObject masterPrefab, TeamIndex team, bool owned, int count, string name) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = Body; if ((Object)(object)body == (Object)null || (Object)(object)masterPrefab == (Object)null) { return; } Vector3 val = AimPoint(body); for (int i = 0; i < count; i++) { MasterSummon val2 = new MasterSummon(); val2.masterPrefab = masterPrefab; val2.position = val + new Vector3(Random.Range(-2f, 2f), 0f, Random.Range(-2f, 2f)); val2.rotation = Quaternion.identity; val2.teamIndexOverride = team; val2.ignoreTeamMemberLimit = true; if (owned) { val2.summonerBodyObject = ((Component)body).gameObject; } val2.Perform(); } Say(T("Spawned: ", "Создано: ", "Створено: ") + name + " x" + count); } private void ChargeTeleporter() { if ((Object)(object)TeleporterInteraction.instance != (Object)null && (Object)(object)TeleporterInteraction.instance.holdoutZoneController != (Object)null) { TeleporterInteraction.instance.holdoutZoneController.FullyChargeHoldoutZone(); Say(T("Teleporter charged", "Телепортер заряжен", "Телепорт заряджено")); } else { Say(T("No teleporter on this stage", "На этой локации нет телепортера", "На цій локації немає телепорта")); } } private void OpenAllChests() { int num = 0; foreach (PurchaseInteraction instances in InstanceTracker.GetInstancesList<PurchaseInteraction>()) { if (!((Object)(object)instances == (Object)null)) { ChestBehavior component = ((Component)instances).GetComponent<ChestBehavior>(); if ((Object)(object)component != (Object)null && !component.isChestOpened) { component.Open(); num++; } } } Say(T("Chests opened: ", "Открыто сундуков: ", "Відкрито скринь: ") + num); } private Color PickupColor(PickupDef def) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return def.baseColor; } private void FillContent(ScanItem s, PickupIndex idx) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0061: Invalid comparison between Unknown and I4 //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Invalid comparison between Unknown and I4 //IL_0064: 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) if (!((PickupIndex)(ref idx)).isValid) { return; } PickupDef pickupDef = PickupCatalog.GetPickupDef(idx); if (pickupDef != null) { s.content = Language.GetString(pickupDef.nameToken); s.contentColor = pickupDef.baseColor; Entry entry = new Entry(); SetPickupIcon(entry, pickupDef, null, null); s.contentTex = entry.tex; s.contentUv = entry.uv; if ((int)pickupDef.itemIndex != -1) { ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex); s.group = (((Object)(object)itemDef != (Object)null) ? TierGroup(itemDef.tier) : 6); } else if ((int)pickupDef.equipmentIndex != -1) { s.group = 7; } else { s.group = 6; } } } private void RefreshScan() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_00b2: 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_00cf: Invalid comparison between Unknown and I4 //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_014e: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) scan.Clear(); CharacterBody body = Body; Vector3 val = (((Object)(object)body != (Object)null) ? body.corePosition : Vector3.zero); foreach (PurchaseInteraction instances in InstanceTracker.GetInstancesList<PurchaseInteraction>()) { if ((Object)(object)instances == (Object)null) { continue; } if (freeInteract && instances.cost > 0) { instances.cost = 0; } if (!instances.available) { continue; } ScanItem scanItem = new ScanItem(); scanItem.go = ((Component)instances).gameObject; scanItem.kind = 0; scanItem.name = instances.GetDisplayName(); if (!string.IsNullOrEmpty(scanItem.name)) { scanItem.pos = ((Component)instances).transform.position; scanItem.cost = ((instances.cost <= 0) ? "" : (((int)instances.costType == 1) ? ("$" + instances.cost) : (instances.cost + " " + instances.costType))); ChestBehavior component = ((Component)instances).GetComponent<ChestBehavior>(); if ((Object)(object)component != (Object)null) { FillContent(scanItem, component.dropPickup); } ShopTerminalBehavior component2 =