using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using CompleteCheatMenu.Cheats; using CompleteCheatMenu.Game; using CompleteCheatMenu.Runtime; using CompleteCheatMenu.UI; using CompleteCheatMenu.UI.Tabs; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CompleteCheatMenu")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.6.1.0")] [assembly: AssemblyInformationalVersion("0.6.1+e81d2eca07f44ac6ef7c03939c49c4c2607fd278")] [assembly: AssemblyProduct("Complete Cheat Menu")] [assembly: AssemblyTitle("CompleteCheatMenu")] [assembly: AssemblyVersion("0.6.1.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CompleteCheatMenu { [BepInPlugin("envincible.howtofish.completecheatmenu", "Complete Cheat Menu", "0.6.1")] [BepInProcess("How to Fish.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "envincible.howtofish.completecheatmenu"; public const string Name = "Complete Cheat Menu"; public const string Version = "0.6.1"; internal static ManualLogSource Log; private Harmony _harmony; internal static ConfigEntry ToggleKey; internal static ConfigEntry AutoEnableCheats; internal static ConfigEntry BackupSaves; internal static ConfigEntry KeybindsEnabled; private bool _checkedOnce; private float _nextGateCheck; private void Awake() { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; ToggleKey = ((BaseUnityPlugin)this).Config.Bind("General", "ToggleKey", (KeyCode)277, "Opens and closes the cheat menu."); AutoEnableCheats = ((BaseUnityPlugin)this).Config.Bind("General", "AutoEnableCheats", true, "Unlock the game's own developer command suite automatically when you load in."); BackupSaves = ((BaseUnityPlugin)this).Config.Bind("General", "BackupSaves", true, "Copy the save folder once per session before the first destructive action. Silent, no prompt."); KeybindsEnabled = ((BaseUnityPlugin)this).Config.Bind("Keybinds", "EnableAllKeybinds", false, "Master switch for every cheat hotkey. The menu key is unaffected and always works."); Keybinds.Register(((BaseUnityPlugin)this).Config); _harmony = new Harmony("envincible.howtofish.completecheatmenu"); try { _harmony.PatchAll(Assembly.GetExecutingAssembly()); int num = 0; foreach (MethodBase patchedMethod in _harmony.GetPatchedMethods()) { _ = patchedMethod; num++; } Log.LogInfo((object)$"{num} method(s) patched."); } catch (Exception arg) { Log.LogError((object)$"Harmony patching failed; the rest of the menu still works: {arg}"); } Log.LogInfo((object)string.Format("{0} {1} loaded. Press {2} in game.", "Complete Cheat Menu", "0.6.1", ToggleKey.Value)); } private void OnDestroy() { if (VisualCheats.FreeCamActive) { VisualCheats.ToggleFreeCam(on: false); } Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private void Update() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown(ToggleKey.Value)) { MenuWindow.Toggle(); if (MenuWindow.Visible && !_checkedOnce) { _checkedOnce = true; SafeRun(DiagnosticsTab.RunChecks, "diagnostics"); } } if (AutoEnableCheats.Value && Time.unscaledTime >= _nextGateCheck) { _nextGateCheck = Time.unscaledTime + 5f; if (Refs.InGame && Refs.IsHost) { SafeRun(CheatGate.EnsureEnabled, "cheat gate"); } } SafeRun(Keybinds.Poll, "keybinds"); SafeRun(WeaponCheats.Tick, "weapons"); SafeRun(TickDriver.Tick, "tick"); } private void FixedUpdate() { SafeRun(TickDriver.FixedTick, "fixed tick"); } private void OnGUI() { SafeRun(EspRenderer.Draw, "esp"); SafeRun(MenuWindow.Draw, "menu"); } private static void SafeRun(Action action, string what) { try { action(); } catch (Exception arg) { Log.LogError((object)$"{what} failed: {arg}"); } } } } namespace CompleteCheatMenu.UI { internal static class MenuWindow { private struct Tab { internal string Title; internal Action Draw; internal bool ServerSide; } [CompilerGenerated] private static class <>O { public static WindowFunction <0>__DrawWindow; } private const int WindowId = 4408141; private static readonly Tab[] Tabs = new Tab[19] { new Tab { Title = "Player", Draw = PlayerTab.Draw, ServerSide = true }, new Tab { Title = "Weapons", Draw = WeaponsTab.Draw, ServerSide = true }, new Tab { Title = "Movement", Draw = MovementTab.Draw, ServerSide = false }, new Tab { Title = "Boat", Draw = BoatTab.Draw, ServerSide = true }, new Tab { Title = "Teleport", Draw = TeleportTab.Draw, ServerSide = true }, new Tab { Title = "Spawn", Draw = SpawnTab.Draw, ServerSide = true }, new Tab { Title = "Entities", Draw = EntitiesTab.Draw, ServerSide = true }, new Tab { Title = "Items", Draw = ItemsTab.Draw, ServerSide = true }, new Tab { Title = "Skins", Draw = SkinsTab.Draw, ServerSide = true }, new Tab { Title = "Money", Draw = MoneyTab.Draw, ServerSide = true }, new Tab { Title = "World", Draw = WorldTab.Draw, ServerSide = true }, new Tab { Title = "Kill score", Draw = KillScoreTab.Draw, ServerSide = true }, new Tab { Title = "Progression", Draw = ProgressionTab.Draw, ServerSide = true }, new Tab { Title = "Gambling", Draw = GamblingTab.Draw, ServerSide = true }, new Tab { Title = "Fishing", Draw = FishingTab.Draw, ServerSide = true }, new Tab { Title = "Visuals", Draw = VisualsTab.Draw, ServerSide = false }, new Tab { Title = "Keybinds", Draw = KeybindsTab.Draw, ServerSide = false }, new Tab { Title = "Settings", Draw = SettingsTab.Draw, ServerSide = false }, new Tab { Title = "Diagnostics", Draw = DiagnosticsTab.Draw, ServerSide = false } }; private static int _active; private static Rect _rect = new Rect(80f, 80f, 620f, 520f); private static Vector2 _contentScroll; private static bool _resizing; internal static bool Visible { get; private set; } internal static void Toggle() { Visible = !Visible; } internal static void Draw() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown if (Visible) { Theme.EnsureBuilt(); Rect rect = _rect; object obj = <>O.<0>__DrawWindow; if (obj == null) { WindowFunction val = DrawWindow; <>O.<0>__DrawWindow = val; obj = (object)val; } _rect = GUILayout.Window(4408141, rect, (WindowFunction)obj, "Complete Cheat Menu v0.6.1", Theme.Window, Array.Empty()); DrawToasts(); } } private static void DrawWindow(int id) { //IL_01ce: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) Keybinds.HandleCapture(Event.current); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.BeginVertical(Theme.SidebarBox, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(132f) }); for (int i = 0; i < Tabs.Length; i++) { if (GUILayout.Button((Tabs[i].ServerSide && !Refs.IsHost) ? (Tabs[i].Title + " ·") : Tabs[i].Title, (i == _active) ? Theme.TabActive : Theme.TabNormal, Array.Empty())) { _active = i; } } GUILayout.FlexibleSpace(); GUILayout.Label(Refs.IsHost ? "HOST" : (Refs.InGame ? "CLIENT" : "MENU"), Theme.Muted, Array.Empty()); if (!Refs.IsHost) { GUILayout.Label("· = needs host", Theme.Muted, Array.Empty()); } GUILayout.EndVertical(); GUILayout.BeginVertical(Array.Empty()); GUILayout.Space(2f); _contentScroll = GUILayout.BeginScrollView(_contentScroll, Array.Empty()); try { Tabs[_active].Draw(); } catch (Exception ex) { GUILayout.Label("This tab hit an error.", Theme.H2, Array.Empty()); GUILayout.Label(ex.Message, Theme.Muted, Array.Empty()); Plugin.Log.LogError((object)$"Tab '{Tabs[_active].Title}' failed: {ex}"); } GUILayout.EndScrollView(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); HandleResize(); GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _rect)).width, 24f)); } private static void HandleResize() { //IL_0031: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Invalid comparison between Unknown and I4 //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Invalid comparison between Unknown and I4 //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref _rect)).width - 16f, ((Rect)(ref _rect)).height - 16f, 14f, 14f); GUI.Label(val, "◢", Theme.Muted); Event current = Event.current; if ((int)current.type == 0 && ((Rect)(ref val)).Contains(current.mousePosition)) { _resizing = true; } if ((int)current.type == 1) { _resizing = false; } if (_resizing && (int)current.type == 3) { ((Rect)(ref _rect)).width = Mathf.Clamp(((Rect)(ref _rect)).width + current.delta.x, 460f, (float)Screen.width); ((Rect)(ref _rect)).height = Mathf.Clamp(((Rect)(ref _rect)).height + current.delta.y, 320f, (float)Screen.height); current.Use(); } } private static void DrawToasts() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) float num = 12f; foreach (Notifications.Toast item in Notifications.Active) { GUIStyle val = (item.Ok ? Theme.ToastOk : Theme.ToastBad); float num2 = Mathf.Max(val.CalcSize(new GUIContent(item.Text)).x + 20f, 160f); GUI.Label(new Rect((float)Screen.width - num2 - 16f, num, num2, 26f), item.Text, val); num += 30f; } } } internal static class Theme { internal static readonly Color Bg = Hex(1316636u); internal static readonly Color Sidebar = Hex(921878u); internal static readonly Color Panel = Hex(1777447u); internal static readonly Color PanelHi = Hex(2304051u); internal static readonly Color Border = Hex(3028033u); internal static readonly Color Accent = Hex(5030568u); internal static readonly Color AccentDim = Hex(3045995u); internal static readonly Color Danger = Hex(14702415u); internal static readonly Color TextMain = Hex(15133424u); internal static readonly Color TextMuted = Hex(9213349u); internal const float SidebarWidth = 132f; internal const float RowHeight = 24f; internal const float Pad = 10f; internal static GUIStyle Window; internal static GUIStyle SidebarBox; internal static GUIStyle TabNormal; internal static GUIStyle TabActive; internal static GUIStyle Section; internal static GUIStyle H1; internal static GUIStyle H2; internal static GUIStyle Body; internal static GUIStyle Muted; internal static GUIStyle Btn; internal static GUIStyle BtnAccent; internal static GUIStyle BtnDanger; internal static GUIStyle Toggle; internal static GUIStyle Field; internal static GUIStyle SliderBar; internal static GUIStyle SliderThumb; internal static GUIStyle ToastOk; internal static GUIStyle ToastBad; internal static GUIStyle Divider; private static bool _built; private static Texture2D _transparent; internal static void EnsureBuilt() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Expected O, but got Unknown //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Expected O, but got Unknown //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Expected O, but got Unknown //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Expected O, but got Unknown //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Expected O, but got Unknown //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Expected O, but got Unknown //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Expected O, but got Unknown //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Expected O, but got Unknown //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Expected O, but got Unknown //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: 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_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Expected O, but got Unknown //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Expected O, but got Unknown //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Expected O, but got Unknown //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Expected O, but got Unknown //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Expected O, but got Unknown //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Expected O, but got Unknown //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Expected O, but got Unknown //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Expected O, but got Unknown //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Expected O, but got Unknown //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Expected O, but got Unknown //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Expected O, but got Unknown //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Expected O, but got Unknown //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Expected O, but got Unknown //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Expected O, but got Unknown //IL_05ba: Expected O, but got Unknown //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Expected O, but got Unknown //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Expected O, but got Unknown //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Expected O, but got Unknown //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_0673: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Unknown result type (might be due to invalid IL or missing references) //IL_06a4: Unknown result type (might be due to invalid IL or missing references) //IL_06aa: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: Expected O, but got Unknown //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06be: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06de: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Expected O, but got Unknown //IL_06f2: Expected O, but got Unknown if (!_built || Window == null) { _built = true; Texture2D background = Rounded(48, 8, Bg, Border); Texture2D tex = Rounded(48, 8, Sidebar, Border); Texture2D tex2 = Rounded(32, 6, Panel, Border); Texture2D background2 = Rounded(32, 6, PanelHi, Accent); Texture2D background3 = Rounded(32, 6, PanelHi, Border); Texture2D background4 = Rounded(32, 6, PanelHi, Border); Texture2D background5 = Rounded(32, 6, Lighten(PanelHi, 0.1f), Accent); Texture2D background6 = Rounded(32, 6, AccentDim, Accent); Texture2D background7 = Rounded(32, 6, Mix(Panel, Danger, 0.35f), Danger); Texture2D background8 = Rounded(32, 6, Hex(724241u), Border); Texture2D background9 = Rounded(16, 4, Hex(724241u), Border); Texture2D background10 = Rounded(16, 8, Accent, Accent); GUIStyle val = new GUIStyle(GUI.skin.window); val.normal.background = background; val.normal.textColor = TextMain; val.onNormal.background = background; val.onNormal.textColor = TextMain; val.border = new RectOffset(10, 10, 10, 10); val.padding = new RectOffset(0, 0, 26, 0); val.fontSize = 13; val.fontStyle = (FontStyle)1; val.alignment = (TextAnchor)1; Window = val; SidebarBox = Boxed(tex, 10); SidebarBox.padding = new RectOffset(8, 8, 8, 8); Section = Boxed(tex2, 8); Section.padding = new RectOffset(10, 10, 8, 10); GUIStyle val2 = new GUIStyle(GUI.skin.button); val2.normal.background = Transparent(); val2.normal.textColor = TextMuted; val2.hover.background = background3; val2.hover.textColor = TextMain; val2.active.background = background3; val2.active.textColor = TextMain; val2.border = new RectOffset(8, 8, 8, 8); val2.padding = new RectOffset(10, 6, 6, 6); val2.margin = new RectOffset(0, 0, 1, 1); val2.alignment = (TextAnchor)3; val2.fontSize = 12; TabNormal = val2; GUIStyle val3 = new GUIStyle(TabNormal); val3.normal.background = background2; val3.normal.textColor = TextMain; val3.hover.background = background2; val3.hover.textColor = TextMain; val3.fontStyle = (FontStyle)1; TabActive = val3; GUIStyle val4 = new GUIStyle(GUI.skin.label) { fontSize = 15, fontStyle = (FontStyle)1 }; val4.normal.textColor = TextMain; H1 = val4; GUIStyle val5 = new GUIStyle(GUI.skin.label) { fontSize = 12, fontStyle = (FontStyle)1 }; val5.normal.textColor = Accent; H2 = val5; GUIStyle val6 = new GUIStyle(GUI.skin.label) { fontSize = 12 }; val6.normal.textColor = TextMain; Body = val6; GUIStyle val7 = new GUIStyle(GUI.skin.label) { fontSize = 11 }; val7.normal.textColor = TextMuted; val7.wordWrap = true; Muted = val7; GUIStyle val8 = new GUIStyle(GUI.skin.button); val8.normal.background = background4; val8.normal.textColor = TextMain; val8.hover.background = background5; val8.hover.textColor = TextMain; val8.active.background = background6; val8.active.textColor = TextMain; val8.border = new RectOffset(8, 8, 8, 8); val8.padding = new RectOffset(8, 8, 5, 5); val8.margin = new RectOffset(2, 2, 2, 2); val8.fontSize = 12; Btn = val8; GUIStyle val9 = new GUIStyle(Btn); val9.normal.background = background6; val9.normal.textColor = TextMain; val9.fontStyle = (FontStyle)1; BtnAccent = val9; GUIStyle val10 = new GUIStyle(Btn); val10.normal.background = background7; val10.normal.textColor = TextMain; val10.hover.background = background7; val10.hover.textColor = Color.white; BtnDanger = val10; GUIStyle val11 = new GUIStyle(GUI.skin.toggle) { fontSize = 12 }; val11.normal.textColor = TextMain; val11.onNormal.textColor = TextMain; Toggle = val11; GUIStyle val12 = new GUIStyle(GUI.skin.textField); val12.normal.background = background8; val12.normal.textColor = TextMain; val12.focused.background = background8; val12.focused.textColor = TextMain; val12.border = new RectOffset(8, 8, 8, 8); val12.padding = new RectOffset(7, 7, 4, 4); val12.fontSize = 12; Field = val12; GUIStyle val13 = new GUIStyle(GUI.skin.horizontalSlider); val13.normal.background = background9; val13.border = new RectOffset(4, 4, 4, 4); val13.fixedHeight = 10f; val13.margin = new RectOffset(2, 2, 8, 8); SliderBar = val13; GUIStyle val14 = new GUIStyle(GUI.skin.horizontalSliderThumb); val14.normal.background = background10; val14.active.background = background10; val14.border = new RectOffset(6, 6, 6, 6); val14.fixedWidth = 14f; val14.fixedHeight = 14f; SliderThumb = val14; ToastOk = Boxed(Rounded(32, 6, Mix(Panel, Accent, 0.22f), Accent), 8); ToastOk.padding = new RectOffset(10, 10, 6, 6); ToastOk.normal.textColor = TextMain; ToastOk.fontSize = 12; GUIStyle val15 = new GUIStyle(ToastOk); val15.normal.background = Rounded(32, 6, Mix(Panel, Danger, 0.25f), Danger); val15.normal.textColor = TextMain; ToastBad = val15; GUIStyle val16 = new GUIStyle(); val16.normal.background = Solid(Border); val16.fixedHeight = 1f; val16.margin = new RectOffset(0, 0, 6, 6); Divider = val16; } } private static GUIStyle Boxed(Texture2D tex, int border) { //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_001b: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003b: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.box); val.normal.background = tex; val.normal.textColor = TextMain; val.border = new RectOffset(border, border, border, border); return val; } private static Texture2D Rounded(int size, int radius, Color fill, Color border) { //IL_0004: 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) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0039: 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_006e: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)5, false) { filterMode = (FilterMode)1, hideFlags = (HideFlags)61 }; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num = CornerDistance(j, i, size, radius); if (num > (float)radius + 0.5f) { val.SetPixel(j, i, Color.clear); continue; } bool flag = num > (float)radius - 1.5f || j == 0 || i == 0 || j == size - 1 || i == size - 1; val.SetPixel(j, i, flag ? border : fill); } } val.Apply(); return val; } private static float CornerDistance(int x, int y, int size, int radius) { float num = ((x < radius) ? radius : ((x > size - 1 - radius) ? (size - 1 - radius) : x)); float num2 = ((y < radius) ? radius : ((y > size - 1 - radius) ? (size - 1 - radius) : y)); return Mathf.Sqrt(((float)x - num) * ((float)x - num) + ((float)y - num2) * ((float)y - num2)); } private static Texture2D Solid(Color c) { //IL_0004: 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) //IL_0011: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1, (TextureFormat)5, false) { hideFlags = (HideFlags)61 }; val.SetPixel(0, 0, c); val.Apply(); return val; } private static Texture2D Transparent() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) return _transparent ?? (_transparent = Solid(new Color(0f, 0f, 0f, 0f))); } private static Color Hex(uint rgb) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) return new Color((float)((rgb >> 16) & 0xFF) / 255f, (float)((rgb >> 8) & 0xFF) / 255f, (float)(rgb & 0xFF) / 255f, 1f); } private static Color Lighten(Color c, float amount) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return Color.Lerp(c, Color.white, amount); } private static Color Mix(Color a, Color b, float t) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) return Color.Lerp(a, b, t); } } internal static class Widgets { internal static void Section(string title, Action body) { GUILayout.BeginVertical(Theme.Section, Array.Empty()); if (!string.IsNullOrEmpty(title)) { GUILayout.Label(title.ToUpperInvariant(), Theme.H2, Array.Empty()); } body(); GUILayout.EndVertical(); GUILayout.Space(6f); } internal static void Divider() { GUILayout.Box(GUIContent.none, Theme.Divider, Array.Empty()); } internal static void Note(string text) { GUILayout.Label(text, Theme.Muted, Array.Empty()); } internal static float SliderRow(string label, float value, float min, float max, string format = "0.##", float? resetTo = null) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(label, Theme.Body, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) }); float result = GUILayout.HorizontalSlider(value, min, max, Theme.SliderBar, Theme.SliderThumb, Array.Empty()); GUILayout.Label(result.ToString(format), Theme.Muted, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(52f) }); if (resetTo.HasValue && GUILayout.Button("↺", Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(24f) })) { result = resetTo.Value; } GUILayout.EndHorizontal(); return result; } internal static int IntSliderRow(string label, int value, int min, int max) { return Mathf.RoundToInt(SliderRow(label, value, min, max, "0")); } internal static bool ToggleRow(string label, bool value, string hint = null) { GUILayout.BeginHorizontal(Array.Empty()); bool result = GUILayout.Toggle(value, " " + label, Theme.Toggle, Array.Empty()); GUILayout.FlexibleSpace(); if (!string.IsNullOrEmpty(hint)) { GUILayout.Label(hint, Theme.Muted, Array.Empty()); } GUILayout.EndHorizontal(); return result; } internal static string FieldRow(string label, string value, float labelWidth = 150f) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(label, Theme.Body, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(labelWidth) }); string result = GUILayout.TextField(value ?? "", Theme.Field, Array.Empty()); GUILayout.EndHorizontal(); return result; } internal static string SearchBox(string value, string placeholder = "Search…") { //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_005a: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal(Array.Empty()); string text = GUILayout.TextField(value ?? "", Theme.Field, Array.Empty()); if (string.IsNullOrEmpty(text)) { Rect lastRect = GUILayoutUtility.GetLastRect(); GUI.Label(new Rect(((Rect)(ref lastRect)).x + 8f, ((Rect)(ref lastRect)).y + 2f, ((Rect)(ref lastRect)).width, ((Rect)(ref lastRect)).height), placeholder, Theme.Muted); } if (GUILayout.Button("×", Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(26f) })) { text = ""; } GUILayout.EndHorizontal(); return text; } internal static void ActionButton(string label, Func action, string okText, GUIStyle style = null, float width = 0f) { GUILayoutOption[] array = (GUILayoutOption[])(object)((!(width > 0f)) ? new GUILayoutOption[0] : new GUILayoutOption[1] { GUILayout.Width(width) }); if (GUILayout.Button(label, style ?? Theme.Btn, array)) { bool ok; try { ok = action(); } catch (Exception ex) { ok = false; Plugin.Log.LogError((object)ex); } Notifications.Result(ok, okText, label + " failed — see log"); } } internal static bool RequireHost(string blockReason) { if (blockReason == null) { return true; } GUILayout.BeginVertical(Theme.Section, Array.Empty()); GUILayout.Label("Unavailable", Theme.H2, Array.Empty()); GUILayout.Label(blockReason, Theme.Muted, Array.Empty()); GUILayout.EndVertical(); return false; } } } namespace CompleteCheatMenu.UI.Tabs { internal static class BoatTab { private struct Row { internal string Field; internal string Label; internal float Min; internal float Max; } internal const string Title = "Boat"; private static readonly Row[] Rows = new Row[6] { new Row { Field = "_antiRollOverForce", Label = "Anti-rollover", Min = 0f, Max = 200f }, new Row { Field = "_steerSmoothing", Label = "Steer smoothing", Min = 0f, Max = 30f }, new Row { Field = "_linearDampAboveWater", Label = "Air drag", Min = 0f, Max = 5f }, new Row { Field = "_angularDampAboveWater", Label = "Air spin drag", Min = 0f, Max = 5f }, new Row { Field = "_underwaterLinearDamp", Label = "Water drag", Min = 0f, Max = 5f }, new Row { Field = "_underwaterAngularDamp", Label = "Water spin drag", Min = 0f, Max = 5f } }; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } if (!BoatCheats.Available) { Widgets.Note("No boat in the scene yet. Load into a save with a boat spawned."); return; } Widgets.Section("Unlocks", delegate { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(BoatCheats.Unlocked ? "Boat unlocked" : "Boat locked", Theme.Body, Array.Empty()); GUILayout.FlexibleSpace(); GUILayout.Label(BoatCheats.RadarUnlocked ? "Radar unlocked" : "Radar locked", Theme.Muted, Array.Empty()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Unlock boat", BoatCheats.UnlockBoat, "Boat unlocked", Theme.BtnAccent); Widgets.ActionButton("Unlock radar", BoatCheats.UnlockRadar, "Radar unlocked", Theme.BtnAccent); Widgets.ActionButton("Bring boat to me", BoatCheats.BringToPlayer, "Boat moved"); GUILayout.EndHorizontal(); }); Widgets.Section("Motor", delegate { GUILayout.Label($"Current tier: {BoatCheats.Motor}", Theme.Body, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); for (byte b = 0; b <= 4; b++) { byte t = b; Widgets.ActionButton($"{t}", () => BoatCheats.SetMotor(t), $"Motor set to {t}", (t == BoatCheats.Motor) ? Theme.BtnAccent : Theme.Btn, 44f); } GUILayout.EndHorizontal(); Widgets.Note("The game's own SetMotor only ever upgrades, so dropping to a lower tier writes the value directly instead."); }); Widgets.Section("Flight", delegate { if (!BoatCheats.FlyAvailable) { Widgets.Note("No boat rigidbody resolved — flight unavailable."); } else { CheatState.BoatFly = Widgets.ToggleRow("Boat flight", CheatState.BoatFly, CheatState.BoatFly ? "active" : "off"); CheatState.BoatFlySpeed = Widgets.SliderRow("Climb speed", CheatState.BoatFlySpeed, 1f, 100f, "0.#", 15f); Widgets.Note("Turns off the boat's gravity and gives Space and Left Ctrl control of its height. Steer normally while airborne. Gravity comes back when you switch it off — so switch it off over water."); } }); Widgets.Section("Speed", delegate { float motorForce = BoatCheats.MotorForce; float num = Widgets.SliderRow("Engine power", motorForce, 0f, 20000f, "0", BoatCheats.MotorForceDefault); if (!Mathf.Approximately(motorForce, num)) { BoatCheats.SetMotorForce(num); } float maxSpeed = BoatCheats.MaxSpeed; float num2 = Widgets.SliderRow("Speed limit", maxSpeed, 1f, 400f, "0"); if (!Mathf.Approximately(maxSpeed, num2)) { BoatCheats.SetMaxSpeed(num2); } Widgets.Note("Engine power is the thrust the motor applies and is the real speed control. The limit is the rigidbody's velocity cap — the game only reads its own value at startup, so this writes the cap directly."); }); Widgets.Section("Handling", delegate { Row[] rows = Rows; for (int i = 0; i < rows.Length; i++) { Row row = rows[i]; float num = BoatCheats.Get(row.Field); float num2 = Widgets.SliderRow(row.Label, num, row.Min, row.Max, "0.##", BoatCheats.Default(row.Field)); if (!Mathf.Approximately(num, num2)) { BoatCheats.Set(row.Field, num2); } } GUILayout.Space(4f); Widgets.ActionButton("Reset handling", delegate { BoatCheats.ResetAll(); return true; }, "Boat handling reset", Theme.BtnAccent); Widgets.Note("Steering and throttle angle were removed — they only rotate the wheel and lever props and never touched how the boat handles."); }); } } internal static class DiagnosticsTab { internal const string Title = "Diagnostics"; private static Vector2 _scroll; internal static void Draw() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) Widgets.Section("Status", delegate { Line("In game", Refs.InGame); Line("Host / solo", Refs.IsHost); Line("Dev cheats unlocked", CheatGate.CheatsEnabled); Line("Money API", MoneyCheats.Available); Line("Movement API", MovementCheats.Available); Line("Spawn API", SpawnCheats.Available); Line("Spawn catalogue", SpawnCatalog.Loaded, $"{SpawnCatalog.Count} entries"); Line("Boat present", BoatCheats.Available); Line("Casino present", GamblingCheats.Available); Line("Skin machine", GamblingCheats.SlotsAvailable); Line("Inventory API", FishingCheats.Available); Line("Boss active", WorldCheats.BossActive); Line("FOV control", VisualCheats.FovAvailable); Line("Free camera", VisualCheats.FreeCamAvailable); Line("Holding a weapon", WeaponCheats.HoldingWeapon, WeaponCheats.WeaponName); Line("Kill score control", KillScoreCheats.Available, $"{KillScoreCheats.Catalogue.Count} bonuses"); }); Widgets.Section("Bindings", delegate { int failed = BindingReport.Failed; GUILayout.Label((failed == 0) ? $"All {BindingReport.Total} resolved." : $"{failed} of {BindingReport.Total} failed to resolve.", (failed == 0) ? Theme.Body : Theme.H2, Array.Empty()); if (GUILayout.Button("Re-run checks", Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) })) { RunChecks(); } }); _scroll = GUILayout.BeginScrollView(_scroll, Array.Empty()); foreach (BindingReport.Entry item in BindingReport.All) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(item.Ok ? "OK" : "MISSING", item.Ok ? Theme.Muted : Theme.H2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(64f) }); GUILayout.Label(item.Name, Theme.Body, Array.Empty()); GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); } private static void Line(string label, bool ok, string extra = null) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(label, Theme.Body, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(170f) }); GUILayout.Label(ok ? "yes" : "no", ok ? Theme.Body : Theme.H2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) }); if (!string.IsNullOrEmpty(extra)) { GUILayout.Label(extra, Theme.Muted, Array.Empty()); } GUILayout.EndHorizontal(); } internal static void RunChecks() { _ = MoneyCheats.Available; _ = MovementCheats.Available; _ = SpawnCheats.Available; _ = CheatGate.CheatsEnabled; _ = Refs.IsHost; string[] fields = MovementCheats.Fields; foreach (string fieldName in fields) { GameBinder.Field("PlayerMovement", fieldName); } GameBinder.Method("PlayerManager", "ToggleGodMode", 0); GameBinder.Property("PlayerManager", "InGodMode"); GameBinder.Method("ServerSettings", "ToggleOneShot", 0); GameBinder.Method("ServerSettings", "ToggleFriendlyFire", 1); GameBinder.Method("PlayerVitals", "Heal", 1); GameBinder.Method("PlayerVitals", "RestoreFullness", 1); GameBinder.Method("PlayerVitals", "ServerResetVitals", 0); GameBinder.Method("ClientSettings", "ToggleCheats", 1); GameBinder.Field("GameInfo", "_nameToSpawnable"); GameBinder.Field("MoneyManager", "_money"); GameBinder.Method("MoneyManager", "RemoveMoney", 2); GameBinder.Field("Player", "LocalPlayer"); GameBinder.Property("BoatManager", "Boat"); GameBinder.Method("Boat", "SetMotor", 1); GameBinder.Method("Boat", "UnlockBoat", 0); GameBinder.Method("BoatManager", "TryMoveBoat", 2); GameBinder.Method("OnlineIslandManager", "TpToSpecificIsland", 1); GameBinder.Method("OnlineIslandManager", "UnlockIsland", 1); GameBinder.Method("Server", "TeleportPlayer", 3); GameBinder.Property("PlayerManager", "AlivePlayers"); GameBinder.Property("PlayerHolding", "HeldItem"); GameBinder.Field("Item", "_worth"); GameBinder.Field("Item", "_cookness"); GameBinder.Method("Item", "SetKillscoreMultiplier", 1); GameBinder.Method("Server", "SetItemSkin", 2); GameBinder.Method("SaveManager", "UnlockSkin", 2); GameBinder.Method("SaveManager", "LockAllSkins", 0); GameBinder.Property("GameInfo", "ItemWithSkinsforCommands"); GameBinder.Method("Server", "SetBoatSkin", 1); GameBinder.Method("GameInfo", "ToggleAllCreaturesKilled", 2); GameBinder.Method("BossManager", "ToggleImmortal", 1); GameBinder.Method("Creature", "HealBoss", 1); GameBinder.Method("NPCManager", "UnlockGrill", 0); GameBinder.Method("AchievementManager", "ToggleAllAchievements", 1); GameBinder.Method("DazedCommands", "UseFinishGameCommand", 0); GameBinder.Method("PlayerInventory", "UnlockExtraPocket", 1); GameBinder.Method("PlayerInventory", "ServerBoughtBait", 1); GameBinder.Method("PlayerInventory", "ServerSetCurBait", 1); GameBinder.Property("GameInfo", "AllBaits"); GameBinder.Method("CasinoManager", "ServerRouletteResult", 1); GameBinder.Method("SlotMachineManager", "SetCheatSkin", 2); GameBinder.EnumNames("BetColor"); GameBinder.Method("PlayerCamera", "SetFOV", 1); GameBinder.Property("PlayerCamera", "CamTransform"); GameBinder.Method("DecalManager", "ToggleDamageNumbers", 1); GameBinder.Method("DecalManager", "ToggleBlood", 1); GameBinder.Method("DecalManager", "ToggleDecals", 1); GameBinder.Property("ItemManager", "Items"); GameBinder.Property("Creature", "IsDead"); GameBinder.Field("CasinoManager", "_curBetColor"); GameBinder.Field("CasinoManager", "_itemsToBet"); GameBinder.Property("CasinoManager", "IsBetting"); GameBinder.Method("CasinoManager", "ServerStartBet", 1); GameBinder.Field("LocalCasino", "_wheel"); GameBinder.Field("LocalCasino", "_ballAngleObject"); GameBinder.Field("LocalCasino", "_slotSize"); GameBinder.Field("LocalCasino", "_isPlaying"); GameBinder.Field("LocalCasino", "_timeInSameSlot"); GameBinder.Method("SlotMachineManager", "RollRandom", 1); GameBinder.Field("SlotMachineManager", "_cheatSkinIndex"); GameBinder.Field("PlayerMovement", "_curMoveSpeed"); GameBinder.Field("PlayerMovement", "_targetMoveSpeed"); GameBinder.Method("PlayerMovement", "Teleport", 2); GameBinder.Property("Player", "Rigidbody"); GameBinder.Property("Player", "Movement"); GameBinder.Property("Player", "Skin"); GameBinder.Field("Boat", "_motorIndex"); GameBinder.Property("Boat", "HiddenPhysicsRig"); GameBinder.Method("Creature", "ServerChangeHp", 1); GameBinder.Method("Item", "DestroyItem", 2); GameBinder.Method("PlayerSkin", "InitializeOther", 0); GameBinder.Field("PlayerSkin", "_bodyRenderer"); GameBinder.Property("Item", "Weapon"); GameBinder.Property("Weapon", "Attachments"); GameBinder.Property("Weapon", "Ammo"); GameBinder.Field("Weapon", "k__BackingField"); GameBinder.Field("Weapon", "_spread"); GameBinder.Field("Weapon", "_recoilKnockback"); GameBinder.Field("Weapon", "_timeBetweenShots"); GameBinder.Field("Weapon", "_projectileCountPerShot"); GameBinder.Field("Weapon", "_projSpeed"); GameBinder.Property("Attachments", "FirePoint"); GameBinder.Method("Server", "BuyBulletUpgrade", 1); GameBinder.Method("PlayerKillScore", "AddKillScore", 3); GameBinder.Method("KillScoreCalculator", "GetAllBonuses", 1); GameBinder.Field("Bonus", "Name"); GameBinder.Field("Bonus", "Worth"); GameBinder.Method("PlayerInventory", "ServerDropAll", 2); GameBinder.Method("PlayerInventory", "SaveInventory", 1); GameBinder.Method("Server", "DropAllItems", 3); GameBinder.Method("Weapon", "Shoot", 0); GameBinder.Method("Weapon", "AddModelRecoil", 1); GameBinder.Method("PlayerCamera", "Recoil", 1); GameBinder.Method("PlayerToolMovement", "Recoil", 1); GameBinder.Field("Boat", "_motors"); GameBinder.Field("Boat", "_propellerInWater"); GameBinder.Property("BoatMotor", "Force"); GameBinder.Field("BoatMotor", "k__BackingField"); SpawnCatalog.Load(); Plugin.Log.LogInfo((object)$"Diagnostics: {BindingReport.Failed}/{BindingReport.Total} bindings failed."); } } internal static class EntitiesTab { internal const string Title = "Entities"; private static Vector2 _scroll; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } if (!EntityCheats.Available) { Widgets.Note("ItemManager.Items did not resolve. See Diagnostics."); return; } Widgets.Section("What's out there", delegate { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) GUILayout.Label($"{EntityCheats.TotalCount} loose object(s) in the world", Theme.H1, Array.Empty()); Widgets.Note("Anything a player is holding or has stored is excluded and never removed."); List list = EntityCheats.Summary(); if (list.Count == 0) { Widgets.Note("Nothing loose right now."); } else { _scroll = GUILayout.BeginScrollView(_scroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(150f) }); foreach (EntityCheats.Group item in list) { SpawnCatalog.Category kind = item.Kind; GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(kind.ToString(), Theme.Body, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) }); GUILayout.Label(item.Count.ToString("N0"), Theme.Muted, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); GUILayout.FlexibleSpace(); Widgets.ActionButton("Despawn", () => EntityCheats.DespawnCategory(kind) > 0, $"Cleared {kind}", Theme.Btn, 80f); GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); } }); Widgets.Section("Clear near me", delegate { CheatState.DespawnRadius = Widgets.SliderRow("Radius", CheatState.DespawnRadius, 5f, 200f, "0", 30f); Widgets.ActionButton($"Despawn everything within {CheatState.DespawnRadius:0}m", () => EntityCheats.DespawnNearby(CheatState.DespawnRadius) > 0, "Area cleared", Theme.BtnAccent); Widgets.Note("The safest option after a spawn button gets away from you."); }); Widgets.Section("Clear everything", delegate { GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("All creatures", () => EntityCheats.DespawnCreatures() > 0, "Creatures cleared", Theme.BtnDanger); Widgets.ActionButton("Everything loose", () => EntityCheats.DespawnAll() > 0, "World cleared", Theme.BtnDanger); GUILayout.EndHorizontal(); Widgets.Note("Uses the game's own Item.DestroyItem, so objects despawn across the network properly rather than vanishing only on your screen. This will also remove loot and quest items lying on the ground."); }); } } internal static class FishingTab { internal const string Title = "Fishing"; private static Vector2 _scroll; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } if (!FishingCheats.Available) { Widgets.Note("No player inventory yet. Load into a save first."); return; } Widgets.Section("Bait", delegate { GUILayout.Label($"Currently equipped: bait {FishingCheats.CurrentBait}", Theme.Body, Array.Empty()); Widgets.ActionButton("Grant every bait", FishingCheats.GrantAllBaits, "All baits granted", Theme.BtnAccent); Widgets.Note("Grants ownership without charging — the same call the game makes once a purchase is approved."); }); List baits = FishingCheats.AllBaits(); if (baits.Count == 0) { Widgets.Note("GameInfo.AllBaits did not resolve. See Diagnostics."); return; } Widgets.Section($"All baits ({baits.Count})", delegate { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) _scroll = GUILayout.BeginScrollView(_scroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(260f) }); foreach (FishingCheats.BaitEntry item in baits) { FishingCheats.BaitEntry b = item; GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(b.Name, Theme.Body, Array.Empty()); GUILayout.FlexibleSpace(); if (b.Cost > 0) { GUILayout.Label($"{b.Cost:N0}", Theme.Muted, Array.Empty()); } Widgets.ActionButton("Grant", () => FishingCheats.GrantBait(b.Index), "Granted " + b.Name, Theme.Btn, 58f); Widgets.ActionButton("Equip", () => FishingCheats.SelectBait(b.Index), "Equipped " + b.Name, (b.Index == FishingCheats.CurrentBait) ? Theme.BtnAccent : Theme.Btn, 58f); GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); }); } } internal static class GamblingTab { internal const string Title = "Gambling"; private static Vector2 _scroll; internal static void Draw() { if (Widgets.RequireHost(CheatGate.BlockReason())) { if (!GamblingCheats.Available) { Widgets.Note("No casino in this scene. Travel to the island with the casino."); DrawSlotMachine(); return; } DrawRig(); DrawLive(); DrawTable(); DrawSlotMachine(); } } private static void DrawRig() { Widgets.Section("Roulette odds", delegate { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button("Off", Mode(GamblingCheats.Mode.Off), Array.Empty())) { GamblingCheats.RigMode = GamblingCheats.Mode.Off; } if (GUILayout.Button("Win chance", Mode(GamblingCheats.Mode.Odds), Array.Empty())) { GamblingCheats.RigMode = GamblingCheats.Mode.Odds; } if (GUILayout.Button("Force colour", Mode(GamblingCheats.Mode.ForceColour), Array.Empty())) { GamblingCheats.RigMode = GamblingCheats.Mode.ForceColour; } GUILayout.EndHorizontal(); switch (GamblingCheats.RigMode) { case GamblingCheats.Mode.Off: Widgets.Note("The wheel runs untouched. Real odds: 18 red, 18 black, 1 green."); break; case GamblingCheats.Mode.Odds: GamblingCheats.WinChance = Widgets.SliderRow("Win chance", GamblingCheats.WinChance, 0f, 100f, "0'%'", 50f); Widgets.Note("Rolled once per spin. On a win the ball is steered to the colour you bet; on a loss it goes to the other of red or black, never green, so a loss can't accidentally pay 35x."); break; case GamblingCheats.Mode.ForceColour: { string[] colours = GamblingCheats.Colours; if (colours.Length == 0) { Widgets.Note("BetColor enum did not resolve. See Diagnostics."); } else { GUILayout.BeginHorizontal(Array.Empty()); string[] array = colours; foreach (string text in array) { if (GUILayout.Button(text, (GamblingCheats.ForcedColour == text) ? Theme.BtnAccent : Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(96f) })) { GamblingCheats.ForcedColour = text; } } GUILayout.EndHorizontal(); Widgets.Note("Every spin lands on this colour regardless of what you bet. Green pays 35x."); } break; } } }); Widgets.Section("How this works", delegate { Widgets.Note("The ball is a real physics object and the game reads its actual angle against the wheel to decide the result. Rather than forging the payout — which is why other mods pay out on a colour the ball never touched — this rotates the wheel a fraction of a pocket while the ball settles, so the ball genuinely comes to rest on the colour you asked for. What you see is what pays, and other players see the same wheel."); }); } private static GUIStyle Mode(GamblingCheats.Mode m) { if (GamblingCheats.RigMode != m) { return Theme.Btn; } return Theme.BtnAccent; } private static void DrawLive() { Widgets.Section("Live", delegate { Row("Spin in progress", GamblingCheats.IsBetting ? "yes" : "no"); Row("You bet", GamblingCheats.BetColour); Row("Ball is on", GamblingCheats.CurrentBallColour); Row("Steering toward", GamblingCheats.CurrentTarget); Row("Pot worth", GamblingCheats.PotWorth.ToString("N0")); Row("Last result", GamblingCheats.LastOutcome); GUILayout.Space(4f); Row("Spins", $"{GamblingCheats.SpinsSeen} won {GamblingCheats.SpinsWon} " + $"lost {GamblingCheats.SpinsLost}"); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Settle now", GamblingCheats.SettleNow, "Wheel settled", Theme.Btn); Widgets.ActionButton("Reset stats", delegate { GamblingCheats.ResetStats(); return true; }, "Stats cleared", Theme.Btn); GUILayout.EndHorizontal(); Widgets.Note("Settle now ends the spin immediately on whatever pocket the ball is already over — use it once the colour reads correctly."); }); } private static void Row(string label, string value) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(label, Theme.Muted, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(140f) }); GUILayout.Label(value, Theme.Body, Array.Empty()); GUILayout.EndHorizontal(); } private static void DrawTable() { Widgets.Section("Bet table", delegate { List list = GamblingCheats.BetItems(); GUILayout.Label($"{list.Count} item(s) on the table", Theme.Body, Array.Empty()); CheatState.BetBoost = Widgets.SliderRow("Item value multiplier", CheatState.BetBoost, 1f, 50f, "0.##", 1f); Widgets.ActionButton("Apply to table", () => GamblingCheats.BoostBetItems(CheatState.BetBoost), $"Table items multiplied by {CheatState.BetBoost:0.##}", Theme.BtnAccent); Widgets.Note("Raises the worth of everything you've placed, so a win pays more. Apply before the wheel resolves."); string[] colours = GamblingCheats.Colours; if (colours.Length != 0 && !GamblingCheats.IsBetting) { GUILayout.Space(4f); GUILayout.Label("Start a spin manually", Theme.Muted, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); string[] array = colours; foreach (string text in array) { string colour = text; Widgets.ActionButton(colour, () => GamblingCheats.StartSpin(colour), "Spinning on " + colour, Theme.Btn, 96f); } GUILayout.EndHorizontal(); } }); } private static void DrawSlotMachine() { if (!GamblingCheats.SlotsAvailable) { Widgets.Section("Skin machine", delegate { Widgets.Note("SlotMachineManager did not resolve. See Diagnostics."); }); return; } List targets = GamblingCheats.SkinTargets(); object selected = SelectedTarget(targets); Widgets.Section("Skin machine", delegate { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(GamblingCheats.SlotRigArmed ? "Armed:" : "Nothing armed", Theme.Body, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(96f) }); GUILayout.Label(GamblingCheats.SlotRigArmed ? GamblingCheats.LastArmed : "the roll is random", Theme.Muted, Array.Empty()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Roll the machine", GamblingCheats.RollSlots, "Rolled", Theme.BtnAccent); Widgets.ActionButton("Clear", GamblingCheats.ClearArmed, "Rig cleared"); GUILayout.EndHorizontal(); Widgets.Note("Arm a skin, then roll — the reel is built around your pick, so the machine visibly stops on the skin it hands you."); }); Widgets.Section("1 · What are you winning a skin for", delegate { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button("Boat", (CheatState.SlotTargetIndex < 0) ? Theme.BtnAccent : Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(96f) })) { CheatState.SlotTargetIndex = -1; } object held = ItemCheats.HeldItem; if (held != null) { int num = targets.FindIndex((object t) => t == held); if (GUILayout.Button("Held item", (num >= 0 && CheatState.SlotTargetIndex == num) ? Theme.BtnAccent : Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) })) { if (num >= 0) { CheatState.SlotTargetIndex = num; } else { Notifications.Show(ItemCheats.ItemName(held) + " has no skins", ok: false); } } } GUILayout.EndHorizontal(); CheatState.SlotTargetFilter = Widgets.SearchBox(CheatState.SlotTargetFilter, "Find a weapon…"); string text = (CheatState.SlotTargetFilter ?? "").Trim().ToLowerInvariant(); int num2 = 0; GUILayout.BeginHorizontal(Array.Empty()); for (int num3 = 0; num3 < targets.Count; num3++) { string text2 = GamblingCheats.TargetName(targets[num3]); if (text.Length <= 0 || text2.ToLowerInvariant().Contains(text)) { int num4 = num3; if (GUILayout.Button(text2, (CheatState.SlotTargetIndex == num4) ? Theme.BtnAccent : Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(128f) })) { CheatState.SlotTargetIndex = num4; } if (++num2 % 3 == 0) { GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); } } } GUILayout.EndHorizontal(); GUILayout.Label("Selected: " + GamblingCheats.TargetName(selected), Theme.Body, Array.Empty()); }); List skins = GamblingCheats.SkinsFor(selected); if (skins.Count == 0) { Widgets.Section("2 · Pick a skin", delegate { Widgets.Note(GamblingCheats.TargetName(selected) + " has no skin preset."); }); return; } <>c__DisplayClass8_0 CS$<>8__locals2; Widgets.Section("2 · Pick a rarity, or take any of it", delegate { List list = GamblingCheats.RaritiesFor(selected); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button("All", string.IsNullOrEmpty(CheatState.SlotRarity) ? Theme.BtnAccent : Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(84f) })) { CheatState.SlotRarity = ""; } foreach (string item in list) { if (GUILayout.Button(item, (CheatState.SlotRarity == item) ? Theme.BtnAccent : Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(104f) })) { CheatState.SlotRarity = item; } } GUILayout.EndHorizontal(); if (!string.IsNullOrEmpty(CheatState.SlotRarity)) { string rarity = CheatState.SlotRarity; Widgets.ActionButton("Arm a random " + rarity + " skin", () => GamblingCheats.ArmRandomOfRarity(CS$<>8__locals2, rarity), "Armed a " + rarity + " skin", Theme.BtnAccent); } Widgets.Note("Rarity also decides where on the reel it lands — the game seats commons, rares and legendaries in different positions."); }); Widgets.Section("3 · Or choose the exact skin", delegate { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) CheatState.SlotSkinFilter = Widgets.SearchBox(CheatState.SlotSkinFilter, "Filter skins…"); string filter = (CheatState.SlotSkinFilter ?? "").Trim().ToLowerInvariant(); List list = (from skinEntry in skins where string.IsNullOrEmpty(CheatState.SlotRarity) || string.Equals(skinEntry.Rarity, CheatState.SlotRarity, StringComparison.OrdinalIgnoreCase) where filter.Length == 0 || skinEntry.Name.ToLowerInvariant().Contains(filter) || (skinEntry.Rarity ?? "").ToLowerInvariant().Contains(filter) select skinEntry).ToList(); GUILayout.Label($"{list.Count} of {skins.Count} skins", Theme.Muted, Array.Empty()); _scroll = GUILayout.BeginScrollView(_scroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(220f) }); foreach (SkinCheats.SkinEntry item2 in list) { SkinCheats.SkinEntry s = item2; GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(s.Name, Theme.Body, Array.Empty()); GUILayout.FlexibleSpace(); if (!string.IsNullOrEmpty(s.Rarity)) { GUILayout.Label(s.Rarity, Theme.Muted, Array.Empty()); } Widgets.ActionButton("Arm", () => GamblingCheats.ArmSkin(CS$<>8__locals2, s), "Next roll awards " + s.Name, Theme.BtnAccent, 54f); Widgets.ActionButton("Unlock", () => SkinCheats.UnlockSkin(CS$<>8__locals2, s.Index), "Unlocked " + s.Name, Theme.Btn, 66f); GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); }); } private static object SelectedTarget(List targets) { if (CheatState.SlotTargetIndex < 0) { return null; } if (CheatState.SlotTargetIndex >= targets.Count) { return null; } return targets[CheatState.SlotTargetIndex]; } } internal static class ItemsTab { internal const string Title = "Items"; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } object held = ItemCheats.HeldItem; Widgets.Section("Target", delegate { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button("Held item", (CheatState.ItemTarget == ItemCheats.Target.Held) ? Theme.BtnAccent : Theme.Btn, Array.Empty())) { CheatState.ItemTarget = ItemCheats.Target.Held; } if (GUILayout.Button("Every item in world", (CheatState.ItemTarget == ItemCheats.Target.World) ? Theme.BtnAccent : Theme.Btn, Array.Empty())) { CheatState.ItemTarget = ItemCheats.Target.World; } GUILayout.EndHorizontal(); int count = ItemCheats.Resolve(CheatState.ItemTarget).Count; GUILayout.Label((CheatState.ItemTarget != ItemCheats.Target.Held) ? $"{count} items in the world." : ((held == null) ? "Nothing in hand." : ("Holding: " + ItemCheats.ItemName(held))), Theme.Muted, Array.Empty()); }); if (held != null && CheatState.ItemTarget == ItemCheats.Target.Held) { Widgets.Section("Current values", delegate { Stat("Base worth", ItemCheats.Worth(held).ToString("N0")); Stat("Total worth", ItemCheats.TotalWorth(held).ToString("N0")); Stat("Weight", ItemCheats.Weight(held).ToString("0.###")); Stat("Cookness", ItemCheats.Cookness(held).ToString("0.###")); Stat("Kill score multi", ItemCheats.KillScoreMulti(held).ToString("0.###")); Stat("Betting multi", ItemCheats.BettingMulti(held).ToString("0.###")); }); } Widgets.Section("Worth", delegate { CheatState.ItemWorth = Widgets.FieldRow("Base worth", CheatState.ItemWorth, 100f); int worth = MoneyTab.Parse(CheatState.ItemWorth); Widgets.ActionButton("Apply worth", () => Apply((object i) => ItemCheats.SetWorth(i, worth)), $"Worth set to {worth:N0}", Theme.BtnAccent); Widgets.Note("Total worth is derived from base worth, weight and cookness."); }); Widgets.Section("Multipliers", delegate { CheatState.ItemWeight = Widgets.SliderRow("Weight", CheatState.ItemWeight, 0.1f, 50f, "0.##", 1f); Widgets.ActionButton("Apply weight", () => Apply((object i) => ItemCheats.SetWeight(i, CheatState.ItemWeight)), $"Weight set to {CheatState.ItemWeight:0.##}"); CheatState.ItemCookness = Widgets.SliderRow("Cookness", CheatState.ItemCookness, 0f, 2f, "0.##", 1f); Widgets.ActionButton("Apply cookness", () => Apply((object i) => ItemCheats.SetCookness(i, CheatState.ItemCookness)), $"Cookness set to {CheatState.ItemCookness:0.##}"); CheatState.ItemKillScore = Widgets.SliderRow("Kill score", CheatState.ItemKillScore, 0f, 25f, "0.##", 1f); Widgets.ActionButton("Apply kill score", () => Apply((object i) => ItemCheats.SetKillScoreMulti(i, CheatState.ItemKillScore)), $"Kill score multi {CheatState.ItemKillScore:0.##}"); CheatState.ItemBetting = Widgets.SliderRow("Betting", CheatState.ItemBetting, 0f, 25f, "0.##", 1f); Widgets.ActionButton("Apply betting", () => Apply((object i) => ItemCheats.SetBettingMulti(i, CheatState.ItemBetting)), $"Betting multi {CheatState.ItemBetting:0.##}"); }); Widgets.Section("Stacking and inventory", delegate { CheatState.KeepInventory = Widgets.ToggleRow("Keep inventory on death", CheatState.KeepInventory, CheatState.KeepInventory ? "ACTIVE" : "off"); Widgets.Note("Skips the drop that normally scatters your items when you die, on both the inventory and the server side so nothing desyncs."); GUILayout.Space(4f); CheatState.DuplicateCount = Widgets.IntSliderRow("Copies", CheatState.DuplicateCount, 1, 50); Widgets.ActionButton($"Duplicate held item ×{CheatState.DuplicateCount}", () => InventoryCheats.DuplicateHeld(CheatState.DuplicateCount) > 0, $"Made {CheatState.DuplicateCount} copies", Theme.BtnAccent); Widgets.Note("The game has no stack count — every slot holds one real item with its own worth and skin — so this spawns that many genuine copies at your feet instead of faking a stack number."); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Save inventory", InventoryCheats.SaveInventory, "Inventory saved"); Widgets.ActionButton("Drop everything", InventoryCheats.DropAll, "Dropped", Theme.BtnDanger); GUILayout.EndHorizontal(); }); Widgets.Section("Bulk", delegate { Widgets.ActionButton("Make everything valuable", () => Apply((object i) => ItemCheats.SetWorth(i, 100000) && ItemCheats.SetWeight(i, 10f)), "Applied to the current target", Theme.BtnDanger); Widgets.Note("Applies base worth 100,000 and weight 10 to whichever target is selected above."); }); } private static bool Apply(Func action) { return ItemCheats.ApplyToAll(CheatState.ItemTarget, action) > 0; } private static void Stat(string label, string value) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(label, Theme.Muted, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(130f) }); GUILayout.Label(value, Theme.Body, Array.Empty()); GUILayout.EndHorizontal(); } } internal static class KeybindsTab { internal const string Title = "Keybinds"; internal static void Draw() { Widgets.Section("Master switch", delegate { //IL_0086: Unknown result type (might be due to invalid IL or missing references) bool enabled = Keybinds.Enabled; bool flag = Widgets.ToggleRow("Enable all keybinds", enabled, enabled ? "ACTIVE" : "off"); if (flag != enabled) { Plugin.KeybindsEnabled.Value = flag; Notifications.Show(flag ? "Cheat hotkeys enabled" : "Cheat hotkeys disabled"); } GUILayout.Space(2f); GUILayout.Label(enabled ? "Hotkeys below are live." : "Hotkeys below do nothing while this is off.", enabled ? Theme.Body : Theme.Muted, Array.Empty()); Widgets.Note($"The menu key ({Plugin.ToggleKey.Value}) is not affected by this switch " + "and always works."); }); Widgets.Section("Hotkeys", delegate { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if (!Keybinds.Enabled) { Widgets.Note("Currently inactive — you can still rebind them."); } Widgets.Note("Click a key to rebind it, then press the new key. Escape cancels."); GUILayout.Space(2f); foreach (Keybinds.Bind item in Keybinds.All) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(item.Name, Keybinds.Enabled ? Theme.Body : Theme.Muted, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) }); bool flag = Keybinds.Capturing == item; if (GUILayout.Button(flag ? "press a key…" : ((object)item.Key.Value/*cast due to .constrained prefix*/).ToString(), flag ? Theme.BtnAccent : Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(130f) })) { Keybinds.Capturing = (flag ? null : item); } GUILayout.Label(item.IsOn() ? "on" : "off", Theme.Muted, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(30f) }); if (GUILayout.Button("clear", Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(56f) })) { item.Key.Value = (KeyCode)0; } GUILayout.EndHorizontal(); } GUILayout.Space(4f); Widgets.Note("A cleared bind is stored as None and stays inactive until you set a key."); }); Widgets.Section("Menu", delegate { //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) GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Open / close menu", Theme.Body, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) }); GUILayout.Label(((object)Plugin.ToggleKey.Value/*cast due to .constrained prefix*/).ToString(), Theme.Body, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(130f) }); GUILayout.Label("always on", Theme.Muted, Array.Empty()); GUILayout.EndHorizontal(); Widgets.Note("Change this one in BepInEx/config/envincible.howtofish.completecheatmenu.cfg, so a mis-set key can never lock you out of the menu."); }); } } internal static class KillScoreTab { internal const string Title = "Kill score"; private static Vector2 _scroll; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } if (!KillScoreCheats.Available) { Widgets.Note("PlayerKillScore.AddKillScore did not resolve. See Diagnostics."); return; } Widgets.Section("Override", delegate { CheatState.KillScoreOverride = Widgets.ToggleRow("Use my bonuses", CheatState.KillScoreOverride, CheatState.KillScoreOverride ? "ACTIVE" : "off"); GUILayout.Label($"Multiplier: ×{KillScoreCheats.PreviewMultiplier:0.##}", Theme.H1, Array.Empty()); CheatState.KillFlatMultiplier = Widgets.SliderRow("Extra multiplier", CheatState.KillFlatMultiplier, 1f, 50f, "0.##", 1f); CheatState.KillBonusLabel = Widgets.FieldRow("Its label", CheatState.KillBonusLabel, 90f); Widgets.Note("The extra multiplier is added as its own named row, so it shows up on the banner like any other bonus rather than appearing from nowhere."); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Select all", delegate { for (int i = 0; i < KillScoreCheats.Catalogue.Count; i++) { if (!KillScoreCheats.Catalogue[i].Selected) { KillScoreCheats.Toggle(i); } } return true; }, "All bonuses selected", Theme.Btn); Widgets.ActionButton("Clear", delegate { KillScoreCheats.ClearSelection(); return true; }, "Selection cleared", Theme.Btn); GUILayout.EndHorizontal(); }); Widgets.Section($"Bonuses ({KillScoreCheats.Selected.Count()} of {KillScoreCheats.Catalogue.Count})", delegate { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) _scroll = GUILayout.BeginScrollView(_scroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(300f) }); List catalogue = KillScoreCheats.Catalogue; for (int i = 0; i < catalogue.Count; i++) { KillScoreCheats.BonusOption bonusOption = catalogue[i]; int index = i; GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Toggle(bonusOption.Selected, " " + bonusOption.Name, Theme.Toggle, Array.Empty()) != bonusOption.Selected) { KillScoreCheats.Toggle(index); } GUILayout.FlexibleSpace(); GUILayout.Label($"×{bonusOption.Worth:0.##}", Theme.Muted, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(52f) }); GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); Widgets.Note("Bonuses multiply together — the game computes the payout as the product of every row, which is why picking several stacks up fast."); }); } } internal static class MoneyTab { internal const string Title = "Money"; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } if (!MoneyCheats.Available) { Widgets.Note("MoneyManager.AddMoney(int, Player) did not resolve. See Diagnostics."); return; } Widgets.Section("Balance", delegate { GUILayout.Label($"{MoneyCheats.Balance:N0}", Theme.H1, Array.Empty()); CheatState.MoneyAmount = Widgets.FieldRow("Amount", CheatState.MoneyAmount, 80f); int amount = Parse(CheatState.MoneyAmount); Widgets.Note("Accepts shorthand: 50k, 2.5m, 1b."); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Add", () => MoneyCheats.Add(amount), $"+{amount:N0}", Theme.BtnAccent); Widgets.ActionButton("Remove", () => MoneyCheats.Remove(amount), $"-{amount:N0}"); Widgets.ActionButton("Set to", () => MoneyCheats.SetTo(amount), $"Balance set to {amount:N0}"); GUILayout.EndHorizontal(); }); Widgets.Section("Quick add", delegate { GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("+1k", () => MoneyCheats.Add(1000), "+1,000"); Widgets.ActionButton("+10k", () => MoneyCheats.Add(10000), "+10,000"); Widgets.ActionButton("+100k", () => MoneyCheats.Add(100000), "+100,000"); Widgets.ActionButton("+1M", () => MoneyCheats.Add(1000000), "+1,000,000"); GUILayout.EndHorizontal(); }); } internal static int Parse(string s) { if (string.IsNullOrEmpty(s)) { return 0; } s = s.Trim().Replace(",", "").Replace("_", ""); double num = 1.0; if (s.Length > 1) { switch (char.ToLowerInvariant(s[s.Length - 1])) { case 'k': num = 1000.0; s = s.Substring(0, s.Length - 1); break; case 'm': num = 1000000.0; s = s.Substring(0, s.Length - 1); break; case 'b': num = 1000000000.0; s = s.Substring(0, s.Length - 1); break; } } if (!double.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { return 0; } double val = result * num; return (int)Math.Max(-2147483648.0, Math.Min(2147483647.0, val)); } } internal static class MovementTab { private struct Row { internal string Field; internal string Label; internal float Min; internal float Max; } internal const string Title = "Movement"; private static readonly Row[] Rows = new Row[8] { new Row { Field = "_walkSpeed", Label = "Walk speed", Min = 0f, Max = 60f }, new Row { Field = "_sprintSpeed", Label = "Sprint speed", Min = 0f, Max = 100f }, new Row { Field = "_crouchWalkSpeedMulti", Label = "Crouch multi", Min = 0f, Max = 5f }, new Row { Field = "_jumpForce", Label = "Jump force", Min = 0f, Max = 60f }, new Row { Field = "_extraGravityForce", Label = "Extra gravity", Min = 0f, Max = 60f }, new Row { Field = "_acceleration", Label = "Acceleration", Min = 0f, Max = 200f }, new Row { Field = "_decceleration", Label = "Deceleration", Min = 0f, Max = 200f }, new Row { Field = "_sinkSpeed", Label = "Sink speed", Min = 0f, Max = 30f } }; internal static void Draw() { if (!MovementCheats.Available) { Widgets.RequireHost("Load into a save first."); return; } Widgets.Section("Flight", delegate { if (!MovementCheats.FlyAvailable) { Widgets.Note("PlayerMovement._curMoveSpeed did not resolve — flight unavailable."); } else { CheatState.Fly = Widgets.ToggleRow("Fly mode", CheatState.Fly, CheatState.Fly ? "active" : "off"); CheatState.FlyHorizontalSpeed = Widgets.SliderRow("Horizontal speed", CheatState.FlyHorizontalSpeed, 1f, 200f, "0.#", 25f); CheatState.FlyVerticalSpeed = Widgets.SliderRow("Vertical speed", CheatState.FlyVerticalSpeed, 1f, 120f, "0.#", 12f); Widgets.Note("WASD moves, Space up, Left Ctrl down. Releasing both hovers instead of falling. Gravity is restored when you switch fly off."); } }); Widgets.Section("Ground movement", delegate { Row[] rows = Rows; for (int i = 0; i < rows.Length; i++) { Row row = rows[i]; float num = MovementCheats.Get(row.Field); float num2 = Widgets.SliderRow(row.Label, num, row.Min, row.Max, "0.##", MovementCheats.Default(row.Field)); if (!Mathf.Approximately(num, num2)) { MovementCheats.Set(row.Field, num2); } } GUILayout.Space(4f); Widgets.ActionButton("Reset all to defaults", delegate { MovementCheats.ResetAll(); return true; }, "Movement reset", Theme.BtnAccent); Widgets.Note("Defaults are captured the first time each slider is read this session."); }); } } internal static class PlayerTab { internal const string Title = "Player"; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } Widgets.Section("Invulnerability", delegate { bool godMode = CombatCheats.GodMode; bool flag = Widgets.ToggleRow("God mode", godMode, godMode ? "on" : "off"); if (flag != godMode) { Notifications.Result(CombatCheats.SetGodMode(flag), flag ? "God mode on" : "God mode off", "God mode toggle failed"); } bool oneShot = CombatCheats.OneShot; bool flag2 = Widgets.ToggleRow("One-shot kills", oneShot, oneShot ? "on" : "off"); if (flag2 != oneShot) { Notifications.Result(CombatCheats.SetOneShot(flag2), flag2 ? "One-shot on" : "One-shot off", "One-shot toggle failed"); } bool friendlyFire = CombatCheats.FriendlyFire; bool flag3 = Widgets.ToggleRow("Friendly fire", friendlyFire, friendlyFire ? "on" : "off"); if (flag3 != friendlyFire) { Notifications.Result(CombatCheats.SetFriendlyFire(flag3), flag3 ? "Friendly fire on" : "Friendly fire off", "Friendly fire toggle failed"); } }); Widgets.Section("Vitals", delegate { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label($"Health {CombatCheats.Health}", Theme.Body, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) }); GUILayout.Label($"Fullness {CombatCheats.Fullness}", Theme.Body, Array.Empty()); GUILayout.EndHorizontal(); CheatState.HealAmount = Widgets.IntSliderRow("Amount", CheatState.HealAmount, 1, 100); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Heal", () => CombatCheats.Heal(CheatState.HealAmount), $"Healed {CheatState.HealAmount}"); Widgets.ActionButton("Feed", () => CombatCheats.RestoreFullness(CheatState.HealAmount), $"Fullness +{CheatState.HealAmount}"); Widgets.ActionButton("Full reset", CombatCheats.ResetVitals, "Vitals reset", Theme.BtnAccent); GUILayout.EndHorizontal(); Widgets.Note("Full reset also clears poison and fire."); }); Widgets.Section("Developer cheats", delegate { bool on = CheatGate.CheatsEnabled; GUILayout.Label(on ? "The game's own command suite is unlocked." : "Locked — the game's dev commands will refuse to run.", Theme.Muted, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton(on ? "Disable dev cheats" : "Enable dev cheats", () => CheatGate.EnableCheats(!on), on ? "Dev cheats disabled" : "Dev cheats enabled", on ? Theme.Btn : Theme.BtnAccent); GUILayout.EndHorizontal(); }); } } internal static class ProgressionTab { internal const string Title = "Progression"; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } Widgets.Section("Everything at once", delegate { Widgets.ActionButton("Unlock everything", ProgressionCheats.UnlockEverything, "Skins, characters, islands, boat, radar, grill and pockets unlocked", Theme.BtnAccent); Widgets.Note("Skins, characters, all islands, boat, radar, grill and every inventory pocket."); }); Widgets.Section("Inventory", delegate { GUILayout.Label($"Extra pockets unlocked: {ProgressionCheats.ExtraSlots}", Theme.Body, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); for (byte b = 1; b <= 4; b++) { byte slot = b; Widgets.ActionButton($"Pocket {slot}", () => ProgressionCheats.UnlockPocket(slot), $"Pocket {slot} unlocked", Theme.Btn, 88f); } GUILayout.EndHorizontal(); Widgets.ActionButton("Unlock all pockets", ProgressionCheats.UnlockAllPockets, "All pockets unlocked", Theme.BtnAccent); }); Widgets.Section("Game completion", delegate { Widgets.ActionButton("Finish game", ProgressionCheats.FinishGame, "Game marked finished", Theme.BtnDanger); Widgets.ActionButton("Show kill scores", ProgressionCheats.ShowKillScores, "Kill scores shown"); }); Widgets.Section("Steam achievements", delegate { GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Unlock all", ProgressionCheats.UnlockAchievements, "All achievements unlocked", Theme.BtnDanger); Widgets.ActionButton("Lock all", ProgressionCheats.LockAchievements, "Achievements locked", Theme.Btn); GUILayout.EndHorizontal(); Widgets.Note("Achievements are written to Steam. Locking clears the local flags, but anything already pushed to your Steam profile stays there."); }); Widgets.Section("Save", delegate { Widgets.ActionButton("Save now", ProgressionCheats.SaveNow, "Server saved", Theme.BtnAccent); Widgets.Note("A backup copy of your save folder is taken automatically before the first permanent change each session."); }); } } internal static class SettingsTab { internal const string Title = "Settings"; internal static void Draw() { Widgets.Section("Presets", delegate { CheatState.PresetName = Widgets.FieldRow("Name", CheatState.PresetName, 60f); Widgets.ActionButton("Save current settings", () => Presets.Save(CheatState.PresetName), "Saved '" + CheatState.PresetName + "'", Theme.BtnAccent); List list = Presets.List(); if (list.Count == 0) { Widgets.Note("No presets yet. Presets store movement, ESP, camera and item values."); return; } GUILayout.Space(4f); foreach (string item in list) { string n = item; GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(n, Theme.Body, Array.Empty()); GUILayout.FlexibleSpace(); Widgets.ActionButton("Load", () => Presets.Load(n), "Loaded '" + n + "'", Theme.BtnAccent, 58f); if (GUILayout.Button("×", Theme.BtnDanger, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(26f) })) { Presets.Delete(n); } GUILayout.EndHorizontal(); } }); Widgets.Section("Plugin", delegate { //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) GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Menu key", Theme.Body, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) }); GUILayout.Label(((object)Plugin.ToggleKey.Value/*cast due to .constrained prefix*/).ToString(), Theme.Muted, Array.Empty()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Cheat hotkeys", Theme.Body, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) }); GUILayout.Label(Keybinds.Enabled ? "enabled" : "disabled — see Keybinds tab", Theme.Muted, Array.Empty()); GUILayout.EndHorizontal(); Plugin.AutoEnableCheats.Value = Widgets.ToggleRow("Auto-unlock dev cheats", Plugin.AutoEnableCheats.Value); Plugin.BackupSaves.Value = Widgets.ToggleRow("Back up saves before permanent changes", Plugin.BackupSaves.Value); Widgets.Note("Config: BepInEx/config/envincible.howtofish.completecheatmenu.cfg"); }); } } internal static class SkinsTab { internal const string Title = "Skins"; private static Vector2 _scroll; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } Widgets.Section("Everything", delegate { GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Unlock all weapon skins", SkinCheats.UnlockAll, "All weapon skins unlocked", Theme.BtnAccent); Widgets.ActionButton("Lock all", SkinCheats.LockAll, "All skins locked", Theme.BtnDanger); GUILayout.EndHorizontal(); Widgets.ActionButton("Unlock all characters", SkinCheats.UnlockAllCharacters, "All characters unlocked", Theme.BtnAccent); }); Widgets.Section("Held item skin", delegate { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) object held = ItemCheats.HeldItem; if (held == null) { Widgets.Note("Hold an item to see and apply its skins."); } else { List list = SkinCheats.SkinsFor(held); GUILayout.Label($"{ItemCheats.ItemName(held)} — {list.Count} skins", Theme.Body, Array.Empty()); if (list.Count == 0) { Widgets.Note("This item has no skin preset."); } else { _scroll = GUILayout.BeginScrollView(_scroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(190f) }); foreach (SkinCheats.SkinEntry item in list) { SkinCheats.SkinEntry s = item; GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(s.Name, Theme.Body, Array.Empty()); GUILayout.FlexibleSpace(); if (!string.IsNullOrEmpty(s.Rarity)) { GUILayout.Label(s.Rarity, Theme.Muted, Array.Empty()); } Widgets.ActionButton("Unlock", () => SkinCheats.UnlockSkin(held, s.Index), "Unlocked " + s.Name, Theme.Btn, 62f); Widgets.ActionButton("Wear", () => ItemCheats.SetSkin(held, s.Index), "Applied " + s.Name, Theme.BtnAccent, 54f); GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); } } }); Widgets.Section("Boat skin", delegate { List list = SkinCheats.BoatSkins(); if (list.Count == 0) { Widgets.Note("No boat in the scene, or it has no skin preset."); } else { GUILayout.Label("Current: " + list.FirstOrDefault((SkinCheats.SkinEntry skinEntry) => skinEntry.Index == SkinCheats.BoatSkin).Name, Theme.Body, Array.Empty()); int num = 0; GUILayout.BeginHorizontal(Array.Empty()); foreach (SkinCheats.SkinEntry item2 in list) { SkinCheats.SkinEntry s = item2; Widgets.ActionButton(s.Name, () => SkinCheats.SetBoatSkin(s.Index), "Boat skin: " + s.Name, (s.Index == SkinCheats.BoatSkin) ? Theme.BtnAccent : Theme.Btn, 110f); if (++num % 3 == 0) { GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); } } GUILayout.EndHorizontal(); } }); Widgets.Section("Characters", delegate { CheatState.SkinFilter = Widgets.SearchBox(CheatState.SkinFilter, "Filter characters…"); string text = (CheatState.SkinFilter ?? "").Trim().ToLowerInvariant(); int num = 0; GUILayout.BeginHorizontal(Array.Empty()); string[] characterUnlocks = SkinCheats.CharacterUnlocks; foreach (string text2 in characterUnlocks) { string text3 = SkinCheats.PrettyCharacter(text2); if (text.Length <= 0 || text3.ToLowerInvariant().Contains(text)) { string m = text2; Widgets.ActionButton(text3, () => SkinCheats.UnlockCharacter(m), "Unlocked " + text3, Theme.Btn, 140f); if (++num % 3 == 0) { GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); } } } GUILayout.EndHorizontal(); }); } } internal static class SpawnTab { internal const string Title = "Spawn"; private const int MaxRows = 200; private static Vector2 _scroll; private static readonly SpawnCatalog.Category[] Categories = (SpawnCatalog.Category[])Enum.GetValues(typeof(SpawnCatalog.Category)); internal static void Draw() { //IL_00d9: 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_00e8: Unknown result type (might be due to invalid IL or missing references) if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } if (!SpawnCatalog.Loaded) { SpawnCatalog.Load(); if (!SpawnCatalog.Loaded) { Widgets.Note("GameInfo._nameToSpawnable did not resolve. See Diagnostics."); return; } } Widgets.Section("Options", delegate { CheatState.SpawnCount = Widgets.IntSliderRow("Quantity", CheatState.SpawnCount, 1, 25); GUILayout.BeginHorizontal(Array.Empty()); CheatState.SpawnDead = GUILayout.Toggle(CheatState.SpawnDead, " Dead", Theme.Toggle, Array.Empty()); CheatState.SpawnDrip = GUILayout.Toggle(CheatState.SpawnDrip, " Drip", Theme.Toggle, Array.Empty()); GUILayout.EndHorizontal(); Widgets.Note("Spawns 2m in front of the camera. Dead and Drip only apply to creatures."); }); Widgets.Section("Sort", delegate { GUILayout.BeginHorizontal(Array.Empty()); SortButton("A–Z", SpawnCatalog.SortMode.Name); SortButton("Category", SpawnCatalog.SortMode.Category); SortButton("Item ID", SpawnCatalog.SortMode.Id); GUILayout.EndHorizontal(); Dictionary dictionary = SpawnCatalog.Counts(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button($"All ({SpawnCatalog.Count})", (!CheatState.SpawnCategory.HasValue) ? Theme.BtnAccent : Theme.Btn, Array.Empty())) { CheatState.SpawnCategory = null; } int num = 1; SpawnCatalog.Category[] categories = Categories; foreach (SpawnCatalog.Category category in categories) { if (dictionary.TryGetValue(category, out var value) && value != 0) { SpawnCatalog.Category category2 = category; if (GUILayout.Button($"{category2} ({value})", (CheatState.SpawnCategory == category2) ? Theme.BtnAccent : Theme.Btn, Array.Empty())) { CheatState.SpawnCategory = category2; } if (++num % 4 == 0) { GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); } } } GUILayout.EndHorizontal(); Widgets.Note("Categories come from the components each prefab carries, not from its name."); }); CheatState.SpawnFilter = Widgets.SearchBox(CheatState.SpawnFilter, "Filter spawnables…"); List list = SpawnCatalog.Search(CheatState.SpawnFilter, CheatState.SpawnCategory, CheatState.SpawnSort).ToList(); GUILayout.Label($"{list.Count} of {SpawnCatalog.Count} spawnables", Theme.Muted, Array.Empty()); _scroll = GUILayout.BeginScrollView(_scroll, Array.Empty()); foreach (SpawnCatalog.Entry item in list.Take(200)) { GUILayout.BeginHorizontal(Theme.Section, Array.Empty()); GUILayout.Label(item.Display, Theme.Body, Array.Empty()); GUILayout.FlexibleSpace(); SpawnCatalog.Category kind = item.Kind; GUILayout.Label(kind.ToString(), Theme.Muted, Array.Empty()); string key = item.Key; string display = item.Display; Widgets.ActionButton("Spawn", () => SpawnCheats.Spawn(key, CheatState.SpawnCount, CheatState.SpawnDead, CheatState.SpawnDrip), $"Spawned {CheatState.SpawnCount}× {display}", Theme.BtnAccent, 66f); GUILayout.EndHorizontal(); } if (list.Count > 200) { Widgets.Note($"Showing the first {200}. Narrow the filter to see the rest."); } GUILayout.EndScrollView(); } private static void SortButton(string label, SpawnCatalog.SortMode mode) { if (GUILayout.Button(label, (CheatState.SpawnSort == mode) ? Theme.BtnAccent : Theme.Btn, Array.Empty())) { CheatState.SpawnSort = mode; } } } internal static class TeleportTab { internal const string Title = "Teleport"; private static Vector2 _scroll; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } Widgets.Section("Islands", delegate { GUILayout.Label($"Current island {TeleportCheats.CurrentIsland} " + $"unlocked up to {TeleportCheats.MaxUnlocked}", Theme.Body, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); int num = Mathf.Max(TeleportCheats.TotalIslands, 6); for (int i = 0; i < num; i++) { byte idx = (byte)i; Widgets.ActionButton($"{i}", () => TeleportCheats.GoToIsland(idx), $"Travelled to island {idx}", (idx == TeleportCheats.CurrentIsland) ? Theme.BtnAccent : Theme.Btn, 38f); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("◀ Previous", () => TeleportCheats.NextIsland(previous: true), "Previous island"); Widgets.ActionButton("Next ▶", () => TeleportCheats.NextIsland(), "Next island"); Widgets.ActionButton("Unlock all", TeleportCheats.UnlockAllIslands, "All islands unlocked", Theme.BtnAccent); GUILayout.EndHorizontal(); Widgets.Note("Island travel moves everyone on the server, same as the game's own command."); }); Widgets.Section("Places", delegate { GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Go to boat", TeleportCheats.GoToBoat, "Teleported to boat"); GUILayout.EndHorizontal(); }); Widgets.Section("Waypoints", delegate { CheatState.WaypointName = Widgets.FieldRow("Name", CheatState.WaypointName, 60f); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Save here", () => TeleportCheats.SaveWaypoint(CheatState.WaypointName), "Saved '" + CheatState.WaypointName + "'", Theme.BtnAccent); GUILayout.EndHorizontal(); if (TeleportCheats.Waypoints.Count == 0) { Widgets.Note("No waypoints yet. They last until you quit the game."); return; } foreach (string item in TeleportCheats.Waypoints.Keys.ToList()) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(item, Theme.Body, Array.Empty()); GUILayout.FlexibleSpace(); string n = item; Widgets.ActionButton("Go", () => TeleportCheats.GoToWaypoint(n), "Teleported to '" + n + "'", Theme.Btn, 48f); if (GUILayout.Button("×", Theme.Btn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(26f) })) { TeleportCheats.Waypoints.Remove(n); } GUILayout.EndHorizontal(); } }); Widgets.Section("Players", delegate { //IL_0019: 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) List list = TeleportCheats.AlivePlayers(); if (list.Count == 0) { Widgets.Note("No other players found."); } else { _scroll = GUILayout.BeginScrollView(_scroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(140f) }); foreach (object item2 in list) { object player = item2; GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(TeleportCheats.PlayerName(player), Theme.Body, Array.Empty()); GUILayout.FlexibleSpace(); Widgets.ActionButton("Go to", () => TeleportCheats.GoToPlayer(player), "Teleported", Theme.Btn, 58f); Widgets.ActionButton("Bring", () => TeleportCheats.BringPlayer(player), "Player brought", Theme.Btn, 58f); GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); } }); } } internal static class VisualsTab { internal const string Title = "Visuals"; internal static void Draw() { Widgets.Section("ESP", delegate { CheatState.EspEnabled = Widgets.ToggleRow("Enable ESP", CheatState.EspEnabled, CheatState.EspEnabled ? $"{VisualCheats.Targets.Count} tracked" : "off"); GUILayout.BeginHorizontal(Array.Empty()); CheatState.EspCreatures = GUILayout.Toggle(CheatState.EspCreatures, " Creatures", Theme.Toggle, Array.Empty()); CheatState.EspItems = GUILayout.Toggle(CheatState.EspItems, " Items", Theme.Toggle, Array.Empty()); CheatState.EspPlayers = GUILayout.Toggle(CheatState.EspPlayers, " Players", Theme.Toggle, Array.Empty()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); CheatState.EspLabels = GUILayout.Toggle(CheatState.EspLabels, " Names", Theme.Toggle, Array.Empty()); CheatState.EspDistanceLabels = GUILayout.Toggle(CheatState.EspDistanceLabels, " Distance", Theme.Toggle, Array.Empty()); CheatState.EspTracers = GUILayout.Toggle(CheatState.EspTracers, " Tracers", Theme.Toggle, Array.Empty()); GUILayout.EndHorizontal(); CheatState.EspDistance = Widgets.SliderRow("Max distance", CheatState.EspDistance, 20f, 600f, "0", 150f); Widgets.Note("Creatures are found by scanning the scene twice a second — the game keeps no live creature list. Raising the distance costs nothing extra."); }); Widgets.Section("Camera", delegate { if (!VisualCheats.FovAvailable) { Widgets.Note("PlayerCamera.SetFOV did not resolve — field of view unavailable."); } else { float num = Widgets.SliderRow("Field of view", CheatState.Fov, 30f, 140f, "0", 60f); if (!Mathf.Approximately(num, CheatState.Fov)) { CheatState.Fov = num; VisualCheats.SetFov(num); } } GUILayout.Space(4f); if (!VisualCheats.FreeCamAvailable) { Widgets.Note("Free camera needs a live player camera. Load into a save."); } else { bool freeCamActive = VisualCheats.FreeCamActive; bool flag = Widgets.ToggleRow("Free camera", freeCamActive, freeCamActive ? "active" : "off"); if (flag != freeCamActive) { Notifications.Result(VisualCheats.ToggleFreeCam(flag), flag ? "Free camera on" : "Free camera off", "Free camera toggle failed"); } CheatState.FreeCamSpeed = Widgets.SliderRow("Speed", CheatState.FreeCamSpeed, 1f, 80f, "0.#", 15f); CheatState.FreeCamSensitivity = Widgets.SliderRow("Sensitivity", CheatState.FreeCamSensitivity, 0.2f, 8f, "0.##", 2f); Widgets.Note("Mouse looks, WASD moves, Space and Ctrl for height, Shift to boost. Your body is now pinned in place while the camera is detached."); GUILayout.Space(4f); if (!VisualCheats.BodyAvailable) { Widgets.Note("Own-body rendering unavailable — PlayerSkin.InitializeOther did not resolve."); } else { bool bodyShown = VisualCheats.BodyShown; bool flag2 = Widgets.ToggleRow("Show my character", bodyShown, bodyShown ? "visible" : "hidden"); if (flag2 != bodyShown) { Notifications.Result(VisualCheats.ShowOwnBody(flag2), flag2 ? "Character visible" : "Character hidden", "Could not switch the model"); } Widgets.Note("The game only builds hand meshes for your own player — that's why free camera showed floating hands. This runs the full-body setup it uses for everyone else. Expect it to look wrong in first person; turn it off when you leave free camera."); } } }); Widgets.Section("Effects", delegate { bool damageNumbers = VisualCheats.DamageNumbers; bool flag = Widgets.ToggleRow("Damage numbers", damageNumbers, damageNumbers ? "on" : "off"); if (flag != damageNumbers) { VisualCheats.SetDamageNumbers(flag); } bool blood = VisualCheats.Blood; bool flag2 = Widgets.ToggleRow("Blood", blood, blood ? "on" : "off"); if (flag2 != blood) { VisualCheats.SetBlood(flag2); } GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Clear decals", VisualCheats.ClearDecals, "Decals cleared"); Widgets.ActionButton("Decals off", () => VisualCheats.SetDecals(to: false), "Decals hidden"); Widgets.ActionButton("Decals on", () => VisualCheats.SetDecals(to: true), "Decals shown"); GUILayout.EndHorizontal(); }); } } internal static class WeaponsTab { internal const string Title = "Weapons"; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } Widgets.Section("Held weapon", delegate { if (!WeaponCheats.HoldingWeapon) { Widgets.Note("Hold a gun. Settings below are applied to whatever you're carrying and re-applied when you switch weapons."); } else { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(WeaponCheats.WeaponName, Theme.H1, Array.Empty()); GUILayout.FlexibleSpace(); GUILayout.Label($"ammo {WeaponCheats.Ammo}", Theme.Muted, Array.Empty()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Refill now", WeaponCheats.RefillAmmo, "Ammo refilled"); Widgets.ActionButton("Free bullet upgrade", WeaponCheats.BuyBulletUpgrade, "Bullet upgrade applied", Theme.BtnAccent); GUILayout.EndHorizontal(); } }); Widgets.Section("Firing", delegate { CheatState.InfiniteAmmo = Widgets.ToggleRow("Infinite ammo", CheatState.InfiniteAmmo, CheatState.InfiniteAmmo ? "on" : "off"); if (CheatState.InfiniteAmmo) { CheatState.AmmoTopUp = Widgets.IntSliderRow("Held at", CheatState.AmmoTopUp, 1, 999); Widgets.Note("Also cancels queued reloads, so the gun never stops to reload."); } CheatState.NoSpread = Widgets.ToggleRow("Perfect accuracy", CheatState.NoSpread, CheatState.NoSpread ? "on" : "off"); CheatState.FireWhereLooking = Widgets.ToggleRow("Fire where you're looking", CheatState.FireWhereLooking, CheatState.FireWhereLooking ? "on" : "off"); Widgets.Note("Aligns the gun's fire point with the camera, removing the barrel-to-eye offset that makes hipfire drift off the crosshair. Pair with perfect accuracy for pinpoint hipfire."); CheatState.ZeroRecoil = Widgets.ToggleRow("Zero recoil", CheatState.ZeroRecoil, CheatState.ZeroRecoil ? "on" : "off"); Widgets.Note("Clears screen kick, weapon kick and the knockback the shot applies to you."); CheatState.RapidFire = Widgets.ToggleRow("Rapid fire", CheatState.RapidFire, CheatState.RapidFire ? "on" : "off"); if (CheatState.RapidFire) { CheatState.FireInterval = Widgets.SliderRow("Seconds between shots", CheatState.FireInterval, 0.01f, 0.5f, "0.###", 0.05f); } }); Widgets.Section("Projectiles", delegate { CheatState.MultiShot = Widgets.ToggleRow("Extra projectiles", CheatState.MultiShot, CheatState.MultiShot ? "on" : "off"); if (CheatState.MultiShot) { CheatState.ProjectileCount = Widgets.SliderRow("Per shot", CheatState.ProjectileCount, 1f, 30f, "0", 1f); Widgets.Note("Turns any gun into a shotgun. Combine with perfect accuracy to stack every pellet on one point."); } CheatState.FastBullets = Widgets.ToggleRow("Bullet speed", CheatState.FastBullets, CheatState.FastBullets ? "on" : "off"); if (CheatState.FastBullets) { CheatState.ProjectileSpeed = Widgets.SliderRow("Speed", CheatState.ProjectileSpeed, 20f, 2000f, "0", 300f); } GUILayout.Space(4f); Widgets.ActionButton("Restore this weapon's originals", WeaponCheats.ResetHeldWeapon, "Original values restored", Theme.Btn); Widgets.Note(WeaponCheats.HasOriginals ? "The values this gun shipped with were saved before anything was changed." : "Nothing has been changed on this weapon yet."); }); Widgets.Section("Aim assist", delegate { CheatState.Aimbot = Widgets.ToggleRow("Aimbot", CheatState.Aimbot, CheatState.Aimbot ? "ACTIVE" : "off"); Widgets.Note("Points the gun's fire point at the best target while your view stays under your control — your shots go where the aimbot looks, your camera doesn't get yanked around."); GUILayout.BeginHorizontal(Array.Empty()); CheatState.AimAtCreatures = GUILayout.Toggle(CheatState.AimAtCreatures, " Creatures", Theme.Toggle, Array.Empty()); CheatState.AimAtPlayers = GUILayout.Toggle(CheatState.AimAtPlayers, " Players", Theme.Toggle, Array.Empty()); CheatState.AimRequireLineOfSight = GUILayout.Toggle(CheatState.AimRequireLineOfSight, " Needs line of sight", Theme.Toggle, Array.Empty()); GUILayout.EndHorizontal(); CheatState.AimFov = Widgets.SliderRow("Cone (degrees)", CheatState.AimFov, 1f, 180f, "0", 35f); CheatState.AimRange = Widgets.SliderRow("Range", CheatState.AimRange, 10f, 600f, "0", 200f); CheatState.AimHeightOffset = Widgets.SliderRow("Aim height", CheatState.AimHeightOffset, -1f, 3f, "0.##", 0.5f); WeaponCheats.Target? currentTarget = WeaponCheats.CurrentTarget; GUILayout.Space(4f); if (currentTarget.HasValue) { GUILayout.Label($"Target: {currentTarget.Value.Name} {currentTarget.Value.Distance:0}m " + $"{currentTarget.Value.Angle:0}° off centre", Theme.Body, Array.Empty()); } else { GUILayout.Label(CheatState.Aimbot ? "No target in the cone." : "Aimbot is off.", Theme.Muted, Array.Empty()); } Widgets.Note("Aim height lifts the point of aim off the target's origin — raise it for head shots on tall creatures."); }); } } internal static class WorldTab { internal const string Title = "World"; internal static void Draw() { if (!Widgets.RequireHost(CheatGate.BlockReason())) { return; } Widgets.Section("Journal", delegate { int totalCreatures = WorldCheats.TotalCreatures; GUILayout.Label($"Normal {WorldCheats.KilledCount(drip: false)} / {totalCreatures}", Theme.Body, Array.Empty()); GUILayout.Label($"Drip {WorldCheats.KilledCount(drip: true)} / {totalCreatures}", Theme.Body, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Complete normal", () => WorldCheats.SetAllCreaturesKilled(to: true, drip: false), "Normal journal completed", Theme.BtnAccent); Widgets.ActionButton("Complete drip", () => WorldCheats.SetAllCreaturesKilled(to: true, drip: true), "Drip journal completed", Theme.BtnAccent); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Reset normal", () => WorldCheats.SetAllCreaturesKilled(to: false, drip: false), "Normal journal reset", Theme.BtnDanger); Widgets.ActionButton("Reset drip", () => WorldCheats.SetAllCreaturesKilled(to: false, drip: true), "Drip journal reset", Theme.BtnDanger); GUILayout.EndHorizontal(); }); Widgets.Section("Boss", delegate { if (!WorldCheats.BossActive) { Widgets.Note("No boss active. Spawn one from the Spawn tab."); } else { GUILayout.Label($"HP {WorldCheats.BossHp:N0} / {WorldCheats.BossMaxHp:N0}", Theme.Body, Array.Empty()); bool immortal = WorldCheats.Immortal; bool flag = Widgets.ToggleRow("Boss immortal", immortal, immortal ? "on" : "off"); if (flag != immortal) { Notifications.Result(WorldCheats.SetBossImmortal(flag), flag ? "Boss is immortal" : "Boss is mortal", "Immortality toggle failed"); } CheatState.BossHeal = Widgets.IntSliderRow("Heal amount", CheatState.BossHeal, 1, 10000); GUILayout.BeginHorizontal(Array.Empty()); Widgets.ActionButton("Heal boss", () => WorldCheats.HealBoss(CheatState.BossHeal), $"Boss healed {CheatState.BossHeal:N0}"); Widgets.ActionButton("Kill boss", WorldCheats.KillBoss, "Boss killed", Theme.BtnDanger); GUILayout.EndHorizontal(); } }); Widgets.Section("World unlocks", delegate { Widgets.ActionButton("Unlock grill", WorldCheats.UnlockGrill, "Grill unlocked", Theme.BtnAccent); }); } } } namespace CompleteCheatMenu.Runtime { internal static class CheatState { internal static bool Fly; internal static float FlySpeed = 20f; internal static float FlyHorizontalSpeed = 25f; internal static float FlyVerticalSpeed = 12f; internal static bool BoatFly; internal static float BoatFlySpeed = 15f; internal static float DespawnRadius = 30f; internal static bool InfiniteAmmo; internal static int AmmoTopUp = 99; internal static bool NoSpread; internal static bool ZeroRecoil; internal static bool RapidFire; internal static float FireInterval = 0.05f; internal static bool MultiShot; internal static float ProjectileCount = 1f; internal static bool FastBullets; internal static float ProjectileSpeed = 300f; internal static bool FireWhereLooking; internal static bool Aimbot; internal static bool AimAtCreatures = true; internal static bool AimAtPlayers; internal static bool AimRequireLineOfSight = true; internal static float AimFov = 35f; internal static float AimRange = 200f; internal static float AimHeightOffset = 0.5f; internal static bool KillScoreOverride; internal static float KillFlatMultiplier = 1f; internal static string KillBonusLabel = "Rigged"; internal static bool KeepInventory; internal static int DuplicateCount = 5; internal static string SpawnFilter = ""; internal static int SpawnCount = 1; internal static bool SpawnDead; internal static bool SpawnDrip; internal static SpawnCatalog.SortMode SpawnSort = SpawnCatalog.SortMode.Name; internal static SpawnCatalog.Category? SpawnCategory; internal static string MoneyAmount = "10000"; internal static int HealAmount = 100; internal static string WaypointName = "spot 1"; internal static ItemCheats.Target ItemTarget = ItemCheats.Target.Held; internal static string ItemWorth = "1000"; internal static float ItemCookness = 1f; internal static float ItemWeight = 1f; internal static float ItemKillScore = 1f; internal static float ItemBetting = 1f; internal static string SkinFilter = ""; internal static int BossHeal = 500; internal static int BetColorIndex; internal static float BetBoost = 1f; internal static string SlotSkinFilter = ""; internal static string SlotTargetFilter = ""; internal static string SlotRarity = ""; internal static int SlotTargetIndex = -1; internal static bool EspEnabled; internal static bool EspCreatures = true; internal static bool EspItems; internal static bool EspPlayers = true; internal static bool EspTracers; internal static bool EspLabels = true; internal static bool EspDistanceLabels = true; internal static float EspDistance = 150f; internal static float Fov = 60f; internal static float FreeCamSpeed = 15f; internal static float FreeCamSensitivity = 2f; internal static string PresetName = "my setup"; internal static string GlobalSearch = ""; } internal static class EspRenderer { private static Texture2D _pixel; private static GUIStyle _label; private static Texture2D Pixel { get { //IL_0015: 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_0027: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_pixel != (Object)null) { return _pixel; } _pixel = new Texture2D(1, 1) { hideFlags = (HideFlags)61 }; _pixel.SetPixel(0, 0, Color.white); _pixel.Apply(); return _pixel; } } internal static void Draw() { //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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_0094: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) if (!CheatState.EspEnabled) { return; } Camera currentCamera = Refs.CurrentCamera; if ((Object)(object)currentCamera == (Object)null) { return; } if (_label == null) { _label = new GUIStyle(GUI.skin.label) { fontSize = 11, alignment = (TextAnchor)4 }; } float num = CheatState.EspDistance * CheatState.EspDistance; Vector3 position = ((Component)currentCamera).transform.position; foreach (VisualCheats.EspTarget target in VisualCheats.Targets) { if ((Object)(object)target.Transform == (Object)null) { continue; } Vector3 position2 = target.Transform.position; Vector3 val = position2 - position; if (((Vector3)(ref val)).sqrMagnitude > num) { continue; } Vector3 val2 = currentCamera.WorldToScreenPoint(position2); if (!(val2.z <= 0f)) { float x = val2.x; float num2 = (float)Screen.height - val2.y; Color val3 = ColorFor(target.Kind); float z = val2.z; float num3 = Mathf.Clamp(600f / Mathf.Max(z, 1f), 10f, 90f); DrawBox(new Rect(x - num3 / 2f, num2 - num3 / 2f, num3, num3), val3); if (CheatState.EspLabels) { _label.normal.textColor = val3; string text = (CheatState.EspDistanceLabels ? $"{target.Label} {z:0}m" : target.Label); GUI.Label(new Rect(x - 100f, num2 - num3 / 2f - 18f, 200f, 16f), text, _label); } if (CheatState.EspTracers) { DrawLine(new Vector2((float)Screen.width / 2f, (float)Screen.height), new Vector2(x, num2), val3, 1f); } } } } private static Color ColorFor(VisualCheats.EspKind kind) { //IL_0009: 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) return (Color)(kind switch { VisualCheats.EspKind.Creature => Theme.Accent, VisualCheats.EspKind.Player => Theme.Danger, _ => new Color(0.85f, 0.78f, 0.35f), }); } private static void DrawBox(Rect r, Color color, float thickness = 1.5f) { //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_0021: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) Color color2 = GUI.color; GUI.color = color; GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, thickness), (Texture)(object)Pixel); GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - thickness, ((Rect)(ref r)).width, thickness), (Texture)(object)Pixel); GUI.DrawTexture(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, thickness, ((Rect)(ref r)).height), (Texture)(object)Pixel); GUI.DrawTexture(new Rect(((Rect)(ref r)).xMax - thickness, ((Rect)(ref r)).y, thickness, ((Rect)(ref r)).height), (Texture)(object)Pixel); GUI.color = color2; } private static void DrawLine(Vector2 from, Vector2 to, Color color, float width) { //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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //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_0025: 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) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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) Color color2 = GUI.color; Matrix4x4 matrix = GUI.matrix; Vector2 val = to - from; float magnitude = ((Vector2)(ref val)).magnitude; if (!(magnitude < 0.01f)) { float num = Mathf.Atan2(val.y, val.x) * 57.29578f; GUI.color = color; GUIUtility.RotateAroundPivot(num, from); GUI.DrawTexture(new Rect(from.x, from.y - width / 2f, magnitude, width), (Texture)(object)Pixel); GUI.matrix = matrix; GUI.color = color2; } } } internal static class Keybinds { internal class Bind { internal string Name; internal ConfigEntry Key; internal Action Invoke; internal Func IsOn; } internal static readonly List All = new List(); internal static Bind Capturing; internal static bool Enabled { get { if (Plugin.KeybindsEnabled != null) { return Plugin.KeybindsEnabled.Value; } return false; } } internal static void Register(ConfigFile config) { All.Clear(); Add(config, "God mode", (KeyCode)282, delegate { CombatCheats.SetGodMode(!CombatCheats.GodMode); }, () => CombatCheats.GodMode); Add(config, "Fly", (KeyCode)283, delegate { CheatState.Fly = !CheatState.Fly; }, () => CheatState.Fly); Add(config, "ESP", (KeyCode)284, delegate { CheatState.EspEnabled = !CheatState.EspEnabled; }, () => CheatState.EspEnabled); Add(config, "Free camera", (KeyCode)285, delegate { VisualCheats.ToggleFreeCam(!VisualCheats.FreeCamActive); }, () => VisualCheats.FreeCamActive); Add(config, "One-shot kills", (KeyCode)286, delegate { CombatCheats.SetOneShot(!CombatCheats.OneShot); }, () => CombatCheats.OneShot); } private static void Add(ConfigFile config, string name, KeyCode fallback, Action action, Func isOn) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) All.Add(new Bind { Name = name, Key = config.Bind("Keybinds", name, fallback, "Hotkey for " + name.ToLowerInvariant() + "."), Invoke = action, IsOn = isOn }); } internal static void Poll() { //IL_0036: 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) if (Capturing != null || !Enabled) { return; } foreach (Bind item in All) { if (item.Key != null && (int)item.Key.Value != 0 && Input.GetKeyDown(item.Key.Value)) { try { item.Invoke(); Notifications.Show(item.Name + ": " + (item.IsOn() ? "on" : "off")); } catch (Exception arg) { Plugin.Log.LogError((object)$"Keybind '{item.Name}' failed: {arg}"); } } } } internal static void HandleCapture(Event e) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (Capturing != null && e != null && (int)e.type == 4) { if ((int)e.keyCode == 27) { Capturing = null; } else if ((int)e.keyCode != 0) { Capturing.Key.Value = e.keyCode; Notifications.Show($"{Capturing.Name} bound to {e.keyCode}"); Capturing = null; e.Use(); } } } } internal static class Notifications { internal struct Toast { internal string Text; internal bool Ok; internal float Until; } private const int MaxVisible = 5; private static readonly List _toasts = new List(); internal static IEnumerable Active { get { _toasts.RemoveAll((Toast t) => Time.unscaledTime > t.Until); return _toasts; } } internal static void Show(string text, bool ok = true, float seconds = 3f) { _toasts.Add(new Toast { Text = text, Ok = ok, Until = Time.unscaledTime + seconds }); if (_toasts.Count > 5) { _toasts.RemoveAt(0); } if (!ok) { Plugin.Log.LogWarning((object)text); } } internal static void Result(bool ok, string okText, string failText = null) { Show(ok ? okText : (failText ?? (okText + " failed")), ok); } } internal static class Presets { private static string Dir => Path.Combine(Paths.ConfigPath, "CompleteCheatMenu-presets"); internal static List List() { try { if (!Directory.Exists(Dir)) { return new List(); } return Directory.GetFiles(Dir, "*.txt").Select(Path.GetFileNameWithoutExtension).OrderBy((string n) => n, StringComparer.OrdinalIgnoreCase) .ToList(); } catch { return new List(); } } internal static bool Save(string name) { if (string.IsNullOrEmpty(name)) { return false; } try { Directory.CreateDirectory(Dir); List list = new List { F("flySpeed", CheatState.FlySpeed), F("espDistance", CheatState.EspDistance), B("espEnabled", CheatState.EspEnabled), B("espCreatures", CheatState.EspCreatures), B("espItems", CheatState.EspItems), B("espPlayers", CheatState.EspPlayers), B("espTracers", CheatState.EspTracers), B("espLabels", CheatState.EspLabels), F("fov", CheatState.Fov), F("freeCamSpeed", CheatState.FreeCamSpeed), F("itemCookness", CheatState.ItemCookness), F("itemWeight", CheatState.ItemWeight), F("itemKillScore", CheatState.ItemKillScore), F("itemBetting", CheatState.ItemBetting) }; string[] fields = MovementCheats.Fields; foreach (string text in fields) { list.Add(F("move." + text, MovementCheats.Get(text))); } File.WriteAllLines(Path.Combine(Dir, Sanitize(name) + ".txt"), list); return true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Preset save failed: " + ex.Message)); return false; } } internal static bool Load(string name) { try { string path = Path.Combine(Dir, Sanitize(name) + ".txt"); if (!File.Exists(path)) { return false; } string[] array = File.ReadAllLines(path); foreach (string text in array) { int num = text.IndexOf('='); if (num <= 0) { continue; } string text2 = text.Substring(0, num).Trim(); string text3 = text.Substring(num + 1).Trim(); if (text2.StartsWith("move.", StringComparison.Ordinal)) { if (TryFloat(text3, out var value)) { MovementCheats.Set(text2.Substring(5), value); } continue; } switch (text2) { case "flySpeed": { if (TryFloat(text3, out var value9)) { CheatState.FlySpeed = value9; } break; } case "espDistance": { if (TryFloat(text3, out var value7)) { CheatState.EspDistance = value7; } break; } case "espEnabled": CheatState.EspEnabled = text3 == "1"; break; case "espCreatures": CheatState.EspCreatures = text3 == "1"; break; case "espItems": CheatState.EspItems = text3 == "1"; break; case "espPlayers": CheatState.EspPlayers = text3 == "1"; break; case "espTracers": CheatState.EspTracers = text3 == "1"; break; case "espLabels": CheatState.EspLabels = text3 == "1"; break; case "fov": { if (TryFloat(text3, out var value8)) { CheatState.Fov = value8; VisualCheats.SetFov(value8); } break; } case "freeCamSpeed": { if (TryFloat(text3, out var value6)) { CheatState.FreeCamSpeed = value6; } break; } case "itemCookness": { if (TryFloat(text3, out var value5)) { CheatState.ItemCookness = value5; } break; } case "itemWeight": { if (TryFloat(text3, out var value4)) { CheatState.ItemWeight = value4; } break; } case "itemKillScore": { if (TryFloat(text3, out var value3)) { CheatState.ItemKillScore = value3; } break; } case "itemBetting": { if (TryFloat(text3, out var value2)) { CheatState.ItemBetting = value2; } break; } } } return true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Preset load failed: " + ex.Message)); return false; } } internal static bool Delete(string name) { try { string path = Path.Combine(Dir, Sanitize(name) + ".txt"); if (!File.Exists(path)) { return false; } File.Delete(path); return true; } catch { return false; } } private static string F(string key, float value) { return key + "=" + value.ToString("R", CultureInfo.InvariantCulture); } private static string B(string key, bool value) { return key + "=" + (value ? "1" : "0"); } private static bool TryFloat(string s, out float value) { return float.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out value); } private static string Sanitize(string name) { char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); foreach (char oldChar in invalidFileNameChars) { name = name.Replace(oldChar, '_'); } return name.Trim(); } } internal static class TickDriver { private static bool _wasFlying; private static bool _wasBoatFlying; internal static void FixedTick() { if (Refs.InGame) { if (VisualCheats.FreeCamActive) { MovementCheats.FreezePlayer(); } else if (CheatState.Fly && MovementCheats.FlyAvailable) { MovementCheats.FlyStep(CheatState.FlyHorizontalSpeed, CheatState.FlyVerticalSpeed); _wasFlying = true; } else if (_wasFlying) { MovementCheats.StopFly(); _wasFlying = false; } if (CheatState.BoatFly && BoatCheats.FlyAvailable) { BoatCheats.FlyStep(CheatState.BoatFlySpeed); _wasBoatFlying = true; } else if (_wasBoatFlying) { BoatCheats.ToggleFly(on: false); _wasBoatFlying = false; } GamblingCheats.FixedStep(); } } internal static void Tick() { if (VisualCheats.FreeCamActive) { VisualCheats.FreeCamStep(CheatState.FreeCamSpeed, CheatState.FreeCamSensitivity); } if (CheatState.EspEnabled && Refs.InGame) { VisualCheats.Rescan(CheatState.EspCreatures, CheatState.EspItems, CheatState.EspPlayers); } } } } namespace CompleteCheatMenu.Patches { [HarmonyPatch] internal static class AddKillScore_Patch { private static MethodBase TargetMethod() { return GameBinder.Method("PlayerKillScore", "AddKillScore", 3); } private static bool Prepare() { bool num = TargetMethod() != null; if (!num) { Plugin.Log.LogWarning((object)"PlayerKillScore.AddKillScore not found — kill score control disabled."); } return num; } private static void Prefix(object[] __args) { try { if (__args != null && __args.Length >= 3 && KillScoreCheats.ShouldOverride) { object obj = KillScoreCheats.BuildBonusList(); if (obj != null) { __args[2] = obj; } } } catch (Exception ex) { Plugin.Log.LogError((object)("Kill score override failed: " + ex.Message)); } } } [HarmonyPatch] internal static class ServerDropAll_Patch { private static MethodBase TargetMethod() { return GameBinder.Method("PlayerInventory", "ServerDropAll", 2); } private static bool Prepare() { bool num = TargetMethod() != null; if (!num) { Plugin.Log.LogWarning((object)"PlayerInventory.ServerDropAll not found — keep inventory disabled."); } return num; } private static bool Prefix() { if (!CheatState.KeepInventory) { return true; } Plugin.Log.LogInfo((object)"Keep inventory: skipped the death drop."); Notifications.Show("Keep inventory: items retained"); return false; } } [HarmonyPatch] internal static class DropAllItems_Patch { private static MethodBase TargetMethod() { return GameBinder.Method("Server", "DropAllItems", 3); } private static bool Prepare() { return TargetMethod() != null; } private static bool Prefix() { return !CheatState.KeepInventory; } } [HarmonyPatch] internal static class WeaponShoot_Patch { private static MethodBase TargetMethod() { return GameBinder.Method("Weapon", "Shoot", 0); } private static bool Prepare() { bool num = TargetMethod() != null; if (!num) { Plugin.Log.LogWarning((object)"Weapon.Shoot not found — aimbot disabled."); } return num; } private static void Prefix() { try { WeaponCheats.AimBeforeShot(); } catch (Exception ex) { Plugin.Log.LogError((object)("Aim failed: " + ex.Message)); } } } [HarmonyPatch] internal static class CameraRecoil_Patch { private static MethodBase TargetMethod() { return GameBinder.Method("PlayerCamera", "Recoil", 1); } private static bool Prepare() { return TargetMethod() != null; } private static bool Prefix() { return !CheatState.ZeroRecoil; } } [HarmonyPatch] internal static class ToolRecoil_Patch { private static MethodBase TargetMethod() { return GameBinder.Method("PlayerToolMovement", "Recoil", 1); } private static bool Prepare() { return TargetMethod() != null; } private static bool Prefix() { return !CheatState.ZeroRecoil; } } [HarmonyPatch] internal static class ModelRecoil_Patch { private static MethodBase TargetMethod() { return GameBinder.Method("Weapon", "AddModelRecoil", 1); } private static bool Prepare() { return TargetMethod() != null; } private static bool Prefix() { return !CheatState.ZeroRecoil; } } } namespace CompleteCheatMenu.Game { internal static class BindingReport { internal struct Entry { internal string Name; internal bool Ok; } private static readonly Dictionary _results = new Dictionary(); internal static IEnumerable All => from kv in _results orderby kv.Value, kv.Key select new Entry { Name = kv.Key, Ok = kv.Value }; internal static int Total => _results.Count; internal static int Failed => _results.Count((KeyValuePair kv) => !kv.Value); internal static void Record(string name, bool ok) { if (!_results.TryGetValue(name, out var value) || value != ok) { _results[name] = ok; if (!ok) { Plugin.Log.LogWarning((object)("Binding failed: " + name)); } } } } internal static class GameBinder { internal const BindingFlags Any = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; private static readonly Dictionary _types = new Dictionary(); private static readonly Dictionary _members = new Dictionary(); private static readonly Dictionary Disambiguate = new Dictionary { { "Player", "LocalPlayer" } }; internal static Type Type(string name) { if (_types.TryGetValue(name, out var value)) { return value; } string value2; Type type = (Disambiguate.TryGetValue(name, out value2) ? ResolveAmbiguous(name, value2) : AccessTools.TypeByName(name)); _types[name] = type; BindingReport.Record("type " + name, type != null); return type; } private static Type ResolveAmbiguous(string name, string marker) { List list = (from x in AppDomain.CurrentDomain.GetAssemblies().SelectMany(SafeTypes) where x.Name == name select x).ToList(); foreach (Type item in list) { if (item.GetField(marker, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) != null || item.GetProperty(marker, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) != null) { if (list.Count > 1) { Plugin.Log.LogInfo((object)($"Type '{name}' was ambiguous ({list.Count} matches); " + "picked " + item.FullName + " by '" + marker + "'.")); } return item; } } return list.FirstOrDefault() ?? AccessTools.TypeByName(name); } private static IEnumerable SafeTypes(Assembly asm) { try { return asm.GetTypes(); } catch (ReflectionTypeLoadException ex) { return ex.Types.Where((Type t) => t != null); } catch { return Enumerable.Empty(); } } internal static FieldInfo Field(string typeName, string fieldName) { string key = "F:" + typeName + "." + fieldName; if (_members.TryGetValue(key, out var value)) { return (FieldInfo)value; } FieldInfo fieldInfo = Type(typeName)?.GetField(fieldName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); _members[key] = fieldInfo; BindingReport.Record(typeName + "." + fieldName, fieldInfo != null); return fieldInfo; } internal static PropertyInfo Property(string typeName, string propName) { string key = "P:" + typeName + "." + propName; if (_members.TryGetValue(key, out var value)) { return (PropertyInfo)value; } PropertyInfo propertyInfo = Type(typeName)?.GetProperty(propName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); _members[key] = propertyInfo; BindingReport.Record(typeName + "." + propName, propertyInfo != null); return propertyInfo; } internal static MethodInfo Method(string typeName, string methodName, int argCount = -1, Type[] paramTypes = null) { string key = string.Format("M:{0}.{1}/{2}/{3}", typeName, methodName, argCount, (paramTypes == null) ? "" : string.Join(",", paramTypes.Select((Type t) => t.Name))); if (_members.TryGetValue(key, out var value)) { return (MethodInfo)value; } Type type = Type(typeName); MethodInfo methodInfo = null; if (type != null) { IEnumerable source = from x in type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) where x.Name == methodName select x; if (paramTypes != null) { source = source.Where((MethodInfo x) => (from p in x.GetParameters() select p.ParameterType).SequenceEqual(paramTypes)); } else if (argCount >= 0) { source = source.Where((MethodInfo x) => x.GetParameters().Length == argCount); } methodInfo = source.FirstOrDefault(); } _members[key] = methodInfo; BindingReport.Record(typeName + "." + methodName + "()", methodInfo != null); return methodInfo; } internal static bool TryGet(FieldInfo f, object instance, out T value) { value = default(T); if (f == null) { return false; } try { value = (T)Convert.ChangeType(f.GetValue(instance), typeof(T)); return true; } catch { return false; } } internal static bool TrySet(FieldInfo f, object instance, object value) { if (f == null) { return false; } try { f.SetValue(instance, Convert.ChangeType(value, f.FieldType)); return true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Set " + f.Name + " failed: " + ex.Message)); return false; } } internal static bool TryInvoke(MethodInfo m, object instance, params object[] args) { if (m == null) { return false; } try { m.Invoke(m.IsStatic ? null : instance, args); return true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("Invoke " + m.Name + " failed: " + (ex.InnerException?.Message ?? ex.Message))); return false; } } internal static object InvokeResult(MethodInfo m, object instance, params object[] args) { if (m == null) { return null; } try { return m.Invoke(m.IsStatic ? null : instance, args); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Invoke " + m.Name + " failed: " + (ex.InnerException?.Message ?? ex.Message))); return null; } } internal static bool TryReadSyncVar(FieldInfo syncVarField, object instance, out T value) { value = default(T); if (syncVarField == null) { return false; } try { object value2 = syncVarField.GetValue(instance); if (value2 == null) { return false; } PropertyInfo property = value2.GetType().GetProperty("Value", BindingFlags.Instance | BindingFlags.Public); if (property == null) { return false; } value = (T)Convert.ChangeType(property.GetValue(value2), typeof(T)); return true; } catch { return false; } } internal static bool TryWriteSyncVar(FieldInfo syncVarField, object instance, object value) { if (syncVarField == null) { return false; } try { object value2 = syncVarField.GetValue(instance); if (value2 == null) { return false; } PropertyInfo property = value2.GetType().GetProperty("Value", BindingFlags.Instance | BindingFlags.Public); if (property == null || !property.CanWrite) { return false; } property.SetValue(value2, Convert.ChangeType(value, property.PropertyType)); return true; } catch (Exception ex) { Plugin.Log.LogWarning((object)("SyncVar write on " + syncVarField.Name + " failed: " + ex.Message)); return false; } } internal static object EnumValue(string typeName, string memberName) { Type type = Type(typeName); if (type == null || !type.IsEnum) { BindingReport.Record("enum " + typeName, ok: false); return null; } try { return Enum.Parse(type, memberName, ignoreCase: true); } catch { BindingReport.Record("enum " + typeName + "." + memberName, ok: false); return null; } } internal static string[] EnumNames(string typeName) { Type type = Type(typeName); if (type == null || !type.IsEnum) { return new string[0]; } try { return Enum.GetNames(type); } catch { return new string[0]; } } } internal static class Refs { private static MethodInfo _findAny; private static bool _findAnyResolved; internal static object LocalPlayer { get { FieldInfo fieldInfo = GameBinder.Field("Player", "LocalPlayer"); if (fieldInfo == null) { return null; } object value = fieldInfo.GetValue(null); if (!IsAlive(value)) { return null; } return value; } } internal static object LocalMovement => GetPlayerPart("Movement"); internal static object LocalVitals => GetPlayerPart("Vitals"); internal static object LocalCamera => GetPlayerPart("Camera"); internal static object LocalHolding => GetPlayerPart("Holding"); internal static object LocalInventory => GetPlayerPart("Inventory"); internal static object Server => StaticInstance("Server", "Instance"); internal static object ServerSettings => StaticInstance("ServerSettings", "Instance"); internal static object BoatManager => StaticInstance("BoatManager", "Instance"); internal static bool IsHost { get { object server = Server; if (server == null) { return false; } PropertyInfo property = server.GetType().GetProperty("IsServerInitialized", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (property == null) { return false; } try { return (bool)property.GetValue(server); } catch { return false; } } } internal static bool InGame => LocalPlayer != null; internal static Camera CurrentCamera { get { PropertyInfo propertyInfo = GameBinder.Property("GameInfo", "CurCamera"); if (propertyInfo != null) { try { object? value = propertyInfo.GetValue(null); Camera val = (Camera)((value is Camera) ? value : null); if (val != null && (Object)(object)val != (Object)null) { return val; } } catch { } } return Camera.main; } } private static object GetPlayerPart(string propName) { object localPlayer = LocalPlayer; if (localPlayer == null) { return null; } PropertyInfo propertyInfo = GameBinder.Property("Player", propName); if (propertyInfo == null) { return null; } try { return propertyInfo.GetValue(localPlayer); } catch { return null; } } private static object StaticInstance(string typeName, string memberName) { PropertyInfo propertyInfo = GameBinder.Type(typeName)?.GetProperty(memberName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (propertyInfo != null) { try { object value = propertyInfo.GetValue(null); if (IsAlive(value)) { return value; } } catch { } } FieldInfo fieldInfo = GameBinder.Type(typeName)?.GetField(memberName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (fieldInfo != null) { try { object value2 = fieldInfo.GetValue(null); if (IsAlive(value2)) { return value2; } } catch { } } return FindInScene(typeName); } internal static object FindInScene(string typeName) { Type type = GameBinder.Type(typeName); if (type == null || !typeof(Object).IsAssignableFrom(type)) { return null; } try { Object val = SceneFind(type); return IsAlive(val) ? val : null; } catch { return null; } } private static Object SceneFind(Type t) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown if (!_findAnyResolved) { _findAnyResolved = true; _findAny = typeof(Object).GetMethod("FindAnyObjectByType", BindingFlags.Static | BindingFlags.Public, null, new Type[1] { typeof(Type) }, null); } if (_findAny != null) { try { return (Object)_findAny.Invoke(null, new object[1] { t }); } catch { } } return Object.FindObjectOfType(t); } internal static bool IsAlive(object o) { if (o == null) { return false; } Object val = (Object)((o is Object) ? o : null); if (val != null) { return val != (Object)null; } return true; } } } namespace CompleteCheatMenu.Cheats { internal static class BoatCheats { private static bool _flyActive; private static readonly Dictionary _motorDefaults = new Dictionary(); internal static readonly string[] Fields = new string[6] { "_antiRollOverForce", "_steerSmoothing", "_linearDampAboveWater", "_angularDampAboveWater", "_underwaterLinearDamp", "_underwaterAngularDamp" }; internal static readonly string[] CosmeticFields = new string[2] { "_maxSteerAngle", "_maxThrottleAngle" }; private static readonly Dictionary _defaults = new Dictionary(); internal static object Boat { get { PropertyInfo propertyInfo = GameBinder.Property("BoatManager", "Boat"); if (propertyInfo == null) { return null; } try { object value = propertyInfo.GetValue(null); return Refs.IsAlive(value) ? value : null; } catch { return null; } } } internal static bool Available => Boat != null; internal static bool Unlocked => ReadBool("BoatUnlocked"); internal static bool RadarUnlocked => ReadBool("BoatRadarUnlocked"); internal static byte Motor { get { object boat = Boat; if (boat == null) { return 0; } PropertyInfo propertyInfo = GameBinder.Property("Boat", "MotorIndex"); if (propertyInfo == null) { return 0; } try { return (byte)propertyInfo.GetValue(boat); } catch { return 0; } } } internal static bool FlyActive => _flyActive; internal static bool FlyAvailable => (Object)(object)Rig != (Object)null; private static Rigidbody Rig { get { object boat = Boat; if (boat == null) { return null; } string[] array = new string[2] { "HiddenPhysicsRig", "VisualPhysicsRig" }; foreach (string propName in array) { PropertyInfo propertyInfo = GameBinder.Property("Boat", propName); if (propertyInfo == null) { continue; } try { object? value = propertyInfo.GetValue(boat); Rigidbody val = (Rigidbody)((value is Rigidbody) ? value : null); if (val != null && (Object)(object)val != (Object)null) { return val; } } catch { } } return null; } } private static IEnumerable Motors { get { object boat = Boat; FieldInfo fieldInfo = GameBinder.Field("Boat", "_motors"); if (boat == null || fieldInfo == null) { yield break; } object value; try { value = fieldInfo.GetValue(boat); } catch { yield break; } if (!(value is IEnumerable enumerable)) { yield break; } foreach (object item in enumerable) { if (Refs.IsAlive(item)) { yield return item; } } } } internal static float MotorForce { get { foreach (object motor in Motors) { PropertyInfo propertyInfo = GameBinder.Property("BoatMotor", "Force"); if (propertyInfo == null) { continue; } try { float num = (float)propertyInfo.GetValue(motor); if (!_motorDefaults.ContainsKey(motor)) { _motorDefaults[motor] = num; } return num; } catch { } } return 0f; } } internal static float MotorForceDefault { get { using (Dictionary.Enumerator enumerator = _motorDefaults.GetEnumerator()) { if (enumerator.MoveNext()) { return enumerator.Current.Value; } } return 0f; } } internal static float MaxSpeed { get { Rigidbody rig = Rig; if (!((Object)(object)rig != (Object)null)) { return Get("_maxVelocity"); } return rig.maxLinearVelocity; } } private static bool ReadBool(string prop) { object boat = Boat; if (boat == null) { return false; } PropertyInfo propertyInfo = GameBinder.Property("Boat", prop); if (propertyInfo == null) { return false; } try { return (bool)propertyInfo.GetValue(boat); } catch { return false; } } internal static bool UnlockBoat() { return GameBinder.TryInvoke(GameBinder.Method("Boat", "UnlockBoat", 0), Boat); } internal static bool UnlockRadar() { return GameBinder.TryInvoke(GameBinder.Method("Boat", "UnlockBoatRadar", 0), Boat); } internal static bool SetMotor(byte tier) { object boat = Boat; if (boat == null) { return false; } if (tier > Motor) { return GameBinder.TryInvoke(GameBinder.Method("Boat", "SetMotor", 1), boat, tier); } if (tier == Motor) { return true; } return GameBinder.TryWriteSyncVar(GameBinder.Field("Boat", "_motorIndex"), boat, tier); } internal static bool ToggleFly(bool on) { Rigidbody rig = Rig; if ((Object)(object)rig == (Object)null) { return false; } _flyActive = on; rig.useGravity = !on; return true; } internal static void FlyStep(float verticalSpeed) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) Rigidbody rig = Rig; if (!((Object)(object)rig == (Object)null)) { rig.useGravity = false; object boat = Boat; if (boat != null) { GameBinder.TrySet(GameBinder.Field("Boat", "_propellerInWater"), boat, true); } float num = 0f; if (Input.GetKey((KeyCode)32)) { num += verticalSpeed; } if (Input.GetKey((KeyCode)306)) { num -= verticalSpeed; } Vector3 linearVelocity = rig.linearVelocity; linearVelocity.y = num; rig.linearVelocity = linearVelocity; } } internal static bool SetMotorForce(float force) { FieldInfo fieldInfo = GameBinder.Field("BoatMotor", "k__BackingField"); if (fieldInfo == null) { return false; } bool result = false; foreach (object motor in Motors) { if (!_motorDefaults.ContainsKey(motor) && GameBinder.TryGet(fieldInfo, motor, out var value)) { _motorDefaults[motor] = value; } if (GameBinder.TrySet(fieldInfo, motor, force)) { result = true; } } return result; } internal static bool SetMaxSpeed(float value) { Rigidbody rig = Rig; if ((Object)(object)rig != (Object)null) { rig.maxLinearVelocity = value; } Set("_maxVelocity", value); return (Object)(object)rig != (Object)null; } internal static float Get(string field) { object boat = Boat; FieldInfo fieldInfo = GameBinder.Field("Boat", field); if (boat == null || fieldInfo == null) { return 0f; } if (GameBinder.TryGet(fieldInfo, boat, out var value)) { if (!_defaults.ContainsKey(field)) { _defaults[field] = value; } return value; } return 0f; } internal static bool Set(string field, float value) { object boat = Boat; FieldInfo fieldInfo = GameBinder.Field("Boat", field); if (boat == null || fieldInfo == null) { return false; } if (!_defaults.ContainsKey(field) && GameBinder.TryGet(fieldInfo, boat, out var value2)) { _defaults[field] = value2; } return GameBinder.TrySet(fieldInfo, boat, value); } internal static float Default(string field) { if (!_defaults.TryGetValue(field, out var value)) { return 0f; } return value; } internal static void ResetAll() { foreach (KeyValuePair @default in _defaults) { Set(@default.Key, @default.Value); } } internal static bool BringToPlayer() { //IL_0020: 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) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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) object boatManager = Refs.BoatManager; Camera currentCamera = Refs.CurrentCamera; if (boatManager == null || (Object)(object)currentCamera == (Object)null) { return false; } Vector3 val = ((Component)currentCamera).transform.position + ((Component)currentCamera).transform.forward * 8f; val.y += 2f; return GameBinder.TryInvoke(GameBinder.Method("BoatManager", "TryMoveBoat", 2), boatManager, val, Quaternion.identity); } } internal static class CheatGate { private static bool _backupDone; internal static bool CheatsEnabled { get { PropertyInfo propertyInfo = GameBinder.Property("ClientSettings", "CheatsEnabled"); if (propertyInfo == null) { return false; } try { return (bool)propertyInfo.GetValue(null); } catch { return false; } } } internal static bool IsHost => Refs.IsHost; internal static bool InGame => Refs.InGame; internal static bool EnableCheats(bool to) { bool num = GameBinder.TryInvoke(GameBinder.Method("ClientSettings", "ToggleCheats", 1), null, to); if (num) { Plugin.Log.LogInfo((object)("Developer cheats " + (to ? "enabled" : "disabled") + ".")); } return num; } internal static void EnsureEnabled() { if (!CheatsEnabled) { EnableCheats(to: true); } } internal static string BlockReason() { if (!InGame) { return "Load into a save first."; } if (!IsHost) { return "Host or solo only — the server owns this."; } return null; } internal static void BackupSavesOnce() { if (_backupDone) { return; } _backupDone = true; try { string persistentDataPath = Application.persistentDataPath; if (!string.IsNullOrEmpty(persistentDataPath) && Directory.Exists(persistentDataPath)) { string text = Path.Combine(Path.GetDirectoryName(persistentDataPath) ?? persistentDataPath, Path.GetFileName(persistentDataPath) + "_ccm_backup_" + DateTime.Now.ToString("yyyyMMdd_HHmmss")); CopyDirectory(persistentDataPath, text); Plugin.Log.LogInfo((object)("Save backup written to " + text)); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Save backup skipped: " + ex.Message)); } } private static void CopyDirectory(string src, string dst) { Directory.CreateDirectory(dst); string[] files = Directory.GetFiles(src); foreach (string text in files) { File.Copy(text, Path.Combine(dst, Path.GetFileName(text)), overwrite: true); } files = Directory.GetDirectories(src); foreach (string text2 in files) { string fileName = Path.GetFileName(text2); if (!fileName.StartsWith("ccm_backup", StringComparison.OrdinalIgnoreCase)) { CopyDirectory(text2, Path.Combine(dst, fileName)); } } } } internal static class CombatCheats { internal static bool GodMode { get { PropertyInfo propertyInfo = GameBinder.Property("PlayerManager", "InGodMode"); if (propertyInfo == null) { return false; } try { return (bool)propertyInfo.GetValue(null); } catch { return false; } } } internal static bool OneShot { get { PropertyInfo propertyInfo = GameBinder.Property("ServerSettings", "OneShotEnabled"); if (propertyInfo == null) { return false; } try { return (bool)propertyInfo.GetValue(null); } catch { return false; } } } internal static bool FriendlyFire { get { PropertyInfo propertyInfo = GameBinder.Property("ServerSettings", "UseFriendlyFire"); if (propertyInfo == null) { return true; } try { return (bool)propertyInfo.GetValue(null); } catch { return true; } } } internal static int Health => ReadVital("Health"); internal static int Fullness => ReadVital("Fullness"); internal static bool SetGodMode(bool to) { if (GodMode == to) { return true; } return GameBinder.TryInvoke(GameBinder.Method("PlayerManager", "ToggleGodMode", 0), null); } internal static bool SetOneShot(bool to) { if (OneShot == to) { return true; } return GameBinder.TryInvoke(GameBinder.Method("ServerSettings", "ToggleOneShot", 0), Refs.ServerSettings); } internal static bool SetFriendlyFire(bool to) { return GameBinder.TryInvoke(GameBinder.Method("ServerSettings", "ToggleFriendlyFire", 1), Refs.ServerSettings, to); } private static int ReadVital(string prop) { object localVitals = Refs.LocalVitals; if (localVitals == null) { return 0; } PropertyInfo propertyInfo = GameBinder.Property("PlayerVitals", prop); if (propertyInfo == null) { return 0; } try { return (int)propertyInfo.GetValue(localVitals); } catch { return 0; } } internal static bool Heal(int amount) { return GameBinder.TryInvoke(GameBinder.Method("PlayerVitals", "Heal", 1), Refs.LocalVitals, amount); } internal static bool RestoreFullness(int amount) { return GameBinder.TryInvoke(GameBinder.Method("PlayerVitals", "RestoreFullness", 1), Refs.LocalVitals, amount); } internal static bool ResetVitals() { return GameBinder.TryInvoke(GameBinder.Method("PlayerVitals", "ServerResetVitals", 0), Refs.LocalVitals); } } internal static class EntityCheats { internal struct Group { internal SpawnCatalog.Category Kind; internal int Count; } internal static bool Available => GameBinder.Property("ItemManager", "Items") != null; internal static int TotalCount => LiveItems().Count; internal static List> LiveItems() { List> list = new List>(); foreach (object item in ItemCheats.WorldItems()) { if (!IsHeldOrStored(item)) { list.Add(new KeyValuePair(CategoryOf(item), item)); } } return list; } private static bool IsHeldOrStored(object item) { PropertyInfo propertyInfo = GameBinder.Property("Item", "SyncedHolder"); if (propertyInfo == null) { return false; } try { return Refs.IsAlive(propertyInfo.GetValue(item)); } catch { return false; } } private static SpawnCatalog.Category CategoryOf(object item) { SpawnCatalog.Entry entry = SpawnCatalog.All.FirstOrDefault((SpawnCatalog.Entry e) => string.Equals(e.Id.ToString(), SkinCheats.ItemId(item).ToString(), StringComparison.Ordinal)); if (entry.Display != null) { return entry.Kind; } return SpawnCatalog.Category.Other; } internal static List Summary() { Dictionary dictionary = new Dictionary(); foreach (KeyValuePair item in LiveItems()) { dictionary.TryGetValue(item.Key, out var value); dictionary[item.Key] = value + 1; } return (from g in dictionary orderby g.Value descending select new Group { Kind = g.Key, Count = g.Value }).ToList(); } private static bool Destroy(object item) { return GameBinder.TryInvoke(GameBinder.Method("Item", "DestroyItem", 2), item, (byte)0, byte.MaxValue); } internal static int DespawnAll() { int num = 0; foreach (KeyValuePair item in LiveItems()) { if (Destroy(item.Value)) { num++; } } return num; } internal static int DespawnCategory(SpawnCatalog.Category kind) { int num = 0; foreach (KeyValuePair item in LiveItems()) { if (item.Key == kind && Destroy(item.Value)) { num++; } } return num; } internal static int DespawnNearby(float radius) { //IL_000c: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) object localPlayer = Refs.LocalPlayer; if (localPlayer == null) { return 0; } Vector3 val = TeleportCheats.PlayerPosition(localPlayer); float num = radius * radius; int num2 = 0; foreach (KeyValuePair item in LiveItems()) { object value = item.Value; object obj = ((value is Component) ? value : null); Transform val2 = ((obj != null) ? ((Component)obj).transform : null); if (!((Object)(object)val2 == (Object)null)) { Vector3 val3 = val2.position - val; if (!(((Vector3)(ref val3)).sqrMagnitude > num) && Destroy(item.Value)) { num2++; } } } return num2; } internal static int DespawnCreatures() { int num = 0; foreach (KeyValuePair item in LiveItems()) { if ((item.Key == SpawnCatalog.Category.Creature || item.Key == SpawnCatalog.Category.Fish || item.Key == SpawnCatalog.Category.Bird || item.Key == SpawnCatalog.Category.Boss) && Destroy(item.Value)) { num++; } } return num; } } internal static class FishingCheats { internal struct BaitEntry { internal byte Index; internal string Name; internal int Cost; } internal static bool Available => Refs.LocalInventory != null; internal static byte CurrentBait { get { object localInventory = Refs.LocalInventory; if (localInventory == null) { return 0; } PropertyInfo propertyInfo = GameBinder.Property("PlayerInventory", "CurBait"); if (propertyInfo == null) { return 0; } try { return (byte)propertyInfo.GetValue(localInventory); } catch { return 0; } } } internal static List AllBaits() { List list = new List(); PropertyInfo propertyInfo = GameBinder.Property("GameInfo", "AllBaits"); if (propertyInfo == null) { return list; } try { if (!(propertyInfo.GetValue(null) is IEnumerable enumerable)) { return list; } byte b = 0; foreach (object item in enumerable) { list.Add(new BaitEntry { Index = b, Name = BaitName(item, b), Cost = BaitCost(item) }); b++; } } catch { } return list; } private static string BaitName(object bait, byte index) { PropertyInfo propertyInfo = GameBinder.Property("BaitInfo", "NameLocalized"); if (propertyInfo != null) { try { string text = propertyInfo.GetValue(bait) as string; if (!string.IsNullOrEmpty(text)) { return text; } } catch { } } return $"Bait {index}"; } private static int BaitCost(object bait) { PropertyInfo propertyInfo = GameBinder.Property("BaitInfo", "Cost"); if (propertyInfo == null) { return 0; } try { return (int)propertyInfo.GetValue(bait); } catch { return 0; } } internal static bool GrantBait(byte index) { object localInventory = Refs.LocalInventory; if (localInventory == null) { return false; } return GameBinder.TryInvoke(GameBinder.Method("PlayerInventory", "ServerBoughtBait", 1), localInventory, index); } internal static bool GrantAllBaits() { List list = AllBaits(); if (list.Count == 0) { return false; } bool result = true; foreach (BaitEntry item in list) { if (!GrantBait(item.Index)) { result = false; } } return result; } internal static bool SelectBait(byte index) { object localInventory = Refs.LocalInventory; if (localInventory == null) { return false; } return GameBinder.TryInvoke(GameBinder.Method("PlayerInventory", "ServerSetCurBait", 1), localInventory, index); } } internal static class GamblingCheats { internal enum Mode { Off, Odds, ForceColour } internal static Mode RigMode = Mode.Off; internal static float WinChance = 50f; internal static string ForcedColour = "Red"; internal static int SpinsSeen; internal static int SpinsWon; internal static int SpinsLost; internal static string LastOutcome = "-"; internal static string CurrentTarget = "-"; private static bool _wasBetting; private static string _target; private const float MaxStepDegrees = 4f; private static object Casino => Refs.FindInScene("CasinoManager"); private static object LocalCasino => Refs.FindInScene("LocalCasino"); internal static bool Available => LocalCasino != null; internal static string[] Colours => GameBinder.EnumNames("BetColor"); internal static string BetColour { get { FieldInfo fieldInfo = GameBinder.Field("CasinoManager", "_curBetColor"); if (fieldInfo == null) { return "-"; } try { return fieldInfo.GetValue(null)?.ToString() ?? "-"; } catch { return "-"; } } } internal static bool IsBetting { get { PropertyInfo propertyInfo = GameBinder.Property("CasinoManager", "IsBetting"); if (propertyInfo == null) { return false; } try { return (bool)propertyInfo.GetValue(null); } catch { return false; } } } internal static int PotWorth { get { object casino = Casino; if (casino == null) { return 0; } PropertyInfo propertyInfo = GameBinder.Property("CasinoManager", "TotalWorth"); if (propertyInfo == null) { return 0; } try { return (int)propertyInfo.GetValue(casino); } catch { return 0; } } } private static bool IsPlaying { get { bool value; return GameBinder.TryGet(GameBinder.Field("LocalCasino", "_isPlaying"), LocalCasino, out value) && value; } } private static float SlotSize { get { if (!GameBinder.TryGet(GameBinder.Field("LocalCasino", "_slotSize"), LocalCasino, out var value) || !(value > 0.01f)) { return 9.72973f; } return value; } } private static int SlotCount => Mathf.Max(1, Mathf.RoundToInt(360f / SlotSize)); private static Transform Wheel => GetTransform("_wheel"); private static Transform BallAngleObject => GetTransform("_ballAngleObject"); internal static string CurrentBallColour { get { if (!TryGetSlot(out var slot)) { return "-"; } return ColourOfSlot(slot); } } internal static bool SlotsAvailable => GameBinder.Method("SlotMachineManager", "RollRandom", 1) != null; internal static string LastArmed { get; private set; } = "nothing"; internal static bool SlotRigArmed { get { if (GameBinder.TryGet(GameBinder.Field("SlotMachineManager", "_cheatSkinIndex"), null, out var value)) { return value != byte.MaxValue; } return false; } } private static Transform GetTransform(string field) { FieldInfo fieldInfo = GameBinder.Field("LocalCasino", field); object localCasino = LocalCasino; if (fieldInfo == null || localCasino == null) { return null; } try { object? value = fieldInfo.GetValue(localCasino); return (Transform)((value is Transform) ? value : null); } catch { return null; } } private static bool TryGetSlot(out int slot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) slot = -1; Transform wheel = Wheel; Transform ballAngleObject = BallAngleObject; if ((Object)(object)wheel == (Object)null || (Object)(object)ballAngleObject == (Object)null) { return false; } Vector3 val = wheel.position - ballAngleObject.position; float num = Mathf.Atan2(val.x, val.z) * 57.29578f; float y = wheel.eulerAngles.y; float num2 = Mathf.Repeat(num - y, 360f); slot = Mathf.FloorToInt(num2 / SlotSize); return true; } internal static string ColourOfSlot(int slot) { if (slot == 0) { return "Green"; } if (slot % 2 <= 0) { return "Red"; } return "Black"; } private static int NearestSlotOfColour(int from, string colour) { int slotCount = SlotCount; if (colour == "Green") { return 0; } for (int i = 0; i <= slotCount / 2 + 1; i++) { int num = ((from + i) % slotCount + slotCount) % slotCount; if (ColourOfSlot(num) == colour) { return num; } int num2 = ((from - i) % slotCount + slotCount) % slotCount; if (ColourOfSlot(num2) == colour) { return num2; } } return from; } private static void OnSpinStarted() { SpinsSeen++; if (RigMode == Mode.Off) { _target = null; CurrentTarget = "not rigged"; return; } if (RigMode == Mode.ForceColour) { _target = ForcedColour; CurrentTarget = _target; return; } string betColour = BetColour; bool flag = Random.Range(0f, 100f) < WinChance; if (flag) { _target = betColour; } else { _target = ((betColour == "Red") ? "Black" : "Red"); } CurrentTarget = _target + " (" + (flag ? "win" : "loss") + ")"; } internal static void FixedStep() { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) bool isBetting = IsBetting; if (isBetting && !_wasBetting) { OnSpinStarted(); } if (!isBetting && _wasBetting) { OnSpinEnded(); } _wasBetting = isBetting; if (isBetting && _target != null && IsPlaying && TryGetSlot(out var slot) && !(ColourOfSlot(slot) == _target)) { int num = NearestSlotOfColour(slot, _target); float num2 = (float)(slot - num) * SlotSize; if (num2 > 180f) { num2 -= 360f; } if (num2 < -180f) { num2 += 360f; } float num3 = Mathf.Clamp(num2, -4f, 4f); Transform wheel = Wheel; if (!((Object)(object)wheel == (Object)null)) { Vector3 localEulerAngles = wheel.localEulerAngles; localEulerAngles.y += num3; wheel.localEulerAngles = localEulerAngles; } } } private static void OnSpinEnded() { string currentBallColour = CurrentBallColour; string betColour = BetColour; bool flag = currentBallColour == betColour; if (flag) { SpinsWon++; } else { SpinsLost++; } LastOutcome = currentBallColour + " — " + (flag ? "won" : "lost"); _target = null; CurrentTarget = "-"; } internal static void ResetStats() { SpinsSeen = (SpinsWon = (SpinsLost = 0)); LastOutcome = "-"; } internal static bool SettleNow() { return GameBinder.TrySet(GameBinder.Field("LocalCasino", "_timeInSameSlot"), LocalCasino, 2.5f); } internal static bool StartSpin(string colourName) { object obj = GameBinder.EnumValue("BetColor", colourName); if (obj == null) { return false; } return GameBinder.TryInvoke(GameBinder.Method("CasinoManager", "ServerStartBet", 1), Casino, obj); } internal static List BetItems() { List list = new List(); FieldInfo fieldInfo = GameBinder.Field("CasinoManager", "_itemsToBet"); if (fieldInfo == null) { return list; } try { if (fieldInfo.GetValue(null) is IEnumerable enumerable) { foreach (object item in enumerable) { if (Refs.IsAlive(item)) { list.Add(item); } } } } catch { } return list; } internal static bool BoostBetItems(float multiplier) { List list = BetItems(); if (list.Count == 0) { return false; } bool result = true; foreach (object item in list) { if (!ItemCheats.SetBettingMulti(item, multiplier)) { result = false; } } return result; } internal static bool SetSlotSkin(object item, byte skinIndex) { return GameBinder.TryInvoke(GameBinder.Method("SlotMachineManager", "SetCheatSkin", 2), null, item, skinIndex); } internal static bool ClearSlotSkin() { return GameBinder.TryInvoke(GameBinder.Method("SlotMachineManager", "SetCheatSkin", 2), null, null, byte.MaxValue); } internal static bool RollSlots() { object localPlayer = Refs.LocalPlayer; if (localPlayer == null) { return false; } return GameBinder.TryInvoke(GameBinder.Method("SlotMachineManager", "RollRandom", 1), null, localPlayer); } internal static List SkinTargets() { return SkinCheats.SkinnableItems(); } internal static string TargetName(object item) { object obj2; if (item != null) { object obj = ((item is Object) ? item : null); obj2 = ((obj != null) ? ((Object)obj).name : null); if (obj2 == null) { return "item"; } } else { obj2 = "Boat"; } return (string)obj2; } internal static List RaritiesFor(object item) { return (from s in (item == null) ? SkinCheats.BoatSkins() : SkinCheats.SkinsFor(item) select s.Rarity into r where !string.IsNullOrEmpty(r) select r).Distinct().ToList(); } internal static List SkinsFor(object item) { if (item != null) { return SkinCheats.SkinsFor(item); } return SkinCheats.BoatSkins(); } internal static bool ArmRandomOfRarity(object item, string rarity) { List list = (from s in SkinsFor(item) where string.Equals(s.Rarity, rarity, StringComparison.OrdinalIgnoreCase) select s).ToList(); if (list.Count == 0) { return false; } SkinCheats.SkinEntry skinEntry = list[Random.Range(0, list.Count)]; LastArmed = TargetName(item) + " — " + skinEntry.Name + " (" + skinEntry.Rarity + ")"; return SetSlotSkin(item, skinEntry.Index); } internal static bool ArmSkin(object item, SkinCheats.SkinEntry skin) { LastArmed = TargetName(item) + " — " + skin.Name + " (" + skin.Rarity + ")"; return SetSlotSkin(item, skin.Index); } internal static bool ClearArmed() { LastArmed = "nothing"; return ClearSlotSkin(); } } internal static class InventoryCheats { internal static bool Available => Refs.LocalInventory != null; internal static byte ExtraSlots => ProgressionCheats.ExtraSlots; internal static int DuplicateHeld(int count) { object heldItem = ItemCheats.HeldItem; if (heldItem == null) { return 0; } string text = SpawnCatalogEntryFor(SkinCheats.ItemId(heldItem)); if (text == null) { Plugin.Log.LogWarning((object)"Held item is not in the spawnable catalogue; cannot duplicate."); return 0; } int num = 0; for (int i = 0; i < Mathf.Clamp(count, 1, 100); i++) { if (SpawnCheats.Spawn(text)) { num++; } } return num; } private static string SpawnCatalogEntryFor(byte id) { foreach (SpawnCatalog.Entry item in SpawnCatalog.All) { if (item.Id == id) { return item.Key; } } return null; } internal static bool DropAll() { //IL_0015: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) object localInventory = Refs.LocalInventory; object localPlayer = Refs.LocalPlayer; if (localInventory == null || localPlayer == null) { return false; } Vector3 val = TeleportCheats.PlayerPosition(localPlayer); return GameBinder.TryInvoke(GameBinder.Method("PlayerInventory", "ServerDropAll", 2), localInventory, val, Quaternion.identity); } internal static bool SaveInventory() { object localInventory = Refs.LocalInventory; if (localInventory == null) { return false; } return GameBinder.TryInvoke(GameBinder.Method("PlayerInventory", "SaveInventory", 1), localInventory, false); } } internal static class ItemCheats { internal enum Target { Held, Inventory, World } internal static object HeldItem { get { object localHolding = Refs.LocalHolding; if (localHolding == null) { return null; } PropertyInfo propertyInfo = GameBinder.Property("PlayerHolding", "HeldItem"); if (propertyInfo == null) { return null; } try { object value = propertyInfo.GetValue(localHolding); return Refs.IsAlive(value) ? value : null; } catch { return null; } } } internal static string ItemName(object item) { object obj = ((item is Object) ? item : null); return ((obj != null) ? ((Object)obj).name : null) ?? "item"; } internal static List WorldItems() { List list = new List(); PropertyInfo propertyInfo = GameBinder.Property("ItemManager", "Items"); if (propertyInfo == null) { return list; } try { if (propertyInfo.GetValue(null) is IDictionary dictionary) { foreach (DictionaryEntry item in dictionary) { if (Refs.IsAlive(item.Value)) { list.Add(item.Value); } } } } catch { } return list; } internal static List Resolve(Target target) { switch (target) { case Target.Held: { object heldItem = HeldItem; if (heldItem != null) { return new List { heldItem }; } return new List(); } case Target.World: return WorldItems(); default: return new List(); } } internal static int Worth(object item) { if (!GameBinder.TryGet(GameBinder.Field("Item", "_worth"), item, out var value)) { return 0; } return value; } internal static int TotalWorth(object item) { return ReadIntProp(item, "TotalWorth"); } internal static float Cookness(object item) { return ReadFloatProp(item, "Cookness"); } internal static float Weight(object item) { return ReadFloatProp(item, "RandomizedWeight"); } internal static float KillScoreMulti(object item) { return ReadFloatProp(item, "KillScoreMultiplier"); } internal static float BettingMulti(object item) { return ReadFloatProp(item, "BettingMultiplier"); } private static int ReadIntProp(object item, string name) { PropertyInfo propertyInfo = GameBinder.Property("Item", name); if (propertyInfo == null || item == null) { return 0; } try { return (int)propertyInfo.GetValue(item); } catch { return 0; } } private static float ReadFloatProp(object item, string name) { PropertyInfo propertyInfo = GameBinder.Property("Item", name); if (propertyInfo == null || item == null) { return 0f; } try { return (float)propertyInfo.GetValue(item); } catch { return 0f; } } internal static bool SetWorth(object item, int worth) { return GameBinder.TrySet(GameBinder.Field("Item", "_worth"), item, worth); } internal static bool SetWeight(object item, float weight) { return GameBinder.TryWriteSyncVar(GameBinder.Field("Item", "_syncedRandomWeight"), item, weight); } internal static bool SetCookness(object item, float cookness) { return GameBinder.TryWriteSyncVar(GameBinder.Field("Item", "_cookness"), item, cookness); } internal static bool SetBettingMulti(object item, float multi) { return GameBinder.TryWriteSyncVar(GameBinder.Field("Item", "_bettingMultiplier"), item, multi); } internal static bool SetKillScoreMulti(object item, float multi) { MethodInfo methodInfo = GameBinder.Method("Item", "SetKillscoreMultiplier", 1); if (methodInfo != null && GameBinder.TryInvoke(methodInfo, item, multi)) { return true; } return GameBinder.TryWriteSyncVar(GameBinder.Field("Item", "_killScoreMultiplier"), item, multi); } internal static bool SetSkin(object item, byte skinIndex) { return GameBinder.TryInvoke(GameBinder.Method("Server", "SetItemSkin", 2), Refs.Server, item, skinIndex); } internal static int ApplyToAll(Target target, Func action) { int num = 0; foreach (object item in Resolve(target)) { if (action(item)) { num++; } } return num; } } internal static class KillScoreCheats { internal struct BonusOption { internal string Name; internal float Worth; internal bool Selected; } private static List _catalogue; internal static bool Available { get { if (GameBinder.Method("PlayerKillScore", "AddKillScore", 3) != null) { return GameBinder.Type("Bonus") != null; } return false; } } internal static List Catalogue { get { if (_catalogue != null) { return _catalogue; } _catalogue = new List(); MethodInfo methodInfo = GameBinder.Method("KillScoreCalculator", "GetAllBonuses", 1); for (int i = 0; i < 3; i++) { if (!(methodInfo != null)) { break; } if (!(GameBinder.InvokeResult(methodInfo, null, i) is IEnumerable enumerable)) { continue; } foreach (object item in enumerable) { string name = ReadName(item); float worth = ReadWorth(item); if (!string.IsNullOrEmpty(name) && !_catalogue.Any((BonusOption b) => b.Name == name)) { _catalogue.Add(new BonusOption { Name = name, Worth = worth }); } } } _catalogue = _catalogue.OrderByDescending((BonusOption b) => b.Worth).ToList(); Plugin.Log.LogInfo((object)$"Kill score catalogue: {_catalogue.Count} bonuses."); return _catalogue; } } internal static IEnumerable Selected => Catalogue.Where((BonusOption b) => b.Selected); internal static float PreviewMultiplier { get { float num = CheatState.KillFlatMultiplier; foreach (BonusOption item in Selected) { num *= item.Worth; } return num; } } internal static bool ShouldOverride { get { if (CheatState.KillScoreOverride) { if (!Selected.Any()) { return Math.Abs(CheatState.KillFlatMultiplier - 1f) > 0.001f; } return true; } return false; } } private static string ReadName(object bonus) { FieldInfo fieldInfo = GameBinder.Field("Bonus", "Name"); try { return fieldInfo?.GetValue(bonus) as string; } catch { return null; } } private static float ReadWorth(object bonus) { if (!GameBinder.TryGet(GameBinder.Field("Bonus", "Worth"), bonus, out var value)) { return 1f; } return value; } internal static void Toggle(int index) { if (index >= 0 && index < Catalogue.Count) { BonusOption value = _catalogue[index]; value.Selected = !value.Selected; _catalogue[index] = value; } } internal static void ClearSelection() { for (int i = 0; i < Catalogue.Count; i++) { BonusOption value = _catalogue[i]; value.Selected = false; _catalogue[i] = value; } } internal static object BuildBonusList() { Type type = GameBinder.Type("Bonus"); if (type == null) { return null; } IList list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(type)); foreach (BonusOption item in Selected) { list.Add(MakeBonus(type, item.Name, item.Worth)); } float killFlatMultiplier = CheatState.KillFlatMultiplier; if (Math.Abs(killFlatMultiplier - 1f) > 0.001f) { list.Add(MakeBonus(type, CheatState.KillBonusLabel, killFlatMultiplier)); } return list; } private static object MakeBonus(Type bonusType, string name, float worth) { ConstructorInfo constructor = bonusType.GetConstructor(new Type[2] { typeof(string), typeof(float) }); if (constructor != null) { return constructor.Invoke(new object[2] { name, worth }); } object obj = Activator.CreateInstance(bonusType); GameBinder.Field("Bonus", "Name")?.SetValue(obj, name); GameBinder.Field("Bonus", "Worth")?.SetValue(obj, worth); return obj; } } internal static class MoneyCheats { private static object Manager => Refs.FindInScene("MoneyManager"); internal static bool Available { get { if (GameBinder.Method("MoneyManager", "AddMoney", 2) != null) { return Refs.LocalPlayer != null; } return false; } } internal static int Balance { get { object manager = Manager; if (manager == null) { return 0; } if (!GameBinder.TryReadSyncVar(GameBinder.Field("MoneyManager", "_money"), manager, out var value)) { return 0; } return value; } } internal static bool Add(int amount) { if (amount == 0) { return true; } MethodInfo methodInfo = GameBinder.Method("MoneyManager", "AddMoney", 2); object localPlayer = Refs.LocalPlayer; if (methodInfo == null || localPlayer == null) { return false; } return GameBinder.TryInvoke(methodInfo, null, amount, localPlayer); } internal static bool Remove(int amount) { if (amount == 0) { return true; } MethodInfo methodInfo = GameBinder.Method("MoneyManager", "RemoveMoney", 2); object localPlayer = Refs.LocalPlayer; if (methodInfo == null || localPlayer == null) { return false; } return GameBinder.TryInvoke(methodInfo, null, amount, localPlayer); } internal static bool SetTo(int target) { int num = target - Balance; if (num == 0) { return true; } if (num <= 0) { return Remove(-num); } return Add(num); } } internal static class MovementCheats { internal static readonly string[] Fields = new string[8] { "_walkSpeed", "_sprintSpeed", "_crouchWalkSpeedMulti", "_jumpForce", "_extraGravityForce", "_acceleration", "_decceleration", "_sinkSpeed" }; private static readonly Dictionary _defaults = new Dictionary(); private static bool _flyActive; private static float _savedGravity; private static bool _hasSavedGravity; internal static bool Available => Refs.LocalMovement != null; private static MethodInfo SetVel => GameBinder.Method("PlayerMovement", "SetVel", 1); internal static bool FlyAvailable { get { if (Refs.LocalMovement != null) { return GameBinder.Field("PlayerMovement", "_curMoveSpeed") != null; } return false; } } private static Rigidbody Rigidbody { get { object localPlayer = Refs.LocalPlayer; if (localPlayer == null) { return null; } PropertyInfo propertyInfo = GameBinder.Property("Player", "Rigidbody"); try { object? obj = propertyInfo?.GetValue(localPlayer); return (Rigidbody)((obj is Rigidbody) ? obj : null); } catch { return null; } } } internal static float Get(string field) { object localMovement = Refs.LocalMovement; FieldInfo fieldInfo = GameBinder.Field("PlayerMovement", field); if (localMovement == null || fieldInfo == null) { return 0f; } if (GameBinder.TryGet(fieldInfo, localMovement, out var value)) { if (!_defaults.ContainsKey(field)) { _defaults[field] = value; } return value; } return 0f; } internal static bool Set(string field, float value) { object localMovement = Refs.LocalMovement; FieldInfo fieldInfo = GameBinder.Field("PlayerMovement", field); if (localMovement == null || fieldInfo == null) { return false; } if (!_defaults.ContainsKey(field) && GameBinder.TryGet(fieldInfo, localMovement, out var value2)) { _defaults[field] = value2; } return GameBinder.TrySet(fieldInfo, localMovement, value); } internal static float Default(string field) { if (!_defaults.TryGetValue(field, out var value)) { return 0f; } return value; } internal static void ResetAll() { foreach (KeyValuePair @default in _defaults) { Set(@default.Key, @default.Value); } } internal static void StopFly() { if (_flyActive) { _flyActive = false; object localMovement = Refs.LocalMovement; if (localMovement != null && _hasSavedGravity) { GameBinder.TrySet(GameBinder.Field("PlayerMovement", "_extraGravityForce"), localMovement, _savedGravity); } SetRigidbodyGravity(on: true); _hasSavedGravity = false; } } internal static void FlyStep(float horizontalSpeed, float verticalSpeed) { //IL_00c7: 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_00d6: Unknown result type (might be due to invalid IL or missing references) object localMovement = Refs.LocalMovement; if (localMovement != null) { if (!_flyActive) { _flyActive = true; _hasSavedGravity = GameBinder.TryGet(GameBinder.Field("PlayerMovement", "_extraGravityForce"), localMovement, out _savedGravity); SetRigidbodyGravity(on: false); } GameBinder.TrySet(GameBinder.Field("PlayerMovement", "_curMoveSpeed"), localMovement, horizontalSpeed); GameBinder.TrySet(GameBinder.Field("PlayerMovement", "_targetMoveSpeed"), localMovement, horizontalSpeed); GameBinder.TrySet(GameBinder.Field("PlayerMovement", "_extraGravityForce"), localMovement, 0f); float num = 0f; if (Input.GetKey((KeyCode)32)) { num += verticalSpeed; } if (Input.GetKey((KeyCode)306)) { num -= verticalSpeed; } Rigidbody rigidbody = Rigidbody; if ((Object)(object)rigidbody != (Object)null) { Vector3 linearVelocity = rigidbody.linearVelocity; linearVelocity.y = num; rigidbody.linearVelocity = linearVelocity; } } } private static void SetRigidbodyGravity(bool on) { Rigidbody rigidbody = Rigidbody; if ((Object)(object)rigidbody != (Object)null) { rigidbody.useGravity = on; } } internal static void FreezePlayer() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) object localMovement = Refs.LocalMovement; if (localMovement != null) { GameBinder.TrySet(GameBinder.Field("PlayerMovement", "_curMoveSpeed"), localMovement, 0f); GameBinder.TrySet(GameBinder.Field("PlayerMovement", "_targetMoveSpeed"), localMovement, 0f); Rigidbody rigidbody = Rigidbody; if ((Object)(object)rigidbody != (Object)null) { rigidbody.linearVelocity = Vector3.zero; } } } } internal static class ProgressionCheats { internal static byte ExtraSlots { get { object localInventory = Refs.LocalInventory; if (localInventory == null) { return 0; } PropertyInfo propertyInfo = GameBinder.Property("PlayerInventory", "ExtraSlots"); if (propertyInfo == null) { return 0; } try { return (byte)propertyInfo.GetValue(localInventory); } catch { return 0; } } } private static void Guard() { if (Plugin.BackupSaves != null && Plugin.BackupSaves.Value) { CheatGate.BackupSavesOnce(); } } internal static bool UnlockAchievements() { Guard(); return GameBinder.TryInvoke(GameBinder.Method("AchievementManager", "ToggleAllAchievements", 1), null, true); } internal static bool LockAchievements() { Guard(); return GameBinder.TryInvoke(GameBinder.Method("AchievementManager", "ToggleAllAchievements", 1), null, false); } internal static bool FinishGame() { Guard(); return GameBinder.TryInvoke(GameBinder.Method("DazedCommands", "UseFinishGameCommand", 0), null); } internal static bool ShowKillScores() { return GameBinder.TryInvoke(GameBinder.Method("DazedCommands", "UseShowKillScoresCommand", 0), null); } internal static bool UnlockPocket(byte index) { Guard(); object localInventory = Refs.LocalInventory; if (localInventory == null) { return false; } return GameBinder.TryInvoke(GameBinder.Method("PlayerInventory", "UnlockExtraPocket", 1), localInventory, index); } internal static bool UnlockAllPockets() { bool result = true; for (byte b = 1; b <= 4; b++) { if (!UnlockPocket(b)) { result = false; } } return result; } internal static bool SaveNow() { return GameBinder.TryInvoke(GameBinder.Method("SaveManager", "SaveServer", 1), null, false); } internal static bool UnlockEverything() { Guard(); bool result = true; if (!SkinCheats.UnlockAll()) { result = false; } if (!SkinCheats.UnlockAllCharacters()) { result = false; } if (!TeleportCheats.UnlockAllIslands()) { result = false; } if (!BoatCheats.UnlockBoat()) { result = false; } if (!BoatCheats.UnlockRadar()) { result = false; } if (!WorldCheats.UnlockGrill()) { result = false; } if (!UnlockAllPockets()) { result = false; } return result; } } internal static class SkinCheats { internal struct SkinEntry { internal byte Index; internal string Name; internal string Rarity; } internal static readonly string[] CharacterUnlocks = new string[14] { "UnlockLighthouseKeeper", "UnlockSwampMan", "UnlockSwampLady", "UnlockKioskLady", "UnlockTourist", "UnlockGrillmaster", "UnlockAndrei", "UnlockJacob", "UnlockGunStoreClerc", "UnlockScaredGuyInShorts", "UnlockStoreGradma", "UnlockMilitary", "UnlockScientist", "UnlockBean" }; internal static byte BoatSkin { get { object boat = BoatCheats.Boat; if (boat == null) { return 0; } PropertyInfo propertyInfo = GameBinder.Property("Boat", "CurSkin"); if (propertyInfo == null) { return 0; } try { return (byte)propertyInfo.GetValue(boat); } catch { return 0; } } } internal static List SkinnableItems() { List list = new List(); PropertyInfo propertyInfo = GameBinder.Property("GameInfo", "ItemWithSkinsforCommands"); if (propertyInfo == null) { return list; } try { if (propertyInfo.GetValue(null) is IEnumerable enumerable) { foreach (object item in enumerable) { if (Refs.IsAlive(item)) { list.Add(item); } } } } catch { } return list; } internal static bool UnlockAll() { List list = SkinnableItems(); if (list.Count == 0) { return false; } MethodInfo methodInfo = GameBinder.Method("SaveManager", "UnlockSkin", 2); if (methodInfo == null) { return false; } bool result = true; foreach (object item in list) { byte b = ItemId(item); foreach (SkinEntry item2 in SkinsFor(item)) { if (!GameBinder.TryInvoke(methodInfo, null, b, item2.Index)) { result = false; } } } return result; } internal static bool LockAll() { return GameBinder.TryInvoke(GameBinder.Method("SaveManager", "LockAllSkins", 0), null); } internal static bool UnlockSkin(object item, byte skinIndex) { return GameBinder.TryInvoke(GameBinder.Method("SaveManager", "UnlockSkin", 2), null, ItemId(item), skinIndex); } internal static byte ItemId(object item) { PropertyInfo propertyInfo = GameBinder.Property("Item", "ID"); if (propertyInfo == null || item == null) { return 0; } try { return (byte)propertyInfo.GetValue(item); } catch { return 0; } } internal static List SkinsFor(object item) { List list = new List(); if (item == null) { return list; } try { object obj = GameBinder.Property("Item", "SkinPreset")?.GetValue(item); if (!Refs.IsAlive(obj)) { return list; } if (!(GameBinder.Property("SkinPreset", "Skins")?.GetValue(obj) is IEnumerable enumerable)) { return list; } byte b = 0; foreach (object item2 in enumerable) { list.Add(new SkinEntry { Index = b, Name = (ReadSkinString(item2, "Name") ?? $"Skin {b}"), Rarity = (ReadSkinString(item2, "Rarity") ?? "") }); b++; } } catch { } return list; } private static string ReadSkinString(object skin, string propName) { PropertyInfo propertyInfo = GameBinder.Property("ItemSkin", propName); if (propertyInfo == null || skin == null) { return null; } try { return propertyInfo.GetValue(skin)?.ToString(); } catch { return null; } } internal static List BoatSkins() { List list = new List(); object boat = BoatCheats.Boat; if (boat == null) { return list; } try { object obj = GameBinder.Property("Boat", "SkinPreset")?.GetValue(boat); if (!Refs.IsAlive(obj)) { return list; } if (!(GameBinder.Property("SkinPreset", "Skins")?.GetValue(obj) is IEnumerable enumerable)) { return list; } byte b = 0; foreach (object item in enumerable) { list.Add(new SkinEntry { Index = b, Name = (ReadSkinString(item, "Name") ?? $"Skin {b}"), Rarity = (ReadSkinString(item, "Rarity") ?? "") }); b++; } } catch { } return list; } internal static bool SetBoatSkin(byte index) { return GameBinder.TryInvoke(GameBinder.Method("Server", "SetBoatSkin", 1), Refs.Server, index); } internal static string PrettyCharacter(string method) { if (!method.StartsWith("Unlock")) { return method; } return Regex.Replace(method.Substring(6), "(? _entries; internal static bool Loaded { get { if (_entries != null) { return _entries.Count > 0; } return false; } } internal static int Count => _entries?.Count ?? 0; internal static IReadOnlyList All { get { if (_entries == null) { Load(); } IReadOnlyList entries = _entries; return entries ?? Array.Empty(); } } internal static void Load() { _entries = new List(); try { FieldInfo fieldInfo = GameBinder.Field("GameInfo", "_nameToSpawnable"); if (fieldInfo == null || !(fieldInfo.GetValue(null) is IDictionary dictionary)) { return; } foreach (DictionaryEntry item in dictionary) { string text = item.Key as string; if (!string.IsNullOrEmpty(text) && item.Value != null) { _entries.Add(new Entry { Key = text, Display = PrettyName(item.Value, text), Id = SkinCheats.ItemId(item.Value), Kind = Classify(item.Value) }); } } _entries = _entries.OrderBy((Entry e) => e.Display, StringComparer.OrdinalIgnoreCase).ToList(); Plugin.Log.LogInfo((object)$"Spawn catalogue loaded: {_entries.Count} entries."); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Spawn catalogue failed to load: " + ex.Message)); } } private static Category Classify(object item) { if (HasComponent(item, "Bird")) { return Category.Bird; } if (HasComponent(item, "Explosive")) { return Category.Explosive; } if (HasComponent(item, "Weapon")) { return Category.Weapon; } if (HasComponent(item, "Melee")) { return Category.Melee; } object component = GetComponent(item, "Creature"); if (component != null) { if (IsBoss(component)) { return Category.Boss; } if (!HasComponent(item, "Fish")) { return Category.Creature; } return Category.Fish; } if (HasComponent(item, "Fish")) { return Category.Fish; } if (HasComponent(item, "Tool")) { return Category.Tool; } return Category.Other; } private static bool IsBoss(object creature) { PropertyInfo propertyInfo = GameBinder.Property("Creature", "BossType"); if (propertyInfo == null) { return false; } try { string text = propertyInfo.GetValue(creature)?.ToString(); return !string.IsNullOrEmpty(text) && text != "None"; } catch { return false; } } private static object GetComponent(object item, string propName) { PropertyInfo propertyInfo = GameBinder.Property("Item", propName); if (propertyInfo == null) { return null; } try { object value = propertyInfo.GetValue(item); return Refs.IsAlive(value) ? value : null; } catch { return null; } } private static bool HasComponent(object item, string propName) { return GetComponent(item, propName) != null; } private static string PrettyName(object item, string fallback) { try { Object val = (Object)((item is Object) ? item : null); if (val != (Object)null && !string.IsNullOrEmpty(val.name)) { return val.name; } } catch { } return fallback; } internal static IEnumerable Search(string filter, Category? only, SortMode sort) { IEnumerable source = All.AsEnumerable(); if (only.HasValue) { source = source.Where((Entry e) => e.Kind == only.Value); } if (!string.IsNullOrEmpty(filter)) { string f = filter.Trim().ToLowerInvariant(); source = source.Where((Entry e) => e.Display.ToLowerInvariant().Contains(f) || e.Key.Contains(f) || e.Kind.ToString().ToLowerInvariant().Contains(f)); } return sort switch { SortMode.Category => source.OrderBy((Entry e) => e.Kind.ToString(), StringComparer.OrdinalIgnoreCase).ThenBy((Entry e) => e.Display, StringComparer.OrdinalIgnoreCase), SortMode.Id => source.OrderBy((Entry e) => e.Id).ThenBy((Entry e) => e.Display, StringComparer.OrdinalIgnoreCase), _ => source.OrderBy((Entry e) => e.Display, StringComparer.OrdinalIgnoreCase), }; } internal static Dictionary Counts() { Dictionary dictionary = new Dictionary(); foreach (Entry item in All) { dictionary.TryGetValue(item.Kind, out var value); dictionary[item.Kind] = value + 1; } return dictionary; } } internal static class SpawnCheats { internal static bool Available { get { if (GameBinder.Method("GameInfo", "GetSpawnable", 1, new Type[1] { typeof(string) }) != null) { return Refs.Server != null; } return false; } } internal static bool Spawn(string key, int count = 1, bool asDead = false, bool asDrip = false) { if (string.IsNullOrEmpty(key)) { return false; } if (CheatGate.BlockReason() != null) { return false; } bool result = true; for (int i = 0; i < Mathf.Clamp(count, 1, 100); i++) { if (!SpawnOne(key, asDead, asDrip)) { result = false; } } return result; } private static bool SpawnOne(string key, bool asDead, bool asDrip) { //IL_0080: 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_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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) try { object obj = GameBinder.InvokeResult(GameBinder.Method("GameInfo", "GetSpawnable", 1, new Type[1] { typeof(string) }), null, key); Object val = (Object)((obj is Object) ? obj : null); if (!Refs.IsAlive(val)) { Plugin.Log.LogWarning((object)("No spawnable named '" + key + "'.")); return false; } Camera currentCamera = Refs.CurrentCamera; if ((Object)(object)currentCamera == (Object)null) { return false; } Vector3 val2 = ((Component)currentCamera).transform.position + ((Component)currentCamera).transform.forward * 2f; Object val3 = Object.Instantiate(val, val2, Quaternion.identity); if (!Refs.IsAlive(val3)) { return false; } object creature = GetCreature(val3); if (asDrip && creature != null) { GameBinder.TryInvoke(GameBinder.Method("Creature", "SetDrip", 0), creature); } if (asDead && creature != null) { GameBinder.TryInvoke(GameBinder.Method("Creature", "ServerKillOnSpawn", 0), creature); } return NetworkSpawn(val3); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Spawn '" + key + "' failed: " + ex.Message)); return false; } } private static object GetCreature(object item) { PropertyInfo propertyInfo = GameBinder.Property("Item", "Creature"); if (propertyInfo == null) { return null; } try { object value = propertyInfo.GetValue(item); return Refs.IsAlive(value) ? value : null; } catch { return null; } } private static bool NetworkSpawn(Object clone) { object server = Refs.Server; if (server == null) { return false; } GameObject gameObject = GetGameObject(clone); if ((Object)(object)gameObject == (Object)null) { return false; } MethodInfo[] methods = server.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.Name != "Spawn") { continue; } ParameterInfo[] parameters = methodInfo.GetParameters(); if (parameters.Length != 0 && !(parameters[0].ParameterType != typeof(GameObject))) { object[] array = new object[parameters.Length]; array[0] = gameObject; for (int j = 1; j < parameters.Length; j++) { array[j] = (parameters[j].HasDefaultValue ? parameters[j].DefaultValue : (parameters[j].ParameterType.IsValueType ? Activator.CreateInstance(parameters[j].ParameterType) : null)); } if (GameBinder.TryInvoke(methodInfo, server, array)) { return true; } } } BindingReport.Record("Server.Spawn(GameObject)", ok: false); return false; } private static GameObject GetGameObject(Object o) { GameObject val = (GameObject)(object)((o is GameObject) ? o : null); if (val != null) { return val; } Component val2 = (Component)(object)((o is Component) ? o : null); if (val2 != null) { return val2.gameObject; } PropertyInfo property = ((object)o).GetType().GetProperty("gameObject", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); try { object? obj = property?.GetValue(o); return (GameObject)((obj is GameObject) ? obj : null); } catch { return null; } } } internal static class TeleportCheats { internal static readonly Dictionary Waypoints = new Dictionary(); internal static byte CurrentIsland => ReadByte("CurIsland"); internal static byte MaxUnlocked => ReadByte("MaxIslandUnlocked"); internal static int TotalIslands { get { if (!GameBinder.TryGet(GameBinder.Field("IslandManager", "TotalIslands"), null, out var value)) { return 0; } return value; } } private static byte ReadByte(string prop) { PropertyInfo propertyInfo = GameBinder.Property("OnlineIslandManager", prop); if (propertyInfo == null) { return 0; } try { return (byte)propertyInfo.GetValue(null); } catch { return 0; } } internal static bool GoToIsland(byte index) { return GameBinder.TryInvoke(GameBinder.Method("OnlineIslandManager", "TpToSpecificIsland", 1), null, index); } internal static bool NextIsland(bool previous = false) { return GameBinder.TryInvoke(GameBinder.Method("OnlineIslandManager", "TpToNextIsland", 1), null, previous); } internal static bool UnlockIsland(byte index) { object instance = Refs.FindInScene("OnlineIslandManager"); return GameBinder.TryInvoke(GameBinder.Method("OnlineIslandManager", "UnlockIsland", 1), instance, index); } internal static bool UnlockAllIslands() { int num = Mathf.Max(TotalIslands, 6); bool result = true; for (byte b = 0; b < num; b++) { if (!UnlockIsland(b)) { result = false; } } return result; } internal static List AlivePlayers() { List list = new List(); object obj = null; PropertyInfo propertyInfo = GameBinder.Property("PlayerManager", "AlivePlayers"); if (propertyInfo != null) { try { obj = propertyInfo.GetValue(null); } catch { } } if (obj == null) { FieldInfo fieldInfo = GameBinder.Field("PlayerManager", "AlivePlayers"); if (fieldInfo != null) { try { obj = fieldInfo.GetValue(null); } catch { } } } if (obj is IEnumerable enumerable) { foreach (object item in enumerable) { if (Refs.IsAlive(item)) { list.Add(item); } } } return list; } internal static string PlayerName(object player) { PropertyInfo propertyInfo = GameBinder.Property("Player", "SteamName"); if (propertyInfo != null) { try { string text = propertyInfo.GetValue(player) as string; if (!string.IsNullOrEmpty(text)) { return text; } } catch { } } object obj2 = ((player is Object) ? player : null); return ((obj2 != null) ? ((Object)obj2).name : null) ?? "player"; } internal static Vector3 PlayerPosition(object player) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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) PropertyInfo propertyInfo = GameBinder.Property("Player", "Transform"); if (propertyInfo == null) { return Vector3.zero; } try { object? value = propertyInfo.GetValue(player); object? obj = ((value is Transform) ? value : null); return (obj != null) ? ((Transform)obj).position : Vector3.zero; } catch { return Vector3.zero; } } internal static bool TeleportPlayerTo(object player, Vector3 pos, float yaw = 0f) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) return GameBinder.TryInvoke(GameBinder.Method("Server", "TeleportPlayer", 3), Refs.Server, player, pos, yaw); } internal static bool TeleportSelfTo(Vector3 pos, float yaw = 0f) { //IL_000c: 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) object localPlayer = Refs.LocalPlayer; if (localPlayer == null) { return false; } if (TeleportPlayerTo(localPlayer, pos, yaw)) { return true; } return GameBinder.TryInvoke(GameBinder.Method("Player", "LocalTeleport", 3), localPlayer, pos, yaw, true); } internal static bool GoToPlayer(object other) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (other == null) { return false; } Vector3 val = PlayerPosition(other); if (val == Vector3.zero) { Plugin.Log.LogWarning((object)"Target player has no usable position."); return false; } return TeleportSelfTo(val + Vector3.up * 1.5f); } internal static bool BringPlayer(object other) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) object localPlayer = Refs.LocalPlayer; if (other == null || localPlayer == null) { return false; } Vector3 val = PlayerPosition(localPlayer); if (val == Vector3.zero) { Plugin.Log.LogWarning((object)"Bring failed: own position unavailable."); return false; } Vector3 pos = val + Vector3.up * 1.5f + Forward(localPlayer) * 1.5f; if (TeleportPlayerTo(other, pos)) { return true; } Plugin.Log.LogWarning((object)"Server.TeleportPlayer failed; trying the movement component directly."); return TeleportViaMovement(other, pos); } private static Vector3 Forward(object player) { //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_003e: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) PropertyInfo propertyInfo = GameBinder.Property("Player", "Transform"); try { object? obj = propertyInfo?.GetValue(player); object? obj2 = ((obj is Transform) ? obj : null); return (obj2 != null) ? ((Transform)obj2).forward : Vector3.forward; } catch { return Vector3.forward; } } private static bool TeleportViaMovement(object player, Vector3 pos) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) PropertyInfo propertyInfo = GameBinder.Property("Player", "Movement"); object obj = null; try { obj = propertyInfo?.GetValue(player); } catch { } if (obj == null) { return false; } return GameBinder.TryInvoke(GameBinder.Method("PlayerMovement", "Teleport", 2), obj, pos, true); } internal static bool GoToBoat() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) object boat = BoatCheats.Boat; if (boat == null) { return false; } PropertyInfo propertyInfo = GameBinder.Property("Boat", "VisualBoat"); try { object? obj = propertyInfo?.GetValue(boat); Transform val = (Transform)((obj is Transform) ? obj : null); if ((Object)(object)val == (Object)null) { return false; } return TeleportSelfTo(val.position + Vector3.up * 3f); } catch { return false; } } internal static bool SaveWaypoint(string name) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) object localPlayer = Refs.LocalPlayer; if (localPlayer == null || string.IsNullOrEmpty(name)) { return false; } Waypoints[name] = PlayerPosition(localPlayer); return true; } internal static bool GoToWaypoint(string name) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (Waypoints.TryGetValue(name, out var value)) { return TeleportSelfTo(value); } return false; } } internal static class VisualCheats { internal enum EspKind { Creature, Item, Player } internal struct EspTarget { internal Transform Transform; internal string Label; internal EspKind Kind; } internal const float DefaultFov = 60f; private static Behaviour _playerCamComponent; private static Transform _camTransform; private static Vector3 _savedPos; private static Quaternion _savedRot; private static bool _freeCamActive; private static bool _bodyShown; private static readonly string[] BodyRenderers = new string[6] { "_bodyRenderer", "_leftHand", "_rightHand", "_outfitRenderer", "_hatRenderer", "_accessoryRenderer" }; private static readonly string[] LocalHandRenderers = new string[2] { "_localLeftHand", "_localRightHand" }; private static readonly List _targets = new List(); private static float _nextScan; private static MethodInfo _findAll; private static bool _findAllResolved; internal static bool FovAvailable => GameBinder.Method("PlayerCamera", "SetFOV", 1) != null; internal static bool DamageNumbers => ReadBool("DecalManager", "UseDamageNumbers", fallback: true); internal static bool Blood => ReadBool("DecalManager", "UseBlood", fallback: true); internal static bool FreeCamActive => _freeCamActive; internal static bool FreeCamAvailable { get { if (Refs.LocalCamera is Behaviour) { return GameBinder.Property("PlayerCamera", "CamTransform") != null; } return false; } } internal static bool BodyShown => _bodyShown; private static object LocalSkin { get { object localPlayer = Refs.LocalPlayer; if (localPlayer == null) { return null; } PropertyInfo propertyInfo = GameBinder.Property("Player", "Skin"); try { object obj = propertyInfo?.GetValue(localPlayer); return Refs.IsAlive(obj) ? obj : null; } catch { return null; } } } internal static bool BodyAvailable { get { if (LocalSkin != null) { return GameBinder.Method("PlayerSkin", "InitializeOther", 0) != null; } return false; } } internal static IReadOnlyList Targets => _targets; internal static bool SetFov(float fov) { return GameBinder.TryInvoke(GameBinder.Method("PlayerCamera", "SetFOV", 1), null, fov); } private static bool ReadBool(string type, string prop, bool fallback) { PropertyInfo propertyInfo = GameBinder.Property(type, prop); if (propertyInfo == null) { return fallback; } try { return (bool)propertyInfo.GetValue(null); } catch { return fallback; } } internal static bool SetDamageNumbers(bool to) { return GameBinder.TryInvoke(GameBinder.Method("DecalManager", "ToggleDamageNumbers", 1), null, to); } internal static bool SetBlood(bool to) { return GameBinder.TryInvoke(GameBinder.Method("DecalManager", "ToggleBlood", 1), null, to); } internal static bool SetDecals(bool to) { return GameBinder.TryInvoke(GameBinder.Method("DecalManager", "ToggleDecals", 1), null, to); } internal static bool ClearDecals() { return GameBinder.TryInvoke(GameBinder.Method("DecalManager", "ClearDecals", 0), null); } internal static bool ToggleFreeCam(bool on) { if (on == _freeCamActive) { return true; } if (!on) { return ExitFreeCam(); } return EnterFreeCam(); } private static bool EnterFreeCam() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_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) object localCamera = Refs.LocalCamera; Behaviour val = (Behaviour)((localCamera is Behaviour) ? localCamera : null); if ((Object)(object)val == (Object)null) { return false; } PropertyInfo propertyInfo = GameBinder.Property("PlayerCamera", "CamTransform"); try { object? obj = propertyInfo?.GetValue(val); _camTransform = (Transform)((obj is Transform) ? obj : null); } catch { _camTransform = null; } if ((Object)(object)_camTransform == (Object)null) { return false; } _playerCamComponent = val; _savedPos = _camTransform.position; _savedRot = _camTransform.rotation; val.enabled = false; _freeCamActive = true; return true; } private static bool ExitFreeCam() { //IL_0018: 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) _freeCamActive = false; if ((Object)(object)_camTransform != (Object)null) { _camTransform.position = _savedPos; _camTransform.rotation = _savedRot; } if ((Object)(object)_playerCamComponent != (Object)null) { _playerCamComponent.enabled = true; } _playerCamComponent = null; _camTransform = null; return true; } internal static bool ShowOwnBody(bool show) { object localSkin = LocalSkin; if (localSkin == null) { return false; } if (show) { GameBinder.TryInvoke(GameBinder.Method("PlayerSkin", "InitializeOther", 0), localSkin); } string[] bodyRenderers = BodyRenderers; foreach (string fieldName in bodyRenderers) { SetRenderer(localSkin, fieldName, show); } bodyRenderers = LocalHandRenderers; foreach (string fieldName2 in bodyRenderers) { SetRenderer(localSkin, fieldName2, !show); } _bodyShown = show; return true; } private static void SetRenderer(object skin, string fieldName, bool enabled) { FieldInfo fieldInfo = GameBinder.Field("PlayerSkin", fieldName); if (fieldInfo == null) { return; } try { object? value = fieldInfo.GetValue(skin); Renderer val = (Renderer)((value is Renderer) ? value : null); if (val == null || (Object)(object)val == (Object)null) { if (enabled) { Plugin.Log.LogWarning((object)("PlayerSkin." + fieldName + " is empty on the local player.")); } return; } if ((Object)(object)((Component)val).gameObject != (Object)null && ((Component)val).gameObject.activeSelf != enabled) { ((Component)val).gameObject.SetActive(enabled); } val.enabled = enabled; if (enabled) { val.shadowCastingMode = (ShadowCastingMode)1; } } catch (Exception ex) { Plugin.Log.LogWarning((object)(fieldName + ": " + ex.Message)); } } internal static void FreeCamStep(float speed, float sensitivity) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_0086: 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_0090: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) if (_freeCamActive && !((Object)(object)_camTransform == (Object)null)) { float num = Input.GetAxisRaw("Mouse X") * sensitivity; float num2 = Input.GetAxisRaw("Mouse Y") * sensitivity; Vector3 eulerAngles = _camTransform.eulerAngles; eulerAngles.x = NormalizePitch(eulerAngles.x - num2); eulerAngles.y += num; eulerAngles.z = 0f; _camTransform.eulerAngles = eulerAngles; Vector3 val = Vector3.zero; if (Input.GetKey((KeyCode)119)) { val += _camTransform.forward; } if (Input.GetKey((KeyCode)115)) { val -= _camTransform.forward; } if (Input.GetKey((KeyCode)100)) { val += _camTransform.right; } if (Input.GetKey((KeyCode)97)) { val -= _camTransform.right; } if (Input.GetKey((KeyCode)32)) { val += Vector3.up; } if (Input.GetKey((KeyCode)306)) { val -= Vector3.up; } float num3 = (Input.GetKey((KeyCode)304) ? 3f : 1f); if (((Vector3)(ref val)).sqrMagnitude > 0.001f) { Transform camTransform = _camTransform; camTransform.position += ((Vector3)(ref val)).normalized * speed * num3 * Time.unscaledDeltaTime; } } } private static float NormalizePitch(float pitch) { if (pitch > 180f) { pitch -= 360f; } return Mathf.Clamp(pitch, -89f, 89f); } internal static void Rescan(bool creatures, bool items, bool players, float interval = 0.5f) { if (!(Time.unscaledTime < _nextScan)) { _nextScan = Time.unscaledTime + Mathf.Max(0.1f, interval); _targets.Clear(); if (creatures) { ScanCreatures(); } if (items) { ScanItems(); } if (players) { ScanPlayers(); } } } private static void ScanCreatures() { Type type = GameBinder.Type("Creature"); if (type == null) { return; } foreach (object item in FindAll(type)) { Component val = (Component)((item is Component) ? item : null); if ((Object)(object)val == (Object)null) { continue; } PropertyInfo propertyInfo = GameBinder.Property("Creature", "IsDead"); if (propertyInfo != null) { try { if ((bool)propertyInfo.GetValue(val)) { continue; } } catch { } } _targets.Add(new EspTarget { Transform = val.transform, Label = ((Object)val).name, Kind = EspKind.Creature }); } } private static void ScanItems() { PropertyInfo propertyInfo = GameBinder.Property("ItemManager", "Items"); if (propertyInfo == null) { return; } try { if (!(propertyInfo.GetValue(null) is IDictionary dictionary)) { return; } foreach (DictionaryEntry item2 in dictionary) { object key = item2.Key; Transform val = (Transform)((key is Transform) ? key : null); if (val != null && !((Object)(object)val == (Object)null)) { List targets = _targets; EspTarget item = new EspTarget { Transform = val }; object? value = item2.Value; object? obj = ((value is Object) ? value : null); item.Label = ((obj != null) ? ((Object)obj).name : null) ?? "item"; item.Kind = EspKind.Item; targets.Add(item); } } } catch { } } private static void ScanPlayers() { foreach (object item in TeleportCheats.AlivePlayers()) { if (item != Refs.LocalPlayer) { PropertyInfo propertyInfo = GameBinder.Property("Player", "Transform"); Transform val = null; try { object? obj = propertyInfo?.GetValue(item); val = (Transform)((obj is Transform) ? obj : null); } catch { } if (!((Object)(object)val == (Object)null)) { _targets.Add(new EspTarget { Transform = val, Label = TeleportCheats.PlayerName(item), Kind = EspKind.Player }); } } } } private static IEnumerable FindAll(Type t) { if (!_findAllResolved) { _findAllResolved = true; MethodInfo[] methods = typeof(Object).GetMethods(BindingFlags.Static | BindingFlags.Public); foreach (MethodInfo methodInfo in methods) { if (!(methodInfo.Name != "FindObjectsByType")) { ParameterInfo[] parameters = methodInfo.GetParameters(); if (parameters.Length == 2 && parameters[0].ParameterType == typeof(Type)) { _findAll = methodInfo; break; } } } } try { if (_findAll != null) { object obj = Enum.Parse(_findAll.GetParameters()[1].ParameterType, "None"); return (IEnumerable)_findAll.Invoke(null, new object[2] { t, obj }); } return Object.FindObjectsOfType(t); } catch { return Array.Empty(); } } } internal static class WeaponCheats { internal struct Target { internal Transform Transform; internal string Name; internal float Angle; internal float Distance; } private static readonly Dictionary> _originals = new Dictionary>(); internal static object HeldWeapon { get { object heldItem = ItemCheats.HeldItem; if (heldItem == null) { return null; } PropertyInfo propertyInfo = GameBinder.Property("Item", "Weapon"); try { object obj = propertyInfo?.GetValue(heldItem); return Refs.IsAlive(obj) ? obj : null; } catch { return null; } } } internal static bool HoldingWeapon => HeldWeapon != null; internal static string WeaponName { get { object heldItem = ItemCheats.HeldItem; object obj = ((heldItem is Object) ? heldItem : null); return ((obj != null) ? ((Object)obj).name : null) ?? "-"; } } private static object Attachments { get { object heldWeapon = HeldWeapon; if (heldWeapon == null) { return null; } PropertyInfo propertyInfo = GameBinder.Property("Weapon", "Attachments"); try { object obj = propertyInfo?.GetValue(heldWeapon); return Refs.IsAlive(obj) ? obj : null; } catch { return null; } } } internal static int Ammo { get { object heldWeapon = HeldWeapon; if (heldWeapon == null) { return 0; } PropertyInfo propertyInfo = GameBinder.Property("Weapon", "Ammo"); try { return (!(propertyInfo == null)) ? ((int)propertyInfo.GetValue(heldWeapon)) : 0; } catch { return 0; } } } internal static Target? CurrentTarget { get; private set; } private static Transform FirePoint { get { object attachments = Attachments; if (attachments == null) { return null; } PropertyInfo propertyInfo = GameBinder.Property("Attachments", "FirePoint"); try { object? obj = propertyInfo?.GetValue(attachments); return (Transform)((obj is Transform) ? obj : null); } catch { return null; } } } internal static bool HasOriginals { get { if (HeldWeapon != null && _originals.TryGetValue(HeldWeapon, out var value)) { return value.Count > 0; } return false; } } internal static void Tick() { object heldWeapon = HeldWeapon; if (heldWeapon != null) { if (CheatState.InfiniteAmmo) { ApplyInfiniteAmmo(heldWeapon); } if (CheatState.NoSpread) { Set(heldWeapon, "_spread", 0f); } if (CheatState.ZeroRecoil) { Set(heldWeapon, "_recoilKnockback", 0); } if (CheatState.RapidFire) { Set(heldWeapon, "_timeBetweenShots", Mathf.Max(0.01f, CheatState.FireInterval)); } if (CheatState.MultiShot) { Set(heldWeapon, "_projectileCountPerShot", Mathf.RoundToInt(CheatState.ProjectileCount)); } if (CheatState.FastBullets) { Set(heldWeapon, "_projSpeed", CheatState.ProjectileSpeed); } if (!CheatState.Aimbot) { CurrentTarget = null; } else { UpdateTargetPreview(); } } } private static void UpdateTargetPreview() { Camera currentCamera = Refs.CurrentCamera; if ((Object)(object)currentCamera == (Object)null) { CurrentTarget = null; } else { CurrentTarget = FindTarget(currentCamera); } } internal static void AimBeforeShot() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_0086: 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) //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_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 (!CheatState.Aimbot && !CheatState.FireWhereLooking) { return; } Camera currentCamera = Refs.CurrentCamera; Transform firePoint = FirePoint; if ((Object)(object)currentCamera == (Object)null || (Object)(object)firePoint == (Object)null) { return; } Vector3 val = ((Component)currentCamera).transform.forward; if (CheatState.Aimbot) { Target? target = (CurrentTarget = FindTarget(currentCamera)); if (target.HasValue && (Object)(object)target.Value.Transform != (Object)null) { Vector3 val2 = target.Value.Transform.position + Vector3.up * CheatState.AimHeightOffset - firePoint.position; val = ((Vector3)(ref val2)).normalized; } } if (((Vector3)(ref val)).sqrMagnitude > 0.0001f) { firePoint.rotation = Quaternion.LookRotation(val, Vector3.up); } } private static void ApplyInfiniteAmmo(object weapon) { FieldInfo fieldInfo = GameBinder.Field("Weapon", "k__BackingField"); if (!(fieldInfo == null)) { int num = Mathf.Max(1, CheatState.AmmoTopUp); if (GameBinder.TryGet(fieldInfo, weapon, out var value) && value < num) { GameBinder.TrySet(fieldInfo, weapon, num); } } } private static void Set(object target, string field, object value, string typeName = "Weapon") { if (typeName == "Weapon") { Remember(target, field); } FieldInfo fieldInfo = GameBinder.Field(typeName, field); if (fieldInfo != null) { GameBinder.TrySet(fieldInfo, target, value); } } private static Target? FindTarget(Camera cam) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) VisualCheats.Rescan(CheatState.AimAtCreatures, items: false, CheatState.AimAtPlayers, 0.15f); Vector3 position = ((Component)cam).transform.position; Vector3 forward = ((Component)cam).transform.forward; Target? result = null; float num = CheatState.AimFov; foreach (VisualCheats.EspTarget target in VisualCheats.Targets) { if ((Object)(object)target.Transform == (Object)null || target.Kind == VisualCheats.EspKind.Item || (target.Kind == VisualCheats.EspKind.Creature && !CheatState.AimAtCreatures) || (target.Kind == VisualCheats.EspKind.Player && !CheatState.AimAtPlayers)) { continue; } Vector3 val = target.Transform.position + Vector3.up * CheatState.AimHeightOffset - position; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude > CheatState.AimRange) && !(magnitude < 0.5f)) { float num2 = Vector3.Angle(forward, val); if (!(num2 > num) && (!CheatState.AimRequireLineOfSight || HasLineOfSight(position, target.Transform))) { num = num2; result = new Target { Transform = target.Transform, Name = target.Label, Angle = num2, Distance = magnitude }; } } } return result; } private static bool HasLineOfSight(Vector3 from, Transform target) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0020: 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_002c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = target.position + Vector3.up * CheatState.AimHeightOffset - from; float magnitude = ((Vector3)(ref val)).magnitude; RaycastHit val2 = default(RaycastHit); if (!Physics.Raycast(from, ((Vector3)(ref val)).normalized, ref val2, magnitude)) { return true; } if (!((Object)(object)((RaycastHit)(ref val2)).transform == (Object)(object)target) && !((RaycastHit)(ref val2)).transform.IsChildOf(target)) { return target.IsChildOf(((RaycastHit)(ref val2)).transform); } return true; } internal static bool RefillAmmo() { object heldWeapon = HeldWeapon; if (heldWeapon == null) { return false; } FieldInfo fieldInfo = GameBinder.Field("Weapon", "k__BackingField"); if (fieldInfo != null) { return GameBinder.TrySet(fieldInfo, heldWeapon, Mathf.Max(1, CheatState.AmmoTopUp)); } return false; } internal static bool BuyBulletUpgrade() { object heldWeapon = HeldWeapon; if (heldWeapon == null) { return false; } return GameBinder.TryInvoke(GameBinder.Method("Server", "BuyBulletUpgrade", 1), Refs.Server, heldWeapon); } internal static bool BuyAttachment(byte index) { object heldWeapon = HeldWeapon; if (heldWeapon == null) { return false; } return GameBinder.TryInvoke(GameBinder.Method("Server", "BuyAttachment", 2), Refs.Server, heldWeapon, index); } private static void Remember(object weapon, string field) { if (!_originals.TryGetValue(weapon, out var value)) { value = (_originals[weapon] = new Dictionary()); } if (value.ContainsKey(field)) { return; } FieldInfo fieldInfo = GameBinder.Field("Weapon", field); if (fieldInfo == null) { return; } try { value[field] = fieldInfo.GetValue(weapon); } catch { } } internal static bool ResetHeldWeapon() { object heldWeapon = HeldWeapon; if (heldWeapon == null) { return false; } if (!_originals.TryGetValue(heldWeapon, out var value) || value.Count == 0) { return false; } foreach (KeyValuePair item in value) { FieldInfo fieldInfo = GameBinder.Field("Weapon", item.Key); if (fieldInfo != null) { GameBinder.TrySet(fieldInfo, heldWeapon, item.Value); } } value.Clear(); return true; } } internal static class WorldCheats { internal static int TotalCreatures { get { PropertyInfo propertyInfo = GameBinder.Property("GameInfo", "AllCreatureCount"); if (propertyInfo == null) { return 0; } try { return (int)propertyInfo.GetValue(null); } catch { return 0; } } } internal static object Boss { get { PropertyInfo propertyInfo = GameBinder.Property("BossManager", "Boss"); if (propertyInfo == null) { return null; } try { object value = propertyInfo.GetValue(null); return Refs.IsAlive(value) ? value : null; } catch { return null; } } } internal static bool BossActive => Boss != null; internal static int BossHp { get { object boss = Boss; if (boss == null) { return 0; } PropertyInfo propertyInfo = GameBinder.Property("Creature", "Hp"); if (propertyInfo == null) { return 0; } try { return (int)propertyInfo.GetValue(boss); } catch { return 0; } } } internal static int BossMaxHp { get { FieldInfo fieldInfo = GameBinder.Field("BossManager", "BossMaxHp"); if (fieldInfo != null && GameBinder.TryGet(fieldInfo, null, out var value)) { return value; } PropertyInfo propertyInfo = GameBinder.Property("BossManager", "BossMaxHp"); if (propertyInfo == null) { return 0; } try { return (int)propertyInfo.GetValue(null); } catch { return 0; } } } internal static bool Immortal { get { PropertyInfo propertyInfo = GameBinder.Property("BossManager", "IsImmortal"); if (propertyInfo == null) { return false; } try { return (bool)propertyInfo.GetValue(null); } catch { return false; } } } internal static int KilledCount(bool drip) { object obj = GameBinder.InvokeResult(GameBinder.Method("GameInfo", "KilledCreaturesCount", 1), null, drip); if (obj is int) { return (int)obj; } return 0; } internal static bool AllKilled(bool drip) { object obj = GameBinder.InvokeResult(GameBinder.Method("GameInfo", "HasKilledAllCreatures", 1), null, drip); bool flag = default(bool); int num; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } internal static bool SetAllCreaturesKilled(bool to, bool drip) { return GameBinder.TryInvoke(GameBinder.Method("GameInfo", "ToggleAllCreaturesKilled", 2), null, to, drip); } internal static bool SetBossImmortal(bool to) { return GameBinder.TryInvoke(GameBinder.Method("BossManager", "ToggleImmortal", 1), null, to); } internal static bool HealBoss(int amount) { return GameBinder.TryInvoke(GameBinder.Method("Creature", "HealBoss", 1), Boss, amount); } internal static bool KillBoss() { object boss = Boss; if (boss == null) { return false; } if (Immortal) { SetBossImmortal(to: false); } int bossHp = BossHp; if (bossHp <= 0) { return false; } return GameBinder.TryInvoke(GameBinder.Method("Creature", "ServerChangeHp", 1), boss, bossHp); } internal static bool UnlockGrill() { return GameBinder.TryInvoke(GameBinder.Method("NPCManager", "UnlockGrill", 0), null); } } }