using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using TidesDebugMenu.Components; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [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("com.hightide.lc.debugmenu")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("TidesDebugMenu")] [assembly: AssemblyTitle("com.hightide.lc.debugmenu")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.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 TidesDebugMenu { [BepInPlugin("com.hightide.lc.debugmenu", "TidesDebugMenu", "1.0.0")] public class TidesDebugMenu : BaseUnityPlugin { public static TidesDebugMenu Instance { get; private set; } internal static ManualLogSource Logger { get; private set; } internal static Harmony? Harmony { get; set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Instance = this; Patch(); Logger.LogInfo((object)"com.hightide.lc.debugmenu v1.0.0 has loaded!"); } internal static void Patch() { //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_0017: Expected O, but got Unknown if (Harmony == null) { Harmony = new Harmony("com.hightide.lc.debugmenu"); } Logger.LogDebug((object)"Patching..."); Harmony.PatchAll(); Logger.LogDebug((object)"Finished patching!"); } internal static void Unpatch() { Logger.LogDebug((object)"Unpatching..."); Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } Logger.LogDebug((object)"Finished unpatching!"); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "com.hightide.lc.debugmenu"; public const string PLUGIN_NAME = "TidesDebugMenu"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace TidesDebugMenu.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch_ { [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB __instance; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if ((Object)(object)StartOfRound.Instance.localPlayerController == (Object)null) { <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)__instance == (Object)(object)StartOfRound.Instance.localPlayerController && (Object)(object)((Component)__instance).GetComponent() == (Object)null) { ((Component)__instance).gameObject.AddComponent(); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static float startSprintTime; private static float startSprintMeter; [HarmonyPatch("Start")] [HarmonyPrefix] private static void Start_Prefix(PlayerControllerB __instance) { ((MonoBehaviour)__instance).StartCoroutine(AddDebuggerOnPlayerReady(__instance)); } [IteratorStateMachine(typeof(d__3))] private static IEnumerator AddDebuggerOnPlayerReady(PlayerControllerB __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { __instance = __instance }; } } } namespace TidesDebugMenu.Components { public class HTDebugMenu : MonoBehaviour { [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HTDebugMenu <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Expected O, but got Unknown int num = <>1__state; HTDebugMenu hTDebugMenu = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; hTDebugMenu._spawnedEntities[typeof(BaboonBirdAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(StingrayAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(ClaySurgeonAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(FlowermanAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(SandSpiderAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(ButlerEnemyAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(CadaverGrowthAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(CadaverBloomAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(RedLocustBees)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(SpringManAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(SandWormAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(MouthDogAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(PumaAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(ForestGiantAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(DressGirlAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(GiantKiwiAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(HoarderBugAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(BlobAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(JesterAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(BushWolfEnemy)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(CaveDwellerAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(DoublewingAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(ButlerBeesEnemyAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(MaskedPlayerEnemy)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(NutcrackerEnemyAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(RadMechAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(DocileLocustBeesAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(CentipedeAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(PufferAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(CrawlerAI)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._spawnedEntities[typeof(FlowerSnakeEnemy)] = (Object)(object)Object.FindObjectOfType() != (Object)null; hTDebugMenu._activeEntityAmount = 0; hTDebugMenu._inactiveEntityAmount = 0; foreach (KeyValuePair spawnedEntity in hTDebugMenu._spawnedEntities) { if (spawnedEntity.Value) { hTDebugMenu._activeEntityAmount++; } else { hTDebugMenu._inactiveEntityAmount++; } } <>2__current = (object)new WaitForSeconds(0f); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private bool _isDebugActive; private readonly Dictionary _spawnedEntities = new Dictionary(); private int _activeEntityAmount; private int _inactiveEntityAmount; private float _spawnEntityCheckDelay; private float _valueInMap; private PlayerControllerB thisController; private void Start() { thisController = ((Component)this).GetComponent(); } private void Update() { if (Keyboard.current.shiftKey.isPressed && ((ButtonControl)Keyboard.current.homeKey).wasPressedThisFrame) { _isDebugActive = !_isDebugActive; } if (Time.time >= _spawnEntityCheckDelay && _isDebugActive) { ((MonoBehaviour)this).StartCoroutine(CheckForSpawnedEntitiesAndPopulate()); _valueInMap = RoundManager.Instance.totalScrapValueInLevel; _spawnEntityCheckDelay = Time.time + 1f; } } private void OnGUI() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_001f: 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_0039: Expected O, but got Unknown //IL_003f: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) if (_isDebugActive) { GUIStyle val = new GUIStyle(GUI.skin.label); val.normal.textColor = Color.red; GUIStyle val2 = new GUIStyle(GUI.skin.label); val2.normal.textColor = Color.green; GUILayout.BeginArea(new Rect(5f, 5f, 600f, 550f), GUI.skin.window); GUILayout.Label("HighTide's Lethal Company Debug", Array.Empty()); GUILayout.Space(3f); GUILayout.Label("====Map Information====", Array.Empty()); GUILayout.Label($"Total Value in Map: {_valueInMap}", Array.Empty()); GUILayout.Label("====Player Information====", Array.Empty()); GUILayout.Label($"Position | X: {((Component)this).transform.position.x:F2} Y: {((Component)this).transform.position.y:F2} Z: {((Component)this).transform.position.z:F2}", Array.Empty()); GUILayout.Label($"Rotation | X: {((Component)thisController.visorCamera).transform.rotation.x:F2} Y: {((Component)thisController.visorCamera).transform.rotation.y:F2} Z: {((Component)thisController.visorCamera).transform.rotation.z:F2}", Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Is Inside Ship:", Array.Empty()); if (!thisController.isInHangarShipRoom) { GUILayout.Label("false", val, Array.Empty()); } else { GUILayout.Label("true", val2, Array.Empty()); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Can Jump:", Array.Empty()); if (thisController.isFallingFromJump || thisController.isFallingNoJump || thisController.isJumping) { GUILayout.Label("false", val, Array.Empty()); } else { GUILayout.Label("true", val2, Array.Empty()); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Can Sprint:", Array.Empty()); if (thisController.isExhausted) { GUILayout.Label("false", val, Array.Empty()); } else { GUILayout.Label("true", val2, Array.Empty()); } GUILayout.EndHorizontal(); GUILayout.Label($"Stamina: %{thisController.sprintMeter * 100f:F0}", Array.Empty()); GUILayout.Label("====Active Entities Information====", Array.Empty()); GUILayout.Label($"Active Count: {_activeEntityAmount}", Array.Empty()); GUILayout.Label($"Inactive Count: {_inactiveEntityAmount}", Array.Empty()); GUILayout.BeginScrollView(Vector2.zero, GUI.skin.box); GUILayout.BeginHorizontal(Array.Empty()); if (IsEntityInMap()) { GUILayout.Label("Baboon Hawk", val2, Array.Empty()); } else { GUILayout.Label("Baboon Hawk", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Blackwater Gunkfish", val2, Array.Empty()); } else { GUILayout.Label("Blackwater Gunkfish", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Barber", val2, Array.Empty()); } else { GUILayout.Label("Barber", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Bracken", val2, Array.Empty()); } else { GUILayout.Label("Bracken", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Bunker Spider", val2, Array.Empty()); } else { GUILayout.Label("Bunker Spider", val, Array.Empty()); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (IsEntityInMap()) { GUILayout.Label("Butler", val2, Array.Empty()); } else { GUILayout.Label("Butler", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Cadaver", val2, Array.Empty()); } else { GUILayout.Label("Cadaver", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Cadaver Bloom", val2, Array.Empty()); } else { GUILayout.Label("Cadaver Bloom", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Circuit Bees", val2, Array.Empty()); } else { GUILayout.Label("Circuit Bees", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Coil-Head", val2, Array.Empty()); } else { GUILayout.Label("Coil-Head", val, Array.Empty()); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (IsEntityInMap()) { GUILayout.Label("Earth Leviathan", val2, Array.Empty()); } else { GUILayout.Label("Earth Leviathan", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Eyeless Dog", val2, Array.Empty()); } else { GUILayout.Label("Eyeless Dog", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Feiopar", val2, Array.Empty()); } else { GUILayout.Label("Feiopar", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Forest Keeper", val2, Array.Empty()); } else { GUILayout.Label("Forest Keeper", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Ghost Girl", val2, Array.Empty()); } else { GUILayout.Label("Ghost Girl", val, Array.Empty()); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (IsEntityInMap()) { GUILayout.Label("Giant Sapsucker", val2, Array.Empty()); } else { GUILayout.Label("Giant Sapsucker", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Hoarding Bug", val2, Array.Empty()); } else { GUILayout.Label("Hoarding Bug", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Hygrodere", val2, Array.Empty()); } else { GUILayout.Label("Hygrodere", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Jester", val2, Array.Empty()); } else { GUILayout.Label("Jester", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Kidnapper Fox", val2, Array.Empty()); } else { GUILayout.Label("Kidnapper Fox", val, Array.Empty()); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (IsEntityInMap()) { GUILayout.Label("Maneater", val2, Array.Empty()); } else { GUILayout.Label("Maneater", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Manticoil", val2, Array.Empty()); } else { GUILayout.Label("Manticoil", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Mask Hornets", val2, Array.Empty()); } else { GUILayout.Label("Mask Hornets", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Masked", val2, Array.Empty()); } else { GUILayout.Label("Masked", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Nutcracker", val2, Array.Empty()); } else { GUILayout.Label("Nutcracker", val, Array.Empty()); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (IsEntityInMap()) { GUILayout.Label("Old Bird", val2, Array.Empty()); } else { GUILayout.Label("Old Bird", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Roaming Locust", val2, Array.Empty()); } else { GUILayout.Label("Roaming Locust", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Snare Flea", val2, Array.Empty()); } else { GUILayout.Label("Snare Flea", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Spore Lizzard", val2, Array.Empty()); } else { GUILayout.Label("Spore Lizzard", val, Array.Empty()); } if (IsEntityInMap()) { GUILayout.Label("Thumper", val2, Array.Empty()); } else { GUILayout.Label("Thumper", val, Array.Empty()); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (IsEntityInMap()) { GUILayout.Label("Tulip Snake", val2, Array.Empty()); } else { GUILayout.Label("Tulip Snake", val, Array.Empty()); } GUILayout.EndHorizontal(); GUILayout.EndScrollView(); GUILayout.EndArea(); } } [IteratorStateMachine(typeof(d__10))] private IEnumerator CheckForSpawnedEntitiesAndPopulate() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { <>4__this = this }; } private bool IsEntityInMap() where T : Component { bool value; return _spawnedEntities.TryGetValue(typeof(T), out value) && value; } } }