Decompiled source of KRAKEN How to Fish Mod Menu v1.2.1
HowToFishCustomMenu.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; 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 HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("HowToFishCustomMenu")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+32f91038609115b8da4c2014dc90326ce7608929")] [assembly: AssemblyProduct("HowToFishCustomMenu")] [assembly: AssemblyTitle("HowToFishCustomMenu")] [assembly: AssemblyVersion("1.0.0.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 HowToFishCustomMenu { [BepInPlugin("sunshineplunge.howtofish.custommenu", "KRAKEN - Modded Lobby Edition", "1.2.1")] public sealed class Plugin : BaseUnityPlugin { private ConfigEntry<bool> announceChat; private float nextChat; private static readonly KeyValuePair<string, string>[] Bosses = new KeyValuePair<string, string>[6] { new KeyValuePair<string, string>("bowheadwhale", "BOWHEAD WHALE"), new KeyValuePair<string, string>("mutatedbowheadwhale", "MUTATED WHALE"), new KeyValuePair<string, string>("giantpiranha", "GIANT PIRANHA"), new KeyValuePair<string, string>("theoldpike", "THE OLD PIKE"), new KeyValuePair<string, string>("goblinshark", "GOBLIN SHARK"), new KeyValuePair<string, string>("spidercrab", "SPIDER CRAB") }; private bool bossRush; private int bossRushIndex; private float nextBoss; private Item currentRushBoss; private bool autoSellFish; private float nextAutoSell; private bool killAura; private float auraRange = 6f; private float nextAura; private int camMode; private Vector3 freePos; private float freeYaw; private float freePitch; private float thirdDistance = 4.5f; private GameObject standIn; private static readonly string[] CamModes = new string[4] { "FIRST PERSON", "THIRD PERSON", "FREE CAM", "SPECTATE TARGET" }; private ConfigEntry<KeyCode>[] presetKeys; private readonly Dictionary<int, List<string>> presets = new Dictionary<int, List<string>>(); private Menu presetMenu; private bool menuSounds = true; private const float BannerTime = 6f; private string bannerTitle = ""; private string bannerSub = ""; private float bannerUntil; private bool greeted; private float readySince = -1f; private Menu bossMenu; private Menu extrasMenu; private readonly Dictionary<ButtonControl, float> padRepeat = new Dictionary<ButtonControl, float>(); private ConfigEntry<KeyCode> keySave; private ConfigEntry<KeyCode> keyLoad; private ConfigEntry<KeyCode> keySkyBase; private ConfigEntry<KeyCode> keyFly; private ConfigEntry<KeyCode> keyNoClip; private ConfigEntry<KeyCode> keyGod; private ConfigEntry<KeyCode> keyCar; private ConfigEntry<KeyCode> capturing; private string capturingName; private Menu keybindMenu; private readonly List<KeyValuePair<string, Vector3>> locations = new List<KeyValuePair<string, Vector3>>(); private Vector3? quickLocation; private bool fly; private bool noClip; private bool airJump; private bool demiGod; private bool neverHungry; private bool spinbot; private bool walkOnWater; private bool freezeAir; private float speedMult = 1f; private float jumpMult = 1f; private float gravityMult = 1f; private int bodyShape; private Vector3 originalScale = Vector3.one; private Transform scaledPlayer; private Rigidbody playerBody; private bool bodyGravitySaved; private bool bodyOldGravity; private Vector3 originalGravity; private bool gravitySaved; private float spinAngle; private float nextHeal; private bool autoFish; private bool fishTornado; private bool fishMagnet; private bool flyingFish; private bool floatingItems; private bool spinningItems; private bool bouncingItems; private float fishScale = 1f; private float valueMult = 2f; private float weightMult = 1f; private float itemScale = 1f; private int spawnQty = 1; private string itemSearch = ""; private string itemId = ""; private string money = "100000"; private float nextAutoFish; private float nextItemTick; private readonly Queue<Action> spawnQueue = new Queue<Action>(); private bool noRecoil; private bool instantReload; private float damageMult = 1f; private bool infiniteAmmo; private bool rapidFire; private bool noCooldown; private bool zeroSpread; private bool fastProjectiles; private bool noWeaponKick; private bool fishCannon; private bool noSway; private bool bigLaser; private bool crosshair; private bool crosshairFollowAim = true; private int crosshairStyle; private float crosshairSize = 18f; private bool aimEnabled; private bool aimAdsOnly; private bool aimSmooth; private bool aimWide; private bool aimPrediction; private bool triggerbot; private float nextTrigger; private float nextCannon; private bool boatBoost; private bool boatFlying; private bool boatSpin; private bool rainbowBoat; private bool driveOnLand; private float boatMult = 2.5f; private float boatScale = 1f; private string coordX = "0"; private string coordY = "20"; private string coordZ = "0"; private object target; private readonly Dictionary<object, float> frozen = new Dictionary<object, float>(); private readonly HashSet<object> spinning = new HashSet<object>(); private readonly HashSet<object> bouncing = new HashSet<object>(); private readonly HashSet<object> rainOn = new HashSet<object>(); private readonly HashSet<object> healAura = new HashSet<object>(); private readonly Dictionary<object, Vector3> freezePos = new Dictionary<object, Vector3>(); private float nextPlayerTick; private bool unlimitedMoney; private bool disco; private bool rainbowMenu; private bool rainbowWorld; private bool drunkCam; private bool upsideDown; private bool cameraSpin; private bool noFog; private bool superFog; private float fov = -1f; private float timeScale = 1f; private float originalFov = -1f; private bool fogSaved; private bool oldFog; private float oldFogDensity; private Color oldFogColor; private Color oldAmbient; private Camera fovCamera; private bool espFish; private bool espItems; private bool espPlayers; private bool espValuable; private bool espBoxes; private bool espTracers; private bool espDistance = true; private bool espRainbow; private float espRange = 150f; private int tracerOrigin; private readonly List<KeyValuePair<Transform, string>> espTargets = new List<KeyValuePair<Transform, string>>(); private float nextEsp; private bool wasJump; private readonly string[] accentNames = new string[7] { "COD BLUE", "CYAN", "GREEN", "RED", "PURPLE", "ORANGE", "PINK" }; private readonly Color[] accentColours = (Color[])(object)new Color[7] { new Color(0.1f, 0.45f, 1f), new Color(0f, 0.85f, 1f), new Color(0.2f, 1f, 0.3f), new Color(1f, 0.2f, 0.2f), new Color(0.65f, 0.3f, 1f), new Color(1f, 0.55f, 0.1f), new Color(1f, 0.35f, 0.8f) }; private int accentIndex; private int menuPos; private float menuScale = 1f; private const int VisibleRows = 14; private const float MenuW = 360f; private const float HeaderH = 86f; private const float TitleH = 30f; private const float RowH = 27f; private const float FooterH = 40f; private Texture2D white; private GUIStyle big; private GUIStyle small; private GUIStyle rowStyle; private GUIStyle valueStyle; private GUIStyle centre; private GUIStyle feedStyle; private GUIStyle espStyle; private Vector2 crosshairPos = new Vector2(-1f, -1f); private const string NeedHost = "HOST ONLY - start the lobby yourself"; private const string NeedPlayer = "LOAD INTO A WORLD FIRST"; private Menu playerMenu; private Menu fishingMenu; private Menu aimMenu; private Menu weaponMenu; private Menu itemMenu; private Menu itemList; private Menu teleportMenu; private Menu vehicleMenu; private Menu trollMenu; private Menu funMenu; private Menu lobbyMenu; private Menu casinoMenu; private Menu worldMenu; private int timeOfDay; private Light sun; private Quaternion sunRot; private float sunIntensity; private Color sunColour; private Menu espMenu; private bool chaosOn; private bool chaosPlayers = true; private bool chaosWorld = true; private bool chaosFish = true; private bool chaosExtreme; private float chaosInterval = 10f; private float nextChaos; private int chaosCount; private string chaosEvent = ""; private Menu chaosMenu; private float chaosBannerUntil; private Menu settingsMenu; public const string Version = "1.2.1"; internal GameBridge Bridge; private Harmony harmony; private ConfigEntry<KeyCode> menuKey; private ConfigEntry<float> flySpeed; private readonly Stack<Menu> stack = new Stack<Menu>(); private Menu root; private bool shown; private Option editing; private float repeatAt; private KeyCode repeatKey; private readonly List<KeyValuePair<string, float>> feed = new List<KeyValuePair<string, float>>(); private GameObject skyBase; private const float SkyHeight = 60f; private int buildLayer; private static readonly Vector3 T = new Vector3(-5f, 0f, -5f); private Transform buildRoot; private Transform skySign; private static readonly Color Navy = new Color(0.07f, 0.1f, 0.18f); private static readonly Color Wood = new Color(0.55f, 0.38f, 0.22f); private static readonly Color DarkWood = new Color(0.36f, 0.24f, 0.14f); private static readonly Color Rock = new Color(0.32f, 0.33f, 0.36f); private static readonly Color Steel = new Color(0.75f, 0.8f, 0.88f); private Menu skyMenu; private GameObject track; private Vector3 trackCentre; private const float TrackRx = 130f; private const float TrackRz = 70f; private const float TrackWidth = 16f; private const int TrackSegments = 72; private float lapStart; private float bestLap = -1f; private float lastLap = -1f; private int lapCount; private int nextCheckpoint; private bool racing; private static readonly float[] Checkpoints = new float[3] { 0.25f, 0.6f, 0.8f }; private Menu trackMenu; private GameObject car; private Transform[] carWheels = (Transform[])(object)new Transform[0]; private bool driving; private float carSpeed; private float carYaw; private float carVertical; private float carBob; private const float CarMaxSpeed = 32f; private const float CarBoostSpeed = 65f; private Menu carMenu; private string PresetFile => Path.Combine(Paths.ConfigPath, "kraken_presets.txt"); private static Gamepad Pad => Gamepad.current; private string LocationsFile => Path.Combine(Paths.ConfigPath, "kraken_locations.txt"); private Vector3 IslandOrigin => (Vector3)(((??)Bridge.IslandCentre) ?? Vector3.zero); private bool Host { get { if (Bridge.Ready) { return Bridge.IsHost; } return false; } } private Color Accent { get { //IL_0039: 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) if (!rainbowMenu) { return accentColours[accentIndex]; } return Color.HSVToRGB(Mathf.Repeat(Time.unscaledTime * 0.15f, 1f), 0.8f, 1f); } } private Camera GameCamera { get { Camera val = GameInfo.CurCamera; if ((Object)(object)val == (Object)null && (Object)(object)Player.LocalPlayer != (Object)null) { val = Player.LocalPlayer.CurCam; } if (!((Object)(object)val != (Object)null)) { return Camera.main; } return val; } } private Menu Current { get { if (stack.Count <= 0) { return root; } return stack.Peek(); } } private Vector3 SkyBaseCentre => IslandOrigin + Vector3.up * 60f; private void Announce(string text, bool force = false) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (announceChat == null || !announceChat.Value || !Host || Time.unscaledTime < nextChat) { return; } nextChat = Time.unscaledTime + 0.35f; try { OnlineChatManager instance = OnlineChatManager.Instance; ulong steamID = SteamManager.CurrentLobbyID.m_SteamID; if ((Object)(object)instance != (Object)null) { instance.SendChatMessage(steamID, "KRAKEN // " + text); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Chat: " + ex.Message)); } } private void SendChatNow(string text) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (!Host || Time.unscaledTime < nextChat) { return; } nextChat = Time.unscaledTime + 0.35f; try { OnlineChatManager instance = OnlineChatManager.Instance; ulong steamID = SteamManager.CurrentLobbyID.m_SteamID; if ((Object)(object)instance != (Object)null) { instance.SendChatMessage(steamID, "KRAKEN // " + text); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Chat: " + ex.Message)); } } private void AnnounceOption(Option o) { if (announceChat != null && announceChat.Value && Host && o.Kind != OptionKind.Submenu && o.Kind != OptionKind.Input && o.Kind != OptionKind.Label) { string text = Regex.Replace(o.Display, "\\s*\\[.*?\\]|\\s*\\(.*?\\)", "").Trim(); if (Current.Targeted && target != null && o.Kind == OptionKind.Action && !text.StartsWith("TARGET")) { Announce(Bridge.PlayerName(target) + " GOT " + text.Replace(" PLAYER", "").Replace("PLAYER ", "") + "!"); } else if (o.Kind == OptionKind.Toggle) { Announce("HOST " + (o.Get() ? "ENABLED " : "DISABLED ") + text); } else if (o.Kind == OptionKind.Action && Current.Title.Contains("LOBBY")) { Announce("HOST ACTIVATED " + text); } } } private int SpawnBirds(Vector3 centre, int count, string kind = "seagull") { //IL_008f: 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) object prefab = Bridge.Spawnables().FirstOrDefault((KeyValuePair<string, object> p) => p.Key == kind).Value; if (prefab == null) { Note("No " + kind + " prefab"); return 0; } int n = 0; for (int num = 0; num < count; num++) { float num2 = (float)num * MathF.PI * 2f / (float)count; Vector3 pos = centre + new Vector3(Mathf.Cos(num2) * 6f, 8f + (float)(num % 3) * 2f, Mathf.Sin(num2) * 6f); int k = num; spawnQueue.Enqueue(delegate { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (Bridge.SpawnPrefab(prefab, pos, Quaternion.Euler(0f, (float)k * 30f, 0f)) != null) { int num3 = n; n = num3 + 1; } }); } return count; } private bool SpawnBoss(string key, Vector3 near) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_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_007f: 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_00c1: Unknown result type (might be due to invalid IL or missing references) object value = Bridge.Spawnables().FirstOrDefault((KeyValuePair<string, object> p) => p.Key == key).Value; if (value == null) { Note("Boss not found: " + key); return false; } Vector3 val = near + new Vector3(Random.Range(-6f, 6f), 0f, Random.Range(-6f, 6f)); val.y = Mathf.Min(val.y, Bridge.WaterHeight - 1.5f); object obj = Bridge.SpawnPrefab(value, val, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f)); Item val2 = (Item)((obj is Item) ? obj : null); if ((Object)(object)val2 == (Object)null) { return false; } if (bossRush) { currentRushBoss = val2; } return true; } private Vector3 NearestWater(Vector3 from) { //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_0025: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0033: Unknown result type (might be due to invalid IL or missing references) Vector3 result = from; result.y = Bridge.WaterHeight - 1.5f; if (Bridge.WaterHeight > from.y - 3f) { return result; } return Bridge.OpenWater(Vector3.Distance(from, IslandOrigin) + 15f) + Vector3.down * 3f; } private void TickBossRush() { //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) if (!bossRush || !Host || Time.unscaledTime < nextBoss) { return; } if ((Object)(object)currentRushBoss != (Object)null && !currentRushBoss.IsDestroying && (Object)(object)currentRushBoss.Creature != (Object)null && !currentRushBoss.Creature.IsDead) { nextBoss = Time.unscaledTime + 2f; return; } if (bossRushIndex >= Bosses.Length) { bossRush = false; Note("BOSS RUSH COMPLETE!"); Announce("BOSS RUSH COMPLETE!", force: true); return; } KeyValuePair<string, string> keyValuePair = Bosses[bossRushIndex++]; if (SpawnBoss(keyValuePair.Key, NearestWater(Bridge.Player.position))) { ShowBanner("BOSS " + bossRushIndex + "/" + Bosses.Length, keyValuePair.Value); Announce("BOSS RUSH " + bossRushIndex + "/" + Bosses.Length + ": " + keyValuePair.Value + " HAS APPEARED", force: true); } nextBoss = Time.unscaledTime + 6f; } private int SellItems(IEnumerable<Item> items) { int num = 0; int num2 = 0; foreach (Item item in items.ToList()) { if (!((Object)(object)item == (Object)null) && !item.IsDestroying && !Object.op_Implicit((Object)(object)item.DeadPlayer) && (!Object.op_Implicit((Object)(object)item.Creature) || item.Creature.IsDead) && item.TotalWorth > 0) { num2 += item.TotalWorth; MoneyManager.SellItem(item); item.DestroyItem((byte)7, byte.MaxValue); num++; } } if (num > 0) { Note("Sold " + num + " items for $" + num2); Announce("HOST SOLD " + num + " ITEMS FOR $" + num2); } else { Note("Nothing sellable"); } return num; } private IEnumerable<Item> NearbyItems(float radius) { Vector3 me = Bridge.Player.position; foreach (KeyValuePair<Transform, object> item in Bridge.World()) { object value = item.Value; Item val = (Item)((value is Item) ? value : null); if (val != null && (Object)(object)val.SyncedHolder == (Object)null) { Vector3 val2 = item.Key.position - me; if (((Vector3)(ref val2)).sqrMagnitude < radius * radius) { yield return val; } } } } private void TickAutoSell() { if (autoSellFish && Host && !(Time.unscaledTime < nextAutoSell)) { nextAutoSell = Time.unscaledTime + 1f; List<Item> list = (from i in NearbyItems(6f) where (Object)(object)i.Creature != (Object)null && i.Creature.IsDead select i).ToList(); if (list.Count > 0) { SellItems(list); } } } private void TickKillAura() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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) if (!killAura || !Bridge.Ready || Time.unscaledTime < nextAura) { return; } nextAura = Time.unscaledTime + 0.25f; Player localPlayer = Player.LocalPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } Vector3 position = Bridge.Player.position; foreach (KeyValuePair<Transform, object> item in Bridge.World().ToList()) { object value = item.Value; Item val = (Item)((value is Item) ? value : null); if (val != null && !((Object)(object)val.Creature == (Object)null) && !val.Creature.IsDead) { Vector3 val2 = item.Key.position - position; if (!(((Vector3)(ref val2)).sqrMagnitude > auraRange * auraRange)) { val2 = item.Key.position - position; Vector3 normalized = ((Vector3)(ref val2)).normalized; val.LocalHit(item.Key, item.Key.position, normalized, localPlayer, 50, false, normalized * 5f, false, false, false); } } } } private void SetCamMode(int mode) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) camMode = mode; Bridge.BlockActions("freecam", new string[4] { "PlayerMove", "PlayerJump", "PlayerLook", "PlayerCrouch" }, mode == 2); Camera gameCamera = GameCamera; if (mode == 2 && (Object)(object)gameCamera != (Object)null) { freePos = ((Component)gameCamera).transform.position; freeYaw = ((Component)gameCamera).transform.eulerAngles.y; freePitch = ((Component)gameCamera).transform.eulerAngles.x; } if (mode == 3 && target == null) { Note("Pick a target in PLAYERS first"); } if (mode != 1 && (Object)(object)standIn != (Object)null) { Object.Destroy((Object)(object)standIn); standIn = null; } } private void TickCamera() { //IL_0062: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //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_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: 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_025a: 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_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: 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_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) if (camMode == 0) { return; } Camera gameCamera = GameCamera; Transform player = Bridge.Player; if ((Object)(object)gameCamera == (Object)null || (Object)(object)player == (Object)null) { return; } Transform transform = ((Component)gameCamera).transform; if (camMode == 1) { if ((Object)(object)standIn == (Object)null) { BuildStandIn(); } standIn.transform.SetPositionAndRotation(player.position, Quaternion.Euler(0f, transform.eulerAngles.y, 0f)); Quaternion rotation = transform.rotation; Vector3 val = player.position + Vector3.up * 1.6f; float num = thirdDistance; Vector3 val2 = rotation * Vector3.back; float num2 = num; LayerMask levelLayer = GameInfo.LevelLayer; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val, val2, ref val3, num2, ((LayerMask)(ref levelLayer)).value, (QueryTriggerInteraction)1)) { num = ((RaycastHit)(ref val3)).distance - 0.2f; } transform.position = val + rotation * new Vector3(0.6f, 0.3f, 0f - num); } else if (camMode == 2) { Mouse current = Mouse.current; if (current != null && !shown) { Vector2 val4 = ((InputControl<Vector2>)(object)((Pointer)current).delta).ReadValue() * 0.12f; freeYaw += val4.x; freePitch = Mathf.Clamp(freePitch - val4.y, -89f, 89f); } Quaternion val5 = Quaternion.Euler(freePitch, freeYaw, 0f); Vector3 val6 = Vector3.zero; if (!shown) { if (Input.GetKey((KeyCode)119)) { val6 += Vector3.forward; } if (Input.GetKey((KeyCode)115)) { val6 += Vector3.back; } if (Input.GetKey((KeyCode)100)) { val6 += Vector3.right; } if (Input.GetKey((KeyCode)97)) { val6 += Vector3.left; } if (Input.GetKey((KeyCode)32)) { val6 += Vector3.up; } if (Input.GetKey((KeyCode)306)) { val6 += Vector3.down; } } freePos += val5 * val6 * (Input.GetKey((KeyCode)304) ? 40f : 12f) * Time.unscaledDeltaTime; transform.SetPositionAndRotation(freePos, val5); } else if (camMode == 3) { object obj = target; Player val7 = (Player)((obj is Player) ? obj : null); if (val7 != null && (Object)(object)val7 != (Object)null && (Object)(object)val7.CamObject != (Object)null) { transform.SetPositionAndRotation(val7.CamObject.position, val7.CamObject.rotation); } } } private void BuildStandIn() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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) standIn = new GameObject("KRAKEN_StandIn"); buildRoot = standIn.transform; buildLayer = 0; Part((PrimitiveType)1, new Vector3(0f, 0.9f, 0f), new Vector3(0.7f, 0.8f, 0.7f), Accent, emissive: false, collider: false); Part((PrimitiveType)0, new Vector3(0f, 1.85f, 0f), Vector3.one * 0.55f, new Color(1f, 0.85f, 0.7f), emissive: false, collider: false); Part((PrimitiveType)3, new Vector3(0f, 1.9f, 0.25f), new Vector3(0.4f, 0.12f, 0.1f), Color.black, emissive: false, collider: false); } private void BindPresets() { presetKeys = new ConfigEntry<KeyCode>[3] { ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", "LoadPreset1", (KeyCode)292, "Load preset 1"), ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", "LoadPreset2", (KeyCode)0, "Load preset 2"), ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", "LoadPreset3", (KeyCode)0, "Load preset 3") }; try { if (!File.Exists(PresetFile)) { return; } string[] array = File.ReadAllLines(PresetFile); foreach (string text in array) { int num = text.IndexOf('|'); if (num >= 1 && int.TryParse(text.Substring(0, num), out var result)) { if (!presets.ContainsKey(result)) { presets[result] = new List<string>(); } presets[result].Add(text.Substring(num + 1)); } } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Presets: " + ex.Message)); } } private IEnumerable<KeyValuePair<string, Option>> PresetOptions() { HashSet<Menu> seen = new HashSet<Menu>(); Stack<Menu> todo = new Stack<Menu>(); todo.Push(root); while (todo.Count > 0) { Menu m = todo.Pop(); if (!seen.Add(m) || m.Dynamic != null) { continue; } foreach (Option option in m.Options) { if (option.Kind == OptionKind.Submenu && option.Open != null && !option.Name.Contains("PLAYERS")) { Menu menu = null; try { menu = option.Open(); } catch { } if (menu != null) { todo.Push(menu); } } else if ((option.Kind == OptionKind.Toggle || option.Kind == OptionKind.Slider) && option.Name != null && !option.Name.Contains("PLAYER") && !option.Name.Contains("FREEZE")) { yield return new KeyValuePair<string, Option>(m.Title + "/" + option.Name, option); } } } } private void SavePreset(int slot) { List<string> list = new List<string>(); foreach (KeyValuePair<string, Option> item in PresetOptions()) { if (item.Value.Kind == OptionKind.Toggle && item.Value.Get()) { list.Add(item.Key + "=1"); } else if (item.Value.Kind == OptionKind.Slider) { list.Add(item.Key + "=" + item.Value.GetValue().ToString(CultureInfo.InvariantCulture)); } } presets[slot] = list; try { File.WriteAllLines(PresetFile, presets.SelectMany((KeyValuePair<int, List<string>> kv) => kv.Value.Select((string v) => kv.Key + "|" + v))); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)ex); } Note("PRESET " + slot + " SAVED (" + list.Count((string v) => v.EndsWith("=1")) + " toggles on)"); } private void LoadPreset(int slot) { if (!presets.TryGetValue(slot, out var value)) { Note("Preset " + slot + " is empty"); return; } Dictionary<string, string> dictionary = (from l in value select l.Split('=') into a where a.Length == 2 select a).ToDictionary((string[] a) => a[0], (string[] a) => a[1]); int num = 0; foreach (KeyValuePair<string, Option> item in PresetOptions()) { try { string value3; float result; if (item.Value.Kind == OptionKind.Toggle) { string value2; bool flag = dictionary.TryGetValue(item.Key, out value2) && value2 == "1"; if (item.Value.Get() != flag && (!flag || item.Value.Available())) { item.Value.Set(flag); } if (flag) { num++; } } else if (dictionary.TryGetValue(item.Key, out value3) && float.TryParse(value3, NumberStyles.Float, CultureInfo.InvariantCulture, out result)) { item.Value.SetValue(result); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Preset " + item.Key + ": " + ex.Message)); } } Note("PRESET " + slot + " LOADED (" + num + " toggles on)"); PlaySound("Click"); } private Menu PresetMenu() { if (presetMenu != null) { return presetMenu; } Menu menu = (presetMenu = new Menu("PRESETS")); for (int i = 1; i <= 3; i++) { int slot = i; menu.Add(new Option { Kind = OptionKind.Action, NameFn = () => "LOAD PRESET " + slot + (presets.ContainsKey(slot) ? "" : " (EMPTY)") + " [" + (((int)presetKeys[slot - 1].Value == 0) ? "-" : ((object)presetKeys[slot - 1].Value/*cast due to .constrained prefix*/).ToString().ToUpper()) + "]", OnSelect = delegate { LoadPreset(slot); } }); menu.Action("SAVE CURRENT SETUP TO PRESET " + slot, delegate { SavePreset(slot); }); } menu.Label("Saves every toggle and slider you have set."); return menu; } private void PlaySound(string clip) { if (!menuSounds) { return; } try { AudioManager.PlayGlobalClip(clip, false, 0.5f, 0f, false); } catch { } } private void ShowBanner(string title, string sub) { bannerTitle = title; bannerSub = sub; bannerUntil = Time.unscaledTime + 6f; } private void TickGreeting() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!Bridge.Ready) { greeted = false; readySince = -1f; } else { if (greeted) { return; } if (readySince < 0f) { readySince = Time.unscaledTime; } if (!(Time.unscaledTime - readySince < 2f)) { greeted = true; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Startup banner shown"); ShowBanner("KRAKEN LOADED", "v1.2.1 // PRESS " + ((object)menuKey.Value/*cast due to .constrained prefix*/).ToString().ToUpper() + " OR LB + D-PAD UP"); PlaySound("PlayerSpawn"); if (Host) { Announce("v1.2.1 LOADED // WELCOME TO THE MODDED LOBBY", force: true); } } } } private void DrawBanner(Color accent) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0107: 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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Expected O, but got Unknown //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Expected O, but got Unknown if (!(Time.unscaledTime > bannerUntil)) { float num = bannerUntil - Time.unscaledTime; float num2 = Mathf.Clamp01(num) * Mathf.Clamp01((6f - num) * 3f); Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, (float)Screen.height * 0.3f, (float)Screen.width, 130f); Rect(new Rect(0f, ((Rect)(ref val)).y, (float)Screen.width, ((Rect)(ref val)).height), new Color(0f, 0f, 0f, 0.55f * num2)); Rect(new Rect(0f, ((Rect)(ref val)).y, (float)Screen.width, 4f), new Color(accent.r, accent.g, accent.b, num2)); Rect(new Rect(0f, ((Rect)(ref val)).yMax - 4f, (float)Screen.width, 4f), new Color(accent.r, accent.g, accent.b, num2)); Text(new Rect(0f, ((Rect)(ref val)).y + 10f, (float)Screen.width, 80f), bannerTitle, new GUIStyle(centre) { fontSize = 64 }, new Color(1f, 1f, 1f, num2)); Text(new Rect(0f, ((Rect)(ref val)).y + 88f, (float)Screen.width, 30f), bannerSub, new GUIStyle(small) { fontSize = 18 }, new Color(0.75f, 0.88f, 1f, num2)); } } private void TickAdditions() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) TickGreeting(); TickBossRush(); TickAutoSell(); TickKillAura(); if (presetKeys == null || editing != null || capturing != null || ChatOpen()) { return; } for (int i = 0; i < presetKeys.Length; i++) { if ((int)presetKeys[i].Value != 0 && Input.GetKeyDown(presetKeys[i].Value)) { LoadPreset(i + 1); } } } private Menu BossMenu() { if (bossMenu != null) { return bossMenu; } Menu menu = (bossMenu = new Menu("BOSS SPAWNER")); KeyValuePair<string, string>[] bosses = Bosses; foreach (KeyValuePair<string, string> keyValuePair in bosses) { KeyValuePair<string, string> boss = keyValuePair; menu.Action("SPAWN " + boss.Value, delegate { //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) if (SpawnBoss(boss.Key, NearestWater(Bridge.Player.position))) { Note(boss.Value + " SPAWNED"); Announce(boss.Value + " HAS APPEARED!"); } }, IsHostNow, "HOST ONLY - start the lobby yourself"); } menu.Action("SPAWN BOSS ON TARGET", delegate { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Transform val = Bridge.PlayerTransform(target); if ((Object)(object)val == (Object)null) { Note("Pick a target in PLAYERS first"); } else { KeyValuePair<string, string> keyValuePair2 = Bosses[Random.Range(0, Bosses.Length)]; if (SpawnBoss(keyValuePair2.Key, NearestWater(val.position))) { Announce(keyValuePair2.Value + " WAS SENT AFTER " + Bridge.PlayerName(target) + "!"); } } }, IsHostNow, "HOST ONLY - start the lobby yourself"); menu.Toggle("BOSS RUSH", () => bossRush, delegate(bool v) { bossRush = v; bossRushIndex = 0; currentRushBoss = null; nextBoss = 0f; if (v) { Announce("BOSS RUSH STARTED!", force: true); } }, IsHostNow, "HOST ONLY - start the lobby yourself"); menu.Label("Rush: next boss spawns when the last one dies."); return menu; } private Menu ExtrasMenu() { if (extrasMenu != null) { return extrasMenu; } Menu menu = (extrasMenu = new Menu("EXTRAS")); menu.Action("UNLOCK ALL [HOST]", delegate { Note(UnlockAll()); }, IsHostNow, "HOST ONLY - start the lobby yourself"); menu.Sub("BOSS SPAWNER", BossMenu); menu.Action("SEAGULL ARMY ON TARGET", delegate { //IL_0023: Unknown result type (might be due to invalid IL or missing references) Transform val = Bridge.PlayerTransform(target) ?? Bridge.Player; SpawnBirds(val.position, 12); Note("SEAGULL ARMY INCOMING"); if (target != null) { Announce(Bridge.PlayerName(target) + " GOT SEAGULL ARMY!"); } }, IsHostNow, "HOST ONLY - start the lobby yourself"); menu.Action("SEAGULL ARMY ON ME", delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) SpawnBirds(Bridge.Player.position, 12); Note("SEAGULL ARMY"); }, IsHostNow, "HOST ONLY - start the lobby yourself"); menu.Action("ALBATROSS SQUAD ON TARGET", delegate { //IL_0023: Unknown result type (might be due to invalid IL or missing references) Transform val = Bridge.PlayerTransform(target) ?? Bridge.Player; SpawnBirds(val.position, 4, "albatross"); }, IsHostNow, "HOST ONLY - start the lobby yourself"); menu.Action("AUTO-SELL HELD ITEM", delegate { object obj = Bridge.HeldItem(); Item val = (Item)((obj is Item) ? obj : null); if ((Object)(object)val == (Object)null) { Note("Hold something to sell"); } else { SellItems((IEnumerable<Item>)(object)new Item[1] { val }); } }, IsHostNow, "HOST ONLY - start the lobby yourself"); menu.Action("AUTO-SELL EVERYTHING NEAR ME (10M)", delegate { SellItems(NearbyItems(10f)); }, IsHostNow, "HOST ONLY - start the lobby yourself"); menu.Toggle("AUTO-SELL DEAD FISH NEAR ME", () => autoSellFish, delegate(bool v) { autoSellFish = v; }, IsHostNow, "HOST ONLY - start the lobby yourself"); menu.Toggle("KILL AURA", () => killAura, delegate(bool v) { killAura = v; }, InWorld, "LOAD INTO A WORLD FIRST"); menu.Slider("KILL AURA RANGE", () => auraRange, delegate(float v) { auraRange = v; }, 2f, 20f, 1f, "0m"); menu.Choice("CAMERA", CamModes, () => camMode, SetCamMode); menu.Slider("THIRD PERSON DISTANCE", () => thirdDistance, delegate(float v) { thirdDistance = v; }, 2f, 12f, 0.5f, "0.0m"); menu.Sub("PRESETS", PresetMenu); menu.Action("SAY KRAKEN IN CHAT", delegate { SendChatNow("THIS LOBBY IS POWERED BY KRAKEN v1.2.1"); }, IsHostNow, "HOST ONLY - start the lobby yourself"); menu.Toggle("MENU SOUNDS", () => menuSounds, delegate(bool v) { menuSounds = v; }); return menu; } private bool PadDown(Func<Gamepad, ButtonControl> pick) { Gamepad pad = Pad; if (pad != null) { return pick(pad).wasPressedThisFrame; } return false; } private bool PadRepeat(Func<Gamepad, ButtonControl> pick) { Gamepad pad = Pad; if (pad == null) { return false; } ButtonControl val = pick(pad); if (val.wasPressedThisFrame) { padRepeat[val] = Time.unscaledTime + 0.35f; return true; } if (val.isPressed && padRepeat.TryGetValue(val, out var value) && Time.unscaledTime >= value) { padRepeat[val] = Time.unscaledTime + 0.07f; return true; } return false; } private bool PadMenuCombo() { if (Pad != null && Pad.leftShoulder.isPressed) { return Pad.dpad.up.wasPressedThisFrame; } return false; } private bool EmergencyMenuCombo() { if (Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)305)) { return Input.GetKeyDown((KeyCode)277); } return false; } private bool MenuOpenPressed() { //IL_0006: 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) if (((int)menuKey.Value == 0 || !Input.GetKeyDown(menuKey.Value)) && !PadMenuCombo()) { return EmergencyMenuCombo(); } return true; } private bool NavUp() { if (!Pressed((KeyCode)273)) { if (!PadMenuComboHeld()) { return PadRepeat((Gamepad p) => p.dpad.up); } return false; } return true; } private bool NavDown() { if (!Pressed((KeyCode)274)) { return PadRepeat((Gamepad p) => p.dpad.down); } return true; } private bool NavLeft() { if (!Pressed((KeyCode)276)) { return PadRepeat((Gamepad p) => p.dpad.left); } return true; } private bool NavRight() { if (!Pressed((KeyCode)275)) { return PadRepeat((Gamepad p) => p.dpad.right); } return true; } private bool NavSelect() { if (!Input.GetKeyDown((KeyCode)32)) { return PadDown((Gamepad p) => p.buttonSouth); } return true; } private bool NavBack() { if (!Input.GetKeyDown((KeyCode)8)) { return PadDown((Gamepad p) => p.buttonEast); } return true; } private bool PadMenuComboHeld() { if (Pad != null) { return Pad.leftShoulder.isPressed; } return false; } private void BindKeys() { announceChat = ((BaseUnityPlugin)this).Config.Bind<bool>("Chat", "AnnounceKraken", false, "Allow KRAKEN to post automatic announcements in lobby chat"); keySave = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", "SaveLocation", (KeyCode)286, "Save your current location to the quick slot"); keyLoad = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", "LoadLocation", (KeyCode)287, "Teleport to the quick slot location"); keySkyBase = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", "SkyBase", (KeyCode)288, "Teleport to the sky base (builds it if needed)"); keyFly = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", "ToggleFly", (KeyCode)289, "Toggle fly mode"); keyNoClip = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", "ToggleNoClip", (KeyCode)290, "Toggle no clip"); keyCar = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", "Car", (KeyCode)291, "Get in / out of the KRAKEN water car (spawns it if needed)"); keyGod = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keys", "ToggleGodMode", (KeyCode)0, "Toggle personal god mode (host)"); LoadLocations(); } private static bool ChatOpen() { try { return ChatManager.IsTyping; } catch { return false; } } private void TickHotkeys() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0059: Invalid comparison between Unknown and I4 //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Invalid comparison between Unknown and I4 //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Invalid comparison between Unknown and I4 //IL_0075: 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_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) if (capturing != null) { if (!Input.GetKeyDown((KeyCode)27)) { foreach (KeyCode value in Enum.GetValues(typeof(KeyCode))) { if ((int)value != 0 && ((int)value < 323 || (int)value > 329) && Input.GetKeyDown(value)) { capturing.Value = (KeyCode)(((int)value != 8) ? ((int)value) : 0); ((BaseUnityPlugin)this).Config.Save(); Note(capturingName + " -> " + (((int)capturing.Value == 0) ? "UNBOUND" : ((object)capturing.Value/*cast due to .constrained prefix*/).ToString().ToUpper())); capturing = null; break; } } return; } capturing = null; Note("Rebind cancelled"); } else { if (editing != null || ChatOpen() || !Bridge.Ready) { return; } if (Hit(keySave)) { SaveQuick(); } if (Hit(keyLoad)) { LoadQuick(); } if (Hit(keySkyBase)) { GoSkyBase(); } if (Hit(keyFly)) { if (fly) { StopFly(); } else { fly = true; } Note("FLY MODE [" + (fly ? "ON" : "OFF") + "]"); } if (Hit(keyNoClip)) { if (Bridge.SetNoClip(!noClip)) { noClip = !noClip; } Note("NO CLIP [" + (noClip ? "ON" : "OFF") + "]"); } if (Hit(keyCar)) { ToggleCar(); } if (Hit(keyGod)) { if (Host) { Patches.PersonalGod = !Patches.PersonalGod; Note("GOD MODE [" + (Patches.PersonalGod ? "ON" : "OFF") + "]"); } else { Note("GOD MODE // HOST ONLY - start the lobby yourself"); } } } } private static bool Hit(ConfigEntry<KeyCode> k) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if ((int)k.Value != 0) { return Input.GetKeyDown(k.Value); } return false; } private Menu KeybindMenu() { if (keybindMenu != null) { return keybindMenu; } Menu m = (keybindMenu = new Menu("KEYBINDS")); Row("OPEN MENU", () => menuKey); Row("SAVE LOCATION", () => keySave); Row("LOAD LOCATION", () => keyLoad); Row("SKY BASE", () => keySkyBase); Row("FLY MODE", () => keyFly); Row("NO CLIP", () => keyNoClip); Row("WATER CAR", () => keyCar); Row("GOD MODE", () => keyGod); Row("LOAD PRESET 1", () => presetKeys[0]); Row("LOAD PRESET 2", () => presetKeys[1]); Row("LOAD PRESET 3", () => presetKeys[2]); m.Action("RESET KEYBINDS", ResetKeybinds); m.Label("Emergency open: CTRL + INSERT (cannot be rebound)"); m.Label("Controller: LB + D-PAD UP opens the menu"); m.Footer = "SPACE ON A ROW, THEN PRESS THE NEW KEY"; return m; void Row(string name, Func<ConfigEntry<KeyCode>> entry) { m.Add(new Option { Kind = OptionKind.Action, NameFn = () => name + ": " + ((capturing == entry()) ? "PRESS A KEY..." : (((int)entry().Value == 0) ? "UNBOUND" : ((object)entry().Value/*cast due to .constrained prefix*/).ToString().ToUpper())), OnSelect = delegate { capturing = entry(); capturingName = name; Note("Press a key for " + name + " (Backspace = unbind, Esc = cancel)"); } }); } } private void ResetKeybinds() { menuKey.Value = (KeyCode)277; keySave.Value = (KeyCode)286; keyLoad.Value = (KeyCode)287; keySkyBase.Value = (KeyCode)288; keyFly.Value = (KeyCode)289; keyNoClip.Value = (KeyCode)290; keyCar.Value = (KeyCode)291; keyGod.Value = (KeyCode)0; if (presetKeys != null && presetKeys.Length >= 3) { presetKeys[0].Value = (KeyCode)292; presetKeys[1].Value = (KeyCode)0; presetKeys[2].Value = (KeyCode)0; } ((BaseUnityPlugin)this).Config.Save(); Note("Keybinds reset // menu: INSERT // emergency: CTRL + INSERT"); } private void LoadLocations() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) try { if (!File.Exists(LocationsFile)) { return; } string[] array = File.ReadAllLines(LocationsFile); Vector3 value = default(Vector3); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split('|'); if (array2.Length == 4) { ((Vector3)(ref value))..ctor(float.Parse(array2[1], CultureInfo.InvariantCulture), float.Parse(array2[2], CultureInfo.InvariantCulture), float.Parse(array2[3], CultureInfo.InvariantCulture)); if (array2[0] == "QUICK") { quickLocation = value; } else { locations.Add(new KeyValuePair<string, Vector3>(array2[0], value)); } } } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Locations: " + ex.Message)); } } private void SaveLocations() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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) try { List<string> list = new List<string>(); if (quickLocation.HasValue) { list.Add("QUICK|" + F(quickLocation.Value.x) + "|" + F(quickLocation.Value.y) + "|" + F(quickLocation.Value.z)); } foreach (KeyValuePair<string, Vector3> location in locations) { list.Add(location.Key.Replace("|", "") + "|" + F(location.Value.x) + "|" + F(location.Value.y) + "|" + F(location.Value.z)); } File.WriteAllLines(LocationsFile, list); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Locations: " + ex.Message)); } static string F(float f) { return f.ToString("0.###", CultureInfo.InvariantCulture); } } private void SaveQuick() { //IL_0020: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Bridge.Player == (Object)null)) { quickLocation = Bridge.Player.position - IslandOrigin; SaveLocations(); Note("LOCATION SAVED [" + ((object)keyLoad.Value/*cast due to .constrained prefix*/).ToString().ToUpper() + " TO LOAD]"); } } private void LoadQuick() { //IL_001b: 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_002b: Unknown result type (might be due to invalid IL or missing references) if (!quickLocation.HasValue) { Note("No saved location yet"); } else { Go(IslandOrigin + quickLocation.Value, "Saved location"); } } private void AddLocation() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Bridge.Player == (Object)null)) { string text = "LOCATION " + (locations.Count + 1); locations.Add(new KeyValuePair<string, Vector3>(text, Bridge.Player.position - IslandOrigin)); SaveLocations(); Note(text + " saved"); } } private Menu LocationsMenu() { return new Menu("SAVED LOCATIONS") { Dynamic = delegate { List<Option> list = new List<Option> { new Option { Kind = OptionKind.Action, NameFn = () => "SAVE LOCATION (QUICK) [" + ((object)keySave.Value/*cast due to .constrained prefix*/).ToString().ToUpper() + "]", OnSelect = SaveQuick }, new Option { Kind = OptionKind.Action, NameFn = () => "LOAD LOCATION (QUICK) [" + ((object)keyLoad.Value/*cast due to .constrained prefix*/).ToString().ToUpper() + "]", OnSelect = LoadQuick }, new Option { Kind = OptionKind.Action, Name = "ADD NEW SAVED LOCATION", OnSelect = AddLocation } }; for (int num = 0; num < locations.Count; num++) { KeyValuePair<string, Vector3> l = locations[num]; list.Add(new Option { Kind = OptionKind.Action, Name = "GO TO " + l.Key, OnSelect = delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) Go(IslandOrigin + l.Value, l.Key); } }); } if (locations.Count > 0) { list.Add(new Option { Kind = OptionKind.Action, Name = "DELETE LAST LOCATION", OnSelect = delegate { locations.RemoveAt(locations.Count - 1); SaveLocations(); Note("Deleted"); } }); } return list; }, Footer = "SAVED TO BepInEx/config/kraken_locations.txt" }; } private void TickFeatures() { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0607: Unknown result type (might be due to invalid IL or missing references) //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) if (!Bridge.Ready) { if (fly) { StopFly(); } return; } Transform player = Bridge.Player; if (fly) { UpdateFly(player); } bool jumpPressed = Bridge.JumpPressed; if (airJump && jumpPressed && !wasJump && !shown && !fly) { Bridge.AirJump(); } wasJump = jumpPressed; if (spinbot) { spinAngle = Mathf.Repeat(spinAngle + Time.deltaTime * 900f, 360f); Bridge.SetYaw(spinAngle); } if (walkOnWater && !fly && (Object)(object)playerBody != (Object)null) { float waterHeight = Bridge.WaterHeight; if (player.position.y < waterHeight + 0.05f) { Vector3 position = playerBody.position; position.y = waterHeight + 0.05f; playerBody.position = position; Vector3 linearVelocity = playerBody.linearVelocity; if (linearVelocity.y < 0f) { linearVelocity.y = 0f; } playerBody.linearVelocity = linearVelocity; } } if ((Object)(object)playerBody == (Object)null) { playerBody = ((Component)player).GetComponent<Rigidbody>(); } if (freezeAir && (Object)(object)playerBody != (Object)null && !fly) { playerBody.linearVelocity = Vector3.zero; } if (Host && Time.unscaledTime >= nextHeal) { nextHeal = Time.unscaledTime + 1f; if (demiGod) { Bridge.HealPlayer(Bridge.LocalPlayerObject); } else if (neverHungry) { Bridge.HealPlayer(Bridge.LocalPlayerObject); } if (unlimitedMoney && MoneyNow() < 1000000) { Bridge.SetMoney(9999999); } } if (autoFish && Host && Time.unscaledTime >= nextAutoFish) { nextAutoFish = Time.unscaledTime + 0.25f; Bridge.InstantCatch(); } if (spawnQueue.Count > 0) { for (int i = 0; i < 4; i++) { if (spawnQueue.Count <= 0) { break; } spawnQueue.Dequeue()(); } } if (Host && (Object)(object)Bridge.BoatBody != (Object)null) { Rigidbody boatBody = Bridge.BoatBody; if (boatBoost && Input.GetKey((KeyCode)119)) { Bridge.ApplyBoatThrust(boatMult); } if (boatFlying) { if (jumpPressed) { Bridge.ApplyBoatVertical(18f); } if (Input.GetKey((KeyCode)306)) { Bridge.ApplyBoatVertical(-18f); } } if (boatSpin) { boatBody.angularVelocity = new Vector3(0f, 8f, 0f); } if (driveOnLand && Input.GetKey((KeyCode)119)) { boatBody.AddForce(((Component)boatBody).transform.forward * 25f + Vector3.up * 6f, (ForceMode)5); } } if (rainbowBoat && Time.frameCount % 6 == 0 && (Object)(object)Bridge.BoatVisual != (Object)null) { TintRenderers(Bridge.BoatVisual, Color.HSVToRGB(Mathf.Repeat(Time.time * 0.3f, 1f), 1f, 1f)); } if (Host && Time.unscaledTime >= nextPlayerTick) { TickPlayers(); } if (Host && Time.unscaledTime >= nextItemTick && (floatingItems || spinningItems || bouncingItems || flyingFish || fishMagnet)) { nextItemTick = Time.unscaledTime + 0.1f; int num = 0; foreach (KeyValuePair<Transform, object> item in Bridge.World()) { if (++num > 150) { break; } object value = item.Value; Rigidbody val = (((Object)((value is Component) ? value : null) != (Object)null) ? ((Component)item.Key).GetComponent<Rigidbody>() : null); if ((Object)(object)val == (Object)null || val.isKinematic) { continue; } bool flag = Bridge.IsCreature(item.Value); if (floatingItems || (flyingFish && flag)) { val.AddForce(-Physics.gravity * 1.15f * 0.1f, (ForceMode)2); } if (spinningItems) { val.angularVelocity = new Vector3(0f, 15f, 0f); } if (bouncingItems && Random.value < 0.05f) { val.AddForce(Vector3.up * 8f, (ForceMode)2); } if (fishMagnet && flag) { Vector3 val2 = player.position + Vector3.up - val.position; if (((Vector3)(ref val2)).sqrMagnitude < 3600f && ((Vector3)(ref val2)).sqrMagnitude > 4f) { val.AddForce(((Vector3)(ref val2)).normalized * 3f, (ForceMode)2); } } } } if (rainbowWorld) { RenderSettings.fogColor = Color.HSVToRGB(Mathf.Repeat(Time.time * 0.2f, 1f), 0.8f, 1f); RenderSettings.ambientLight = RenderSettings.fogColor; } if (chaosOn && Time.unscaledTime >= nextChaos) { TickChaos(); } } private void TickLate() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (!Bridge.Ready) { return; } Camera gameCamera = GameCamera; if ((Object)(object)gameCamera != (Object)null) { float num = 0f; if (drunkCam) { num += Mathf.Sin(Time.time * 1.7f) * 12f; } if (upsideDown) { num += 180f; } if (cameraSpin) { num += Mathf.Repeat(Time.time * 120f, 360f); } if (num != 0f) { Transform transform = ((Component)gameCamera).transform; transform.rotation *= Quaternion.AngleAxis(num, Vector3.forward); } if (fov > 0f) { if ((Object)(object)fovCamera != (Object)(object)gameCamera) { fovCamera = gameCamera; originalFov = gameCamera.fieldOfView; } gameCamera.fieldOfView = fov + (drunkCam ? (Mathf.Sin(Time.time * 2.3f) * 8f) : 0f); } } if (!shown && aimEnabled) { Bridge.AimAtTarget(aimAdsOnly, aimSmooth, aimWide, aimPrediction); } if (!shown && triggerbot && Time.unscaledTime >= nextTrigger) { nextTrigger = Time.unscaledTime + 0.12f; Bridge.Triggerbot(aimAdsOnly); } if (fishTornado && Host) { Bridge.FishTornadoTick(); } if (fishCannon && Host && !shown && Input.GetMouseButton(2) && Time.unscaledTime >= nextCannon) { nextCannon = Time.unscaledTime + 0.12f; LaunchFish(); } Patches.NoRecoil = noRecoil; Patches.NoCooldown = noCooldown; Patches.DamageMultiplier = damageMult; if (instantReload) { Bridge.InstantReload(); } try { TickCamera(); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Camera: " + ex.Message)); } Bridge.UpdateWeaponMods(infiniteAmmo, rapidFire, noCooldown, zeroSpread, fastProjectiles, noWeaponKick, noSway, bigLaser); } private void TickPlayers() { //IL_005f: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) nextPlayerTick = Time.unscaledTime + 0.1f; foreach (object item in Bridge.Players()) { Transform val = Bridge.PlayerTransform(item); if (!((Object)(object)val == (Object)null)) { if (freezePos.TryGetValue(item, out var value)) { Bridge.TeleportPlayer(item, value); } if (spinning.Contains(item)) { Bridge.TeleportPlayerRotated(item, val.position, Mathf.Repeat(Time.time * 720f, 360f)); } if (bouncing.Contains(item) && Random.value < 0.08f) { Bridge.KnockPlayer(item, Vector3.up * 14f); } if (rainOn.Contains(item) && Random.value < 0.3f) { SpawnFishAround(val.position + Vector3.up * 14f, 1, 6f, 1f); } if (healAura.Contains(item) && Random.value < 0.1f) { Bridge.HealPlayer(item); } } } } private int MoneyNow() { return Bridge.MoneyValue; } private void UpdateFly(Transform t) { //IL_004e: 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_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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_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) Rigidbody component = ((Component)t).GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { if (!bodyGravitySaved) { bodyOldGravity = component.useGravity; bodyGravitySaved = true; } component.useGravity = false; component.linearVelocity = Vector3.zero; } Transform obj = Bridge.LookTransform ?? t; Vector3 forward = obj.forward; Vector3 right = obj.right; forward.y = (right.y = 0f); ((Vector3)(ref forward)).Normalize(); ((Vector3)(ref right)).Normalize(); Vector3 val = Vector3.zero; if (!shown) { if (Input.GetKey((KeyCode)119)) { val += forward; } if (Input.GetKey((KeyCode)115)) { val -= forward; } if (Input.GetKey((KeyCode)100)) { val += right; } if (Input.GetKey((KeyCode)97)) { val -= right; } if (Bridge.JumpPressed) { val += Vector3.up; } if (Input.GetKey((KeyCode)306)) { val -= Vector3.up; } } float num = flySpeed.Value * (Input.GetKey((KeyCode)304) ? 2.5f : 1f); if (((Vector3)(ref val)).sqrMagnitude > 0f) { Bridge.Teleport(t.position + ((Vector3)(ref val)).normalized * num * Time.deltaTime); } } private void StopFly() { fly = false; Transform player = Bridge.Player; Rigidbody val = (((Object)(object)player != (Object)null) ? ((Component)player).GetComponent<Rigidbody>() : null); if ((Object)(object)val != (Object)null && bodyGravitySaved) { val.useGravity = bodyOldGravity; } bodyGravitySaved = false; } private void SetBodyShape(int shape) { //IL_0046: 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_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) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b5: 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_002d: 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) Transform player = Bridge.Player; if (!((Object)(object)player == (Object)null)) { if ((Object)(object)scaledPlayer != (Object)(object)player) { scaledPlayer = player; originalScale = player.localScale; } bodyShape = shape; Vector3[] array = (Vector3[])(object)new Vector3[5] { Vector3.one, Vector3.one * 3f, Vector3.one * 0.35f, new Vector3(0.25f, 1f, 0.25f), new Vector3(2.5f, 0.7f, 2.5f) }; player.localScale = Vector3.Scale(originalScale, array[shape]); } } private void SetGravity(float multiplier) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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) if (!gravitySaved) { originalGravity = Physics.gravity; gravitySaved = true; } gravityMult = multiplier; Physics.gravity = originalGravity * multiplier; } private void SetFog(bool? off, bool? heavy) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!fogSaved) { oldFog = RenderSettings.fog; oldFogDensity = RenderSettings.fogDensity; oldFogColor = RenderSettings.fogColor; oldAmbient = RenderSettings.ambientLight; fogSaved = true; } if (off.HasValue) { noFog = off.Value; } if (heavy.HasValue) { superFog = heavy.Value; } RenderSettings.fog = superFog || (!noFog && oldFog); RenderSettings.fogDensity = (superFog ? 0.08f : oldFogDensity); if (superFog) { RenderSettings.fogMode = (FogMode)3; } } private void RestoreWorldVisuals() { //IL_0027: 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) rainbowWorld = false; if (fogSaved) { RenderSettings.fog = oldFog; RenderSettings.fogDensity = oldFogDensity; RenderSettings.fogColor = oldFogColor; RenderSettings.ambientLight = oldAmbient; noFog = (superFog = false); } } private static void TintRenderers(Transform root, Color c) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = ((Component)root).GetComponentsInChildren<Renderer>(); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] materials = componentsInChildren[i].materials; foreach (Material val in materials) { if (val.HasProperty("_BaseColor")) { val.SetColor("_BaseColor", c); } else if (val.HasProperty("_Color")) { val.color = c; } } } } private void SetTimeScale(float s) { timeScale = s; Time.timeScale = s; } private int SpawnFishAround(Vector3 centre, int count, float radius, float scale) { //IL_003b: 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) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) List<object> list = Bridge.SpawnablesWith("Fish").ToList(); if (list.Count == 0) { return 0; } int num = 0; for (int i = 0; i < count; i++) { float num2 = (float)i * MathF.PI * 2f / (float)count; Vector3 pos = centre + new Vector3(Mathf.Cos(num2) * radius, Random.Range(0f, 1f), Mathf.Sin(num2) * radius); if (Bridge.SpawnPrefab(list[Random.Range(0, list.Count)], pos, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f), scale * fishScale) != null) { num++; } } return num; } private void QueueSpawn(object prefab, int count, float scale = 1f) { for (int i = 0; i < count; i++) { int k = i; spawnQueue.Enqueue(delegate { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor((float)(k % 6) * 0.5f - 1.25f, 0.3f + (float)(k / 36) * 0.4f, (float)(k / 6 % 6) * 0.5f); Bridge.SpawnPrefab(prefab, Bridge.InFront(2.5f) + val, Quaternion.identity, scale * itemScale); }); } } private void LaunchFish() { //IL_004d: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) Transform lookTransform = Bridge.LookTransform; List<object> list = Bridge.SpawnablesWith("Fish").ToList(); if (!((Object)(object)lookTransform == (Object)null) && list.Count != 0) { object obj = Bridge.SpawnPrefab(list[Random.Range(0, list.Count)], lookTransform.position + lookTransform.forward * 1.8f, lookTransform.rotation, fishScale); Component val = (Component)((obj is Component) ? obj : null); Rigidbody val2 = (((Object)(object)val != (Object)null) ? val.GetComponent<Rigidbody>() : null); if ((Object)(object)val2 != (Object)null) { val2.linearVelocity = lookTransform.forward * 45f; } } } private void LaunchNearby(float force) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) Transform player = Bridge.Player; if ((Object)(object)player == (Object)null) { return; } int num = 0; foreach (KeyValuePair<Transform, object> item in Bridge.World()) { Rigidbody component = ((Component)item.Key).GetComponent<Rigidbody>(); if (!((Object)(object)component == (Object)null) && !component.isKinematic) { Vector3 val = item.Key.position - player.position; if (!(((Vector3)(ref val)).sqrMagnitude > 400f)) { component.AddForce((((Vector3)(ref val)).normalized + Vector3.up) * force, (ForceMode)2); num++; } } } Note("Launched " + num + " objects"); } private void RefreshEsp() { nextEsp = Time.unscaledTime + 0.5f; espTargets.Clear(); if (espPlayers) { foreach (object item in Bridge.Players()) { if (!Bridge.IsLocal(item)) { Transform val = Bridge.PlayerTransform(item); if (val != null) { espTargets.Add(new KeyValuePair<Transform, string>(val, "P|" + Bridge.PlayerName(item))); } } } } foreach (KeyValuePair<Transform, object> item2 in Bridge.World()) { if (espTargets.Count > 250) { break; } bool flag = Bridge.IsCreature(item2.Value); int num = Bridge.ItemWorth(item2.Value); bool flag2 = espValuable && num >= 100; if ((flag && espFish) || (!flag && espItems) || flag2) { string text; try { text = Bridge.ItemLabel(item2.Value); } catch (Exception) { text = ((Object)item2.Key).name.Replace("(Clone)", ""); } espTargets.Add(new KeyValuePair<Transform, string>(item2.Key, (flag2 ? "V|" : (flag ? "F|" : "I|")) + text)); } } } private void ResetEverything() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (driving) { ExitCar(); } if (camMode != 0) { SetCamMode(0); } killAura = (bossRush = (autoSellFish = false)); StopFly(); Bridge.SetNoClip(enabled: false); noClip = false; Bridge.ResetWeaponMods(); Bridge.SetBoatFlying(enabled: false); boatFlying = (boatBoost = (boatSpin = (driveOnLand = false))); if (gravitySaved) { Physics.gravity = originalGravity; gravityMult = 1f; } if (bodyShape != 0) { SetBodyShape(0); } if (speedMult != 1f) { speedMult = 1f; Bridge.SetSpeed(1f); } if (jumpMult != 1f) { jumpMult = 1f; Bridge.SetJumpMultiplier(1f); } if ((Object)(object)fovCamera != (Object)null && originalFov > 0f) { fovCamera.fieldOfView = originalFov; } fov = -1f; SetTimeScale(1f); RestoreWorldVisuals(); drunkCam = (upsideDown = (cameraSpin = (disco = (spinbot = (freezeAir = (walkOnWater = false)))))); floatingItems = (spinningItems = (bouncingItems = (flyingFish = (fishMagnet = (fishTornado = false))))); freezePos.Clear(); spinning.Clear(); bouncing.Clear(); rainOn.Clear(); healAura.Clear(); Patches.PersonalGod = (Patches.ExplosiveBullets = (Patches.SilentAim = false)); noRecoil = (noCooldown = (instantReload = (noSway = (bigLaser = false)))); crosshair = false; damageMult = 1f; chaosOn = false; } private void InitStyles() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00c8: Expected O, but got Unknown //IL_00cf: 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_00e0: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_015a: Expected O, but got Unknown if (!((Object)(object)white != (Object)null)) { white = new Texture2D(1, 1); white.SetPixel(0, 0, Color.white); white.Apply(); big = new GUIStyle(GUI.skin.label) { fontSize = 38, fontStyle = (FontStyle)1, alignment = (TextAnchor)4 }; small = new GUIStyle(GUI.skin.label) { fontSize = 12, fontStyle = (FontStyle)1, alignment = (TextAnchor)4 }; rowStyle = new GUIStyle(GUI.skin.label) { fontSize = 15, fontStyle = (FontStyle)1, alignment = (TextAnchor)3, clipping = (TextClipping)1, wordWrap = false }; valueStyle = new GUIStyle(rowStyle) { alignment = (TextAnchor)5 }; centre = new GUIStyle(GUI.skin.label) { fontSize = 34, fontStyle = (FontStyle)1, alignment = (TextAnchor)4 }; feedStyle = new GUIStyle(GUI.skin.label) { fontSize = 15, fontStyle = (FontStyle)1 }; espStyle = new GUIStyle(GUI.skin.label) { fontSize = 12, fontStyle = (FontStyle)1, alignment = (TextAnchor)1 }; } } private void DestroyTextures() { if ((Object)(object)white != (Object)null) { Object.Destroy((Object)(object)white); } } private void Rect(Rect r, Color c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Color color = GUI.color; GUI.color = c; GUI.DrawTexture(r, (Texture)(object)white); GUI.color = color; } private void Text(Rect r, string s, GUIStyle st, Color c, bool shadow = true) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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) if (shadow) { st.normal.textColor = new Color(0f, 0f, 0f, 0.85f); GUI.Label(new Rect(((Rect)(ref r)).x + 1.5f, ((Rect)(ref r)).y + 1.5f, ((Rect)(ref r)).width, ((Rect)(ref r)).height), s, st); } st.normal.textColor = c; GUI.Label(r, s, st); } private void OnGUI() { //IL_0007: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown InitStyles(); Color accent = Accent; if (disco && (int)Event.current.type == 7) { Rect(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), new Color(Mathf.Abs(Mathf.Sin(Time.time * 3f)), Mathf.Abs(Mathf.Sin(Time.time * 2.1f)), Mathf.Abs(Mathf.Sin(Time.time * 1.3f)), 0.18f)); } if (Bridge.Ready && espTargets.Count > 0 && (espFish || espItems || espPlayers || espValuable)) { DrawEsp(); } DrawFeed(accent); DrawSpeedo(accent); DrawRaceHud(accent); DrawBanner(accent); if (crosshair && !shown) { DrawCrosshair(accent); } if (Time.unscaledTime < chaosBannerUntil) { Text(new Rect(0f, (float)Screen.height * 0.18f, (float)Screen.width, 90f), chaosEvent, centre, accent); } if (!shown) { Text(new Rect(10f, 6f, 400f, 22f), "KRAKEN v1.2.1 [" + ((object)menuKey.Value/*cast due to .constrained prefix*/).ToString().ToUpper() + "]", new GUIStyle(small) { alignment = (TextAnchor)3 }, new Color(1f, 1f, 1f, 0.55f)); return; } Matrix4x4 matrix = GUI.matrix; float num = menuScale * Mathf.Max(1f, (float)Screen.height / 1080f); GUI.matrix = Matrix4x4.Scale(new Vector3(num, num, 1f)); DrawMenu(accent, num); GUI.matrix = matrix; } private void DrawMenu(Color accent, float scale) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Expected O, but got Unknown //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_061a: 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_062b: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) /