using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using FishNet; using FishNet.Broadcast; using FishNet.Connection; using FishNet.Managing.Client; using FishNet.Managing.Server; using FishNet.Object; using FishNet.Serializing; using FishNet.Transporting; using HarmonyLib; using HowToFish.ModKit; using HowToFish.Warthog.Patches; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.Audio; using UnityEngine.InputSystem; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("zPaulin")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright (c) 2026 zPaulin. All rights reserved.")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ed3864f363b71b0a7f3da27f86b6fbbd7b45f789")] [assembly: AssemblyProduct("zPaulin's A10-Warthog for How to Fish")] [assembly: AssemblyTitle("HowToFish.Warthog")] [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 HowToFish.Warthog { public static class Boom { public static float Delay(Vector3 from) { //IL_0036: 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) ModConfig cfg = Plugin.Cfg; if (cfg == null || cfg.SpeedOfSound.Value <= 0f) { return 0f; } Transform val = Ears(); if ((Object)(object)val == (Object)null) { return 0f; } return Vector3.Distance(from, val.position) / cfg.SpeedOfSound.Value; } public static void At(string clips, Vector3 point, float volume, AudioDistance distance) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) string text = Pick(clips); if (text != null) { float num = Delay(point); if (num < 0.02f || (Object)(object)WarthogRuntime.Instance == (Object)null) { Play(text, point, volume, distance); } else { ((MonoBehaviour)WarthogRuntime.Instance).StartCoroutine(Later(text, point, volume, distance, num)); } } } private static IEnumerator Later(string clip, Vector3 point, float volume, AudioDistance distance, float wait) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForSeconds(wait); Play(clip, point, volume, distance); } private static void Play(string clip, Vector3 point, float volume, AudioDistance distance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) try { AudioManager.PlayClipAt(clip, point, true, distance, volume, 0f); } catch { } } private static string Pick(string clips) { if (string.IsNullOrEmpty(clips)) { return null; } string[] array = clips.Split(new char[1] { ',' }); if (array.Length == 1) { return array[0].Trim(); } for (int i = 0; i < 4; i++) { string text = array[Random.Range(0, array.Length)].Trim(); if (text.Length > 0) { return text; } } return array[0].Trim(); } private static Transform Ears() { try { Player localPlayer = Player.LocalPlayer; if ((Object)(object)localPlayer != (Object)null && (Object)(object)localPlayer.Transform != (Object)null) { return localPlayer.Transform; } } catch { } Camera main = Camera.main; if (!((Object)(object)main == (Object)null)) { return ((Component)main).transform; } return null; } } public static class Carrier { private static int _walkableLayer = -1; public static GameObject Root { get; private set; } public static Transform Deck { get; private set; } public static Transform ParkingSpot { get; private set; } public static bool Exists => (Object)(object)Root != (Object)null; public static void OnSceneLoaded(Scene scene) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (Islands.IsCarrierIsland(((Scene)(ref scene)).name) && !Exists) { Build(scene); } } public static void Clear() { Vendor.Clear(); if ((Object)(object)Root != (Object)null) { Object.Destroy((Object)(object)Root); } Root = null; Deck = null; ParkingSpot = null; } private static void Build(Scene scene) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00de: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0270: 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_0060: Unknown result type (might be due to invalid IL or missing references) ModConfig cfg = Plugin.Cfg; Vector3 heading; Vector3? val = ComputePosition(out heading); if (!val.HasValue) { Feedback.Warn("Could not place the carrier: the island reported no position."); return; } Root = new GameObject("A10_Carrier"); Root.transform.SetPositionAndRotation(val.Value, Quaternion.LookRotation(heading, Vector3.up)); if (((Scene)(ref scene)).IsValid()) { SceneManager.MoveGameObjectToScene(Root, scene); } float value = cfg.CarrierLength.Value; float value2 = cfg.CarrierWidth.Value; float value3 = cfg.CarrierDraft.Value; float value4 = cfg.CarrierDeckHeight.Value; Deck = Box("Hull", Root.transform, new Vector3(0f, (value4 - value3) * 0.5f, 0f), new Vector3(value2, value4 + value3, value), new Color(0.24f, 0.25f, 0.27f)).transform; float num = value2 * 0.18f; float num2 = Mathf.Max(value2 * 0.38f, 9.5f + num * 0.5f); Box("Superstructure", Root.transform, new Vector3(num2, value4 + 5f, value * 0.12f), new Vector3(num, 10f, value * 0.14f), new Color(0.34f, 0.35f, 0.37f)); Box("Centreline", Root.transform, new Vector3(0f, value4 + 0.02f, 0f), new Vector3(1.2f, 0.04f, value * 0.86f), new Color(0.86f, 0.86f, 0.82f)); GameObject val2 = new GameObject("ParkingSpot"); val2.transform.SetParent(Root.transform, false); val2.transform.localPosition = new Vector3(0f, value4, (0f - value) * 0.36f); val2.transform.localRotation = Quaternion.identity; ParkingSpot = val2.transform; Gangway(cfg, value2, value, value4); ((MonoBehaviour)WarthogRuntime.Instance).StartCoroutine(RaiseVendor(value4, value, cfg)); ManualLogSource log = Plugin.Log; string[] obj = new string[5] { "Carrier on station at ", null, null, null, null }; Vector3 value5 = val.Value; obj[1] = ((Vector3)(ref value5)).ToString("F0"); obj[2] = ", "; obj[3] = Vector3.Distance(val.Value, Island.IslandPos).ToString("F0"); obj[4] = " m from the island."; log.LogDebug((object)string.Concat(obj)); } private static IEnumerator RaiseVendor(float deckHeight, float length, ModConfig cfg) { yield return null; if ((Object)(object)Root != (Object)null) { Vendor.Build(Root.transform, deckHeight, length, cfg); } } public static void ParkJet() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ParkingSpot == (Object)null)) { JetFleet.PlaceAt(ParkingSpot.position + Vector3.up * Plugin.Cfg.GearHeight.Value, ParkingSpot.rotation); } } private static Vector3? ComputePosition(out Vector3 heading) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) heading = Vector3.forward; Vector3 islandPos = Island.IslandPos; Vector3 val = SpawnManager.BoatSpawnPos - islandPos; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 1f) { val = Vector3.forward; } else { ((Vector3)(ref val)).Normalize(); } Vector3 val2 = Vector3.Cross(Vector3.up, val); heading = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref heading)).sqrMagnitude < 0.5f) { heading = Vector3.forward; } float y = WaterLevel(); Vector3 value = islandPos + val * Plugin.Cfg.CarrierDistance.Value; value.y = y; return value; } private static float WaterLevel() { try { return WaterManager.WaterHeight; } catch { return 0f; } } private static void Gangway(ModConfig cfg, float width, float length, float deckHeight) { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_01a9: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01be: 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_01ca: 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_01ce: 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_01d5: 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_00de: 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) float num = Mathf.Clamp(cfg.RampAngle.Value, 10f, 50f); float num2 = Mathf.Max(cfg.RampWidth.Value, 1.5f); float num3 = Mathf.Clamp(cfg.RampPosition.Value, (0f - length) * 0.45f, length * 0.45f); float num4 = (deckHeight - 0.5f) / Mathf.Tan(num * ((float)Math.PI / 180f)); float num5 = width * 0.5f; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(num5 + 0.05f, deckHeight, num3); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x + num4, 0.5f, num3); Vector3 val3 = val - val2; Vector3 normalized = ((Vector3)(ref val3)).normalized; float num6 = Vector3.Distance(val2, val); Vector3 val4 = default(Vector3); ((Vector3)(ref val4))..ctor(normalized.y, 0f - normalized.x, 0f); if (val4.y < 0f) { val4 = -val4; } Quaternion val5 = Quaternion.LookRotation(Vector3.forward, val4); Color color = default(Color); ((Color)(ref color))..ctor(0.3f, 0.31f, 0.33f); Color colour = default(Color); ((Color)(ref colour))..ctor(0.86f, 0.72f, 0.2f); Box("Gangway", Root.transform, (val2 + val) * 0.5f - val4 * 0.25f, new Vector3(num6, 0.5f, num2), color).transform.localRotation = val5; Box("GangwayFoot", Root.transform, new Vector3(num5 + num4 + 3.5f, 0.25f, num3), new Vector3(8f, 0.5f, num2 + 2f), color); Rails(val2, val, normalized, val4, val5, num6, num2, colour); Treads(val2, normalized, val4, val5, num6, num2, val.y - val2.y); } private static void Rails(Vector3 foot, Vector3 head, Vector3 axis, Vector3 normal, Quaternion tilt, float slope, float span, Color colour) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(Mathf.RoundToInt(slope / 2.5f), 2, 14); Vector3 val = default(Vector3); for (int i = -1; i <= 1; i += 2) { ((Vector3)(ref val))..ctor(0f, 0f, (float)i * span * 0.5f); Box("GangwayRail" + i, Root.transform, (foot + head) * 0.5f + normal * 0.85f + val, new Vector3(slope, 0.18f, 0.18f), colour).transform.localRotation = tilt; for (int j = 0; j <= num; j++) { Vector3 localPos = foot + axis * (slope * (float)j / (float)num) + normal * 0.425f + val; GameObject obj = Box("GangwayPost" + i + "_" + j, Root.transform, localPos, new Vector3(0.16f, 0.85f, 0.16f), colour); obj.transform.localRotation = tilt; Object.Destroy((Object)(object)obj.GetComponent()); } } } private static void Treads(Vector3 foot, Vector3 axis, Vector3 normal, Quaternion tilt, float slope, float span, float rise) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_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_0070: 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_0094: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(Mathf.RoundToInt(rise / 0.42f), 4, 40); Color color = default(Color); ((Color)(ref color))..ctor(0.46f, 0.47f, 0.49f); for (int i = 1; i < num; i++) { Vector3 localPos = foot + axis * (slope * (float)i / (float)num) + normal * 0.05f; GameObject obj = Box("Tread" + i, Root.transform, localPos, new Vector3(0.12f, 0.1f, span * 0.92f), color); obj.transform.localRotation = tilt; Object.Destroy((Object)(object)obj.GetComponent()); } } private static GameObject Box(string name, Transform parent, Vector3 localPos, Vector3 size, Color color) { //IL_0021: 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_0049: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val).name = name; val.transform.SetParent(parent, false); val.transform.localPosition = localPos; val.transform.localScale = size; val.layer = WalkableLayer(); val.tag = "Level"; Material val2 = Mat.Solid(color); if ((Object)(object)val2 != (Object)null) { ((Renderer)val.GetComponent()).sharedMaterial = val2; } return val; } public static int WalkableLayer() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (_walkableLayer >= 0) { return _walkableLayer; } LayerMask canJumpOnLayers = GameInfo.CanJumpOnLayers; int value = ((LayerMask)(ref canJumpOnLayers)).value; for (int i = 0; i < 32; i++) { if ((value & (1 << i)) != 0) { string text = LayerMask.LayerToName(i); switch (text) { case "Player": case "LocalPlayer": case "Item": continue; } _walkableLayer = i; Plugin.Log.LogDebug((object)("Carrier hull on layer " + i + " (" + text + ")")); return i; } } _walkableLayer = 0; Plugin.Log.LogWarning((object)"CanJumpOnLayers was empty; falling back to Default."); return 0; } } public static class Commands { private static readonly List Spawned = new List(); public static bool Handle(string raw) { if (string.IsNullOrEmpty(raw)) { return false; } string text = raw.Trim(); if (text.StartsWith("/")) { text = text.Substring(1); } string[] array = text.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (array.Length == 0) { return false; } if (!array[0].Equals("a10", StringComparison.OrdinalIgnoreCase)) { return false; } switch ((array.Length > 1) ? array[1].ToLowerInvariant() : "status") { case "status": Status(); return true; case "spawn": Spawn(); return true; case "clear": Clear(); return true; case "goto": GoToCarrier(); return true; case "fly": Fly(); return true; case "out": JetControl.RequestDismount(); return true; case "seat": Seat(array); return true; case "muzzle": Muzzle(array); return true; case "cam": Cam(array); return true; case "unstick": Unstick(); return true; case "recover": Recover(); return true; case "radar": Radar(array); return true; case "keys": Keys(); return true; case "ui": Ui(); return true; case "gear": GearInfo(array); return true; case "fx": Effects(); return true; case "glow": Glow(array); return true; case "hull": Hull(array); return true; case "npcs": Npcs(); return true; case "brrrt": Brrrt(array); return true; case "buy": JetSales.Request(); return true; case "money": Money(array); return true; case "refund": Refund(); return true; default: Help(); return true; } } private static void Status() { Feedback.Say(Feedback.Value("zPaulin's A10-Warthog") + " version " + Feedback.Value("1.0.0")); if (!JetAssets.Ready) { Feedback.Warn("The model did not load. The bundle is missing from the plugin folder, and nothing will fly until it is there."); } Feedback.Say("Island " + Feedback.Value(Islands.CurrentSceneName()) + " carrier " + Feedback.Value(Carrier.Exists ? "on station" : "not here")); Feedback.Say("The A-10 is " + (JetSales.Available ? Feedback.Value("yours") : ("for sale at " + Feedback.Cash(JetSales.Price))) + " you are carrying " + Feedback.Cash(MoneyManager.Money)); Feedback.Say("Multiplayer " + Feedback.Value((!Plugin.Cfg.Multiplayer.Value) ? "off" : (JetNetwork.Live ? "connected" : "not connected")) + (JetCalm.Active ? (" " + Feedback.Value(JetCalm.Count.ToString()) + " creature(s) leaving you alone") : "")); JetVehicle local = JetVehicle.Local; if ((Object)(object)local == (Object)null) { Feedback.Say((JetVehicle.All.Count == 0) ? "No aircraft in the world yet." : (Feedback.Value(JetVehicle.All.Count.ToString()) + " aircraft in the world. You are not flying.")); return; } Feedback.Say(string.Format(CultureInfo.InvariantCulture, "Airborne at {0} km/h, {1} m up, throttle {2}.", Feedback.Value((local.Speed * 3.6f).ToString("F0", CultureInfo.InvariantCulture)), Feedback.Value(Altitude(local).ToString("F0", CultureInfo.InvariantCulture)), Feedback.Value(local.Throttle.ToString("P0", CultureInfo.InvariantCulture)))); Feedback.Say(string.Format(CultureInfo.InvariantCulture, "{0} deg of bank, {1} G, {2} rounds left.{3}{4}", Feedback.Value(JetArcade.BankAngle(local).ToString("F0", CultureInfo.InvariantCulture)), Feedback.Value(local.GLoad.ToString("F1", CultureInfo.InvariantCulture)), Feedback.Value(local.Ammo.ToString()), local.Stalled ? " Stalled." : "", local.OnGround ? " Wheels down." : "")); } private static float Altitude(JetVehicle jet) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) try { return ((Component)jet).transform.position.y - WaterManager.WaterHeight; } catch { return ((Component)jet).transform.position.y; } } private static void Spawn() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_006f: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.LocalPlayer; if ((Object)(object)localPlayer == (Object)null) { Feedback.Warn("You are not in the world yet."); return; } Vector3 val = localPlayer.Camera.CamTransform.forward; val.y = 0f; val = ((((Vector3)(ref val)).sqrMagnitude < 0.0001f) ? Vector3.forward : ((Vector3)(ref val)).normalized); Vector3 position = localPlayer.Transform.position + val * 25f + Vector3.up * Plugin.Cfg.GearHeight.Value; JetVehicle jetVehicle = JetControl.Create("Warthog_Test_" + Spawned.Count, position, Quaternion.LookRotation(val, Vector3.up)); if (!((Object)(object)jetVehicle == (Object)null)) { Spawned.Add(jetVehicle); Feedback.Say("jet placed 25 m ahead - walk up to it and press the pick-up key."); } } private static void Clear() { int num = 0; foreach (JetVehicle item in Spawned) { if (!((Object)(object)item == (Object)null)) { if ((Object)(object)item.Pilot != (Object)null) { item.Dismount(); } Object.Destroy((Object)(object)((Component)item).gameObject); num++; } } Spawned.Clear(); Feedback.Say("removed " + num + " jet(s)."); } private static void Fly() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.LocalPlayer; if ((Object)(object)localPlayer == (Object)null) { Feedback.Warn("No local player yet."); return; } JetVehicle jetVehicle = null; float num = float.MaxValue; foreach (JetVehicle item in JetVehicle.All) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.Pilot != (Object)null)) { Vector3 val = ((Component)item).transform.position - localPlayer.Transform.position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (!(sqrMagnitude >= num)) { num = sqrMagnitude; jetVehicle = item; } } } if ((Object)(object)jetVehicle == (Object)null) { Feedback.Warn("There is no free aircraft here."); } else { JetControl.RequestMount(jetVehicle, localPlayer); } } private static void GoToCarrier() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (!Carrier.Exists) { Feedback.Warn("There is no carrier here. It is stationed off " + Feedback.Value("Island5") + "."); return; } Player localPlayer = Player.LocalPlayer; if ((Object)(object)localPlayer == (Object)null) { Feedback.Warn("No local player yet."); return; } localPlayer.Movement.Teleport(Carrier.ParkingSpot.position + Vector3.up * 3f, true); Feedback.Good("On the carrier deck."); } private static void Seat(string[] parts) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (!Three(parts, out var v)) { Feedback.Say("/a10 seat "); return; } Plugin.Cfg.SeatX.Value = v.x; Plugin.Cfg.SeatY.Value = v.y; Plugin.Cfg.SeatZ.Value = v.z; RefreshAll(); Feedback.Say("seat = " + ((Vector3)(ref v)).ToString("F2", (IFormatProvider)CultureInfo.InvariantCulture)); } private static void Muzzle(string[] parts) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (!Three(parts, out var v)) { Feedback.Say("/a10 muzzle "); return; } Plugin.Cfg.MuzzleX.Value = v.x; Plugin.Cfg.MuzzleY.Value = v.y; Plugin.Cfg.MuzzleZ.Value = v.z; RefreshAll(); Feedback.Say("muzzle = " + ((Vector3)(ref v)).ToString("F2", (IFormatProvider)CultureInfo.InvariantCulture)); } private static void Cam(string[] parts) { if (parts.Length < 4 || !Num(parts[2], out var value) || !Num(parts[3], out var value2)) { Feedback.Say("/a10 cam "); return; } Plugin.Cfg.CameraDistance.Value = value; Plugin.Cfg.CameraHeight.Value = value2; Feedback.Say(string.Format(CultureInfo.InvariantCulture, "camera = {0:F1} m back, {1:F1} m up", value, value2)); } private static void RefreshAll() { foreach (JetVehicle item in JetVehicle.All) { if ((Object)(object)item != (Object)null) { item.RefreshAnchors(); } } } private static bool Three(string[] parts, out Vector3 v) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) v = Vector3.zero; if (parts.Length < 5) { return false; } if (!Num(parts[2], out v.x)) { return false; } if (!Num(parts[3], out v.y)) { return false; } if (!Num(parts[4], out v.z)) { return false; } return true; } private static bool Num(string text, out float value) { return float.TryParse(text.Replace(',', '.'), NumberStyles.Float, CultureInfo.InvariantCulture, out value); } private static void Money(string[] parts) { if (!Server()) { Feedback.Warn("only the host can print money - MoneyManager writes the till server-side and there is one till for everyone."); return; } float value; int num = ((parts.Length > 2 && Num(parts[2], out value)) ? Mathf.RoundToInt(value) : Mathf.Max(0, JetSales.Price - MoneyManager.Money)); if (num <= 0) { Feedback.Say("the till already covers it."); return; } try { MoneyManager.AddMoney(num, Player.LocalPlayer); Feedback.Say("added $" + num.ToString("N0", Feedback.Numbers) + "."); } catch (Exception ex) { Feedback.Warn("could not add money: " + ex.Message); } } private static bool Server() { try { return InstanceFinder.IsServerStarted; } catch { return true; } } private static void Refund() { JetSales.Refund(); Feedback.Say("the A-10 is back on the lot - no money returned, this is for testing."); } private static void GearInfo(string[] parts) { JetVehicle jetVehicle = JetVehicle.Local ?? JetFleet.Jet; if ((Object)(object)jetVehicle == (Object)null || jetVehicle.Gear == null) { Feedback.Warn("no jet in the world."); return; } if (parts.Length > 2) { ConfigEntry gearHandedness = Plugin.Cfg.GearHandedness; float value; if (parts[2].Equals("flip", StringComparison.OrdinalIgnoreCase)) { gearHandedness.Value = (Mathf.RoundToInt(gearHandedness.Value) + 1) % 4; } else if (Num(parts[2], out value)) { gearHandedness.Value = Mathf.Clamp(Mathf.Round(value), 0f, 3f); } jetVehicle.Gear.Rebind(); } Feedback.Say("gear: " + jetVehicle.Gear.Describe() + " key " + Plugin.Cfg.GearKey.Value); Feedback.Say("/a10 gear flip | /a10 gear <0-3>"); } private static void Hull(string[] parts) { ModConfig cfg = Plugin.Cfg; string text = ((parts.Length > 2) ? parts[2].ToLowerInvariant() : ""); switch (text) { case "debug": cfg.HullDebug.Value = !cfg.HullDebug.Value; Reshape(); Feedback.Say("hull blocks " + (cfg.HullDebug.Value ? "shown" : "hidden") + "."); return; case "on": case "off": cfg.HullSolid.Value = text == "on"; Reshape(); Feedback.Say("solid bodywork " + text + "."); return; case "body": { if (parts.Length > 6 && Num(parts[3], out var value) && Num(parts[4], out var value2) && Num(parts[5], out var value3) && Num(parts[6], out var value4)) { cfg.HullBodyWidth.Value = value; cfg.HullBodyHeight.Value = value2; cfg.HullBodyLength.Value = value3; cfg.HullBodyRise.Value = value4; Reshape(); Feedback.Say("fuselage box moved."); return; } break; } } if (text == "wing" && parts.Length > 7 && Num(parts[3], out var value5) && Num(parts[4], out var value6) && Num(parts[5], out var value7) && Num(parts[6], out var value8) && Num(parts[7], out var value9)) { cfg.HullWingSpan.Value = value5; cfg.HullWingThickness.Value = value6; cfg.HullWingChord.Value = value7; cfg.HullWingRise.Value = value8; cfg.HullWingBack.Value = value9; Reshape(); Feedback.Say("wing box moved."); } else { Feedback.Say("/a10 hull debug|on|off | hull body | hull wing "); JetVehicle jetVehicle = JetVehicle.Local ?? ((JetVehicle.All.Count > 0) ? JetVehicle.All[0] : null); if ((Object)(object)jetVehicle != (Object)null && jetVehicle.Hull != null) { Feedback.Say(jetVehicle.Hull.Describe()); } Feedback.Say("body " + Four(cfg.HullBodyWidth.Value, cfg.HullBodyHeight.Value, cfg.HullBodyLength.Value, cfg.HullBodyRise.Value) + " solid: " + (cfg.HullSolid.Value ? "yes" : "no")); Feedback.Say("wing " + Four(cfg.HullWingSpan.Value, cfg.HullWingThickness.Value, cfg.HullWingChord.Value, cfg.HullWingRise.Value) + " " + cfg.HullWingBack.Value.ToString("F2", CultureInfo.InvariantCulture)); } } private static string Four(float a, float b, float c, float d) { return a.ToString("F2", CultureInfo.InvariantCulture) + " " + b.ToString("F2", CultureInfo.InvariantCulture) + " " + c.ToString("F2", CultureInfo.InvariantCulture) + " " + d.ToString("F2", CultureInfo.InvariantCulture); } private static void Reshape() { foreach (JetVehicle item in JetVehicle.All) { if ((Object)(object)item != (Object)null && item.Hull != null) { item.Hull.Place(); } } } private static void Glow(string[] parts) { ModConfig cfg = Plugin.Cfg; if (parts.Length > 5 && Num(parts[2], out var value) && Num(parts[3], out var value2) && Num(parts[4], out var value3) && Num(parts[5], out var value4)) { cfg.TrailSpread.Value = value; cfg.TrailHeight.Value = value2; cfg.TrailBack.Value = value3; cfg.GlowSize.Value = value4; foreach (JetVehicle item in JetVehicle.All) { if ((Object)(object)item != (Object)null && item.Trails != null) { item.Trails.Place(); } } Feedback.Say("nozzles moved."); } else { Feedback.Say("/a10 glow now " + cfg.TrailSpread.Value.ToString("F2", CultureInfo.InvariantCulture) + " " + cfg.TrailHeight.Value.ToString("F2", CultureInfo.InvariantCulture) + " " + cfg.TrailBack.Value.ToString("F2", CultureInfo.InvariantCulture) + " " + cfg.GlowSize.Value.ToString("F2", CultureInfo.InvariantCulture)); } } private static void Effects() { List list = Fx.Names(); Feedback.Say("crash: " + (Fx.Explosion() ?? "none") + " impact: " + (Fx.Impact() ?? "none")); Feedback.Say(list.Count + " particle(s): " + Fx.Join(list)); List list2 = Fx.Sounds(); Feedback.Say(list2.Count + " sound(s), full list in the log."); foreach (string item in list2) { Plugin.Log.LogInfo((object)("clip: " + item)); } } private static void Npcs() { List list = Vendor.Islanders(); Feedback.Say("wanted: '" + Plugin.Cfg.VendorNpc.Value + "'"); Feedback.Say(list.Count + " NPC(s): " + Vendor.Names(list)); } private static void Brrrt(string[] parts) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00e8: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) JetVehicle jetVehicle = JetFleet.Jet ?? JetVehicle.Local; if ((Object)(object)jetVehicle == (Object)null) { Feedback.Warn("no jet in the world to fire."); return; } float value; float num = ((parts.Length > 2 && Num(parts[2], out value)) ? Mathf.Clamp(value, 0.2f, 30f) : 3f); Player localPlayer = Player.LocalPlayer; if ((Object)(object)localPlayer == (Object)null) { Feedback.Warn("no local player."); return; } Vector3 val = (((Object)(object)jetVehicle.Muzzle != (Object)null) ? jetVehicle.Muzzle.position : ((Component)jetVehicle).transform.position); Vector3 val2 = localPlayer.Transform.position - val; Vector3 val3 = localPlayer.Transform.position - ((Vector3)(ref val2)).normalized * 7f; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3 + Vector3.up * 30f, Vector3.down, ref val4, 120f, LayerMask.op_Implicit(GameInfo.CanJumpOnLayers), (QueryTriggerInteraction)1)) { val3 = ((RaycastHit)(ref val4)).point; } JetCannon.Demo(jetVehicle, val3, num); Feedback.Say(string.Format(CultureInfo.InvariantCulture, "firing at the ground {0:F0} m off for {1:F1} s. {2}", Vector3.Distance(val3, localPlayer.Transform.position), num, JetAudio.CannonReport())); } private static void Ui() { Feedback.Say("hide stats: " + Plugin.Cfg.HideVanillaStats.Value + " hide hotbar: " + Plugin.Cfg.HideHotbar.Value); Feedback.Say(VanillaHud.StatsReport); } private static void Keys() { Feedback.Say("pitch W/S = " + JetInput.Binding("PlayerMove") + " throttle = " + Plugin.Cfg.ThrottleUpKey.Value + "/" + Plugin.Cfg.ThrottleDownKey.Value); Feedback.Say("roll A/D = same axis cannon = " + JetInput.Binding("PlayerLeftClick")); Feedback.Say("rudder left (" + Plugin.Cfg.RudderLeftAction.Value + ") = " + JetInput.Binding(Plugin.Cfg.RudderLeftAction.Value)); Feedback.Say("rudder right (" + Plugin.Cfg.RudderRightAction.Value + ") = " + JetInput.Binding(Plugin.Cfg.RudderRightAction.Value)); Feedback.Say("exit = " + Plugin.Cfg.ExitKey.Value + " brakes = " + JetInput.Binding("PlayerJump") + " gear = " + Plugin.Cfg.GearKey.Value); } private static void Radar(string[] parts) { float value; float value2; float value3; float value4; float value5; if (parts.Length > 2 && parts[2].Equals("retry", StringComparison.OrdinalIgnoreCase)) { JetRadar.Retry(); Feedback.Say("radar will be rebuilt on the next frame in the cockpit."); } else if (parts.Length > 3 && parts[2].Equals("chrome", StringComparison.OrdinalIgnoreCase) && Num(parts[3], out value)) { Plugin.Cfg.RadarChrome.Value = Mathf.Clamp01(value); JetRadar.Apply(); Feedback.Say("radar rings and sweep at " + Mathf.Clamp01(value).ToString("P0") + "."); } else if (parts.Length > 3 && parts[2].Equals("corner", StringComparison.OrdinalIgnoreCase)) { Plugin.Cfg.RadarCorner.Value = parts[3]; JetRadar.Relayout(); Feedback.Say("radar moved to " + Plugin.Cfg.RadarCorner.Value + "."); } else if (parts.Length > 3 && parts[2].Equals("range", StringComparison.OrdinalIgnoreCase) && Num(parts[3], out value2)) { Plugin.Cfg.RadarRange.Value = Mathf.Max(50f, value2); Feedback.Say("radar range " + Mathf.Max(50f, value2).ToString("F0") + " m."); } else if (parts.Length > 3 && parts[2].Equals("sweep", StringComparison.OrdinalIgnoreCase) && Num(parts[3], out value3)) { Plugin.Cfg.RadarSweepSpeed.Value = value3; JetRadar.Apply(); Feedback.Say("radar sweep at " + value3.ToString("F2") + " turns per second."); } else if (parts.Length > 3 && Num(parts[2], out value4) && Num(parts[3], out value5)) { Plugin.Cfg.RadarPixels.Value = value4; Plugin.Cfg.RadarMargin.Value = value5; JetRadar.Relayout(); Feedback.Say("radar resized."); } else { Feedback.Say("radar: " + JetRadar.Describe()); Feedback.Say("/a10 radar | corner | range | chrome <0-1> | sweep | retry"); } } private static void Recover() { if (!JetSales.Available) { Feedback.Warn("Nothing to recover - the A-10 has not been bought yet."); return; } JetFleet.OnIslandLoaded(); Feedback.Say(Carrier.Exists ? "a fresh jet is on the deck." : "a fresh jet is waiting by the shore."); } private static void Unstick() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) JetVehicle local = JetVehicle.Local; if ((Object)(object)local != (Object)null) { local.Dismount(); } GameFlags.Release(); JetInput.Reset(); try { ShaderManager.UpdateVignette(0f, Color.black); } catch { } Player localPlayer = Player.LocalPlayer; if ((Object)(object)localPlayer != (Object)null) { localPlayer.Rigidbody.isKinematic = false; } Feedback.Say("released flight state - punching, pickup and movement are back."); } private static void Help() { Feedback.Say("/a10 status | spawn | clear | goto | fly | out | recover | radar | keys | ui | buy | money | refund | gear | fx | glow | npcs | brrrt | unstick"); Feedback.Say("/a10 seat | muzzle | cam "); } } public static class Feedback { private enum Tone { Info, Good, Bad } public static readonly CultureInfo Numbers = CultureInfo.InvariantCulture; private static readonly Regex Tags = new Regex("<[^>]+>", RegexOptions.Compiled); private static bool? _rich; public static void Say(string message) { Write(Tone.Info, message); } public static void Good(string message) { Write(Tone.Good, message); } public static void Warn(string message) { Write(Tone.Bad, message); } public static string Key(string key) { return Paint((Plugin.Cfg == null) ? "FFFFFF" : Plugin.Cfg.ChatKeyColour.Value, "" + key + ""); } public static string Value(string value) { return Paint((Plugin.Cfg == null) ? "FFFFFF" : Plugin.Cfg.ChatValueColour.Value, value); } public static string Value(int value) { return Value(value.ToString("N0", Numbers)); } public static string Cash(int amount) { return Value("$" + amount.ToString("N0", Numbers)); } private static void Write(Tone tone, string message) { string text = Tags.Replace(message, ""); if (tone == Tone.Bad) { Plugin.Log.LogWarning((object)text); } else { Plugin.Log.LogDebug((object)text); } if (Plugin.Cfg == null || !Plugin.Cfg.ChatFeedback.Value) { return; } try { ChatManager.ChatMessage(Rich() ? Decorate(tone, message) : ("[A-10] " + text)); } catch { } } private static string Decorate(Tone tone, string message) { ModConfig cfg = Plugin.Cfg; string hex = ((tone == Tone.Bad) ? cfg.ChatWarnColour.Value : cfg.ChatTagColour.Value); return Paint(hex, "A-10") + " " + ((tone == Tone.Info) ? message : Paint(hex, message)); } private static string Paint(string hex, string body) { return "" + body + ""; } private static bool Rich() { if (_rich.HasValue) { return _rich.Value; } if (Plugin.Cfg != null && !Plugin.Cfg.ChatRichText.Value) { _rich = false; return false; } try { Type typeFromHandle = typeof(ChatManager); object obj = typeFromHandle.GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null); if (obj == null) { return true; } object? obj2 = typeFromHandle.GetField("_messageText", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(obj); TextMeshProUGUI val = (TextMeshProUGUI)((obj2 is TextMeshProUGUI) ? obj2 : null); _rich = (Object)(object)val == (Object)null || ((TMP_Text)val).richText; } catch { _rich = true; } return _rich.Value; } } public static class Fx { private static string _explosion; private static string _impact; private static bool _looked; private static bool _lookedImpact; public static string Explosion() { if (_looked) { return _explosion; } _looked = true; List list = Names(); if (list.Count == 0) { return null; } string value = Plugin.Cfg.CrashParticle.Value; if (!string.IsNullOrEmpty(value)) { foreach (string item in list) { if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase)) { return _explosion = item; } } Plugin.Log.LogWarning((object)("No particle called '" + value + "'. /a10 fx lists them.")); } foreach (string item2 in list) { string text = item2.ToLowerInvariant(); if (text.Contains("explos") && !text.Contains("blood") && !text.Contains("water") && !text.Contains("lava")) { return _explosion = item2; } } Plugin.Log.LogWarning((object)("No explosion particle found among: " + Join(list))); return null; } public static string Impact() { if (_lookedImpact) { return _impact; } _lookedImpact = true; List list = Names(); string value = Plugin.Cfg.ImpactParticle.Value; if (!string.IsNullOrEmpty(value)) { foreach (string item in list) { if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase)) { return _impact = item; } } Plugin.Log.LogWarning((object)("No particle called '" + value + "'. /a10 fx lists them.")); } string[] array = new string[5] { "dirt", "debris", "dust", "ground", "rock" }; foreach (string value2 in array) { foreach (string item2 in list) { if (item2.ToLowerInvariant().Contains(value2)) { return _impact = item2; } } } return _impact = Explosion(); } public static List Sounds() { List list = new List(); try { if (typeof(AudioManager).GetField("_realClips", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null) is IDictionary dictionary) { foreach (object key in dictionary.Keys) { list.Add(key.ToString()); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not read the clip list: " + ex.Message)); } list.Sort(); return list; } public static List Names() { List list = new List(); try { if (typeof(ParticleManager).GetField("_particles", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null) is IDictionary dictionary) { foreach (object key in dictionary.Keys) { list.Add(key.ToString()); } } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not read the particle list: " + ex.Message)); } list.Sort(); return list; } public static void Forget() { _looked = (_lookedImpact = false); _explosion = (_impact = null); } public static string Join(List names) { if (names.Count != 0) { return string.Join(", ", names.ToArray()); } return "(none)"; } } public static class GameFlags { private static readonly PropertyInfo DrivingLocally = typeof(Boat).GetProperty("IsDrivingLocally", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); private static bool _raisedByUs; private static bool _warned; public static bool RaisedByUs => _raisedByUs; public static void Raise() { if (Write(value: true)) { _raisedByUs = true; } } public static void Release() { if (_raisedByUs) { Write(value: false); _raisedByUs = false; } } private static bool Write(bool value) { MethodInfo methodInfo = DrivingLocally?.GetSetMethod(nonPublic: true); if (methodInfo == null) { if (!_warned) { _warned = true; Plugin.Log.LogWarning((object)"Boat.IsDrivingLocally has no reachable setter; ground actions stay live while flying."); } return false; } methodInfo.Invoke(null, new object[1] { value }); return true; } public static bool IsDriving() { try { return Boat.IsDrivingLocally; } catch { return false; } } } public static class ImpactFx { private class Spark { public LineRenderer Line; public Vector3 From; public Vector3 Velocity; public float Life; public float Span; } private class Puff { public Transform Root; public SpriteRenderer Sprite; public float Life; public float Size; } private static readonly List LiveSparks = new List(); private static readonly Queue SparkPool = new Queue(); private static readonly List LivePuffs = new List(); private static readonly Queue PuffPool = new Queue(); private static Transform _root; private static Material _material; public static void Burst(Vector3 point, Vector3 normal) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) ModConfig cfg = Plugin.Cfg; SpawnPuff(point + normal * 0.2f, cfg); int num = Mathf.RoundToInt(cfg.ImpactSparks.Value); for (int i = 0; i < num; i++) { Vector3 val = Random.insideUnitSphere * 0.8f; Vector3 val2 = normal + val; Vector3 normalized = ((Vector3)(ref val2)).normalized; SpawnSpark(point, normalized * Random.Range(cfg.ImpactSparkSpeed.Value * 0.4f, cfg.ImpactSparkSpeed.Value), cfg); } } public static void Tick() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0084: 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_0093: 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_00a3: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ec: 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_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_012e: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: 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_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; ModConfig cfg = Plugin.Cfg; for (int num = LiveSparks.Count - 1; num >= 0; num--) { Spark spark = LiveSparks[num]; spark.Life -= deltaTime; if (spark.Life <= 0f || (Object)(object)spark.Line == (Object)null) { RetireSpark(num); } else { spark.Velocity += Vector3.down * 22f * deltaTime; spark.From += spark.Velocity * deltaTime; float num2 = Mathf.Clamp01(spark.Life / Mathf.Max(spark.Span, 0.01f)); Vector3 val = spark.Velocity * 0.03f; spark.Line.SetPosition(0, spark.From - val); spark.Line.SetPosition(1, spark.From); Color val2 = Mat.Parse(cfg.ImpactSparkColour.Value, new Color(1f, 0.72f, 0.3f)); val2.a = num2; spark.Line.startColor = val2; spark.Line.endColor = new Color(val2.r, val2.g, val2.b, 0f); spark.Line.widthMultiplier = cfg.ImpactSparkWidth.Value * num2; } } Camera main = Camera.main; for (int num3 = LivePuffs.Count - 1; num3 >= 0; num3--) { Puff puff = LivePuffs[num3]; puff.Life -= deltaTime; if (puff.Life <= 0f || (Object)(object)puff.Root == (Object)null) { RetirePuff(num3); } else { float num4 = 1f - Mathf.Clamp01(puff.Life / Mathf.Max(puff.Size, 0.01f)); puff.Root.localScale = Vector3.one * cfg.ImpactPuffSize.Value * (0.35f + num4 * 1.6f); Transform root = puff.Root; root.position += Vector3.up * (1.4f * deltaTime); if ((Object)(object)main != (Object)null) { puff.Root.rotation = Quaternion.LookRotation(puff.Root.position - ((Component)main).transform.position); } Color color = Mat.Parse(cfg.ImpactPuffColour.Value, new Color(0.28f, 0.24f, 0.19f)); color.a *= 1f - num4; puff.Sprite.color = color; } } } private static void SpawnSpark(Vector3 at, Vector3 velocity, ModConfig cfg) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) Spark spark = null; while (SparkPool.Count > 0 && spark == null) { Spark spark2 = SparkPool.Dequeue(); if ((Object)(object)spark2.Line != (Object)null) { spark = spark2; } } if (spark == null) { GameObject val = new GameObject("Spark"); val.transform.SetParent(Root(), false); LineRenderer val2 = val.AddComponent(); val2.positionCount = 2; val2.useWorldSpace = true; val2.numCapVertices = 0; ((Renderer)val2).material = Material(); val2.alignment = (LineAlignment)0; ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; spark = new Spark { Line = val2 }; } spark.From = at; spark.Velocity = velocity; spark.Span = cfg.ImpactSparkLife.Value; spark.Life = spark.Span; ((Renderer)spark.Line).enabled = true; LiveSparks.Add(spark); } private static void SpawnPuff(Vector3 at, ModConfig cfg) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown Puff puff = null; while (PuffPool.Count > 0 && puff == null) { Puff puff2 = PuffPool.Dequeue(); if ((Object)(object)puff2.Root != (Object)null) { puff = puff2; } } if (puff == null) { GameObject val = new GameObject("Puff"); val.transform.SetParent(Root(), false); SpriteRenderer val2 = val.AddComponent(); val2.sprite = Textures.Disc(96); ((Renderer)val2).material = Material(); puff = new Puff { Root = val.transform, Sprite = val2 }; } puff.Root.position = at; puff.Size = cfg.ImpactPuffLife.Value; puff.Life = puff.Size; ((Renderer)puff.Sprite).enabled = true; LivePuffs.Add(puff); } private static void RetireSpark(int index) { Spark spark = LiveSparks[index]; if ((Object)(object)spark.Line != (Object)null) { ((Renderer)spark.Line).enabled = false; } LiveSparks.RemoveAt(index); SparkPool.Enqueue(spark); } private static void RetirePuff(int index) { Puff puff = LivePuffs[index]; if ((Object)(object)puff.Sprite != (Object)null) { ((Renderer)puff.Sprite).enabled = false; } LivePuffs.RemoveAt(index); PuffPool.Enqueue(puff); } private static Transform Root() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown if ((Object)(object)_root != (Object)null) { return _root; } GameObject val = new GameObject("A10_Impacts") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); _root = val.transform; return _root; } private static Material Material() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown if ((Object)(object)_material != (Object)null) { return _material; } Shader val = Shader.Find("Sprites/Default"); if ((Object)(object)val == (Object)null) { val = Shader.Find("Universal Render Pipeline/Unlit"); } _material = new Material(val) { hideFlags = (HideFlags)61 }; _material.renderQueue = 3000; return _material; } public static void Clear() { LiveSparks.Clear(); SparkPool.Clear(); LivePuffs.Clear(); PuffPool.Clear(); if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)((Component)_root).gameObject); } _root = null; } } public static class Islands { public const string CarrierIsland = "Island5"; public static string CurrentSceneName() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < SceneManager.sceneCount; i++) { Scene sceneAt = SceneManager.GetSceneAt(i); if (((Scene)(ref sceneAt)).isLoaded && ((Scene)(ref sceneAt)).name.StartsWith("Island")) { return ((Scene)(ref sceneAt)).name; } } return "(none)"; } public static bool IsCarrierIsland(string sceneName) { return string.Equals(sceneName, "Island5", StringComparison.OrdinalIgnoreCase); } } public static class JetArcade { private static bool _seeded; public static Vector3 AimDirection { get; private set; } = Vector3.forward; public static void Reset() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _seeded = false; AimDirection = Vector3.forward; } public static void Aim(JetVehicle jet, Vector2 mouseDelta, bool freeLook, float keyPitch) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_00ee: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: 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_008f: 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_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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)jet == (Object)null) { return; } ModConfig cfg = Plugin.Cfg; Vector3 forward = ((Component)jet).transform.forward; if (!_seeded) { AimDirection = forward; _seeded = true; } if (!freeLook && (((Vector2)(ref mouseDelta)).sqrMagnitude > 0f || Mathf.Abs(keyPitch) > 0f)) { Quaternion val = Basis(jet); float value = cfg.Sensitivity.Value; AimDirection = Quaternion.AngleAxis(mouseDelta.x * value, val * Vector3.up) * AimDirection; AimDirection = Quaternion.AngleAxis((0f - mouseDelta.y) * value, val * Vector3.right) * AimDirection; if (Mathf.Abs(keyPitch) > 0f) { AimDirection = Quaternion.AngleAxis(keyPitch, ((Component)jet).transform.right) * AimDirection; } } Vector3 aimDirection = AimDirection; AimDirection = ((Vector3)(ref aimDirection)).normalized; float value2 = cfg.Cone.Value; if (Vector3.Angle(forward, AimDirection) > value2) { AimDirection = Vector3.RotateTowards(forward, AimDirection, value2 * ((float)Math.PI / 180f), 0f); } } private static Quaternion Basis(JetVehicle jet) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (JetCamera.Active) { return JetCamera.Frame; } Vector3 forward = ((Component)jet).transform.forward; Vector3 val = ((Mathf.Abs(forward.y) > 0.985f) ? ((Component)jet).transform.up : Vector3.up); return Quaternion.LookRotation(forward, val); } public static float LateralError(JetVehicle jet) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(Vector3.up, ((Component)jet).transform.forward); if (((Vector3)(ref val)).sqrMagnitude < 0.001f) { return 0f; } ((Vector3)(ref val)).Normalize(); return Mathf.Asin(Mathf.Clamp(Vector3.Dot(AimDirection, val), -1f, 1f)) * 57.29578f; } public static float BankAngle(JetVehicle jet) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) Vector3 forward = ((Component)jet).transform.forward; Vector3 val = Vector3.Cross(Vector3.up, forward); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { return 0f; } ((Vector3)(ref val)).Normalize(); Vector3 val2 = Vector3.Cross(forward, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; return (0f - Mathf.Atan2(Vector3.Dot(((Component)jet).transform.right, normalized), Vector3.Dot(((Component)jet).transform.right, val))) * 57.29578f; } } public static class JetAssets { private static GameObject _prefab; public static bool Ready => (Object)(object)_prefab != (Object)null; public static void Load(object plugin) { BundleLoader.Log = Plugin.Log; AssetBundle val = BundleLoader.Load(plugin, "warthog.bundle"); if (!((Object)(object)val == (Object)null)) { _prefab = BundleLoader.Prefab(val, "Warthog"); if (!((Object)(object)_prefab == (Object)null)) { Plugin.Log.LogDebug((object)"Jet model loaded from warthog.bundle"); } } } public static GameObject CreateJet(string name) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_008a: 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_00a9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_prefab == (Object)null) { Plugin.Log.LogError((object)"Cannot create a jet: the model never loaded."); return null; } GameObject val = new GameObject(name); GameObject obj = Object.Instantiate(_prefab, val.transform); ((Object)obj).name = "Model"; ModConfig cfg = Plugin.Cfg; Quaternion val2 = Quaternion.Euler(0f, cfg.YawOffset.Value, 0f); obj.transform.localRotation = val2; obj.transform.localPosition = val2 * (cfg.Pivot * cfg.Scale.Value); obj.transform.localScale = Vector3.one * cfg.Scale.Value; return val; } public static Bounds BoundsOf(GameObject jet) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = jet.GetComponentsInChildren(true); if (componentsInChildren.Length == 0) { return new Bounds(jet.transform.position, Vector3.zero); } Bounds bounds = componentsInChildren[0].bounds; for (int i = 1; i < componentsInChildren.Length; i++) { ((Bounds)(ref bounds)).Encapsulate(componentsInChildren[i].bounds); } return bounds; } } public static class JetAudio { public const string ClipFile = "a10-engine.wav"; public const string CannonFile = "a10-cannon.wav"; public const string CannonStartFile = "a10-cannon-start.wav"; public const string CannonStopFile = "a10-cannon-stop.wav"; public const string CannonCockpitFile = "a10-cannon-cockpit.wav"; private static AudioClip _clip; private static AudioClip _cannon; private static AudioClip _cannonStart; private static AudioClip _cannonStop; private static AudioClip _cannonCockpit; private static bool _tried; private static AudioMixerGroup _fx; public static bool Ready => (Object)(object)_clip != (Object)null; public static bool CannonReady => (Object)(object)_cannon != (Object)null; public static AudioClip CannonStart => _cannonStart; public static AudioClip CannonStop => _cannonStop; public static string CannonReport() { StringBuilder stringBuilder = new StringBuilder(); if ((Object)(object)_cannonStart == (Object)null) { stringBuilder.Append("a10-cannon-start.wav").Append(' '); } if ((Object)(object)_cannon == (Object)null) { stringBuilder.Append("a10-cannon.wav").Append(' '); } if ((Object)(object)_cannonStop == (Object)null) { stringBuilder.Append("a10-cannon-stop.wav").Append(' '); } if (stringBuilder.Length != 0) { return "missing: " + stringBuilder.ToString().Trim(); } return "all three clips loaded."; } public static IEnumerator Load(string folder) { if (!_tried) { _tried = true; yield return LoadOne(folder, "a10-engine.wav", "A10Engine", delegate(AudioClip clip) { _clip = clip; }); yield return LoadOne(folder, "a10-cannon.wav", "A10Cannon", delegate(AudioClip clip) { _cannon = clip; }); yield return LoadOne(folder, "a10-cannon-start.wav", "A10CannonStart", delegate(AudioClip clip) { _cannonStart = clip; }); yield return LoadOne(folder, "a10-cannon-stop.wav", "A10CannonStop", delegate(AudioClip clip) { _cannonStop = clip; }); yield return LoadOne(folder, "a10-cannon-cockpit.wav", "A10CannonCockpit", delegate(AudioClip clip) { _cannonCockpit = clip; }); } } private static IEnumerator LoadOne(string folder, string file, string name, Action assign) { string text = Path.Combine(folder, file); if (!File.Exists(text)) { Plugin.Log.LogDebug((object)(file + " not present - that sound stays silent. Drop the file next to the plugin to enable it.")); yield break; } string text2 = "file:///" + text.Replace(Path.DirectorySeparatorChar, '/'); UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip(text2, TypeOf(text)); try { yield return request.SendWebRequest(); if ((int)request.result != 1) { Plugin.Log.LogWarning((object)(file + " failed to load: " + request.error)); yield break; } AudioClip content = DownloadHandlerAudioClip.GetContent(request); if ((Object)(object)content == (Object)null) { Plugin.Log.LogWarning((object)(file + " decoded to nothing.")); yield break; } ((Object)content).name = name; assign(content); Plugin.Log.LogDebug((object)(file + " loaded (" + content.length.ToString("F2") + " s).")); } finally { ((IDisposable)request)?.Dispose(); } } private static AudioType TypeOf(string path) { string text = Path.GetExtension(path).ToLowerInvariant(); if (!(text == ".mp3")) { if (!(text == ".ogg")) { return (AudioType)20; } return (AudioType)14; } return (AudioType)13; } public static AudioMixerGroup FxGroup() { if ((Object)(object)_fx != (Object)null) { return _fx; } try { Type typeFromHandle = typeof(AudioManager); object obj = typeFromHandle.GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null); if (obj == null) { return null; } object? obj2 = typeFromHandle.GetField("_fxGroup", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(obj); _fx = (AudioMixerGroup)((obj2 is AudioMixerGroup) ? obj2 : null); } catch (Exception ex) { Plugin.Log.LogWarning((object)("No audio mixer group, the volume slider will not reach the jet: " + ex.Message)); } return _fx; } public static void Route(AudioSource source) { if (!((Object)(object)source == (Object)null) && !((Object)(object)source.outputAudioMixerGroup != (Object)null)) { source.outputAudioMixerGroup = FxGroup(); } } public static AudioSource AttachOneShot(Transform parent) { if ((Object)(object)_cannonStart == (Object)null && (Object)(object)_cannonStop == (Object)null) { return null; } AudioSource obj = Gun("CannonOneShot", parent); obj.loop = false; Route(obj); return obj; } public static AudioSource AttachCannon(Transform parent) { if ((Object)(object)_cannon == (Object)null) { return null; } AudioSource obj = Gun("CannonAudio", parent); obj.clip = _cannon; obj.loop = true; obj.volume = 0f; Route(obj); return obj; } public static AudioSource AttachCockpit(Transform parent) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown if ((Object)(object)_cannon == (Object)null) { return null; } GameObject val = new GameObject("CannonCockpit"); val.transform.SetParent(parent, false); AudioSource obj = val.AddComponent(); obj.clip = (((Object)(object)_cannonCockpit != (Object)null) ? _cannonCockpit : _cannon); obj.loop = true; obj.playOnAwake = false; obj.volume = 0f; obj.spatialBlend = 0f; obj.dopplerLevel = 0f; val.AddComponent().cutoffFrequency = Plugin.Cfg.CockpitCutoff.Value; Route(obj); return obj; } private static AudioSource Gun(string name, Transform parent) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown ModConfig cfg = Plugin.Cfg; GameObject val = new GameObject(name); val.transform.SetParent(parent, false); AudioSource obj = val.AddComponent(); obj.playOnAwake = false; obj.spatialBlend = cfg.CannonSpatialBlend.Value; obj.rolloffMode = (AudioRolloffMode)0; obj.minDistance = cfg.CannonNearDistance.Value; obj.maxDistance = cfg.CannonRange.Value; obj.dopplerLevel = 1f; if (cfg.CannonEcho.Value > 0f) { AudioEchoFilter obj2 = val.AddComponent(); obj2.delay = cfg.CannonEchoDelay.Value; obj2.decayRatio = cfg.CannonEchoDecay.Value; obj2.wetMix = cfg.CannonEcho.Value; obj2.dryMix = 1f; } val.AddComponent().cutoffFrequency = 22000f; Route(obj); return obj; } public static AudioSource Attach(Transform parent) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_clip == (Object)null) { return null; } GameObject val = new GameObject("EngineAudio"); val.transform.SetParent(parent, false); ModConfig cfg = Plugin.Cfg; AudioSource obj = val.AddComponent(); obj.clip = _clip; obj.loop = true; obj.playOnAwake = false; obj.volume = 0f; obj.spatialBlend = cfg.EngineSpatialBlend.Value; obj.rolloffMode = (AudioRolloffMode)0; obj.minDistance = cfg.EngineNearDistance.Value; obj.maxDistance = cfg.EngineRange.Value; obj.dopplerLevel = cfg.EngineDoppler.Value; Route(obj); return obj; } } public static class JetCalm { private class Saved { public FieldInfo[] Info; public float[] Values; } private static readonly string[] Fields = new string[5] { "_towardsPlayerForce", "_airTowardsPlayerForce", "_constantTowardsPlayerForce", "_flyForceTowardsPlayer", "_flyForceTowardsPlayer2" }; private static readonly Dictionary Held = new Dictionary(); private static readonly Dictionary Layouts = new Dictionary(); private static float _next; private static bool _active; public static bool Active => _active; public static int Count => Held.Count; public static void Tick() { ModConfig cfg = Plugin.Cfg; if (cfg == null) { return; } if (!cfg.CalmCreatures.Value) { if (_active) { Release(); } } else { if (Time.time < _next) { return; } _next = Time.time + 0.5f; if (!ShouldCalm(cfg)) { if (_active) { Release(); } } else { _active = true; Sweep(); } } } private static bool ShouldCalm(ModConfig cfg) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)JetVehicle.Local != (Object)null) { return true; } float value = cfg.CalmAltitude.Value; if (value <= 0f) { return false; } float waterHeight; try { waterHeight = WaterManager.WaterHeight; } catch { return false; } try { foreach (Player alivePlayer in PlayerManager.AlivePlayers) { if ((Object)(object)alivePlayer != (Object)null && (Object)(object)alivePlayer.Transform != (Object)null && alivePlayer.Transform.position.y - waterHeight > value) { return true; } } } catch { } return false; } private static void Sweep() { AttackingFish[] array = Object.FindObjectsByType((FindObjectsInactive)0, (FindObjectsSortMode)0); foreach (AttackingFish val in array) { if ((Object)(object)val == (Object)null || Held.ContainsKey((Component)(object)val)) { continue; } FieldInfo[] array2 = Layout(((object)val).GetType()); if (array2.Length != 0) { float[] array3 = new float[array2.Length]; for (int j = 0; j < array2.Length; j++) { array3[j] = (float)array2[j].GetValue(val); array2[j].SetValue(val, 0f); } Held[(Component)(object)val] = new Saved { Info = array2, Values = array3 }; } } } public static void Release() { foreach (KeyValuePair item in Held) { if (!((Object)(object)item.Key == (Object)null)) { Saved value = item.Value; for (int i = 0; i < value.Info.Length; i++) { value.Info[i].SetValue(item.Key, value.Values[i]); } } } Held.Clear(); _active = false; } private static FieldInfo[] Layout(Type type) { if (Layouts.TryGetValue(type, out var value)) { return value; } List list = new List(); string[] fields = Fields; foreach (string name in fields) { FieldInfo fieldInfo = Find(type, name); if (fieldInfo != null && fieldInfo.FieldType == typeof(float)) { list.Add(fieldInfo); } } FieldInfo[] array = list.ToArray(); Layouts[type] = array; Plugin.Log.LogDebug((object)("Calm: " + type.Name + " exposes " + array.Length + " chase force(s).")); return array; } private static FieldInfo Find(Type type, string name) { Type type2 = type; while (type2 != null) { FieldInfo field = type2.GetField(name, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { return field; } type2 = type2.BaseType; } return null; } } public static class JetCamera { private static readonly FieldInfo RotField = typeof(PlayerCamera).GetField("_rot", BindingFlags.Instance | BindingFlags.NonPublic); private static JetVehicle _jet; private static Quaternion _smoothed = Quaternion.identity; private static Vector3 _up = Vector3.up; private static Vector3 _prevForward = Vector3.forward; private static Vector3 _prevJetUp = Vector3.up; private static Vector2 _free; private static float _originalFov; private static bool _active; public static Quaternion Frame { get; private set; } = Quaternion.identity; public static bool Active => _active; public static void Begin(JetVehicle jet) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) _jet = jet; _free = Vector2.zero; _smoothed = ((Component)jet).transform.rotation; _up = Vector3.up; Frame = ((Component)jet).transform.rotation; _prevForward = ((Component)jet).transform.forward; _prevJetUp = ((Component)jet).transform.up; Camera val = Camera(); _originalFov = (((Object)(object)val != (Object)null) ? val.fieldOfView : 0f); _active = true; } public static void End() { Camera val = Camera(); if ((Object)(object)val != (Object)null && _originalFov > 0f) { val.fieldOfView = _originalFov; } _jet = null; _active = false; } public static void Tick() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_010e: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0144: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: 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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) if (!_active || (Object)(object)_jet == (Object)null || !_jet.FlownLocally) { return; } Player localPlayer = Player.LocalPlayer; if ((Object)(object)localPlayer == (Object)null || (Object)(object)localPlayer.Camera == (Object)null) { return; } Transform camTransform = localPlayer.Camera.CamTransform; if (!((Object)(object)camTransform == (Object)null)) { ModConfig cfg = Plugin.Cfg; float deltaTime = Time.deltaTime; if (JetInput.FreeLook) { _free += JetInput.FreeLookDelta * cfg.FreeLookSensitivity.Value; _free.y = Mathf.Clamp(_free.y, -80f, 80f); } else { _free = Vector2.MoveTowards(_free, Vector2.zero, 220f * deltaTime); } Quaternion val = Upright(((Component)_jet).transform.forward, deltaTime, cfg); Quaternion val2 = AimLead(val, val, cfg); _smoothed = Quaternion.Slerp(_smoothed, val2, Mathf.Clamp01(deltaTime * cfg.CameraLag.Value)); Frame = _smoothed; Quaternion val3 = (camTransform.rotation = _smoothed * Quaternion.Euler(0f - _free.y, _free.x, 0f)); camTransform.position = ((Component)_jet).transform.position - val3 * Vector3.forward * cfg.CameraDistance.Value + val3 * Vector3.up * cfg.CameraHeight.Value; Vector3 eulerAngles = ((Quaternion)(ref val3)).eulerAngles; RotField?.SetValue(localPlayer.Camera, (object)new Vector3(Mathf.DeltaAngle(0f, eulerAngles.x), eulerAngles.y, 0f)); Camera val5 = Camera(); if (!((Object)(object)val5 == (Object)null) && !(_originalFov <= 0f)) { float num = Mathf.Clamp01(_jet.Speed / Mathf.Max(cfg.MaxSpeed.Value, 1f)); val5.fieldOfView = Mathf.Lerp(val5.fieldOfView, _originalFov + cfg.CameraFovBoost.Value * num, deltaTime * 4f); } } } private static Quaternion Upright(Vector3 forward, float dt, ModConfig cfg) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) //IL_001d: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Quaternion.FromToRotation(_prevForward, forward) * _up; _prevForward = forward; val -= forward * Vector3.Dot(val, forward); if (((Vector3)(ref val)).sqrMagnitude < 1E-06f) { val = Vector3.Cross(forward, Vector3.right); if (((Vector3)(ref val)).sqrMagnitude < 1E-06f) { val = Vector3.Cross(forward, Vector3.forward); } } ((Vector3)(ref val)).Normalize(); Vector3 up = ((Component)_jet).transform.up; Vector3 val2 = Vector3.ProjectOnPlane(_prevJetUp, forward); Vector3 val3 = Vector3.ProjectOnPlane(up, forward); if (((Vector3)(ref val2)).sqrMagnitude > 1E-06f && ((Vector3)(ref val3)).sqrMagnitude > 1E-06f) { val = Quaternion.AngleAxis(Vector3.SignedAngle(val2, val3, forward) * cfg.CameraRollFollow.Value, forward) * val; } _prevJetUp = up; Vector3 val4 = Vector3.up - forward * Vector3.Dot(Vector3.up, forward); if (((Vector3)(ref val4)).sqrMagnitude > 0.0001f) { float num = Vector3.SignedAngle(((Vector3)(ref val4)).normalized, val, forward); float num2 = cfg.CameraLevelRate.Value * (1f - Mathf.Abs(forward.y)) * dt; val = Quaternion.AngleAxis(0f - Mathf.Clamp(num, 0f - num2, num2), forward) * val; } _up = val; return Quaternion.LookRotation(forward, val); } private static Quaternion AimLead(Quaternion target, Quaternion upright, ModConfig cfg) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0054: Unknown result type (might be due to invalid IL or missing references) if (cfg.CameraAimFollow.Value <= 0f) { return target; } Vector3 aimDirection = JetArcade.AimDirection; if (((Vector3)(ref aimDirection)).sqrMagnitude < 0.5f) { return target; } Vector3 val = _up - aimDirection * Vector3.Dot(_up, aimDirection); if (((Vector3)(ref val)).sqrMagnitude < 1E-06f) { return target; } Quaternion val2 = Quaternion.Inverse(upright) * target; return Quaternion.Slerp(target, Quaternion.LookRotation(aimDirection, ((Vector3)(ref val)).normalized) * val2, cfg.CameraAimFollow.Value); } private static Camera Camera() { Player localPlayer = Player.LocalPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Object)(object)localPlayer.Camera == (Object)null)) { return localPlayer.Camera.Cam; } return null; } } public static class JetCannon { private static WeaponInfo _info; private static int _typeCount = -1; private static float _nextGroup; private static float _reloadUntil; private static bool _warnedNoManager; private static float _lastShot = -99f; private static float _demoUntil; private static Vector3 _demoTarget; private static JetVehicle _demoJet; public static bool Firing => Time.time - _lastShot < 0.15f; public static bool Reloading => Time.time < _reloadUntil; public static bool DemoActive { get { if (Time.time < _demoUntil) { return (Object)(object)_demoJet != (Object)null; } return false; } } public static bool Live { get { if (!((Object)(object)JetVehicle.Local != (Object)null)) { return DemoActive; } return true; } } public static void Demo(JetVehicle jet, Vector3 target, float seconds) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) _demoJet = jet; _demoTarget = target; _demoUntil = Time.time + seconds; } public static void DemoTick() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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) if (DemoActive) { ModConfig cfg = Plugin.Cfg; if (!(Time.time < _nextGroup)) { Transform val = (((Object)(object)_demoJet.Muzzle != (Object)null) ? _demoJet.Muzzle : ((Component)_demoJet).transform); JetVehicle demoJet = _demoJet; Vector3 val2 = _demoTarget - val.position; Fire(demoJet, cfg, ((Vector3)(ref val2)).normalized); _demoJet.RemoteFire(); } } } public static void Tick(JetVehicle jet) { if ((Object)(object)jet == (Object)null || !jet.FlownLocally) { return; } ModConfig cfg = Plugin.Cfg; if (jet.Ammo <= 0) { if (!Reloading && jet.OnGround) { BeginReload(jet, cfg); } } else if (!Reloading && JetInput.FirePressed() && !(Time.time < _nextGroup)) { Fire(jet, cfg); } } private static void BeginReload(JetVehicle jet, ModConfig cfg) { _reloadUntil = Time.time + cfg.CannonReloadSeconds.Value; Feedback.Say("Rearming."); ((MonoBehaviour)WarthogRuntime.Instance).StartCoroutine(FinishReload(jet, cfg)); } private static IEnumerator FinishReload(JetVehicle jet, ModConfig cfg) { yield return (object)new WaitForSeconds(cfg.CannonReloadSeconds.Value); if (!((Object)(object)jet == (Object)null)) { jet.Ammo = Mathf.RoundToInt(cfg.CannonAmmo.Value); Feedback.Good("Cannon rearmed - " + Feedback.Value(jet.Ammo) + " rounds."); } } private static void Fire(JetVehicle jet, ModConfig cfg) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Fire(jet, cfg, ((Component)jet).transform.forward); } private static void Fire(JetVehicle jet, ModConfig cfg, Vector3 forward) { //IL_00a5: 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_00aa: 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_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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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) ProjectileManager instance = ProjectileManager.Instance; Player localPlayer = Player.LocalPlayer; if ((Object)(object)instance == (Object)null || (Object)(object)localPlayer == (Object)null) { if (!_warnedNoManager) { _warnedNoManager = true; Plugin.Log.LogWarning((object)"No ProjectileManager yet; the cannon cannot fire."); } return; } int num = Mathf.Max(1, Mathf.RoundToInt(cfg.CannonRoundsPerBurst.Value)); num = Mathf.Min(num, jet.Ammo); float num2 = Mathf.Max(cfg.CannonRoundsPerSecond.Value, 1f); _nextGroup = Time.time + (float)num / num2; Vector3 val = (((Object)(object)jet.Muzzle != (Object)null) ? jet.Muzzle.position : ((Component)jet).transform.position); Vector3[] array = (Vector3[])(object)new Vector3[num]; float value = cfg.CannonSpread.Value; for (int i = 0; i < num; i++) { Vector3 val2 = ((value > 0f) ? (Quaternion.Euler(Random.Range(0f - value, value), Random.Range(0f - value, value), 0f) * forward) : forward); array[i] = val2 * cfg.CannonMuzzleVelocity.Value + jet.Velocity; JetTracers.Spawn(val, array[i]); } instance.AddProjectiles(localPlayer, Info(cfg), true, val, array, 0u, 0u, false); if (!DemoActive) { jet.Ammo -= num; } if (!DemoActive) { jet.ApplyRecoil(cfg.CannonRecoil.Value * (float)num); } _lastShot = Time.time; } private static WeaponInfo Info(ModConfig cfg) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown if (_info == null) { _info = new WeaponInfo(); } _info.Weapon = null; _info.ProjectileType = SafeType(cfg); _info.ProjectileDamage = Mathf.RoundToInt(cfg.CannonDamage.Value); _info.ProjectileForce = cfg.CannonForce.Value; _info.ProjectileGravity = cfg.CannonGravity.Value; _info.ShootVFX = cfg.CannonVfx.Value; _info.BoatForceOverride = 0f; return _info; } private static byte SafeType(ModConfig cfg) { if (_typeCount < 0) { _typeCount = CountTypes(); } int value = cfg.CannonProjectileType.Value; if (_typeCount <= 0) { return 0; } return (byte)Mathf.Clamp(value, 0, _typeCount - 1); } private static int CountTypes() { try { int result = (typeof(ProjectileManager).GetField("_types", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(ProjectileManager.Instance) as Array)?.Length ?? 0; Plugin.Log.LogDebug((object)("ProjectileManager exposes " + result + " projectile type(s).")); return result; } catch { return 0; } } public static void Reset() { _nextGroup = 0f; _reloadUntil = 0f; } } public static class JetControl { private static bool _briefed; public static void RequestMount(JetVehicle jet, Player player) { if ((Object)(object)jet == (Object)null || (Object)(object)player == (Object)null) { return; } if ((Object)(object)JetVehicle.Local != (Object)null) { Feedback.Warn("You are already in a cockpit."); } else if (jet.TryMount(player)) { JetCannon.Reset(); if (!_briefed) { _briefed = true; ModConfig cfg = Plugin.Cfg; Feedback.Good("You have the aircraft."); Feedback.Say(Feedback.Key("Mouse") + " aim " + Feedback.Key("W/S") + " pitch " + Feedback.Key("A/D") + " roll " + Feedback.Key(Short(cfg.ThrottleUpKey.Value) + "/" + Short(cfg.ThrottleDownKey.Value)) + " throttle"); Feedback.Say(Feedback.Key(cfg.ExitKey.Value.ToUpperInvariant()) + " steps out. The rest is listed on the right - " + Feedback.Key(cfg.HelpKey.Value.ToUpperInvariant()) + " hides it."); } } } private static string Short(string key) { return key.Replace("Left", "").Replace("Right", "").ToUpperInvariant(); } public static void RequestDismount() { JetVehicle local = JetVehicle.Local; if ((Object)(object)local != (Object)null) { local.Dismount(); } } public static void Tick() { JetVehicle local = JetVehicle.Local; if ((Object)(object)local == (Object)null) { if (GameFlags.RaisedByUs) { JetVehicle.ReleaseLocalPilot(); return; } JetHud.Hide(); JetRadar.Toggle(on: false); VanillaHud.Restore(); return; } if (!PilotStillFlyable(local)) { local.Dismount(); return; } JetInput.Sample(); ModConfig cfg = Plugin.Cfg; if (cfg.HudEnabled.Value) { JetHud.Show(); JetHud.Tick(local); } else { JetHud.Hide(); } if (cfg.RadarEnabled.Value) { JetRadar.Attach(JetHud.Root); JetRadar.Toggle(on: true); } else { JetRadar.Toggle(on: false); } VanillaHud.SetHotbarHidden(cfg.HideHotbar.Value); VanillaHud.SetStatsHidden(cfg.HideVanillaStats.Value); if (JetInput.HelpPressed()) { JetHud.ToggleHelp(); } JetCannon.Tick(local); GameFlags.Raise(); if (JetInput.DismountPressed()) { RequestDismount(); } else { local.PinPilot(); } } private static bool PilotStillFlyable(JetVehicle jet) { Player pilot = jet.Pilot; if ((Object)(object)pilot == (Object)null) { return false; } try { return !pilot.Dying.IsDead; } catch { return true; } } public static void LateTick() { JetTracers.Tick(); ImpactFx.Tick(); foreach (JetVehicle item in JetVehicle.All) { item.RemoteTick(); } JetVehicle local = JetVehicle.Local; if (!((Object)(object)local == (Object)null)) { local.PinPilot(); JetCamera.Tick(); JetFog.Apply(); if (Plugin.Cfg.RadarEnabled.Value) { JetRadar.Tick(); } } } public static JetVehicle Create(string name, Vector3 position, Quaternion rotation) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) GameObject val = JetAssets.CreateJet(name); if ((Object)(object)val == (Object)null) { return null; } JetVehicle jetVehicle = val.AddComponent(); jetVehicle.Park(position, rotation); Bounds val2 = JetAssets.BoundsOf(val); JetInteractable.Attach(jetVehicle, ClampPromptSize(((Bounds)(ref val2)).size)); return jetVehicle; } private static Vector3 ClampPromptSize(Vector3 size) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) return new Vector3(Mathf.Min(size.x * 0.35f, 6f), Mathf.Max(size.y, 3f), Mathf.Min(size.z * 0.5f, 9f)); } } public static class JetFleet { private static float _rebuildAt = -1f; public static JetVehicle Jet { get; private set; } public static bool Exists => (Object)(object)Jet != (Object)null; public static JetVehicle Ensure(Vector3 position, Quaternion rotation) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Jet != (Object)null) { return Jet; } Jet = JetControl.Create("Warthog", position, rotation); if ((Object)(object)Jet != (Object)null) { Object.DontDestroyOnLoad((Object)(object)((Component)Jet).gameObject); } return Jet; } public static void Scrap(JetVehicle wreck) { if (!((Object)(object)wreck == (Object)null)) { if ((Object)(object)Jet == (Object)(object)wreck) { Jet = null; } Object.Destroy((Object)(object)((Component)wreck).gameObject); float value = Plugin.Cfg.RespawnSeconds.Value; if (value < 0f) { _rebuildAt = -1f; return; } _rebuildAt = Time.time + value; Feedback.Say("Airframe written off. A replacement is being brought up - " + Feedback.Value(value.ToString("F0")) + " seconds."); } } public static void Tick() { if (_rebuildAt < 0f || Time.time < _rebuildAt) { return; } _rebuildAt = -1f; if (!((Object)(object)Jet != (Object)null)) { OnIslandLoaded(); if ((Object)(object)Jet != (Object)null) { Feedback.Good("A fresh A-10 is on the deck."); } } } public static void PlaceAt(Vector3 position, Quaternion rotation) { //IL_0025: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Jet == (Object)null) { Ensure(position, rotation); return; } bool flownLocally = Jet.FlownLocally; Jet.Park(position, rotation); if (flownLocally) { Jet.PinPilot(); } } public static void OnIslandLoaded() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Jet != (Object)null) || !((Object)(object)Jet.Pilot != (Object)null)) { if (Carrier.Exists) { Carrier.ParkJet(); } else { PlaceAt(FallbackSpot(out var rotation), rotation); } } } private static Vector3 FallbackSpot(out Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) Vector3 islandPos = Island.IslandPos; Vector3 boatSpawnPos = SpawnManager.BoatSpawnPos; Vector3 val = boatSpawnPos - islandPos; val.y = 0f; val = ((((Vector3)(ref val)).sqrMagnitude < 1f) ? Vector3.forward : ((Vector3)(ref val)).normalized); rotation = Quaternion.LookRotation(Vector3.Cross(Vector3.up, val), Vector3.up); Vector3 val2 = boatSpawnPos + val * Plugin.Cfg.JetShoreOffset.Value; float value = Plugin.Cfg.GearHeight.Value; RaycastHit val3 = default(RaycastHit); val2.y = (Physics.Raycast(val2 + Vector3.up * 120f, Vector3.down, ref val3, 260f, LayerMask.op_Implicit(GameInfo.CanJumpOnLayers), (QueryTriggerInteraction)1) ? (Mathf.Max(((RaycastHit)(ref val3)).point.y, WaterLevel()) + value) : (WaterLevel() + value)); return val2; } private static float WaterLevel() { try { return WaterManager.WaterHeight; } catch { return 0f; } } public static void Destroy() { _rebuildAt = -1f; if ((Object)(object)Jet != (Object)null) { Object.Destroy((Object)(object)((Component)Jet).gameObject); } Jet = null; } } public static class JetFog { private static float _base = -1f; private static float _far; private static bool _held; public static bool Active => _held; public static void Apply() { ModConfig cfg = Plugin.Cfg; float num = Mathf.Clamp01(cfg.FogFactor.Value); if (num >= 0.999f) { Restore(); return; } if (!_held) { _base = RenderSettings.fogDensity; _held = true; Camera val = Camera(); if ((Object)(object)val != (Object)null && cfg.ViewDistance.Value > 0f) { _far = val.farClipPlane; val.farClipPlane = Mathf.Max(_far, cfg.ViewDistance.Value); } } RenderSettings.fogDensity = _base * num; } public static void Restore() { if (_held) { _held = false; RenderSettings.fogDensity = _base; Camera val = Camera(); if ((Object)(object)val != (Object)null && _far > 0f) { val.farClipPlane = _far; } _far = 0f; } } public static void Rebase() { if (_held) { _base = RenderSettings.fogDensity; RenderSettings.fogDensity = _base * Mathf.Clamp01(Plugin.Cfg.FogFactor.Value); } } private static Camera Camera() { Player localPlayer = Player.LocalPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Object)(object)localPlayer.Camera == (Object)null)) { return localPlayer.Camera.Cam; } return null; } } public sealed class JetGear { private struct Hinge { public string Bone; public Quaternion Delta; public Vector3 Shift; public Hinge(string bone, Quaternion delta) { //IL_0008: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) Bone = bone; Delta = delta; Shift = Vector3.zero; } public Hinge(string bone, Quaternion delta, Vector3 shift) { //IL_0008: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) Bone = bone; Delta = delta; Shift = shift; } } private class Joint { public Transform Bone; public Quaternion Delta; public Quaternion Down; public Quaternion Up; public Vector3 Rest; public Vector3 Shift; } private static readonly Hinge[] Hinges = new Hinge[5] { new Hinge("bone9_40", new Quaternion(0.00293f, -0.00252f, 0.96014f, -0.2795f)), new Hinge("bone11_43", new Quaternion(-0.03016f, -0.03151f, -0.69085f, 0.72168f), new Vector3(0f, -0.0375f, 0f)), new Hinge("bone12_54", new Quaternion(0.60876f, 0f, 0f, 0.79335f)), new Hinge("bone15_66", new Quaternion(0.70711f, 0f, 0f, 0.70711f)), new Hinge("bone19_69", new Quaternion(0.69151f, 0f, 0f, 0.72236f)) }; private readonly List _joints = new List(); private float _target; public float Position { get; private set; } public bool Down => Position < 0.01f; public bool Up => Position > 0.99f; public bool Moving { get; private set; } public int Found => _joints.Count; private static Quaternion Convert(Quaternion q) { //IL_002b: 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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_0078: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) return (Quaternion)(Mathf.RoundToInt(Plugin.Cfg.GearHandedness.Value) switch { 1 => new Quaternion(0f - q.x, 0f - q.y, q.z, q.w), 2 => new Quaternion(q.x, 0f - q.y, 0f - q.z, q.w), 3 => new Quaternion(0f - q.x, q.y, q.z, q.w), _ => new Quaternion(q.x, q.y, 0f - q.z, q.w), }); } public JetGear(GameObject model) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)model == (Object)null) { return; } Hinge[] hinges = Hinges; for (int i = 0; i < hinges.Length; i++) { Hinge hinge = hinges[i]; Transform val = Find(model.transform, hinge.Bone); if (!((Object)(object)val == (Object)null)) { _joints.Add(new Joint { Bone = val, Down = val.localRotation, Delta = hinge.Delta, Up = val.localRotation * Convert(hinge.Delta), Rest = val.localPosition, Shift = hinge.Shift }); } } if (_joints.Count == 0) { Plugin.Log.LogWarning((object)"None of the landing gear bones are in the model, so the gear will work but not move. /a10 gear lists what it wanted."); return; } Plugin.Log.LogDebug((object)("Landing gear bound to " + _joints.Count + " of " + Hinges.Length + " bones.")); } public void Rebind() { //IL_0018: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) foreach (Joint joint in _joints) { joint.Up = joint.Down * Convert(joint.Delta); } Apply(); } public void Toggle() { _target = ((_target > 0.5f) ? 0f : 1f); } public void Raise() { _target = 1f; } public void Lower() { _target = 0f; } public void Snap(bool up) { _target = (up ? 1f : 0f); Position = _target; Moving = false; Apply(); } public void Tick(float dt) { float num = dt / Mathf.Max(Plugin.Cfg.GearSeconds.Value, 0.1f); float num2 = Mathf.MoveTowards(Position, _target, num); Moving = !Mathf.Approximately(num2, Position); if (Moving) { Position = num2; Apply(); } } private void Apply() { //IL_004c: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_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) float num = Position * Position * (3f - 2f * Position); foreach (Joint joint in _joints) { if (!((Object)(object)joint.Bone == (Object)null)) { joint.Bone.localRotation = Quaternion.Slerp(joint.Down, joint.Up, num); if (joint.Shift != Vector3.zero) { joint.Bone.localPosition = joint.Rest + joint.Shift * num; } } } } public string Describe() { List list = new List(); Hinge[] hinges = Hinges; for (int i = 0; i < hinges.Length; i++) { Hinge hinge = hinges[i]; bool flag = false; foreach (Joint joint in _joints) { if ((Object)(object)joint.Bone != (Object)null && ((Object)joint.Bone).name == hinge.Bone) { flag = true; break; } } if (!flag) { list.Add(hinge.Bone); } } return string.Format("{0}/{1} bones, {2:P0} retracted, handedness {3}{4}", _joints.Count, Hinges.Length, Position, Mathf.RoundToInt(Plugin.Cfg.GearHandedness.Value), (list.Count == 0) ? "" : (", missing " + string.Join(", ", list.ToArray()))); } private static Transform Find(Transform root, string name) { Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if (((Object)val).name == name) { return val; } } return null; } } public static class JetHud { private static GameObject _root; private static RectTransform _stickDot; private static RectTransform _throttleFill; private static RectTransform _engineMark; private static RectTransform _rudderMark; private static Image _stickRing; private static RectTransform _pipper; private static RectTransform _aim; private static Canvas _canvas; private static TextMeshProUGUI _help; private static TextMeshProUGUI _top; private static TextMeshProUGUI _bottom; private static float _ringRadius; private static float _throttleHeight; private static float _rudderHalfWidth; private static readonly Color Idle = new Color(0.15f, 0.85f, 0.4f, 0.7f); private static readonly Color Live = new Color(0.05f, 1f, 0.3f, 0.95f); private static readonly Color Warn = new Color(1f, 0.45f, 0.3f, 0.95f); private static readonly string[] HelpLines = new string[7] { "MOUSE aim", "W / S pitch", "A / D roll", "Q / E rudder", "LMB cannon", "RMB look around", "SPACE wheel brakes" }; private static Color _green; private static readonly Color Amber = new Color(1f, 0.55f, 0.25f); public static Transform Root { get { Build(); if (!((Object)(object)_root == (Object)null)) { return _root.transform; } return null; } } public static void Show() { Build(); if ((Object)(object)_root != (Object)null && !_root.activeSelf) { _root.SetActive(true); } } public static void Hide() { if ((Object)(object)_root != (Object)null && _root.activeSelf) { _root.SetActive(false); } } public static void Destroy() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _top = null; _bottom = null; _help = null; } public static void Tick(JetVehicle jet) { //IL_0029: 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_0051: 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_0071: 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_00a7: 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) if (!((Object)(object)_root == (Object)null) && !((Object)(object)jet == (Object)null) && _root.activeSelf) { _stickDot.anchoredPosition = jet.Controls * _ringRadius; ((Graphic)_stickRing).color = (jet.Stalled ? Warn : Idle); float num = Mathf.Clamp01(jet.Throttle); _throttleFill.sizeDelta = new Vector2(_throttleFill.sizeDelta.x, _throttleHeight * num); _engineMark.anchoredPosition = new Vector2(0f, _throttleHeight * Mathf.Clamp01(jet.Thrust)); _rudderMark.anchoredPosition = new Vector2(Mathf.Clamp(JetInput.Rudder, -1f, 1f) * _rudderHalfWidth, 0f); UpdatePipper(jet); UpdateAim(jet); UpdateReadout(jet); } } private static void Build() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00f8: 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_0110: 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_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_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: 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_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: 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_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_root != (Object)null)) { _root = new GameObject("A10_Hud"); Object.DontDestroyOnLoad((Object)(object)_root); _canvas = _root.AddComponent(); _canvas.renderMode = (RenderMode)0; _canvas.sortingOrder = 500; CanvasScaler obj = _root.AddComponent(); obj.uiScaleMode = (ScaleMode)1; obj.referenceResolution = new Vector2(1920f, 1080f); obj.matchWidthOrHeight = 0.5f; ModConfig cfg = Plugin.Cfg; float value = cfg.HudStickSize.Value; _ringRadius = value * 0.5f; RectTransform parent = Rect("Panel", _root.transform, new Vector2(1f, 0f), new Vector2(1f, 0f), new Vector2(0f - (value * 0.5f + 70f), value * 0.5f + 60f), new Vector2(value + 140f, value + 80f)); _stickRing = Icon("Ring", (Transform)(object)parent, Vector2.zero, new Vector2(value, value), Textures.Ring(160, 0.055f), Idle); Icon("CrossH", (Transform)(object)parent, Vector2.zero, new Vector2(value * 0.5f, 1.5f), Textures.Solid(), new Color(1f, 1f, 1f, 0.22f)); Icon("CrossV", (Transform)(object)parent, Vector2.zero, new Vector2(1.5f, value * 0.5f), Textures.Solid(), new Color(1f, 1f, 1f, 0.22f)); _stickDot = ((Graphic)Icon("Dot", (Transform)(object)parent, Vector2.zero, new Vector2(value * 0.11f, value * 0.11f), Textures.Disc(64), Live)).rectTransform; float num = 16f; _throttleHeight = value; RectTransform val = Rect("Throttle", (Transform)(object)parent, new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2((0f - value) * 0.5f - 34f, 0f), new Vector2(num, _throttleHeight)); Image obj2 = ((Component)val).gameObject.AddComponent(); obj2.sprite = Textures.Solid(); ((Graphic)obj2).color = new Color(0f, 0f, 0f, 0.35f); RectTransform obj3 = Rect("Fill", (Transform)(object)val, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), Vector2.zero, new Vector2(num, 0f)); obj3.pivot = new Vector2(0.5f, 0f); Image obj4 = ((Component)obj3).gameObject.AddComponent(); obj4.sprite = Textures.Solid(); ((Graphic)obj4).color = Live; _throttleFill = obj3; RectTransform obj5 = Rect("Engine", (Transform)(object)val, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), Vector2.zero, new Vector2(num + 12f, 3f)); Image obj6 = ((Component)obj5).gameObject.AddComponent(); obj6.sprite = Textures.Solid(); ((Graphic)obj6).color = new Color(1f, 0.85f, 0.3f, 0.95f); _engineMark = obj5; _rudderHalfWidth = value * 0.5f; RectTransform val2 = Rect("Rudder", (Transform)(object)parent, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, -6f), new Vector2(value, 3f)); Image obj7 = ((Component)val2).gameObject.AddComponent(); obj7.sprite = Textures.Solid(); ((Graphic)obj7).color = new Color(0f, 0f, 0f, 0.35f); RectTransform obj8 = Rect("RudderMark", (Transform)(object)val2, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), Vector2.zero, new Vector2(8f, 12f)); Image obj9 = ((Component)obj8).gameObject.AddComponent(); obj9.sprite = Textures.Solid(); ((Graphic)obj9).color = Live; _rudderMark = obj8; float value2 = cfg.HudPipperSize.Value; _pipper = ((Graphic)Icon("Pipper", _root.transform, Vector2.zero, new Vector2(value2, value2), Textures.Ring(160, 0.13f), new Color(1f, 0.78f, 0.25f, 0.9f))).rectTransform; _pipper.anchorMin = new Vector2(0.5f, 0.5f); _pipper.anchorMax = new Vector2(0.5f, 0.5f); _aim = ((Graphic)Icon("Aim", _root.transform, Vector2.zero, new Vector2(44f, 44f), Textures.Ring(160, 0.05f), new Color(0.1f, 1f, 0.35f, 0.9f))).rectTransform; _aim.anchorMin = new Vector2(0.5f, 0.5f); _aim.anchorMax = new Vector2(0.5f, 0.5f); BuildReadout(cfg); BuildHelp(cfg); } } private static string Short(string key) { return key.Replace("Left", "").Replace("Right", "").ToUpperInvariant(); } private static void BuildHelp(ModConfig cfg) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) float num = cfg.HudTextSize.Value * 0.85f; float num2 = num * 21f; _help = ((Component)Rect("Help", _root.transform, new Vector2(1f, 0.5f), new Vector2(1f, 0.5f), new Vector2(0f - (num2 * 0.5f + cfg.HelpMargin.Value), cfg.HelpHeight.Value), new Vector2(num2, num * 13f))).gameObject.AddComponent(); TMP_FontAsset val = Font(); if ((Object)(object)val != (Object)null) { ((TMP_Text)_help).font = val; } ((TMP_Text)_help).fontSize = num; ((Graphic)_help).color = _green; ((TMP_Text)_help).alignment = (TextAlignmentOptions)257; ((Graphic)_help).raycastTarget = false; StringBuilder stringBuilder = new StringBuilder(); string[] helpLines = HelpLines; foreach (string value in helpLines) { stringBuilder.AppendLine(value); } stringBuilder.AppendLine(Short(Plugin.Cfg.ThrottleUpKey.Value) + "/" + Short(Plugin.Cfg.ThrottleDownKey.Value) + " throttle"); stringBuilder.AppendLine(Plugin.Cfg.GearKey.Value.ToUpperInvariant().PadRight(8) + "gear"); stringBuilder.AppendLine(Plugin.Cfg.ExitKey.Value.ToUpperInvariant().PadRight(8) + "get out"); stringBuilder.AppendLine(); stringBuilder.Append(Plugin.Cfg.HelpKey.Value.ToUpperInvariant() + " hide this"); ((TMP_Text)_help).text = Mono(stringBuilder.ToString()); ((Component)_help).gameObject.SetActive(cfg.HudHelp.Value); } public static void ToggleHelp() { ModConfig cfg = Plugin.Cfg; cfg.HudHelp.Value = !cfg.HudHelp.Value; if ((Object)(object)_help != (Object)null) { ((Component)_help).gameObject.SetActive(cfg.HudHelp.Value); } } private static void BuildReadout(ModConfig cfg) { //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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) float value = cfg.HudTextSize.Value; Color colour = (_green = Mat.Parse(cfg.HudTextColour.Value, new Color(0f, 1f, 0.25f))); if (cfg.HudReadout.Value) { _top = Row("ReadoutTop", cfg.HudReadoutBottom.Value + value * 1.35f, value, colour); _bottom = Row("ReadoutBottom", cfg.HudReadoutBottom.Value, value, colour); } } private static TextMeshProUGUI Row(string name, float y, float size, Color colour) { //IL_0015: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI val = ((Component)Rect(name, _root.transform, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, y), new Vector2(1500f, size * 1.6f))).gameObject.AddComponent(); TMP_FontAsset val2 = Font(); if ((Object)(object)val2 != (Object)null) { ((TMP_Text)val).font = val2; } ((TMP_Text)val).fontSize = size; ((Graphic)val).color = colour; ((TMP_Text)val).alignment = (TextAlignmentOptions)514; ((Graphic)val).raycastTarget = false; ((TMP_Text)val).richText = true; return val; } private static TMP_FontAsset Font() { try { TextMeshProUGUI canvasTextPrefab = PlayerUI.CanvasTextPrefab; if ((Object)(object)canvasTextPrefab != (Object)null && (Object)(object)((TMP_Text)canvasTextPrefab).font != (Object)null) { return ((TMP_Text)canvasTextPrefab).font; } } catch { } try { return TMP_Settings.defaultFontAsset; } catch { return null; } } private static void UpdateReadout(JetVehicle jet) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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) if (!((Object)(object)_top == (Object)null) && !((Object)(object)_bottom == (Object)null)) { Vector3 forward = ((Component)jet).transform.forward; float num = jet.Speed * 1.94384f; float num2 = Altitude(jet); float num3 = Mathf.Repeat(((Component)jet).transform.eulerAngles.y, 360f); float num4 = Mathf.Asin(Mathf.Clamp(forward.y, -1f, 1f)) * 57.29578f; float num5 = JetArcade.BankAngle(jet); ((TMP_Text)_top).text = Mono(string.Format(CultureInfo.InvariantCulture, "IAS {0,4:F0} KT ALT {1,5:F0} M HDG {2:000} G {3,4:F1}", num, num2, num3, jet.GLoad)); string text = ((jet.Gear == null || jet.Gear.Found == 0) ? "N/A" : (jet.Gear.Moving ? "MOV" : (jet.Gear.Down ? "DN" : "UP"))); ((TMP_Text)_bottom).text = Mono(string.Format(CultureInfo.InvariantCulture, "PCH {0,4:F0} BNK {1,4:F0} AOA {2,4:F0} GUN {3,4} FUEL --:-- GEAR {4}", num4, num5, jet.Aoa, jet.Ammo, text)); bool flag = jet.Stalled || jet.Ammo <= 0; ((Graphic)_bottom).color = (flag ? Amber : _green); } } private static string Mono(string line) { return "" + line + ""; } private static float Altitude(JetVehicle jet) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) try { return ((Component)jet).transform.position.y - WaterManager.WaterHeight; } catch { return ((Component)jet).transform.position.y; } } private static void UpdatePipper(JetVehicle jet) { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //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) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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) if ((Object)(object)_pipper == (Object)null) { return; } Player localPlayer = Player.LocalPlayer; if ((Object)(object)(((Object)(object)localPlayer == (Object)null || (Object)(object)localPlayer.Camera == (Object)null) ? null : localPlayer.Camera.Cam) == (Object)null || (Object)(object)jet.Muzzle == (Object)null) { ((Component)_pipper).gameObject.SetActive(false); return; } ModConfig cfg = Plugin.Cfg; float num = Mathf.Max(cfg.CannonMuzzleVelocity.Value, 1f); Vector3 val = ((Component)jet).transform.forward * num + jet.Velocity; Vector3 position = jet.Muzzle.position; float num2 = cfg.PipperRange.Value; RaycastHit val3 = default(RaycastHit); for (int i = 0; i < 2; i++) { float num3 = num2 / num; Vector3 val2 = position + val * num3 + Vector3.down * (0.5f * cfg.CannonGravity.Value * num3 * num3) - position; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude < 0.01f) { break; } num2 = (Physics.Raycast(position, val2 / magnitude, ref val3, magnitude, LayerMask.op_Implicit(GameInfo.CanJumpOnLayers), (QueryTriggerInteraction)1) ? ((RaycastHit)(ref val3)).distance : num2); } float num4 = num2 / num; if (!Project(position + val * num4 + Vector3.down * (0.5f * cfg.CannonGravity.Value * num4 * num4), out var canvasPosition)) { ((Component)_pipper).gameObject.SetActive(false); return; } ((Component)_pipper).gameObject.SetActive(true); _pipper.anchoredPosition = canvasPosition; } private static void UpdateAim(JetVehicle jet) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_005c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_aim == (Object)null)) { if (!Project(((Component)jet).transform.position + JetArcade.AimDirection * 600f, out var canvasPosition)) { ((Component)_aim).gameObject.SetActive(false); return; } ((Component)_aim).gameObject.SetActive(true); _aim.anchoredPosition = canvasPosition; } } private static bool Project(Vector3 world, out Vector2 canvasPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) canvasPosition = Vector2.zero; Player localPlayer = Player.LocalPlayer; Camera val = (((Object)(object)localPlayer == (Object)null || (Object)(object)localPlayer.Camera == (Object)null) ? null : localPlayer.Camera.Cam); if ((Object)(object)val == (Object)null) { return false; } Vector3 val2 = val.WorldToScreenPoint(world); if (val2.z <= 0f) { return false; } float num = (((Object)(object)_canvas == (Object)null || _canvas.scaleFactor <= 0f) ? 1f : _canvas.scaleFactor); canvasPosition = new Vector2(val2.x - (float)Screen.width * 0.5f, val2.y - (float)Screen.height * 0.5f) / num; return true; } private static RectTransform Rect(string name, Transform parent, Vector2 anchorMin, Vector2 anchorMax, Vector2 position, Vector2 size) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); RectTransform obj = val.AddComponent(); obj.anchorMin = anchorMin; obj.anchorMax = anchorMax; obj.pivot = new Vector2(0.5f, 0.5f); obj.anchoredPosition = position; obj.sizeDelta = size; return obj; } private static Image Icon(string name, Transform parent, Vector2 position, Vector2 size, Sprite sprite, Color color) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) Image obj = ((Component)Rect(name, parent, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), position, size)).gameObject.AddComponent(); obj.sprite = sprite; ((Graphic)obj).color = color; return obj; } } internal static class Textures { private static Sprite _solid; private static readonly Dictionary Cache = new Dictionary(); public static Sprite Solid() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_003f: 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) if ((Object)(object)_solid != (Object)null) { return _solid; } Texture2D val = new Texture2D(4, 4, (TextureFormat)4, false); Color32[] array = (Color32[])(object)new Color32[16]; for (int i = 0; i < array.Length; i++) { array[i] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue); } val.SetPixels32(array); val.Apply(); _solid = ToSprite(val); return _solid; } public static Sprite Disc(int size) { return Ring(size, 0f); } public static Sprite Ring(int size, float thickness) { string key = "ring" + size + ":" + thickness.ToString("F3"); if (Cache.TryGetValue(key, out var value) && (Object)(object)value != (Object)null) { return value; } Sprite val = ToSprite(Circle(size, thickness)); Cache[key] = val; return val; } public static Sprite Triangle(int size) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) string key = "tri" + size; if (Cache.TryGetValue(key, out var value) && (Object)(object)value != (Object)null) { return value; } Texture2D val = new Texture2D(size, size, (TextureFormat)4, false); Color32[] array = (Color32[])(object)new Color32[size * size]; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num = ((float)j + 0.5f) / (float)size; float num2 = ((float)i + 0.5f) / (float)size; float num3 = Mathf.Min((1f - num2) * 0.5f - Mathf.Abs(num - 0.5f), num2) * (float)size; array[i * size + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(Mathf.Clamp01(num3) * 255f)); } } val.SetPixels32(array); val.Apply(); Sprite val2 = ToSprite(val); Cache[key] = val2; return val2; } private static Texture2D Circle(int size, float thickness) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false); Color32[] array = (Color32[])(object)new Color32[size * size]; float num = (float)size * 0.5f - 1f; float num2 = ((thickness > 0f) ? (num * (1f - thickness * 2f)) : (-1f)); float num3 = (float)size * 0.5f - 0.5f; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num4 = (float)j - num3; float num5 = (float)i - num3; float num6 = Mathf.Sqrt(num4 * num4 + num5 * num5); float num7 = Mathf.Clamp01(num - num6); if (num2 > 0f) { num7 = Mathf.Min(num7, Mathf.Clamp01(num6 - num2)); } array[i * size + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num7 * 255f)); } } val.SetPixels32(array); val.Apply(); return val; } private static Sprite ToSprite(Texture2D tex) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) ((Texture)tex).wrapMode = (TextureWrapMode)1; ((Texture)tex).filterMode = (FilterMode)1; ((Object)tex).hideFlags = (HideFlags)61; return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0); } } public sealed class JetHull { private readonly Transform _jet; private readonly BoxCollider _body; private readonly BoxCollider _wing; private readonly Transform[] _marks = (Transform[])(object)new Transform[2]; private static Material _material; public JetHull(JetVehicle jet) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) _jet = ((Component)jet).transform; Vector3 val = LocalSize(((Component)jet).gameObject); ModConfig cfg = Plugin.Cfg; Rigidbody val2 = ((Component)jet).gameObject.GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = ((Component)jet).gameObject.AddComponent(); } val2.isKinematic = true; val2.useGravity = false; val2.interpolation = (RigidbodyInterpolation)0; _body = Box(((Component)jet).transform, "Fuselage", new Vector3(val.x * cfg.HullBodyWidth.Value, val.y * cfg.HullBodyHeight.Value, val.z * cfg.HullBodyLength.Value), new Vector3(0f, cfg.HullBodyRise.Value, 0f)); _wing = Box(((Component)jet).transform, "Wing", new Vector3(val.x * cfg.HullWingSpan.Value, val.y * cfg.HullWingThickness.Value, val.z * cfg.HullWingChord.Value), new Vector3(0f, cfg.HullWingRise.Value, cfg.HullWingBack.Value)); Apply(); } public void Apply() { bool value = Plugin.Cfg.HullSolid.Value; if ((Object)(object)_body != (Object)null) { ((Collider)_body).enabled = value; } if ((Object)(object)_wing != (Object)null) { ((Collider)_wing).enabled = value; } Reveal(); } public void Reveal() { //IL_00af: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) ModConfig cfg = Plugin.Cfg; bool flag = cfg.HullDebug.Value && cfg.HullSolid.Value; for (int i = 0; i < 2; i++) { BoxCollider val = ((i == 0) ? _body : _wing); if ((Object)(object)val == (Object)null) { continue; } if (!flag) { if ((Object)(object)_marks[i] != (Object)null) { ((Component)_marks[i]).gameObject.SetActive(false); } continue; } if ((Object)(object)_marks[i] == (Object)null) { _marks[i] = Mark(val); } ((Component)_marks[i]).gameObject.SetActive(true); _marks[i].localPosition = val.center; _marks[i].localScale = val.size; MeshRenderer component = ((Component)_marks[i]).GetComponent(); if ((Object)(object)component != (Object)null) { ((Renderer)component).material.color = Mat.Parse(cfg.HullDebugColour.Value, new Color(0.25f, 0.55f, 1f, 0.4f)); } } } private static Transform Mark(BoxCollider box) { GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)obj).name = ((Object)box).name + "Block"; Object.Destroy((Object)(object)obj.GetComponent()); obj.transform.SetParent(((Component)box).transform, false); MeshRenderer component = obj.GetComponent(); ((Renderer)component).material = Material(); ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component).receiveShadows = false; return obj.transform; } private static Material Material() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown if ((Object)(object)_material != (Object)null) { return _material; } Shader val = Shader.Find("Sprites/Default"); if ((Object)(object)val == (Object)null) { val = Shader.Find("Universal Render Pipeline/Unlit"); } _material = new Material(val) { hideFlags = (HideFlags)61 }; _material.renderQueue = 3000; return _material; } public void Place() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_004f: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) Vector3 val = LocalSize(((Component)_jet).gameObject); ModConfig cfg = Plugin.Cfg; if ((Object)(object)_body != (Object)null) { _body.size = new Vector3(val.x * cfg.HullBodyWidth.Value, val.y * cfg.HullBodyHeight.Value, val.z * cfg.HullBodyLength.Value); _body.center = new Vector3(0f, cfg.HullBodyRise.Value, 0f); } if ((Object)(object)_wing != (Object)null) { _wing.size = new Vector3(val.x * cfg.HullWingSpan.Value, val.y * cfg.HullWingThickness.Value, val.z * cfg.HullWingChord.Value); _wing.center = new Vector3(0f, cfg.HullWingRise.Value, cfg.HullWingBack.Value); } Apply(); } public string Describe() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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) //IL_0040: 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_008f: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) Vector3 val = LocalSize(((Component)_jet).gameObject); return string.Format(CultureInfo.InvariantCulture, "model {0:F1} x {1:F1} x {2:F1} m fuselage {3:F1} x {4:F1} x {5:F1} wing {6:F1} x {7:F1} x {8:F1}", val.x, val.y, val.z, ((Object)(object)_body == (Object)null) ? 0f : _body.size.x, ((Object)(object)_body == (Object)null) ? 0f : _body.size.y, ((Object)(object)_body == (Object)null) ? 0f : _body.size.z, ((Object)(object)_wing == (Object)null) ? 0f : _wing.size.x, ((Object)(object)_wing == (Object)null) ? 0f : _wing.size.y, ((Object)(object)_wing == (Object)null) ? 0f : _wing.size.z); } private static BoxCollider Box(Transform parent, string name, Vector3 size, Vector3 centre) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); val.layer = Carrier.WalkableLayer(); val.tag = "Level"; BoxCollider obj = val.AddComponent(); obj.size = size; obj.center = centre; return obj; } private static Vector3 LocalSize(GameObject jet) { //IL_001b: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0074: 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_0094: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = jet.GetComponentsInChildren(true); if (componentsInChildren.Length == 0) { return new Vector3(18f, 6f, 18f); } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(float.MaxValue, float.MaxValue, float.MaxValue); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(float.MinValue, float.MinValue, float.MinValue); Renderer[] array = componentsInChildren; Vector3 val3 = default(Vector3); for (int i = 0; i < array.Length; i++) { Bounds bounds = array[i].bounds; for (int j = 0; j < 8; j++) { ((Vector3)(ref val3))..ctor(((j & 1) == 0) ? ((Bounds)(ref bounds)).min.x : ((Bounds)(ref bounds)).max.x, ((j & 2) == 0) ? ((Bounds)(ref bounds)).min.y : ((Bounds)(ref bounds)).max.y, ((j & 4) == 0) ? ((Bounds)(ref bounds)).min.z : ((Bounds)(ref bounds)).max.z); Vector3 val4 = jet.transform.InverseTransformPoint(val3); val = Vector3.Min(val, val4); val2 = Vector3.Max(val2, val4); } } return val2 - val; } } public static class JetImpacts { private static float _next; private static Vector3 _last = Vector3.positiveInfinity; public static void At(Vector3 point, Vector3 normal) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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) ModConfig cfg = Plugin.Cfg; if (cfg == null || cfg.ImpactEvery.Value <= 0f) { return; } if (Time.time < _next) { Vector3 val = point - _last; if (((Vector3)(ref val)).sqrMagnitude < cfg.ImpactSpacing.Value * cfg.ImpactSpacing.Value) { return; } } _next = Time.time + cfg.ImpactEvery.Value; _last = point; try { ImpactFx.Burst(point, normal); string value = Plugin.Cfg.ImpactParticle.Value; if (!string.IsNullOrEmpty(value)) { ParticleManager.Play(value, point, normal); } Boom.At(cfg.ImpactSound.Value, point, cfg.ImpactVolume.Value, (AudioDistance)3); } catch (Exception ex) { Plugin.Log.LogDebug((object)("Impact effect failed: " + ex.Message)); } } } public static class JetInput { private static bool _gearWasDown; private static bool _helpWasDown; private static float _exitHeldSince = -1f; private static bool _exitWasDown; public static float Roll { get; private set; } public static float Rudder { get; private set; } public static bool FreeLook { get; private set; } public static Vector2 FreeLookDelta { get; private set; } private static InputAction Action(string name) { try { PlayerInput input = GameInfo.Input; return ((Object)(object)input == (Object)null) ? null : input.actions[name]; } catch { return null; } } private static Vector2 Move() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) InputAction val = Action("PlayerMove"); if (val != null) { return val.ReadValue(); } return Vector2.zero; } public static void Sample() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) if (Typing()) { Roll = 0f; Rudder = 0f; FreeLook = false; return; } FreeLook = Pressed("PlayerRightClick"); InputAction val = Action("PlayerLook"); Vector2 val2 = ((val == null) ? Vector2.zero : val.ReadValue()); FreeLookDelta = (FreeLook ? val2 : Vector2.zero); Roll = RollInput(); Rudder = RudderInput(); JetArcade.Aim(JetVehicle.Local, val2, FreeLook, PitchKeys() * Plugin.Cfg.PitchKeyRate.Value * Time.deltaTime); } public static void Reset() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) Roll = 0f; Rudder = 0f; FreeLook = false; FreeLookDelta = Vector2.zero; JetArcade.Reset(); } public static float ThrottleAxis() { if (Typing()) { return 0f; } return (Held(Plugin.Cfg.ThrottleUpKey.Value) ? 1f : 0f) - (Held(Plugin.Cfg.ThrottleDownKey.Value) ? 1f : 0f); } public static float PitchKeys() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (Typing()) { return 0f; } float y = Move().y; if (!Plugin.Cfg.PitchKeysInverted.Value) { return y; } return 0f - y; } public static float RollInput() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (!Typing()) { return Move().x; } return 0f; } public static float RudderInput() { if (Typing()) { return 0f; } float num = (Pressed(Plugin.Cfg.RudderLeftAction.Value) ? 1f : 0f); return (Pressed(Plugin.Cfg.RudderRightAction.Value) ? 1f : 0f) - num; } public static string Binding(string action) { InputAction val = Action(action); try { return (val == null) ? "(no such action)" : InputActionRebindingExtensions.GetBindingDisplayString(val, (DisplayStringOptions)0, (string)null); } catch { return "(unreadable)"; } } public static bool Brakes() { if (!Typing()) { return Pressed("PlayerJump"); } return false; } public static bool GearPressed() { if (Typing()) { _gearWasDown = false; return false; } bool flag = Held(Plugin.Cfg.GearKey.Value); bool result = flag && !_gearWasDown; _gearWasDown = flag; return result; } public static bool FirePressed() { if (!Typing()) { return Pressed("PlayerLeftClick"); } return false; } public static bool HelpPressed() { bool flag = !Typing() && Held(Plugin.Cfg.HelpKey.Value); bool result = flag && !_helpWasDown; _helpWasDown = flag; return result; } public static bool DismountPressed() { if (Typing()) { _exitHeldSince = -1f; _exitWasDown = false; return false; } if (!Held(Plugin.Cfg.ExitKey.Value)) { _exitHeldSince = -1f; _exitWasDown = false; return false; } float value = Plugin.Cfg.ExitHoldSeconds.Value; if (value <= 0f) { bool result = !_exitWasDown; _exitWasDown = true; return result; } _exitWasDown = true; if (_exitHeldSince < 0f) { _exitHeldSince = Time.time; return false; } if (Time.time - _exitHeldSince < value) { return false; } _exitHeldSince = -1f; return true; } private static bool Held(string key) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) try { if (!Enum.IsDefined(typeof(KeyCode), key)) { return false; } return Input.GetKey((KeyCode)Enum.Parse(typeof(KeyCode), key)); } catch { return false; } } private static bool Pressed(string name) { InputAction val = Action(name); if (val != null) { return val.IsPressed(); } return false; } public static bool Typing() { try { return ChatManager.IsTyping || PauseManager.IsPaused; } catch { return false; } } } public sealed class JetInteractable : Interactable { private static readonly FieldInfo InteractColField = typeof(Interactable).GetField("_interactCol", BindingFlags.Instance | BindingFlags.NonPublic); private static readonly FieldInfo TextTargetField = typeof(Interactable).GetField("_textTarget", BindingFlags.Instance | BindingFlags.NonPublic); private JetVehicle _jet; private string _hoverText; public override bool InteractableWhenHoldingItem => false; public static JetInteractable Attach(JetVehicle jet, Vector3 size) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Interact"); val.transform.SetParent(((Component)jet).transform, false); val.SetActive(false); val.tag = "Interactable"; BoxCollider val2 = val.AddComponent(); val2.size = size; ((Collider)val2).isTrigger = Physics.queriesHitTriggers; JetInteractable jetInteractable = val.AddComponent(); jetInteractable._jet = jet; ((Interactable)jetInteractable)._modelsToOutline = (GameObject[])(object)new GameObject[0]; InteractColField?.SetValue(jetInteractable, val2); TextTargetField?.SetValue(jetInteractable, val.transform); val.SetActive(true); ((Interactable)jetInteractable).ToggleIsInteractable(true); jet.AttachInteractable(jetInteractable); Plugin.Log.LogDebug((object)("Jet prompt: layer " + LayerMask.LayerToName(val.layer) + ", tag " + val.tag + ", trigger " + ((Collider)val2).isTrigger + ", size " + ((Vector3)(ref size)).ToString("F1"))); return jetInteractable; } public override void Hover() { //IL_0018: 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) //IL_0049: Unknown result type (might be due to invalid IL or missing references) string text = HoverText(); if (!base._isHovering) { PlayerUI.SetLookAtText(text, ((Interactable)this).TextTarget, default(Vector3), false); } else if (text != _hoverText) { PlayerUI.UpdateLookAtText(text); } _hoverText = text; PlayerUI.SetLookAtColor(JetSales.Available ? Color.white : GameInfo.RedColor); ((Interactable)this).Hover(); } public override void UnHover() { PlayerUI.HideLookAtText(_hoverText); ((Interactable)this).UnHover(); } public override void Interact(Player player) { if ((Object)(object)_jet == (Object)null || (Object)(object)_jet.Pilot != (Object)null) { return; } if (!JetSales.Available) { try { AudioManager.PlayGlobalClip("Error", true, 0.3f, 0.1f, false); return; } catch { return; } } ((Interactable)this).Interact(player); JetControl.RequestMount(_jet, player); } private string HoverText() { if (!JetSales.Available) { return "Locked - $" + JetSales.Price.ToString("N0", Feedback.Numbers) + " from the dealer"; } string text = "Fly the A-10\n" + SpriteManager.GetPickUpInput(); if ((Object)(object)Player.LocalPlayer != (Object)null && (Object)(object)Player.LocalPlayer.Holding.HeldItem != (Object)null && !((Interactable)this).InteractableWhenHoldingItem) { text += "\n(unequip first)"; } return text; } } public struct JetPose : IBroadcast { public byte Op; public int Pilot; public Quaternion Attitude; } public static class JetNetwork { private const byte Protocol = 1; private const byte Mount = 0; private const byte Dismount = 1; private const byte Pose = 2; private const byte Buy = 3; private const byte Bought = 4; private static bool _serializers; private static ClientManager _client; private static ServerManager _server; private static float _nextPose; public static bool Live => (Object)(object)_client != (Object)null; public static void Prepare() { if (!_serializers) { _serializers = true; GenericWriter.SetWrite((Action)delegate(Writer writer, JetPose value) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) writer.WriteByte(value.Op); writer.WriteInt32(value.Pilot); writer.WriteQuaternion32(value.Attitude); }); GenericReader.SetRead((Func)((Reader reader) => new JetPose { Op = reader.ReadByte(), Pilot = reader.ReadInt32(), Attitude = reader.ReadQuaternion32() })); } } public static void Tick() { if (Plugin.Cfg == null || !Plugin.Cfg.Multiplayer.Value) { Detach(); return; } Attach(); SendPose(); } private static void Attach() { ClientManager clientManager = InstanceFinder.ClientManager; ServerManager serverManager = InstanceFinder.ServerManager; if ((Object)(object)clientManager != (Object)(object)_client) { if ((Object)(object)_client != (Object)null) { _client.UnregisterBroadcast((Action)OnClient); } _client = clientManager; if ((Object)(object)_client != (Object)null) { _client.RegisterBroadcast((Action)OnClient); } } if (!((Object)(object)serverManager == (Object)(object)_server)) { if ((Object)(object)_server != (Object)null) { _server.UnregisterBroadcast((Action)OnServer); } _server = serverManager; if ((Object)(object)_server != (Object)null) { _server.RegisterBroadcast((Action)OnServer, true); } } } public static void Detach() { if ((Object)(object)_client != (Object)null) { _client.UnregisterBroadcast((Action)OnClient); } if ((Object)(object)_server != (Object)null) { _server.UnregisterBroadcast((Action)OnServer); } _client = null; _server = null; } private static void SendPose() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) JetVehicle local = JetVehicle.Local; if (!((Object)(object)local == (Object)null) && !((Object)(object)_client == (Object)null)) { float num = Mathf.Max(Plugin.Cfg.PoseRate.Value, 1f); if (!(Time.time < _nextPose)) { _nextPose = Time.time + 1f / num; Send(2, ((Component)local).transform.rotation, (Channel)1); } } } public static void SendMount() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Send(0, Attitude(), (Channel)0); } public static void SendPurchase() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Send(3, Quaternion.identity, (Channel)0); } public static void SendPurchased() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_server == (Object)null) { return; } Player localPlayer = Player.LocalPlayer; try { _server.Broadcast(new JetPose { Op = 20, Pilot = ((!((Object)(object)localPlayer == (Object)null)) ? ((NetworkBehaviour)localPlayer).ObjectId : 0), Attitude = Quaternion.identity }, true, (Channel)0); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Purchase announcement failed: " + ex.Message)); } } public static void SendDismount() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Send(1, Attitude(), (Channel)0); } private static Quaternion Attitude() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)JetVehicle.Local != (Object)null)) { return Quaternion.identity; } return ((Component)JetVehicle.Local).transform.rotation; } private static void Send(byte op, Quaternion attitude, Channel channel) { //IL_005f: 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_0066: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_client == (Object)null || Plugin.Cfg == null || !Plugin.Cfg.Multiplayer.Value) { return; } Player localPlayer = Player.LocalPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } try { _client.Broadcast(new JetPose { Op = (byte)(0x10 | op), Pilot = ((NetworkBehaviour)localPlayer).ObjectId, Attitude = attitude }, channel); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Jet broadcast failed: " + ex.Message)); } } private static void OnServer(NetworkConnection connection, JetPose message, Channel channel) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (message.Op >> 4 != 1) { return; } Player val = FromConnection(connection); if ((Object)(object)val == (Object)null) { return; } message.Pilot = ((NetworkBehaviour)val).ObjectId; if ((message.Op & 0xF) == 3) { if (!JetSales.Settle()) { Plugin.Log.LogInfo((object)"Refused the jet purchase."); } return; } try { _server.BroadcastExcept(connection, message, true, channel); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Jet relay failed: " + ex.Message)); } } private static void OnClient(JetPose message, Channel channel) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (message.Op >> 4 != 1) { return; } if ((message.Op & 0xF) == 4) { JetSales.Grant(); return; } Player val = FromObjectId(message.Pilot); JetVehicle jet = JetFleet.Jet; if (!((Object)(object)val == (Object)null) && !((Object)(object)jet == (Object)null) && !((Object)(object)val == (Object)(object)Player.LocalPlayer)) { switch (message.Op & 0xF) { case 0: jet.SetRemotePilot(val, message.Attitude); break; case 1: jet.ClearRemotePilot(); break; case 2: jet.ReceivePose(val, message.Attitude); break; } } } private static Player FromConnection(NetworkConnection connection) { if (connection == (NetworkConnection)null) { return null; } try { foreach (Player player in PlayerManager.Players) { if ((Object)(object)player != (Object)null && ((NetworkBehaviour)player).Owner == connection) { return player; } } } catch { } return null; } private static Player FromObjectId(int id) { try { foreach (Player player in PlayerManager.Players) { if ((Object)(object)player != (Object)null && ((NetworkBehaviour)player).ObjectId == id) { return player; } } } catch { } return null; } } public static class JetRadar { private enum Kind { Island, Carrier, Boat, Player, Death } private static readonly Color[] IslandColours = (Color[])(object)new Color[6] { new Color(0.1f, 1f, 0.35f), new Color(0f, 0.95f, 1f), new Color(0.8f, 0.58f, 1f), new Color(1f, 0.45f, 0.85f), new Color(1f, 0.42f, 0.3f), new Color(0.95f, 0.92f, 0.45f) }; private static readonly Color CarrierColour = new Color(1f, 0.78f, 0.28f); private static readonly Color BoatColour = new Color(0.5f, 0.82f, 1f); private static readonly Color PlayerColour = new Color(0.95f, 0.95f, 1f); private static readonly Color DeathColour = new Color(0.85f, 0.08f, 0.16f); private static readonly Color ChromeColour = new Color(0f, 1f, 0.35f); private static GameObject _root; private static RectTransform _rect; private static readonly List Chrome = new List(); private static RectTransform _sweep; private static Transform _blipRoot; private static RectTransform _own; private static readonly List Blips = new List(); private static float _radius; private static float _sweepAngle; private static int _shown; public static bool Ready => (Object)(object)_root != (Object)null; public static string Diagnosis { get { if (!((Object)(object)_root == (Object)null)) { return "drawn"; } return "not built"; } } public static void Attach(Transform parent) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0091: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_root != (Object)null) && !((Object)(object)parent == (Object)null)) { ModConfig cfg = Plugin.Cfg; float value = cfg.RadarPixels.Value; _radius = value * 0.5f; _root = new GameObject("A10_Radar"); _rect = _root.AddComponent(); ((Transform)_rect).SetParent(parent, false); Place(cfg); Chrome.Clear(); Chrome.Add(Circle("Edge", _root.transform, value, Textures.Ring(160, 0.02f), ChromeColour)); Chrome.Add(Circle("Mid", _root.transform, value * 0.5f, Textures.Ring(160, 0.03f), ChromeColour)); for (int i = 0; i < 4; i++) { RectTransform val = Bar("Tick" + i, _root.transform, 1.5f, value * 0.09f, ChromeColour); ((Transform)val).localRotation = Quaternion.Euler(0f, 0f, -90f * (float)i); val.anchoredPosition = Vector2.op_Implicit(Quaternion.Euler(0f, 0f, -90f * (float)i) * Vector2.op_Implicit(new Vector2(0f, _radius - value * 0.05f))); Chrome.Add(((Component)val).GetComponent()); } _sweep = Bar("Sweep", _root.transform, 2f, _radius, ChromeColour); _sweep.pivot = new Vector2(0.5f, 0f); _sweep.anchoredPosition = Vector2.zero; Chrome.Add(((Component)_sweep).GetComponent()); _blipRoot = (Transform)(object)Element("Contacts", _root.transform, new Vector2(value, value)); _own = ((Graphic)Circle("Own", _root.transform, value * 0.075f, Textures.Triangle(64), Color.white)).rectTransform; Apply(); } } public static void Tick() { //IL_0053: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) JetVehicle local = JetVehicle.Local; if (!((Object)(object)_root == (Object)null) && !((Object)(object)local == (Object)null) && _root.activeSelf) { ModConfig cfg = Plugin.Cfg; float num = Mathf.Max(cfg.RadarRange.Value, 10f); float scale = _radius / num; float num2 = ((Component)local).transform.eulerAngles.y * ((float)Math.PI / 180f); float sin = Mathf.Sin(num2); float cos = Mathf.Cos(num2); Vector3 position = ((Component)local).transform.position; _shown = 0; if (Carrier.Exists) { Blip(Carrier.Root.transform.position, Kind.Carrier, 0, position, sin, cos, scale); } Transform val = Boat(); if ((Object)(object)val != (Object)null) { Blip(val.position, Kind.Boat, 0, position, sin, cos, scale); } Islands(position, sin, cos, scale); Players(position, sin, cos, scale); Death(position, sin, cos, scale); for (int i = _shown; i < Blips.Count; i++) { ((Behaviour)Blips[i]).enabled = false; } _sweepAngle += cfg.RadarSweepSpeed.Value * 360f * Time.deltaTime; if ((Object)(object)_sweep != (Object)null) { ((Transform)_sweep).localRotation = Quaternion.Euler(0f, 0f, 0f - _sweepAngle); } } } private static void Islands(Vector3 centre, float sin, float cos, float scale) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) int maxIslandUnlocked; try { maxIslandUnlocked = OnlineIslandManager.MaxIslandUnlocked; } catch { return; } for (int i = 0; i < maxIslandUnlocked; i++) { try { IslandInfo islandInfo = IslandManager.GetIslandInfo(i); if (islandInfo != null) { Blip(islandInfo.IslandPosition, Kind.Island, i, centre, sin, cos, scale); } } catch { break; } } } private static void Players(Vector3 centre, float sin, float cos, float scale) { //IL_003d: 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) List otherPlayers; try { otherPlayers = PlayerManager.OtherPlayers; } catch { return; } if (otherPlayers == null) { return; } foreach (Player item in otherPlayers) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.Transform == (Object)null)) { Blip(item.Transform.position, Kind.Player, 0, centre, sin, cos, scale); } } } private static void Death(Vector3 centre, float sin, float cos, float scale) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) FieldInfo field = typeof(RadarUI).GetField("_lastDeathPos", BindingFlags.Static | BindingFlags.NonPublic); if (!(field == null) && field.GetValue(null) is Vector3 val && !(val == Vector3.zero)) { Blip(val, Kind.Death, 0, centre, sin, cos, scale); } } private static Transform Boat() { try { Boat boat = BoatManager.Boat; if ((Object)(object)boat == (Object)null) { return null; } return ((Object)(object)boat.VisualBoat != (Object)null) ? boat.VisualBoat : ((Component)boat).transform; } catch { return null; } } private static void Blip(Vector3 world, Kind kind, int index, Vector3 centre, float sin, float cos, float scale) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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) float num = world.x - centre.x; float num2 = world.z - centre.z; Vector2 anchoredPosition = new Vector2(num * cos - num2 * sin, num * sin + num2 * cos) * scale; bool flag = ((Vector2)(ref anchoredPosition)).magnitude > _radius; if (flag) { anchoredPosition = ((Vector2)(ref anchoredPosition)).normalized * _radius; } Image obj = Rent(); Color color = Colour(kind, index); color.a = Plugin.Cfg.RadarDotAlpha.Value * (flag ? 0.55f : 1f); obj.sprite = ((kind == Kind.Island) ? Textures.Ring(160, 0.22f) : Textures.Disc(160)); ((Graphic)obj).color = color; ((Behaviour)obj).enabled = true; float num3 = Plugin.Cfg.RadarPixels.Value * Scale(kind) * (flag ? 0.6f : 1f); ((Graphic)obj).rectTransform.sizeDelta = new Vector2(num3, num3); ((Graphic)obj).rectTransform.anchoredPosition = anchoredPosition; } private static Color Colour(Kind kind, int index) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) switch (kind) { case Kind.Carrier: return CarrierColour; case Kind.Boat: return BoatColour; case Kind.Player: return PlayerColour; case Kind.Death: return DeathColour; default: if (index >= 0 && index < IslandColours.Length) { return IslandColours[index]; } return Color.HSVToRGB((float)index * 0.13f % 1f, 0.55f, 1f); } } private static float Scale(Kind kind) { return kind switch { Kind.Island => 0.065f, Kind.Carrier => 0.075f, _ => 0.05f, }; } private static Image Rent() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (_shown < Blips.Count) { return Blips[_shown++]; } Image val = Circle("Blip" + Blips.Count, _blipRoot, 10f, Textures.Disc(160), Color.white); Blips.Add(val); _shown++; return val; } public static void Apply() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null) { return; } ModConfig cfg = Plugin.Cfg; float value = cfg.RadarChrome.Value; foreach (Image item in Chrome) { if (!((Object)(object)item == (Object)null)) { Color chromeColour = ChromeColour; chromeColour.a = value; ((Graphic)item).color = chromeColour; ((Behaviour)item).enabled = value > 0.001f; } } if ((Object)(object)_sweep != (Object)null) { ((Component)_sweep).gameObject.SetActive(cfg.RadarSweepSpeed.Value > 0f && value > 0.001f); } } public static void Relayout() { if (!((Object)(object)_root == (Object)null)) { Destroy(); Attach(JetHud.Root); } } public static void Toggle(bool on) { if ((Object)(object)_root != (Object)null && _root.activeSelf != on) { _root.SetActive(on); } } public static void Destroy() { if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)_root); } _root = null; _rect = null; _sweep = null; _blipRoot = null; _own = null; Chrome.Clear(); Blips.Clear(); _shown = 0; } public static void Retry() { Destroy(); } public static string Describe() { if ((Object)(object)_root == (Object)null) { return "not built"; } return $"{Plugin.Cfg.RadarPixels.Value} px, range {Plugin.Cfg.RadarRange.Value:F0} m, {_shown} contacts, chrome {Plugin.Cfg.RadarChrome.Value:P0}, sweep {Plugin.Cfg.RadarSweepSpeed.Value:F2}"; } private static void Place(ModConfig cfg) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_00bb: 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_00ef: 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) Vector2 val = Corner(cfg.RadarCorner.Value); float num = cfg.RadarPixels.Value * 0.5f * cfg.RadarScale.Value; _rect.anchorMin = val; _rect.anchorMax = val; _rect.pivot = new Vector2(0.5f, 0.5f); float num2 = num + cfg.RadarMargin.Value; float num3 = num + cfg.RadarHeight.Value; _rect.anchoredPosition = new Vector2((val.x > 0.5f) ? (0f - num2) : num2, (val.y > 0.5f) ? (0f - num3) : ((val.y < 0.5f) ? num3 : cfg.RadarHeight.Value)); _rect.sizeDelta = new Vector2(cfg.RadarPixels.Value, cfg.RadarPixels.Value); ((Transform)_rect).localScale = Vector3.one * cfg.RadarScale.Value; } private static Vector2 Corner(string name) { //IL_0062: 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_0082: 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_00a2: 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) return (Vector2)((name ?? string.Empty).Trim().ToLowerInvariant() switch { "topleft" => new Vector2(0f, 1f), "topright" => new Vector2(1f, 1f), "bottomright" => new Vector2(1f, 0f), "left" => new Vector2(0f, 0.5f), "right" => new Vector2(1f, 0.5f), _ => new Vector2(0f, 0f), }); } private static Image Circle(string name, Transform parent, float size, Sprite sprite, Color colour) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Image obj = ((Component)Element(name, parent, new Vector2(size, size))).gameObject.AddComponent(); obj.sprite = sprite; ((Graphic)obj).color = colour; ((Graphic)obj).raycastTarget = false; return obj; } private static RectTransform Bar(string name, Transform parent, float width, float height, Color colour) { //IL_0004: 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) RectTransform obj = Element(name, parent, new Vector2(width, height)); Image obj2 = ((Component)obj).gameObject.AddComponent(); obj2.sprite = Textures.Solid(); ((Graphic)obj2).color = colour; ((Graphic)obj2).raycastTarget = false; return obj; } private static RectTransform Element(string name, Transform parent, Vector2 size) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0063: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); RectTransform obj = val.AddComponent(); obj.anchorMin = new Vector2(0.5f, 0.5f); obj.anchorMax = new Vector2(0.5f, 0.5f); obj.pivot = new Vector2(0.5f, 0.5f); obj.anchoredPosition = Vector2.zero; obj.sizeDelta = size; return obj; } } public static class JetSales { public static bool Owned { get; private set; } public static int Price => Mathf.Max(0, Mathf.RoundToInt(Plugin.Cfg.JetPrice.Value)); public static bool Required => Plugin.Cfg.RequirePurchase.Value; public static bool Available { get { if (!Owned) { return !Required; } return true; } } public static void Load() { Owned = Plugin.Cfg.JetPurchased.Value; } public static bool CanAfford() { try { return MoneyManager.CanAfford(Price); } catch { return false; } } public static string HoverText() { if (Available) { return "The A-10 is on the deck"; } return "Buy the A-10 - $" + Price.ToString("N0", Feedback.Numbers) + "\n" + SpriteManager.GetPickUpInput(); } public static void Request() { if (Available) { Feedback.Say("The A-10 is already yours."); } else if (!CanAfford()) { Refused(); } else if (Server()) { Settle(); } else { JetNetwork.SendPurchase(); } } public static bool Settle() { if (Owned) { return true; } if (!Server()) { return false; } if (!CanAfford()) { return false; } try { MoneyManager.RemoveMoney(Price, Player.LocalPlayer); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not take the money: " + ex.Message)); return false; } Grant(); JetNetwork.SendPurchased(); return true; } public static void Grant() { if (!Owned) { Owned = true; Plugin.Cfg.JetPurchased.Value = true; Feedback.Good("The A-10 is yours. She is waiting on the deck."); VendorInteractable.Reset(); JetFleet.OnIslandLoaded(); } } public static void Refund() { Owned = false; Plugin.Cfg.JetPurchased.Value = false; VendorInteractable.Reset(); } public static void Refused() { Feedback.Warn("that is $" + Price.ToString("N0", Feedback.Numbers) + " and the till has $" + Money().ToString("N0", Feedback.Numbers) + "."); try { AudioManager.PlayGlobalClip("Error", true, 0.3f, 0.1f, false); } catch { } } private static int Money() { try { return MoneyManager.Money; } catch { return 0; } } private static bool Server() { try { return InstanceFinder.IsServerStarted; } catch { return true; } } } public static class JetTracers { private class Tracer { public LineRenderer Line; public Vector3 Origin; public Vector3 Position; public Vector3 Velocity; public float Life; } private static readonly List Live = new List(); private static readonly Queue Pool = new Queue(); private static Transform _root; private static Material _material; private static int _counter; private static MaterialPropertyBlock _block; public static void Spawn(Vector3 origin, Vector3 velocity) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) ModConfig cfg = Plugin.Cfg; if (cfg.TracerLength.Value <= 0f) { return; } int num = Mathf.Max(1, Mathf.RoundToInt(cfg.TracerEvery.Value)); if (_counter++ % num == 0) { Tracer tracer = Rent(); if (tracer != null) { tracer.Origin = origin; tracer.Position = origin; tracer.Velocity = velocity; tracer.Life = cfg.TracerLife.Value; tracer.Line.startWidth = cfg.TracerWidth.Value; tracer.Line.endWidth = cfg.TracerWidth.Value * 0.35f; ((Renderer)tracer.Line).enabled = true; Place(tracer, cfg); Live.Add(tracer); } } } public static void Tick() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (Live.Count == 0) { return; } ModConfig cfg = Plugin.Cfg; float deltaTime = Time.deltaTime; for (int num = Live.Count - 1; num >= 0; num--) { Tracer tracer = Live[num]; tracer.Life -= deltaTime; if (tracer.Life <= 0f || (Object)(object)tracer.Line == (Object)null) { Retire(tracer, num); } else { tracer.Position += tracer.Velocity * deltaTime; Place(tracer, cfg); } } } private static void Place(Tracer tracer, ModConfig cfg) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_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_0066: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0111: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown Vector3 val = tracer.Position - tracer.Origin; float magnitude = ((Vector3)(ref val)).magnitude; float num = Mathf.Min(cfg.TracerLength.Value, magnitude); Vector3 val2 = ((((Vector3)(ref tracer.Velocity)).sqrMagnitude > 0.01f) ? (((Vector3)(ref tracer.Velocity)).normalized * num) : Vector3.zero); tracer.Line.SetPosition(0, tracer.Position - val2); tracer.Line.SetPosition(1, tracer.Position); float num2 = Mathf.Clamp01(tracer.Life / Mathf.Max(cfg.TracerLife.Value, 0.01f)); Color val3 = cfg.TracerColour(); val3.a *= num2; if (_block == null) { _block = new MaterialPropertyBlock(); } ((Renderer)tracer.Line).GetPropertyBlock(_block); _block.SetColor("_BaseColor", val3); _block.SetColor("_Color", val3); ((Renderer)tracer.Line).SetPropertyBlock(_block); tracer.Line.startColor = new Color(val3.r, val3.g, val3.b, val3.a * 0.2f); tracer.Line.endColor = val3; } private static Tracer Rent() { ModConfig cfg = Plugin.Cfg; int num = Mathf.Max(4, Mathf.RoundToInt(cfg.TracerMax.Value)); if (Live.Count >= num) { Retire(Live[0], 0); } if (Pool.Count > 0) { Tracer tracer = Pool.Dequeue(); if ((Object)(object)tracer.Line != (Object)null) { return tracer; } } return Create(); } private static Tracer Create() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown if ((Object)(object)_root == (Object)null) { GameObject val = new GameObject("A10_Tracers") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); _root = val.transform; } GameObject val2 = new GameObject("Tracer"); val2.transform.SetParent(_root, false); LineRenderer val3 = val2.AddComponent(); val3.positionCount = 2; val3.useWorldSpace = true; val3.numCapVertices = 0; ((Renderer)val3).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val3).receiveShadows = false; ((Renderer)val3).material = TracerMaterial(); val3.textureMode = (LineTextureMode)0; val3.alignment = (LineAlignment)0; return new Tracer { Line = val3 }; } private static Material TracerMaterial() { //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_0059: Expected O, but got Unknown if ((Object)(object)_material != (Object)null) { return _material; } Shader val = Shader.Find("Universal Render Pipeline/Unlit"); if ((Object)(object)val == (Object)null) { val = Shader.Find("Sprites/Default"); } if ((Object)(object)val == (Object)null) { val = Shader.Find("Universal Render Pipeline/Lit"); } _material = new Material(val) { hideFlags = (HideFlags)61 }; if (_material.HasProperty("_Surface")) { _material.SetFloat("_Surface", 1f); } if (_material.HasProperty("_Blend")) { _material.SetFloat("_Blend", 0f); } if (_material.HasProperty("_SrcBlend")) { _material.SetFloat("_SrcBlend", 5f); } if (_material.HasProperty("_DstBlend")) { _material.SetFloat("_DstBlend", 10f); } if (_material.HasProperty("_ZWrite")) { _material.SetFloat("_ZWrite", 0f); } _material.renderQueue = 3000; return _material; } private static void Retire(Tracer tracer, int index) { if ((Object)(object)tracer.Line != (Object)null) { ((Renderer)tracer.Line).enabled = false; } Live.RemoveAt(index); Pool.Enqueue(tracer); } public static void Clear() { Live.Clear(); Pool.Clear(); if ((Object)(object)_root != (Object)null) { Object.Destroy((Object)(object)((Component)_root).gameObject); } _root = null; } } public sealed class JetTrails { private readonly TrailRenderer[] _trails = (TrailRenderer[])(object)new TrailRenderer[2]; private readonly Transform[] _glow = (Transform[])(object)new Transform[2]; private readonly SpriteRenderer[] _glowSprite = (SpriteRenderer[])(object)new SpriteRenderer[2]; private static Material _material; private float _flicker; public JetTrails(Transform jet) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0097: 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_00f7: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) ModConfig cfg = Plugin.Cfg; Vector3 localPosition = default(Vector3); for (int i = 0; i < 2; i++) { int num = ((i != 0) ? 1 : (-1)); ((Vector3)(ref localPosition))..ctor((float)num * cfg.TrailSpread.Value, cfg.TrailHeight.Value, cfg.TrailBack.Value); GameObject val = new GameObject("Exhaust" + num); val.transform.SetParent(jet, false); val.transform.localPosition = localPosition; SpriteRenderer val2 = val.AddComponent(); val2.sprite = Textures.Disc(96); ((Renderer)val2).material = Material(); ((Renderer)val2).enabled = false; _glow[i] = val.transform; _glowSprite[i] = val2; GameObject val3 = new GameObject("Contrail" + num); val3.transform.SetParent(jet, false); val3.transform.localPosition = localPosition; TrailRenderer val4 = val3.AddComponent(); ((Renderer)val4).material = Material(); val4.time = cfg.TrailSeconds.Value; val4.startWidth = cfg.TrailWidth.Value; val4.endWidth = cfg.TrailWidth.Value * cfg.TrailSpreadRate.Value; val4.minVertexDistance = 0.5f; val4.numCapVertices = 2; ((Renderer)val4).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val4).receiveShadows = false; val4.emitting = false; val4.alignment = (LineAlignment)0; Color val5 = (val4.startColor = Mat.Parse(cfg.TrailFade.Value, new Color(0.55f, 0.56f, 0.6f))); val4.endColor = new Color(val5.r, val5.g, val5.b, 0f); _trails[i] = val4; } } public void Place() { //IL_0055: 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) ModConfig cfg = Plugin.Cfg; Vector3 localPosition = default(Vector3); for (int i = 0; i < 2; i++) { int num = ((i != 0) ? 1 : (-1)); ((Vector3)(ref localPosition))..ctor((float)num * cfg.TrailSpread.Value, cfg.TrailHeight.Value, cfg.TrailBack.Value); if ((Object)(object)_glow[i] != (Object)null) { _glow[i].localPosition = localPosition; } if ((Object)(object)_trails[i] != (Object)null) { ((Component)_trails[i]).transform.localPosition = localPosition; } } } public void Tick(JetVehicle jet) { ModConfig cfg = Plugin.Cfg; float open = Mathf.Clamp01((jet.Thrust - cfg.GlowThrottle.Value) / Mathf.Max(1f - cfg.GlowThrottle.Value, 0.01f)); Glow(jet, cfg, open); Contrail(jet, cfg); } private void Glow(JetVehicle jet, ModConfig cfg, float open) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) bool flag = cfg.GlowSize.Value > 0f && open > 0.01f; _flicker = Mathf.Lerp(_flicker, Random.Range(0.88f, 1.12f), Time.deltaTime * 14f); Color color = Mat.Parse(cfg.GlowColour.Value, new Color(1f, 0.55f, 0.22f)); Camera main = Camera.main; for (int i = 0; i < 2; i++) { SpriteRenderer val = _glowSprite[i]; if ((Object)(object)val == (Object)null) { continue; } if (((Renderer)val).enabled != flag) { ((Renderer)val).enabled = flag; } if (flag) { float num = cfg.GlowSize.Value * (0.45f + 0.55f * open) * _flicker; _glow[i].localScale = new Vector3(num, num, num * cfg.GlowStretch.Value); if ((Object)(object)main != (Object)null) { _glow[i].rotation = Quaternion.LookRotation(_glow[i].position - ((Component)main).transform.position); } color.a = Mat.Parse(cfg.GlowColour.Value, Color.white).a * open; val.color = color; } } } private void Contrail(JetVehicle jet, ModConfig cfg) { bool flag = cfg.TrailSeconds.Value > 0f && !jet.OnGround && jet.Speed > cfg.TrailMinSpeed.Value && jet.Thrust > 0.2f; TrailRenderer[] trails = _trails; foreach (TrailRenderer val in trails) { if (!((Object)(object)val == (Object)null)) { if (val.emitting != flag) { val.emitting = flag; } if (flag) { val.time = cfg.TrailSeconds.Value; } } } } public void Clear() { TrailRenderer[] trails = _trails; foreach (TrailRenderer val in trails) { if ((Object)(object)val != (Object)null) { val.Clear(); } } SpriteRenderer[] glowSprite = _glowSprite; foreach (SpriteRenderer val2 in glowSprite) { if ((Object)(object)val2 != (Object)null) { ((Renderer)val2).enabled = false; } } } private static Material Material() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown if ((Object)(object)_material != (Object)null) { return _material; } Shader val = Shader.Find("Sprites/Default"); if ((Object)(object)val == (Object)null) { val = Shader.Find("Universal Render Pipeline/Unlit"); } _material = new Material(val) { hideFlags = (HideFlags)61 }; _material.renderQueue = 3000; return _material; } } public sealed class JetVehicle : MonoBehaviour { public static readonly List All = new List(); private Quaternion _wireAttitude = Quaternion.identity; private float _wireAt = -99f; private static float _killedAt = -99f; private JetTrails _trails; private readonly RaycastHit[] _casts = (RaycastHit[])(object)new RaycastHit[8]; private Vector3 _rates; private float _dropSign = 1f; private bool _settled = true; private JetInteractable _interactable; private AudioSource _engine; private AudioSource _gun; private AudioSource _gunOneShot; private AudioSource _gunCockpit; private bool _wasFiring; private float _remoteFiringUntil = -99f; private float _gunHeardAt; private float _audioFade; public static JetVehicle Local { get; private set; } public Player Pilot { get; private set; } public bool FlownLocally { get { if ((Object)(object)Pilot != (Object)null) { return (Object)(object)Pilot == (Object)(object)Player.LocalPlayer; } return false; } } public bool RemotelyFlown { get; private set; } public Vector3 Velocity { get; private set; } public float Speed { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = Velocity; return ((Vector3)(ref velocity)).magnitude; } } public float Throttle { get; private set; } public float Thrust { get; private set; } public float Aoa { get; private set; } public float Sideslip { get; private set; } public float GLoad { get; private set; } public float StallAmount { get; private set; } public bool Stalled => StallAmount > 0f; public bool OnGround { get; private set; } public bool Wrecked { get; private set; } public float Greyout { get; private set; } public int Ammo { get; set; } public float PitchRate => _rates.x; public float YawRate => _rates.y; public float RollRate => _rates.z; public Vector2 Controls { get; private set; } public static bool KillingPilot => Time.time - _killedAt < 2f; public JetGear Gear { get; private set; } public JetHull Hull { get; private set; } public JetTrails Trails => _trails; public Transform Seat { get; private set; } public Transform Muzzle { get; private set; } private bool Mine(Collider collider) { if ((Object)(object)collider != (Object)null) { return ((Component)collider).transform.IsChildOf(((Component)this).transform); } return false; } private void Awake() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) All.Add(this); Gear = new JetGear(((Component)this).gameObject); Hull = new JetHull(this); _trails = new JetTrails(((Component)this).transform); Seat = Anchor("Seat", Plugin.Cfg.Seat); _engine = JetAudio.Attach(((Component)this).transform); _gun = JetAudio.AttachCannon(((Component)this).transform); _gunOneShot = JetAudio.AttachOneShot(((Component)this).transform); _gunCockpit = JetAudio.AttachCockpit(((Component)this).transform); Muzzle = Anchor("Muzzle", Plugin.Cfg.MuzzleOffset); _dropSign = ((All.Count % 2 == 0) ? 1f : (-1f)); } private void OnDestroy() { All.Remove(this); if (!((Object)(object)Local != (Object)(object)this)) { Local = null; ReleaseLocalPilot(); } } public static void ReleaseLocalPilot() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.LocalPlayer; if ((Object)(object)localPlayer != (Object)null && (Object)(object)localPlayer.Rigidbody != (Object)null) { localPlayer.Rigidbody.isKinematic = false; } GameFlags.Release(); JetCamera.End(); JetFog.Restore(); JetHud.Hide(); JetRadar.Toggle(on: false); VanillaHud.Restore(); JetInput.Reset(); try { ShaderManager.UpdateVignette(0f, Color.black); } catch { } } private Transform Anchor(string name, Vector3 localPos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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) GameObject val = new GameObject(name); val.transform.SetParent(((Component)this).transform, false); val.transform.localPosition = localPos; return val.transform; } public void AttachInteractable(JetInteractable interactable) { _interactable = interactable; } public void RefreshAnchors() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Seat != (Object)null) { Seat.localPosition = Plugin.Cfg.Seat; } if ((Object)(object)Muzzle != (Object)null) { Muzzle.localPosition = Plugin.Cfg.MuzzleOffset; } } public void SetRemotePilot(Player pilot, Quaternion attitude) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)pilot == (Object)null) && !((Object)(object)pilot == (Object)(object)Player.LocalPlayer) && !FlownLocally) { Pilot = pilot; RemotelyFlown = true; _wireAttitude = attitude; _wireAt = Time.time; if ((Object)(object)_interactable != (Object)null) { ((Interactable)_interactable).ToggleIsInteractable(false); } } } public void ClearRemotePilot() { if (RemotelyFlown) { Pilot = null; RemotelyFlown = false; Throttle = 0f; _settled = false; if ((Object)(object)_interactable != (Object)null && !Wrecked) { ((Interactable)_interactable).ToggleIsInteractable(true); } } } public void ReceivePose(Player pilot, Quaternion attitude) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Pilot != (Object)(object)pilot) { SetRemotePilot(pilot, attitude); } if (RemotelyFlown) { _wireAttitude = attitude; _wireAt = Time.time; } } public void RemoteFire() { _remoteFiringUntil = Time.time + 0.2f; } public void FireForShow(float seconds) { _remoteFiringUntil = Time.time + seconds; } public void RemoteTick() { //IL_005c: 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_007d: 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_00a3: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if (!RemotelyFlown) { return; } ModConfig cfg = Plugin.Cfg; if ((Object)(object)Pilot == (Object)null || (Object)(object)Pilot.Transform == (Object)null || Time.time - _wireAt > cfg.PoseTimeout.Value) { ClearRemotePilot(); return; } ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, _wireAttitude, Mathf.Clamp01(Time.deltaTime * cfg.PoseSmoothing.Value)); ((Component)this).transform.position = Pilot.Transform.position - ((Component)this).transform.rotation * Seat.localPosition; Velocity = Vector3.zero; Throttle = 0.75f; Thrust = 0.75f; if (_trails != null) { _trails.Tick(this); } UpdateEngineAudio(cfg); UpdateGunAudio(cfg); } public bool TryMount(Player player) { if ((Object)(object)player == (Object)null || (Object)(object)Pilot != (Object)null || Wrecked) { return false; } if (!JetSales.Available) { return false; } Pilot = player; if ((Object)(object)player == (Object)(object)Player.LocalPlayer) { Local = this; player.Rigidbody.isKinematic = true; GameFlags.Raise(); JetInput.Reset(); JetCamera.Begin(this); JetNetwork.SendMount(); if (Plugin.Cfg.HideIslandWarning.Value) { try { PlayerUI.ToggleIslandWarning(false); } catch { } } } if ((Object)(object)_interactable != (Object)null) { ((Interactable)_interactable).ToggleIsInteractable(false); } return true; } public void Dismount() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) Player pilot = Pilot; Pilot = null; if ((Object)(object)pilot != (Object)null && (Object)(object)pilot == (Object)(object)Player.LocalPlayer) { pilot.Rigidbody.isKinematic = false; Vector3 vel = Velocity + Vector3.up * Plugin.Cfg.BailOutImpulse.Value; ((Component)pilot.Rigidbody).transform.position = Seat.position + Vector3.up * Plugin.Cfg.BailOutClearance.Value; pilot.Movement.SetVel(vel); ClearGreyout(); GameFlags.Release(); JetCamera.End(); JetFog.Restore(); JetInput.Reset(); JetNetwork.SendDismount(); Local = null; } if ((Object)(object)_interactable != (Object)null && !Wrecked) { ((Interactable)_interactable).ToggleIsInteractable(true); } } public void Park(Vector3 position, Quaternion rotation) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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) ((Component)this).transform.SetPositionAndRotation(position, rotation); Velocity = Vector3.zero; _rates = Vector3.zero; Throttle = 0f; Thrust = 0f; Aoa = 0f; Sideslip = 0f; GLoad = 1f; StallAmount = 0f; Greyout = 0f; Wrecked = false; RemotelyFlown = false; Ammo = Mathf.RoundToInt(Plugin.Cfg.CannonAmmo.Value); _settled = true; OnGround = true; if (Gear != null) { Gear.Snap(up: false); } Controls = Vector2.zero; _audioFade = 0f; if (_trails != null) { _trails.Clear(); } if ((Object)(object)_engine != (Object)null && _engine.isPlaying) { _engine.Stop(); } if ((Object)(object)_gun != (Object)null && _gun.isPlaying) { _gun.Stop(); } if ((Object)(object)_interactable != (Object)null) { ((Interactable)_interactable).ToggleIsInteractable((Object)(object)Pilot == (Object)null); } } private void FixedUpdate() { //IL_0123: 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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) if (RemotelyFlown) { return; } float fixedDeltaTime = Time.fixedDeltaTime; ModConfig cfg = Plugin.Cfg; float rollInput; float rudder; if (FlownLocally) { _settled = false; rollInput = JetInput.Roll; rudder = JetInput.Rudder; Throttle = Mathf.Clamp01(Throttle + JetInput.ThrottleAxis() * cfg.ThrottleRate.Value * fixedDeltaTime); } else { if (_settled) { Idle(cfg); return; } rollInput = 0f; rudder = 0f; Throttle = Mathf.MoveTowards(Throttle, 0f, cfg.ThrottleRate.Value * fixedDeltaTime); } Thrust = Mathf.MoveTowards(Thrust, Throttle, fixedDeltaTime / Mathf.Max(cfg.SpoolTime.Value, 0.05f)); if (Gear != null) { if (FlownLocally && JetInput.GearPressed()) { Gear.Toggle(); } Gear.Tick(fixedDeltaTime); } Step(rollInput, rudder, fixedDeltaTime, cfg); if (_trails != null) { _trails.Tick(this); } if (!Impact(fixedDeltaTime, cfg)) { Ground(((Component)this).transform.position + Velocity * fixedDeltaTime, fixedDeltaTime, cfg, rudder); } UpdateGreyout(fixedDeltaTime, cfg); UpdateEngineAudio(cfg); UpdateGunAudio(cfg); } private void Step(float rollInput, float rudder, float dt, ModConfig cfg) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: 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_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0234: 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_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = Velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; bool flag = (Object)(object)Pilot != (Object)null; float num = Mathf.Max(cfg.FlySpeed.Value, 1f); float num2 = Mathf.Clamp01(magnitude / num); float num3 = num / Mathf.Sqrt(Mathf.Max(cfg.Lift.Value, 0.01f)); StallAmount = (flag ? Mathf.Clamp01(1f - magnitude / num3) : 0f); Steer(rollInput, rudder, dt, cfg, flag ? Mathf.Lerp(cfg.SlowAuthority.Value, 1f, num2) : 0f); Vector3 val = ((magnitude > 0.01f) ? (Velocity / magnitude) : ((Component)this).transform.forward); magnitude = Mathf.Clamp(magnitude + (Thrust * cfg.MaxThrust.Value - Drag(cfg) * magnitude * magnitude) * dt, 0f, cfg.MaxSpeed.Value); Vector3 val2 = val * magnitude + Vector3.down * cfg.Gravity.Value * dt; magnitude = ((Vector3)(ref val2)).magnitude; val = ((magnitude > 0.01f) ? (val2 / magnitude) : ((Component)this).transform.forward); Vector3 val3 = val; float num4 = (flag ? (cfg.Lift.Value * cfg.Gravity.Value * magnitude / (num * num)) : 0f); float num5 = Mathf.Min(Vector3.Angle(val, ((Component)this).transform.forward) * ((float)Math.PI / 180f) * cfg.AlignGain.Value, num4); val = Vector3.RotateTowards(val, ((Component)this).transform.forward, num5 * dt, 0f); Velocity = val * magnitude; Vector3 val4 = Quaternion.Inverse(((Component)this).transform.rotation) * Velocity; Aoa = ((magnitude < 1f) ? 0f : (Mathf.Atan2(0f - val4.y, val4.z) * 57.29578f)); Sideslip = ((magnitude < 1f) ? 0f : (Mathf.Atan2(val4.x, val4.z) * 57.29578f)); GLoad = 1f + magnitude * Vector3.Angle(val3, val) * ((float)Math.PI / 180f) / dt / cfg.Gravity.Value; } private void Steer(float rollInput, float rudder, float dt, ModConfig cfg, float authority) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Quaternion.Inverse(((Component)this).transform.rotation) * JetArcade.AimDirection; float num = Mathf.Atan2(val.x, Mathf.Max(val.z, 0.05f)) * 57.29578f; float num2 = Mathf.Atan2(val.y, Mathf.Max(val.z, 0.05f)) * 57.29578f; float value = cfg.Chase.Value; float value2 = cfg.PitchRate.Value; float value3 = cfg.RollRate.Value; float num3 = Mathf.Clamp(num2 * value, 0f - value2, value2); float num4 = Mathf.Clamp(num * value, 0f - cfg.YawRate.Value, cfg.YawRate.Value) + rudder * cfg.RudderRate.Value; float num5 = Mathf.Clamp(JetArcade.LateralError(this) * cfg.BankPerDegree.Value, 0f - cfg.MaxBank.Value, cfg.MaxBank.Value); float num6 = JetArcade.BankAngle(this); float num7 = Mathf.Clamp((num5 - num6) * cfg.BankGain.Value, 0f - value3, value3); if (Mathf.Abs(rollInput) > 0.05f) { num7 = rollInput * value3; } if (OnGround) { num7 = Mathf.Clamp((0f - num6) * 4f, 0f - value3, value3); num3 = Mathf.Max(num3, 0f); num4 = 0f; } _rates = new Vector3(num3, num4, num7) * authority; Controls = new Vector2(_rates.z / value3, _rates.x / value2); Transform transform = ((Component)this).transform; transform.rotation *= Quaternion.Euler((0f - _rates.x) * dt, _rates.y * dt, (0f - _rates.z) * dt); } private bool Impact(float dt, ModConfig cfg) { //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) //IL_0054: 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: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) if (Wrecked || OnGround || (Object)(object)Pilot == (Object)null) { return false; } float value = cfg.ImpactRadius.Value; Vector3 velocity = Velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; if (value <= 0f || magnitude < 25f) { return false; } int num = Physics.SphereCastNonAlloc(((Component)this).transform.position, value, Velocity / magnitude, _casts, magnitude * dt, LayerMask.op_Implicit(GameInfo.CanJumpOnLayers), (QueryTriggerInteraction)1); bool flag = false; for (int i = 0; i < num; i++) { if (!Mine(((RaycastHit)(ref _casts[i])).collider)) { flag = true; break; } } if (!flag) { return false; } Velocity = Vector3.zero; Touchdown(overWater: false, cfg, $"flew into it at {magnitude:F0} m/s"); return true; } private float Drag(ModConfig cfg) { return cfg.Drag.Value + cfg.GearDrag.Value * (1f - ((Gear == null) ? 1f : Gear.Position)); } private void Idle(ModConfig cfg) { Throttle = 0f; Thrust = 0f; UpdateEngineAudio(cfg); UpdateGunAudio(cfg); } private void Ground(Vector3 next, float dt, ModConfig cfg, float rudder) { //IL_0016: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0081: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: 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_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) float value = cfg.GearHeight.Value; float num = WaterLevel() + value; bool overWater = true; int num2 = Physics.RaycastNonAlloc(next + Vector3.up * 6f, Vector3.down, _casts, value + 12f, LayerMask.op_Implicit(GameInfo.CanJumpOnLayers), (QueryTriggerInteraction)1); float num3 = float.NegativeInfinity; for (int i = 0; i < num2; i++) { if (!Mine(((RaycastHit)(ref _casts[i])).collider) && ((RaycastHit)(ref _casts[i])).point.y > num3) { num3 = ((RaycastHit)(ref _casts[i])).point.y; } } if (num3 > float.NegativeInfinity && num3 + value > num) { num = num3 + value; overWater = false; } if (next.y > num + 0.25f) { OnGround = false; ((Component)this).transform.position = next; return; } bool num4 = !OnGround; OnGround = true; next.y = num; if (num4 && !Wrecked) { Touchdown(overWater, cfg, null); } Vector3 val = Velocity; if (val.y < 0f) { val.y = 0f; } float num5 = ((Wrecked || (Object)(object)Pilot == (Object)null) ? cfg.GroundFriction.Value : (JetInput.Brakes() ? cfg.BrakeFriction.Value : cfg.RollingFriction.Value)); val = Vector3.MoveTowards(val, Vector3.zero, num5 * dt); if (!Wrecked && (Object)(object)Pilot != (Object)null && ((Vector3)(ref val)).magnitude > 0.5f) { Quaternion val2 = Quaternion.AngleAxis(rudder * cfg.NosewheelPower.Value * dt, Vector3.up); ((Component)this).transform.rotation = val2 * ((Component)this).transform.rotation; val = val2 * val; } if (((Vector3)(ref val)).magnitude < 0.5f && (Object)(object)Pilot == (Object)null) { val = Vector3.zero; _settled = true; } Velocity = val; ((Component)this).transform.position = next; } private void Touchdown(bool overWater, ModConfig cfg, string forced) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_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) float num = Mathf.Max(0f, 0f - Velocity.y); float num2 = Mathf.Abs(Mathf.DeltaAngle(0f, ((Component)this).transform.eulerAngles.z)); float num3 = Mathf.DeltaAngle(0f, ((Component)this).transform.eulerAngles.x); bool flag = Gear != null && Gear.Found > 0 && !Gear.Down; if (forced != null || flag || overWater || num > cfg.MaxSinkRate.Value || num2 > cfg.MaxLandingBank.Value || num3 > cfg.MaxLandingPitch.Value || Speed > cfg.MaxLandingSpeed.Value) { Wrecked = true; _rates = Vector3.zero; string text = forced ?? (flag ? "landed on the gear doors" : (overWater ? "ditched in the sea" : ((num > cfg.MaxSinkRate.Value) ? $"{num:F0} m/s sink rate" : ((num2 > cfg.MaxLandingBank.Value) ? $"{num2:F0} deg of bank" : ((num3 > cfg.MaxLandingPitch.Value) ? "nose down" : $"{Speed:F0} m/s too fast"))))); Feedback.Warn("Airframe lost - " + text + ". Type " + Feedback.Key("/a10 recover") + " for a replacement."); bool flownLocally = FlownLocally; Player pilot = Pilot; if ((Object)(object)_interactable != (Object)null) { ((Interactable)_interactable).ToggleIsInteractable(false); } Explode(); if (flownLocally) { Dismount(); } if (flownLocally && cfg.CrashKills.Value) { Kill(pilot); } JetFleet.Scrap(this); } } private void Explode() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; try { string text = Fx.Explosion(); if (text != null) { ParticleManager.Play(text, position); } Boom.At("Explosion", position, 0.9f, (AudioDistance)3); Player localPlayer = Player.LocalPlayer; if ((Object)(object)localPlayer != (Object)null && (Object)(object)localPlayer.ScreenShake != (Object)null) { localPlayer.ScreenShake.ShakeAt(position, 1, Plugin.Cfg.CrashShake.Value, 10f, 100f, default(Vector2)); } } catch (Exception ex) { Plugin.Log.LogDebug((object)("No crash explosion: " + ex.Message)); } } private static void Kill(Player pilot) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pilot == (Object)null) { return; } _killedAt = Time.time; try { Server.Instance.HitPlayer(pilot, 9999, Vector3.up * 4f, pilot.Transform.position, (byte)2, (Player)null); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Crash did not kill: " + ex.Message)); } } private void UpdateEngineAudio(ModConfig cfg) { if ((Object)(object)_engine == (Object)null) { return; } JetAudio.Route(_engine); float num = (RemotelyFlown ? Time.deltaTime : Time.fixedDeltaTime); if (!((Object)(object)Pilot != (Object)null) && !(Thrust > 0.02f)) { _audioFade = Mathf.MoveTowards(_audioFade, 0f, num / Mathf.Max(cfg.EngineFadeOut.Value, 0.05f)); if (_audioFade <= 0f && _engine.isPlaying) { _engine.Stop(); return; } } else { if (!_engine.isPlaying) { _audioFade = 0f; _engine.time = 0f; _engine.Play(); } _audioFade = Mathf.MoveTowards(_audioFade, 1f, num / Mathf.Max(cfg.EngineFadeIn.Value, 0.05f)); } _engine.dopplerLevel = (FlownLocally ? 0f : cfg.EngineDoppler.Value); float num2 = Mathf.Clamp01(Thrust); _engine.pitch = Mathf.Lerp(cfg.EnginePitchIdle.Value, cfg.EnginePitchFull.Value, num2); _engine.volume = Mathf.Lerp(cfg.EngineVolumeIdle.Value, cfg.EngineVolume.Value, num2) * _audioFade; } private void UpdateGunAudio(ModConfig cfg) { //IL_0158: Unknown result type (might be due to invalid IL or missing references) bool flag = Time.time < _remoteFiringUntil || (FlownLocally && JetCannon.Firing); JetAudio.Route(_gun); JetAudio.Route(_gunOneShot); JetAudio.Route(_gunCockpit); if ((Object)(object)_gunCockpit != (Object)null) { if (FlownLocally) { if (flag) { if (!_gunCockpit.isPlaying) { _gunCockpit.Play(); } _gunCockpit.volume = cfg.CockpitVolume.Value; } else if (_gunCockpit.isPlaying) { _gunCockpit.volume = Mathf.MoveTowards(_gunCockpit.volume, 0f, Time.fixedDeltaTime * cfg.CannonRelease.Value); if (_gunCockpit.volume <= 0f) { _gunCockpit.Stop(); } } } else if (_gunCockpit.isPlaying) { _gunCockpit.Stop(); } } if (FlownLocally) { _wasFiring = flag; if ((Object)(object)_gun != (Object)null && _gun.isPlaying) { _gun.Stop(); } return; } if (flag != _wasFiring) { _wasFiring = flag; _gunHeardAt = Time.time + Boom.Delay(((Component)this).transform.position); OneShot(flag ? JetAudio.CannonStart : JetAudio.CannonStop, cfg); } if ((Object)(object)_gun == (Object)null) { return; } Muffle(_gun, cfg); Muffle(_gunOneShot, cfg); bool flag2 = Time.time >= _gunHeardAt; if (flag && flag2) { if (!_gun.isPlaying) { _gun.Play(); } _gun.volume = cfg.CannonVolume.Value; } else if ((flag || flag2) && _gun.isPlaying) { _gun.volume = Mathf.MoveTowards(_gun.volume, 0f, Time.fixedDeltaTime * cfg.CannonRelease.Value); if (_gun.volume <= 0f) { _gun.Stop(); } } } private static void Muffle(AudioSource source, ModConfig cfg) { //IL_0055: 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) if ((Object)(object)source == (Object)null) { return; } AudioLowPassFilter component = ((Component)source).GetComponent(); if (!((Object)(object)component == (Object)null)) { Player localPlayer = Player.LocalPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Object)(object)localPlayer.Transform == (Object)null)) { float num = Mathf.Max(cfg.CannonRange.Value, 1f); float num2 = Mathf.Clamp01(Vector3.Distance(((Component)source).transform.position, localPlayer.Transform.position) / num); component.cutoffFrequency = Mathf.Lerp(22000f, cfg.CannonFarCutoff.Value, num2 * num2); } } } private void OneShot(AudioClip clip, ModConfig cfg) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)clip == (Object)null) && !((Object)(object)_gunOneShot == (Object)null)) { float num = cfg.CannonVolume.Value * cfg.CannonTailVolume.Value; float num2 = Boom.Delay(((Component)this).transform.position); if (num2 < 0.02f || (Object)(object)WarthogRuntime.Instance == (Object)null) { _gunOneShot.PlayOneShot(clip, num); } else { ((MonoBehaviour)WarthogRuntime.Instance).StartCoroutine(LateShot(clip, num, num2)); } } } private IEnumerator LateShot(AudioClip clip, float volume, float wait) { yield return (object)new WaitForSeconds(wait); if ((Object)(object)_gunOneShot != (Object)null) { _gunOneShot.PlayOneShot(clip, volume); } } private void UpdateGreyout(float dt, ModConfig cfg) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (!FlownLocally) { return; } float num = Mathf.Max(cfg.GreyoutFull.Value - cfg.GreyoutOnset.Value, 0.1f); float num2 = Mathf.Clamp01((Mathf.Abs(GLoad) - cfg.GreyoutOnset.Value) / num); float num3 = ((num2 > Greyout) ? cfg.GreyoutRate.Value : cfg.GreyoutRecovery.Value); Greyout = Mathf.MoveTowards(Greyout, num2, dt / Mathf.Max(num3, 0.05f)); try { ShaderManager.UpdateVignette(Mathf.Min(Greyout * cfg.GreyoutStrength.Value, 2f), Color.black); } catch { } } public void ClearGreyout() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) Greyout = 0f; try { ShaderManager.UpdateVignette(0f, Color.black); } catch { } } private static float WaterLevel() { try { return WaterManager.WaterHeight; } catch { return 0f; } } public void ApplyRecoil(float decel) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity = Velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; if (!(magnitude < 0.01f)) { Velocity = Velocity / magnitude * Mathf.Max(0f, magnitude - decel); } } public void PinPilot() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (FlownLocally && !((Object)(object)Seat == (Object)null)) { ((Component)Pilot.Rigidbody).transform.position = Seat.position; } } } public static class Mat { private static Shader _lit; private static Material _donor; public static Color Parse(string hex, Color fallback) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(hex)) { return fallback; } string text = hex.Trim(); if (!text.StartsWith("#")) { text = "#" + text; } Color result = default(Color); if (!ColorUtility.TryParseHtmlString(text, ref result)) { return fallback; } return result; } private static Shader Lit() { if ((Object)(object)_lit != (Object)null) { return _lit; } _lit = Shader.Find("Universal Render Pipeline/Lit"); if ((Object)(object)_lit == (Object)null) { _lit = Shader.Find("Universal Render Pipeline/Simple Lit"); } if ((Object)(object)_lit == (Object)null) { Plugin.Log.LogWarning((object)"URP Lit shader not found; falling back to a scene material."); } return _lit; } private static Material Donor() { if ((Object)(object)_donor != (Object)null) { return _donor; } MeshRenderer[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (MeshRenderer val in array) { Material sharedMaterial = ((Renderer)val).sharedMaterial; if (!((Object)(object)sharedMaterial == (Object)null) && !((Object)(object)sharedMaterial.shader == (Object)null) && !((Object)sharedMaterial.shader).name.Contains("Hidden")) { _donor = sharedMaterial; Plugin.Log.LogDebug((object)("Borrowing shader '" + ((Object)sharedMaterial.shader).name + "' from " + ((Object)val).name)); return _donor; } } return null; } public static Material Solid(Color color, float smoothness = 0.1f, float metallic = 0f) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) Shader val = Lit(); Material val2; if ((Object)(object)val != (Object)null) { val2 = new Material(val); } else { Material val3 = Donor(); if ((Object)(object)val3 == (Object)null) { return null; } val2 = new Material(val3); } if (val2.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", color); } if (val2.HasProperty("_Color")) { val2.SetColor("_Color", color); } val2.color = color; if (val2.HasProperty("_Smoothness")) { val2.SetFloat("_Smoothness", smoothness); } if (val2.HasProperty("_Metallic")) { val2.SetFloat("_Metallic", metallic); } return val2; } } public sealed class ModConfig { private const int TuningRevision = 50; private const string General = "01 - General"; private const string Model = "02 - Model"; private const string Ship = "03 - Carrier"; private const string Cockpit = "04 - Cockpit"; private const string Flight = "05 - Flight"; private const string View = "06 - Camera"; private const string Sticks = "07 - Controls"; private const string Hud = "08 - HUD"; private const string Sound = "09 - Sound"; private const string Gun = "10 - Cannon"; public readonly ConfigEntry Revision; public readonly ConfigEntry ChatRichText; public readonly ConfigEntry ChatTagColour; public readonly ConfigEntry ChatKeyColour; public readonly ConfigEntry ChatValueColour; public readonly ConfigEntry ChatWarnColour; public readonly ConfigEntry ChatFeedback; public readonly ConfigEntry Multiplayer; public readonly ConfigEntry PoseRate; public readonly ConfigEntry PoseTimeout; public readonly ConfigEntry PoseSmoothing; public readonly ConfigEntry HullSolid; public readonly ConfigEntry HullDebug; public readonly ConfigEntry HullDebugColour; public readonly ConfigEntry HullBodyWidth; public readonly ConfigEntry HullBodyHeight; public readonly ConfigEntry HullBodyLength; public readonly ConfigEntry HullBodyRise; public readonly ConfigEntry HullWingSpan; public readonly ConfigEntry HullWingThickness; public readonly ConfigEntry HullWingChord; public readonly ConfigEntry HullWingRise; public readonly ConfigEntry HullWingBack; public readonly ConfigEntry Scale; public readonly ConfigEntry PivotX; public readonly ConfigEntry PivotY; public readonly ConfigEntry PivotZ; public readonly ConfigEntry YawOffset; public readonly ConfigEntry CarrierDistance; public readonly ConfigEntry CarrierLength; public readonly ConfigEntry CarrierWidth; public readonly ConfigEntry CarrierDeckHeight; public readonly ConfigEntry CarrierDraft; public readonly ConfigEntry JetShoreOffset; public readonly ConfigEntry RequirePurchase; public readonly ConfigEntry JetPurchased; public readonly ConfigEntry JetPrice; public readonly ConfigEntry VendorX; public readonly ConfigEntry VendorZ; public readonly ConfigEntry VendorYaw; public readonly ConfigEntry VendorStand; public readonly ConfigEntry VendorNpc; public readonly ConfigEntry VendorSuitColour; public readonly ConfigEntry RampAngle; public readonly ConfigEntry RampWidth; public readonly ConfigEntry RampPosition; public readonly ConfigEntry SeatX; public readonly ConfigEntry SeatY; public readonly ConfigEntry SeatZ; public readonly ConfigEntry MuzzleX; public readonly ConfigEntry MuzzleY; public readonly ConfigEntry MuzzleZ; public readonly ConfigEntry GearHeight; public readonly ConfigEntry ImpactRadius; public readonly ConfigEntry GearSeconds; public readonly ConfigEntry GearDrag; public readonly ConfigEntry GearKey; public readonly ConfigEntry GearHandedness; public readonly ConfigEntry MaxThrust; public readonly ConfigEntry MaxSpeed; public readonly ConfigEntry Drag; public readonly ConfigEntry Gravity; public readonly ConfigEntry FlySpeed; public readonly ConfigEntry PitchRate; public readonly ConfigEntry YawRate; public readonly ConfigEntry RollRate; public readonly ConfigEntry Chase; public readonly ConfigEntry Cone; public readonly ConfigEntry Sensitivity; public readonly ConfigEntry MaxBank; public readonly ConfigEntry BankPerDegree; public readonly ConfigEntry BankGain; public readonly ConfigEntry AlignGain; public readonly ConfigEntry Lift; public readonly ConfigEntry SlowAuthority; public readonly ConfigEntry RudderRate; public readonly ConfigEntry ThrottleRate; public readonly ConfigEntry SpoolTime; public readonly ConfigEntry RollingFriction; public readonly ConfigEntry BrakeFriction; public readonly ConfigEntry NosewheelPower; public readonly ConfigEntry MaxSinkRate; public readonly ConfigEntry MaxLandingBank; public readonly ConfigEntry MaxLandingPitch; public readonly ConfigEntry MaxLandingSpeed; public readonly ConfigEntry GreyoutStrength; public readonly ConfigEntry GreyoutOnset; public readonly ConfigEntry GreyoutFull; public readonly ConfigEntry GreyoutRate; public readonly ConfigEntry GreyoutRecovery; public readonly ConfigEntry RudderLeftAction; public readonly ConfigEntry RudderRightAction; public readonly ConfigEntry ExitKey; public readonly ConfigEntry ThrottleUpKey; public readonly ConfigEntry ThrottleDownKey; public readonly ConfigEntry PitchKeyRate; public readonly ConfigEntry PitchKeysInverted; public readonly ConfigEntry ExitHoldSeconds; public readonly ConfigEntry HudEnabled; public readonly ConfigEntry HudStickSize; public readonly ConfigEntry HudReadout; public readonly ConfigEntry HudTextSize; public readonly ConfigEntry HudPipperSize; public readonly ConfigEntry HudReadoutBottom; public readonly ConfigEntry HudTextColour; public readonly ConfigEntry HudHelp; public readonly ConfigEntry HelpKey; public readonly ConfigEntry HelpMargin; public readonly ConfigEntry HelpHeight; public readonly ConfigEntry CrashParticle; public readonly ConfigEntry CrashShake; public readonly ConfigEntry FogFactor; public readonly ConfigEntry ViewDistance; public readonly ConfigEntry HideHotbar; public readonly ConfigEntry HideVanillaStats; public readonly ConfigEntry CalmCreatures; public readonly ConfigEntry CalmAltitude; public readonly ConfigEntry FreezeVitals; public readonly ConfigEntry CrashKills; public readonly ConfigEntry RespawnSeconds; public readonly ConfigEntry RadarEnabled; public readonly ConfigEntry RadarScale; public readonly ConfigEntry RadarPixels; public readonly ConfigEntry RadarMargin; public readonly ConfigEntry RadarCorner; public readonly ConfigEntry RadarHeight; public readonly ConfigEntry RadarChrome; public readonly ConfigEntry RadarRange; public readonly ConfigEntry RadarDotAlpha; public readonly ConfigEntry RadarSweepSpeed; public readonly ConfigEntry EngineVolume; public readonly ConfigEntry EnginePitchIdle; public readonly ConfigEntry EnginePitchFull; public readonly ConfigEntry EngineVolumeIdle; public readonly ConfigEntry EngineSpatialBlend; public readonly ConfigEntry EngineRange; public readonly ConfigEntry EngineFadeIn; public readonly ConfigEntry EngineFadeOut; public readonly ConfigEntry HideIslandWarning; public readonly ConfigEntry ImpactSparks; public readonly ConfigEntry ImpactSparkSpeed; public readonly ConfigEntry ImpactSparkLife; public readonly ConfigEntry ImpactSparkWidth; public readonly ConfigEntry ImpactSparkColour; public readonly ConfigEntry ImpactPuffSize; public readonly ConfigEntry ImpactPuffLife; public readonly ConfigEntry ImpactPuffColour; public readonly ConfigEntry ImpactParticle; public readonly ConfigEntry ImpactSound; public readonly ConfigEntry ImpactVolume; public readonly ConfigEntry ImpactEvery; public readonly ConfigEntry ImpactSpacing; public readonly ConfigEntry CannonProjectileType; public readonly ConfigEntry CannonDamage; public readonly ConfigEntry CannonHitRadius; public readonly ConfigEntry CannonRoundsPerSecond; public readonly ConfigEntry CannonRoundsPerBurst; public readonly ConfigEntry CannonMuzzleVelocity; public readonly ConfigEntry CannonSpread; public readonly ConfigEntry CannonForce; public readonly ConfigEntry CannonGravity; public readonly ConfigEntry CannonAmmo; public readonly ConfigEntry CannonReloadSeconds; public readonly ConfigEntry CannonRecoil; public readonly ConfigEntry CannonVfx; public readonly ConfigEntry TracerLength; public readonly ConfigEntry TracerWidth; public readonly ConfigEntry TracerLife; public readonly ConfigEntry TracerEvery; public readonly ConfigEntry TracerMax; public readonly ConfigEntry TracerColourHex; public readonly ConfigEntry PipperRange; public readonly ConfigEntry CannonVolume; public readonly ConfigEntry CockpitVolume; public readonly ConfigEntry CockpitCutoff; public readonly ConfigEntry CannonSpatialBlend; public readonly ConfigEntry CannonRange; public readonly ConfigEntry CannonNearDistance; public readonly ConfigEntry CannonFarCutoff; public readonly ConfigEntry CannonEcho; public readonly ConfigEntry CannonEchoDelay; public readonly ConfigEntry CannonEchoDecay; public readonly ConfigEntry CannonTailVolume; public readonly ConfigEntry CannonRelease; public readonly ConfigEntry GroundFriction; public readonly ConfigEntry BailOutImpulse; public readonly ConfigEntry BailOutClearance; public readonly ConfigEntry EngineNearDistance; public readonly ConfigEntry EngineDoppler; public readonly ConfigEntry SpeedOfSound; public readonly ConfigEntry GlowSize; public readonly ConfigEntry GlowStretch; public readonly ConfigEntry GlowThrottle; public readonly ConfigEntry GlowColour; public readonly ConfigEntry TrailSeconds; public readonly ConfigEntry TrailWidth; public readonly ConfigEntry TrailSpreadRate; public readonly ConfigEntry TrailMinSpeed; public readonly ConfigEntry TrailSpread; public readonly ConfigEntry TrailHeight; public readonly ConfigEntry TrailBack; public readonly ConfigEntry TrailFade; public readonly ConfigEntry CameraDistance; public readonly ConfigEntry CameraHeight; public readonly ConfigEntry CameraFovBoost; public readonly ConfigEntry CameraRollFollow; public readonly ConfigEntry CameraLevelRate; public readonly ConfigEntry CameraLag; public readonly ConfigEntry CameraAimFollow; public readonly ConfigEntry FreeLookSensitivity; public Vector3 Pivot => new Vector3(PivotX.Value, PivotY.Value, PivotZ.Value); public Vector3 Seat => new Vector3(SeatX.Value, SeatY.Value, SeatZ.Value); public Vector3 MuzzleOffset => new Vector3(MuzzleX.Value, MuzzleY.Value, MuzzleZ.Value); public ModConfig(ConfigFile file) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Expected O, but got Unknown //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Expected O, but got Unknown //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Expected O, but got Unknown //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Expected O, but got Unknown //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Expected O, but got Unknown //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Expected O, but got Unknown //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Expected O, but got Unknown //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Expected O, but got Unknown //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Expected O, but got Unknown //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Expected O, but got Unknown //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Expected O, but got Unknown //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Expected O, but got Unknown //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Expected O, but got Unknown //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Expected O, but got Unknown //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Expected O, but got Unknown //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Expected O, but got Unknown //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Expected O, but got Unknown //IL_06bd: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Expected O, but got Unknown //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Expected O, but got Unknown //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Expected O, but got Unknown //IL_07a8: Unknown result type (might be due to invalid IL or missing references) //IL_07b2: Expected O, but got Unknown //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Expected O, but got Unknown //IL_081a: Unknown result type (might be due to invalid IL or missing references) //IL_0824: Expected O, but got Unknown //IL_0853: Unknown result type (might be due to invalid IL or missing references) //IL_085d: Expected O, but got Unknown //IL_094c: Unknown result type (might be due to invalid IL or missing references) //IL_0956: Expected O, but got Unknown //IL_0985: Unknown result type (might be due to invalid IL or missing references) //IL_098f: Expected O, but got Unknown //IL_09be: Unknown result type (might be due to invalid IL or missing references) //IL_09c8: Expected O, but got Unknown //IL_09f7: Unknown result type (might be due to invalid IL or missing references) //IL_0a01: Expected O, but got Unknown //IL_0a50: Unknown result type (might be due to invalid IL or missing references) //IL_0a5a: Expected O, but got Unknown //IL_0a89: Unknown result type (might be due to invalid IL or missing references) //IL_0a93: Expected O, but got Unknown //IL_0ac2: Unknown result type (might be due to invalid IL or missing references) //IL_0acc: Expected O, but got Unknown //IL_0afb: Unknown result type (might be due to invalid IL or missing references) //IL_0b05: Expected O, but got Unknown //IL_0b34: Unknown result type (might be due to invalid IL or missing references) //IL_0b3e: Expected O, but got Unknown //IL_0b6d: Unknown result type (might be due to invalid IL or missing references) //IL_0b77: Expected O, but got Unknown //IL_0ba6: Unknown result type (might be due to invalid IL or missing references) //IL_0bb0: Expected O, but got Unknown //IL_0bdf: Unknown result type (might be due to invalid IL or missing references) //IL_0be9: Expected O, but got Unknown //IL_0c18: Unknown result type (might be due to invalid IL or missing references) //IL_0c22: Expected O, but got Unknown //IL_0c51: Unknown result type (might be due to invalid IL or missing references) //IL_0c5b: Expected O, but got Unknown //IL_0c8a: Unknown result type (might be due to invalid IL or missing references) //IL_0c94: Expected O, but got Unknown //IL_0cc3: Unknown result type (might be due to invalid IL or missing references) //IL_0ccd: Expected O, but got Unknown //IL_0cfc: Unknown result type (might be due to invalid IL or missing references) //IL_0d06: Expected O, but got Unknown //IL_0d35: Unknown result type (might be due to invalid IL or missing references) //IL_0d3f: Expected O, but got Unknown //IL_0d6e: Unknown result type (might be due to invalid IL or missing references) //IL_0d78: Expected O, but got Unknown //IL_0da7: Unknown result type (might be due to invalid IL or missing references) //IL_0db1: Expected O, but got Unknown //IL_0de0: Unknown result type (might be due to invalid IL or missing references) //IL_0dea: Expected O, but got Unknown //IL_0e19: Unknown result type (might be due to invalid IL or missing references) //IL_0e23: Expected O, but got Unknown //IL_0e52: Unknown result type (might be due to invalid IL or missing references) //IL_0e5c: Expected O, but got Unknown //IL_0e8b: Unknown result type (might be due to invalid IL or missing references) //IL_0e95: Expected O, but got Unknown //IL_0ec4: Unknown result type (might be due to invalid IL or missing references) //IL_0ece: Expected O, but got Unknown //IL_0efd: Unknown result type (might be due to invalid IL or missing references) //IL_0f07: Expected O, but got Unknown //IL_0f36: Unknown result type (might be due to invalid IL or missing references) //IL_0f40: Expected O, but got Unknown //IL_0f6f: Unknown result type (might be due to invalid IL or missing references) //IL_0f79: Expected O, but got Unknown //IL_0fa8: Unknown result type (might be due to invalid IL or missing references) //IL_0fb2: Expected O, but got Unknown //IL_0fe1: Unknown result type (might be due to invalid IL or missing references) //IL_0feb: Expected O, but got Unknown //IL_101a: Unknown result type (might be due to invalid IL or missing references) //IL_1024: Expected O, but got Unknown //IL_1053: Unknown result type (might be due to invalid IL or missing references) //IL_105d: Expected O, but got Unknown //IL_108c: Unknown result type (might be due to invalid IL or missing references) //IL_1096: Expected O, but got Unknown //IL_10c5: Unknown result type (might be due to invalid IL or missing references) //IL_10cf: Expected O, but got Unknown //IL_10fe: Unknown result type (might be due to invalid IL or missing references) //IL_1108: Expected O, but got Unknown //IL_1137: Unknown result type (might be due to invalid IL or missing references) //IL_1141: Expected O, but got Unknown //IL_1170: Unknown result type (might be due to invalid IL or missing references) //IL_117a: Expected O, but got Unknown //IL_11a9: Unknown result type (might be due to invalid IL or missing references) //IL_11b3: Expected O, but got Unknown //IL_11e2: Unknown result type (might be due to invalid IL or missing references) //IL_11ec: Expected O, but got Unknown //IL_121b: Unknown result type (might be due to invalid IL or missing references) //IL_1225: Expected O, but got Unknown //IL_12f4: Unknown result type (might be due to invalid IL or missing references) //IL_12fe: Expected O, but got Unknown //IL_1349: Unknown result type (might be due to invalid IL or missing references) //IL_1353: Expected O, but got Unknown //IL_13ba: Unknown result type (might be due to invalid IL or missing references) //IL_13c4: Expected O, but got Unknown //IL_13f3: Unknown result type (might be due to invalid IL or missing references) //IL_13fd: Expected O, but got Unknown //IL_142c: Unknown result type (might be due to invalid IL or missing references) //IL_1436: Expected O, but got Unknown //IL_1481: Unknown result type (might be due to invalid IL or missing references) //IL_148b: Expected O, but got Unknown //IL_14ba: Unknown result type (might be due to invalid IL or missing references) //IL_14c4: Expected O, but got Unknown //IL_1513: Unknown result type (might be due to invalid IL or missing references) //IL_151d: Expected O, but got Unknown //IL_154c: Unknown result type (might be due to invalid IL or missing references) //IL_1556: Expected O, but got Unknown //IL_15a5: Unknown result type (might be due to invalid IL or missing references) //IL_15af: Expected O, but got Unknown //IL_15fe: Unknown result type (might be due to invalid IL or missing references) //IL_1608: Expected O, but got Unknown //IL_166f: Unknown result type (might be due to invalid IL or missing references) //IL_1679: Expected O, but got Unknown //IL_16c4: Unknown result type (might be due to invalid IL or missing references) //IL_16ce: Expected O, but got Unknown //IL_1751: Unknown result type (might be due to invalid IL or missing references) //IL_175b: Expected O, but got Unknown //IL_178a: Unknown result type (might be due to invalid IL or missing references) //IL_1794: Expected O, but got Unknown //IL_17ef: Unknown result type (might be due to invalid IL or missing references) //IL_17f9: Expected O, but got Unknown //IL_1828: Unknown result type (might be due to invalid IL or missing references) //IL_1832: Expected O, but got Unknown //IL_1861: Unknown result type (might be due to invalid IL or missing references) //IL_186b: Expected O, but got Unknown //IL_189a: Unknown result type (might be due to invalid IL or missing references) //IL_18a4: Expected O, but got Unknown //IL_18d3: Unknown result type (might be due to invalid IL or missing references) //IL_18dd: Expected O, but got Unknown //IL_190c: Unknown result type (might be due to invalid IL or missing references) //IL_1916: Expected O, but got Unknown //IL_1945: Unknown result type (might be due to invalid IL or missing references) //IL_194f: Expected O, but got Unknown //IL_197e: Unknown result type (might be due to invalid IL or missing references) //IL_1988: Expected O, but got Unknown //IL_19b7: Unknown result type (might be due to invalid IL or missing references) //IL_19c1: Expected O, but got Unknown //IL_19f0: Unknown result type (might be due to invalid IL or missing references) //IL_19fa: Expected O, but got Unknown //IL_1a29: Unknown result type (might be due to invalid IL or missing references) //IL_1a33: Expected O, but got Unknown //IL_1a62: Unknown result type (might be due to invalid IL or missing references) //IL_1a6c: Expected O, but got Unknown //IL_1a9b: Unknown result type (might be due to invalid IL or missing references) //IL_1aa5: Expected O, but got Unknown //IL_1ad4: Unknown result type (might be due to invalid IL or missing references) //IL_1ade: Expected O, but got Unknown //IL_1b0d: Unknown result type (might be due to invalid IL or missing references) //IL_1b17: Expected O, but got Unknown //IL_1b46: Unknown result type (might be due to invalid IL or missing references) //IL_1b50: Expected O, but got Unknown //IL_1b7f: Unknown result type (might be due to invalid IL or missing references) //IL_1b89: Expected O, but got Unknown //IL_1bb8: Unknown result type (might be due to invalid IL or missing references) //IL_1bc2: Expected O, but got Unknown //IL_1bf1: Unknown result type (might be due to invalid IL or missing references) //IL_1bfb: Expected O, but got Unknown //IL_1c2a: Unknown result type (might be due to invalid IL or missing references) //IL_1c34: Expected O, but got Unknown //IL_1c63: Unknown result type (might be due to invalid IL or missing references) //IL_1c6d: Expected O, but got Unknown //IL_1cbc: Unknown result type (might be due to invalid IL or missing references) //IL_1cc6: Expected O, but got Unknown //IL_1cf5: Unknown result type (might be due to invalid IL or missing references) //IL_1cff: Expected O, but got Unknown //IL_1d2e: Unknown result type (might be due to invalid IL or missing references) //IL_1d38: Expected O, but got Unknown //IL_1d67: Unknown result type (might be due to invalid IL or missing references) //IL_1d71: Expected O, but got Unknown //IL_1da0: Unknown result type (might be due to invalid IL or missing references) //IL_1daa: Expected O, but got Unknown //IL_1dd9: Unknown result type (might be due to invalid IL or missing references) //IL_1de3: Expected O, but got Unknown //IL_1e12: Unknown result type (might be due to invalid IL or missing references) //IL_1e1c: Expected O, but got Unknown //IL_1e6b: Unknown result type (might be due to invalid IL or missing references) //IL_1e75: Expected O, but got Unknown //IL_1ea4: Unknown result type (might be due to invalid IL or missing references) //IL_1eae: Expected O, but got Unknown //IL_1edd: Unknown result type (might be due to invalid IL or missing references) //IL_1ee7: Expected O, but got Unknown //IL_1f16: Unknown result type (might be due to invalid IL or missing references) //IL_1f20: Expected O, but got Unknown //IL_1f4f: Unknown result type (might be due to invalid IL or missing references) //IL_1f59: Expected O, but got Unknown //IL_1f88: Unknown result type (might be due to invalid IL or missing references) //IL_1f92: Expected O, but got Unknown //IL_1fc1: Unknown result type (might be due to invalid IL or missing references) //IL_1fcb: Expected O, but got Unknown //IL_1ffa: Unknown result type (might be due to invalid IL or missing references) //IL_2004: Expected O, but got Unknown //IL_204f: Unknown result type (might be due to invalid IL or missing references) //IL_2059: Expected O, but got Unknown //IL_2088: Unknown result type (might be due to invalid IL or missing references) //IL_2092: Expected O, but got Unknown //IL_20c1: Unknown result type (might be due to invalid IL or missing references) //IL_20cb: Expected O, but got Unknown //IL_20fa: Unknown result type (might be due to invalid IL or missing references) //IL_2104: Expected O, but got Unknown //IL_2153: Unknown result type (might be due to invalid IL or missing references) //IL_215d: Expected O, but got Unknown //IL_218c: Unknown result type (might be due to invalid IL or missing references) //IL_2196: Expected O, but got Unknown //IL_2225: Unknown result type (might be due to invalid IL or missing references) //IL_222f: Expected O, but got Unknown //IL_225e: Unknown result type (might be due to invalid IL or missing references) //IL_2268: Expected O, but got Unknown //IL_2297: Unknown result type (might be due to invalid IL or missing references) //IL_22a1: Expected O, but got Unknown //IL_22ec: Unknown result type (might be due to invalid IL or missing references) //IL_22f6: Expected O, but got Unknown //IL_2325: Unknown result type (might be due to invalid IL or missing references) //IL_232f: Expected O, but got Unknown //IL_235e: Unknown result type (might be due to invalid IL or missing references) //IL_2368: Expected O, but got Unknown //IL_2397: Unknown result type (might be due to invalid IL or missing references) //IL_23a1: Expected O, but got Unknown //IL_23d0: Unknown result type (might be due to invalid IL or missing references) //IL_23da: Expected O, but got Unknown //IL_2409: Unknown result type (might be due to invalid IL or missing references) //IL_2413: Expected O, but got Unknown //IL_2442: Unknown result type (might be due to invalid IL or missing references) //IL_244c: Expected O, but got Unknown //IL_247b: Unknown result type (might be due to invalid IL or missing references) //IL_2485: Expected O, but got Unknown //IL_24b4: Unknown result type (might be due to invalid IL or missing references) //IL_24be: Expected O, but got Unknown //IL_24ed: Unknown result type (might be due to invalid IL or missing references) //IL_24f7: Expected O, but got Unknown //IL_2526: Unknown result type (might be due to invalid IL or missing references) //IL_2530: Expected O, but got Unknown //IL_255f: Unknown result type (might be due to invalid IL or missing references) //IL_2569: Expected O, but got Unknown //IL_2598: Unknown result type (might be due to invalid IL or missing references) //IL_25a2: Expected O, but got Unknown //IL_25d1: Unknown result type (might be due to invalid IL or missing references) //IL_25db: Expected O, but got Unknown //IL_260a: Unknown result type (might be due to invalid IL or missing references) //IL_2614: Expected O, but got Unknown //IL_2643: Unknown result type (might be due to invalid IL or missing references) //IL_264d: Expected O, but got Unknown //IL_269c: Unknown result type (might be due to invalid IL or missing references) //IL_26a6: Expected O, but got Unknown //IL_26d5: Unknown result type (might be due to invalid IL or missing references) //IL_26df: Expected O, but got Unknown //IL_270e: Unknown result type (might be due to invalid IL or missing references) //IL_2718: Expected O, but got Unknown //IL_2747: Unknown result type (might be due to invalid IL or missing references) //IL_2751: Expected O, but got Unknown //IL_2780: Unknown result type (might be due to invalid IL or missing references) //IL_278a: Expected O, but got Unknown //IL_27b9: Unknown result type (might be due to invalid IL or missing references) //IL_27c3: Expected O, but got Unknown //IL_27f2: Unknown result type (might be due to invalid IL or missing references) //IL_27fc: Expected O, but got Unknown //IL_282b: Unknown result type (might be due to invalid IL or missing references) //IL_2835: Expected O, but got Unknown //IL_2864: Unknown result type (might be due to invalid IL or missing references) //IL_286e: Expected O, but got Unknown //IL_289d: Unknown result type (might be due to invalid IL or missing references) //IL_28a7: Expected O, but got Unknown //IL_28d6: Unknown result type (might be due to invalid IL or missing references) //IL_28e0: Expected O, but got Unknown //IL_290f: Unknown result type (might be due to invalid IL or missing references) //IL_2919: Expected O, but got Unknown //IL_2948: Unknown result type (might be due to invalid IL or missing references) //IL_2952: Expected O, but got Unknown Revision = file.Bind("01 - General", "TuningRevision", 0, "Internal. Tracks which set of tuned flight values this file holds; changing it by hand forces a reset to the mod's own numbers."); Multiplayer = file.Bind("01 - General", "Multiplayer", true, "Show other players' jets, and let them see yours. Everyone needs the mod at the same version - there is no host-only install."); PoseRate = file.Bind("01 - General", "PoseRate", 15f, new ConfigDescription("Attitude broadcasts per second while flying. Nine bytes each, unreliable; position is not in there because the game already replicates the pilot's.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 60f), Array.Empty())); PoseTimeout = file.Bind("01 - General", "PoseTimeout", 2f, new ConfigDescription("Seconds of silence before someone else's jet is assumed to be empty. No dismount message survives a disconnect, so the stream going quiet has to.", (AcceptableValueBase)(object)new AcceptableValueRange(0.2f, 30f), Array.Empty())); PoseSmoothing = file.Bind("01 - General", "PoseSmoothing", 12f, new ConfigDescription("How hard a remote jet is slerped onto the attitude last received.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 60f), Array.Empty())); ChatRichText = file.Bind("01 - General", "ChatRichText", true, "Colour and weight in the chat. Turned off, every message falls back to plain text that still reads properly - the wording does not depend on the markup."); ChatTagColour = file.Bind("01 - General", "ChatTagColour", "8FD94F", "Colour of the A-10 tag at the head of each line, hex."); ChatKeyColour = file.Bind("01 - General", "ChatKeyColour", "FFFFFF", "Colour of keys and commands inside a message, hex."); ChatValueColour = file.Bind("01 - General", "ChatValueColour", "9EE8FF", "Colour of numbers and names inside a message, hex."); ChatWarnColour = file.Bind("01 - General", "ChatWarnColour", "FF9F5A", "Colour of a line that is telling you something is wrong, hex."); ChatFeedback = file.Bind("01 - General", "ChatFeedback", true, "Print mod messages in the in-game chat instead of only the BepInEx console."); HullSolid = file.Bind("02 - Model", "HullSolid", true, "Give the jet solid bodywork, so it can be bumped into and stood on instead of walked through. The aircraft skips its own colliders when it looks for the ground, so this does not make it think it has crashed into itself."); HullDebug = file.Bind("02 - Model", "HullDebug", false, "Draw the collider boxes as solid blocks, so what you are adjusting is visible. /a10 hull debug toggles it."); HullDebugColour = file.Bind("02 - Model", "HullDebugColour", "3F8CFF66", "Colour of those blocks, hex with alpha."); HullBodyWidth = file.Bind("02 - Model", "HullBodyWidth", 0.22f, new ConfigDescription("Fuselage collider width, as a fraction of the wingspan.", (AcceptableValueBase)(object)new AcceptableValueRange(0.01f, 1f), Array.Empty())); HullBodyHeight = file.Bind("02 - Model", "HullBodyHeight", 0.62f, new ConfigDescription("Fuselage collider height, as a fraction of the model.", (AcceptableValueBase)(object)new AcceptableValueRange(0.01f, 1f), Array.Empty())); HullBodyLength = file.Bind("02 - Model", "HullBodyLength", 0.95f, new ConfigDescription("Fuselage collider length, as a fraction of the model.", (AcceptableValueBase)(object)new AcceptableValueRange(0.01f, 1f), Array.Empty())); HullBodyRise = file.Bind("02 - Model", "HullBodyRise", 0.25f, new ConfigDescription("Fuselage collider centre height, metres, measured from the model's pivot. The pivot sits GearHeight above the ground, so 0 is roughly the axle line and not the floor - which is why these are small numbers and not obvious ones.", (AcceptableValueBase)(object)new AcceptableValueRange(-10f, 10f), Array.Empty())); HullWingSpan = file.Bind("02 - Model", "HullWingSpan", 0.98f, new ConfigDescription("Wing collider span, as a fraction of the model.", (AcceptableValueBase)(object)new AcceptableValueRange(0.01f, 1f), Array.Empty())); HullWingThickness = file.Bind("02 - Model", "HullWingThickness", 0.14f, new ConfigDescription("Wing collider thickness, as a fraction of the model.", (AcceptableValueBase)(object)new AcceptableValueRange(0.005f, 1f), Array.Empty())); HullWingChord = file.Bind("02 - Model", "HullWingChord", 0.34f, new ConfigDescription("Wing collider depth front to back, as a fraction.", (AcceptableValueBase)(object)new AcceptableValueRange(0.01f, 1f), Array.Empty())); HullWingRise = file.Bind("02 - Model", "HullWingRise", -0.26f, new ConfigDescription("Wing collider height, metres from the pivot. Negative: an A-10 carries its wings low enough to walk up to.", (AcceptableValueBase)(object)new AcceptableValueRange(-10f, 10f), Array.Empty())); HullWingBack = file.Bind("02 - Model", "HullWingBack", -0.4f, new ConfigDescription("Wing collider position along the fuselage, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(-20f, 20f), Array.Empty())); Scale = file.Bind("02 - Model", "Scale", 1f, new ConfigDescription("Uniform scale of the jet model. The source model measures 17.8 m across the wings against the real A-10's 17.5 m, so 1.0 is already life size.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 5f), Array.Empty())); PivotX = file.Bind("02 - Model", "PivotX", 0f, "Model offset that centres the airframe, X."); PivotY = file.Bind("02 - Model", "PivotY", -1.512f, "Model offset that centres the airframe, Y."); PivotZ = file.Bind("02 - Model", "PivotZ", -3.273f, "Model offset that centres the airframe, Z."); YawOffset = file.Bind("02 - Model", "YawOffset", 180f, new ConfigDescription("Yaw applied to the model so its nose points along the jet's +Z.", (AcceptableValueBase)(object)new AcceptableValueRange(-180f, 180f), Array.Empty())); CarrierDistance = file.Bind("03 - Carrier", "Distance", 260f, new ConfigDescription("How far offshore the carrier sits, in metres from the island centre.", (AcceptableValueBase)(object)new AcceptableValueRange(80f, 900f), Array.Empty())); CarrierLength = file.Bind("03 - Carrier", "Length", 200f, new ConfigDescription("Deck length. Takeoff needs about 90 m of run to reach flying speed, and the jet parks 36% of the deck behind centre, so this leaves margin.", (AcceptableValueBase)(object)new AcceptableValueRange(40f, 400f), Array.Empty())); CarrierWidth = file.Bind("03 - Carrier", "Width", 42f, new ConfigDescription("Deck width.", (AcceptableValueBase)(object)new AcceptableValueRange(15f, 120f), Array.Empty())); CarrierDeckHeight = file.Bind("03 - Carrier", "DeckHeight", 9f, new ConfigDescription("Height of the deck above the waterline.", (AcceptableValueBase)(object)new AcceptableValueRange(2f, 30f), Array.Empty())); CarrierDraft = file.Bind("03 - Carrier", "Draft", 6f, new ConfigDescription("How far the hull reaches below the waterline.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 30f), Array.Empty())); RequirePurchase = file.Bind("03 - Carrier", "RequirePurchase", true, "The deck stays empty until the jet is bought from the dealer. Off puts it on the pad for free, which is how every build before this one behaved."); JetPurchased = file.Bind("03 - Carrier", "JetPurchased", false, "Whether the jet has been bought. Money in this game is one shared pot, so this is the crew's aircraft rather than a player's."); JetPrice = file.Bind("03 - Carrier", "JetPrice", 200000f, new ConfigDescription("What the dealer wants for it.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 10000000f), Array.Empty())); VendorX = file.Bind("03 - Carrier", "VendorX", 8f, new ConfigDescription("Dealer's position across the deck, metres from centreline.", (AcceptableValueBase)(object)new AcceptableValueRange(-20f, 20f), Array.Empty())); VendorZ = file.Bind("03 - Carrier", "VendorZ", -0.26f, new ConfigDescription("Dealer's position along the deck as a fraction of hull length. Aft, between the top of the ramp and the parking spot.", (AcceptableValueBase)(object)new AcceptableValueRange(-0.45f, 0.45f), Array.Empty())); VendorYaw = file.Bind("03 - Carrier", "VendorYaw", 90f, new ConfigDescription("Which way the dealer faces, degrees.", (AcceptableValueBase)(object)new AcceptableValueRange(-180f, 180f), Array.Empty())); VendorStand = file.Bind("03 - Carrier", "VendorStand", 0.35f, new ConfigDescription("How far the dealer stands from his own origin towards the counter, metres. The counter's back face is at 0.55, so this puts him up against it.", (AcceptableValueBase)(object)new AcceptableValueRange(-3f, 3f), Array.Empty())); VendorNpc = file.Bind("03 - Carrier", "VendorNpc", "soldier", "Substring of the island NPC to borrow a body from. Blank takes the first by name; /a10 npcs lists who is on the island."); VendorSuitColour = file.Bind("03 - Carrier", "VendorSuitColour", "", "Flight suit colour, hex. Blank keeps the borrowed NPC's own outfit, which is the right answer when the one being borrowed is already a soldier."); RampAngle = file.Bind("03 - Carrier", "RampAngle", 30f, new ConfigDescription("Slope of the boarding ramp, degrees. Past PlayerMovement's slip angle the player slides back down instead of climbing, and that angle is not readable from outside, so this stays conservative.", (AcceptableValueBase)(object)new AcceptableValueRange(10f, 50f), Array.Empty())); RampWidth = file.Bind("03 - Carrier", "RampWidth", 4f, new ConfigDescription("Width of the boarding ramp, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(1.5f, 20f), Array.Empty())); RampPosition = file.Bind("03 - Carrier", "RampPosition", -60f, new ConfigDescription("Where along the hull the ramp meets the deck, metres from midships. Negative is aft, towards the parking spot; keep it off the runway.", (AcceptableValueBase)(object)new AcceptableValueRange(-90f, 90f), Array.Empty())); JetShoreOffset = file.Bind("03 - Carrier", "JetShoreOffset", 45f, new ConfigDescription("How far past the boat spawn the jet waits on islands with no carrier.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 300f), Array.Empty())); SeatX = file.Bind("04 - Cockpit", "SeatX", 0f, "Pilot seat offset, X."); SeatY = file.Bind("04 - Cockpit", "SeatY", 1f, "Pilot seat offset, Y."); SeatZ = file.Bind("04 - Cockpit", "SeatZ", 3.3f, "Pilot seat offset, Z."); MuzzleX = file.Bind("04 - Cockpit", "MuzzleX", 0f, "Cannon muzzle offset, X."); MuzzleY = file.Bind("04 - Cockpit", "MuzzleY", -0.2f, "Cannon muzzle offset, Y."); MuzzleZ = file.Bind("04 - Cockpit", "MuzzleZ", 8.6f, "Cannon muzzle offset, Z."); GearHeight = file.Bind("04 - Cockpit", "GearHeight", 2.6f, new ConfigDescription("Distance from the airframe centre down to the wheels, so the jet rests on a deck instead of sinking into it.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 10f), Array.Empty())); GearSeconds = file.Bind("05 - Flight", "GearSeconds", 1.6f, new ConfigDescription("Landing gear travel time, matching the source animation.", (AcceptableValueBase)(object)new AcceptableValueRange(0.2f, 10f), Array.Empty())); GearDrag = file.Bind("05 - Flight", "GearDrag", 0.0006f, new ConfigDescription("Extra drag with the gear down. Top level speed drops from 85 to about 72 m/s.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 0.01f), Array.Empty())); GearHandedness = file.Bind("05 - Flight", "GearHandedness", 0f, new ConfigDescription("Which right-to-left-handed conversion the gear animation needs, 0-3. They differ only in which quaternion components change sign; 0 and 1 are the same hinge turning opposite ways, as are 2 and 3. /a10 gear flip cycles it.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 3f), Array.Empty())); GearKey = file.Bind("07 - Controls", "GearKey", "G", "Key that raises and lowers the gear. Any UnityEngine.KeyCode name."); ImpactRadius = file.Bind("05 - Flight", "ImpactRadius", 1.8f, new ConfigDescription("Radius of the sphere swept ahead of the jet looking for terrain, metres. The ground check only looks down, so without this a cliff face is scenery. 0 disables it.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 15f), Array.Empty())); MaxThrust = file.Bind("05 - Flight", "MaxThrust", 9f, new ConfigDescription("Full-throttle acceleration, m/s^2.", (AcceptableValueBase)(object)new AcceptableValueRange(5f, 300f), Array.Empty())); Drag = file.Bind("05 - Flight", "Drag", 0.00125f, new ConfigDescription("Quadratic drag coefficient.", (AcceptableValueBase)(object)new AcceptableValueRange(0.0005f, 0.05f), Array.Empty())); MaxSpeed = file.Bind("05 - Flight", "MaxSpeed", 85f, new ConfigDescription("Hard speed cap, m/s. An island is 55 m in radius, so turn radius is the budget everything else is spent from: at this speed a full-rate turn circles the island rather than the sea around it.", (AcceptableValueBase)(object)new AcceptableValueRange(20f, 400f), Array.Empty())); Gravity = file.Bind("05 - Flight", "Gravity", 9.81f, new ConfigDescription("Downward acceleration, m/s^2.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 40f), Array.Empty())); ThrottleRate = file.Bind("05 - Flight", "ThrottleRate", 1.2f, new ConfigDescription("Throttle change per second at full input.", (AcceptableValueBase)(object)new AcceptableValueRange(0.05f, 5f), Array.Empty())); FlySpeed = file.Bind("05 - Flight", "FlySpeed", 30f, new ConfigDescription("Reference airspeed for the wing, m/s. Control authority is full at it, and the stall speed follows from it: FlySpeed over the root of Lift.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 120f), Array.Empty())); PitchRate = file.Bind("05 - Flight", "PitchRate", 65f, new ConfigDescription("Fastest the nose pitches in arcade, deg/s. Turn radius is speed divided by this: 45 m/s here gives about 40 m, which fits inside one island.", (AcceptableValueBase)(object)new AcceptableValueRange(5f, 360f), Array.Empty())); YawRate = file.Bind("05 - Flight", "YawRate", 26f, new ConfigDescription("Fastest the nose yaws in arcade, deg/s. Deliberately weak: a hard turn is meant to come from banking and pulling, not from skidding round flat.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 360f), Array.Empty())); RollRate = file.Bind("05 - Flight", "RollRate", 160f, new ConfigDescription("Roll rate in arcade, deg/s, on A/D and for the auto-bank.", (AcceptableValueBase)(object)new AcceptableValueRange(10f, 720f), Array.Empty())); Chase = file.Bind("05 - Flight", "Chase", 4.5f, new ConfigDescription("Degrees per second of turn per degree the marker is off the nose. Higher reaches the rate limits sooner, so the jet feels sharper near centre.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 30f), Array.Empty())); Cone = file.Bind("07 - Controls", "Cone", 28f, new ConfigDescription("How far off the nose the marker may sit, degrees. Past PitchRate over Chase - about 14 degrees - the turn is already at full rate, so the rest of the cone only buys lead. Widening it just pushes the nose, and the pipper with it, further off the screen.", (AcceptableValueBase)(object)new AcceptableValueRange(5f, 89f), Array.Empty())); Sensitivity = file.Bind("07 - Controls", "Sensitivity", 0.09f, new ConfigDescription("Degrees of marker travel per unit of mouse movement.", (AcceptableValueBase)(object)new AcceptableValueRange(0.005f, 1f), Array.Empty())); MaxBank = file.Bind("05 - Flight", "MaxBank", 72f, new ConfigDescription("Steepest bank the auto-bank will roll to, degrees.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 90f), Array.Empty())); BankPerDegree = file.Bind("05 - Flight", "BankPerDegree", 3.2f, new ConfigDescription("Bank angle commanded per degree of horizontal error. Bank is what turns the strong pitch axis sideways, so this is really the turn-rate control.", (AcceptableValueBase)(object)new AcceptableValueRange(0.2f, 20f), Array.Empty())); BankGain = file.Bind("05 - Flight", "BankGain", 3f, new ConfigDescription("Roll rate per degree of bank error.", (AcceptableValueBase)(object)new AcceptableValueRange(0.2f, 20f), Array.Empty())); AlignGain = file.Bind("05 - Flight", "AlignGain", 40f, new ConfigDescription("How hard the flight path is pulled onto the nose, per radian of angle of attack. Kept high so that what limits a turn is Lift rather than this.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 200f), Array.Empty())); Lift = file.Bind("05 - Flight", "Lift", 4.5f, new ConfigDescription("Lift available at FlySpeed, in g, growing with the square of airspeed. It sets the stall speed - 4.5 g at 30 m/s means the wing gives out at 14 m/s - and below about 23 m/s a full-rate pull starts sliding instead of turning.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 20f), Array.Empty())); SlowAuthority = file.Bind("05 - Flight", "SlowAuthority", 0.25f, new ConfigDescription("Fraction of control left at a standstill. Never zero, or a jet that stalls has no way of pointing its nose down to recover.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); RudderRate = file.Bind("05 - Flight", "RudderRate", 22f, new ConfigDescription("Extra yaw from the rudder keys in arcade, deg/s.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 180f), Array.Empty())); GroundFriction = file.Bind("05 - Flight", "GroundFriction", 12f, new ConfigDescription("Deceleration of an unpiloted jet sliding along the ground, m/s^2.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 100f), Array.Empty())); BailOutImpulse = file.Bind("05 - Flight", "BailOutImpulse", 6f, new ConfigDescription("Upward speed added when stepping out, so the pilot clears the airframe instead of riding along inside it.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 40f), Array.Empty())); BailOutClearance = file.Bind("05 - Flight", "BailOutClearance", 3f, new ConfigDescription("Height above the seat the pilot is placed on stepping out.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 20f), Array.Empty())); SpoolTime = file.Bind("05 - Flight", "SpoolTime", 2.2f, new ConfigDescription("Seconds for the engines to travel from idle to full. The A-10's TF34s are famously slow, and it is what makes low and slow genuinely dangerous.", (AcceptableValueBase)(object)new AcceptableValueRange(0.05f, 15f), Array.Empty())); RollingFriction = file.Bind("05 - Flight", "RollingFriction", 1.5f, new ConfigDescription("Wheel rolling resistance, m/s^2.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 30f), Array.Empty())); BrakeFriction = file.Bind("05 - Flight", "BrakeFriction", 9f, new ConfigDescription("Wheel braking deceleration, m/s^2.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 60f), Array.Empty())); NosewheelPower = file.Bind("05 - Flight", "NosewheelPower", 40f, new ConfigDescription("Ground steering strength from the rudder keys.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 300f), Array.Empty())); MaxSinkRate = file.Bind("05 - Flight", "MaxSinkRate", 7f, new ConfigDescription("Sink rate the gear survives, m/s.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 50f), Array.Empty())); MaxLandingBank = file.Bind("05 - Flight", "MaxLandingBank", 20f, new ConfigDescription("Bank the gear survives on touchdown, degrees.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 90f), Array.Empty())); MaxLandingPitch = file.Bind("05 - Flight", "MaxLandingPitch", 12f, new ConfigDescription("Nose-down attitude the gear survives, degrees.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 90f), Array.Empty())); MaxLandingSpeed = file.Bind("05 - Flight", "MaxLandingSpeed", 60f, new ConfigDescription("Touchdown speed the gear survives, m/s.", (AcceptableValueBase)(object)new AcceptableValueRange(10f, 200f), Array.Empty())); GreyoutStrength = file.Bind("05 - Flight", "GreyoutStrength", 1.7f, new ConfigDescription("How dark the vignette goes at full greyout. The game's own effects sit around 1, so above that is heavier than anything it does on its own.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2f), Array.Empty())); GreyoutOnset = file.Bind("05 - Flight", "GreyoutOnset", 4.5f, new ConfigDescription("Load factor where vision starts to grey out.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 15f), Array.Empty())); GreyoutFull = file.Bind("05 - Flight", "GreyoutFull", 9f, new ConfigDescription("Load factor at full blackout.", (AcceptableValueBase)(object)new AcceptableValueRange(2f, 20f), Array.Empty())); GreyoutRate = file.Bind("05 - Flight", "GreyoutRate", 1.6f, new ConfigDescription("Seconds to grey out fully once past the onset.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 20f), Array.Empty())); GreyoutRecovery = file.Bind("05 - Flight", "GreyoutRecovery", 2.5f, new ConfigDescription("Seconds to recover vision after easing off.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 20f), Array.Empty())); RudderLeftAction = file.Bind("07 - Controls", "RudderLeftAction", "PlayerDrop", "Input action used for left rudder. PlayerDrop is the game's drop key, normally Q. Run /a10 keys in the cockpit to see what each action is actually bound to."); RudderRightAction = file.Bind("07 - Controls", "RudderRightAction", "PlayerPickUp", "Input action used for right rudder, normally E."); ExitKey = file.Bind("07 - Controls", "ExitKey", "F", "Key that gets you out of the cockpit. A key of its own rather than one of the game's actions, so it cannot collide with the rudder or the throttle."); ThrottleUpKey = file.Bind("07 - Controls", "ThrottleUpKey", "LeftShift", "Key that opens the throttle."); ThrottleDownKey = file.Bind("07 - Controls", "ThrottleDownKey", "LeftControl", "Key that closes the throttle."); PitchKeyRate = file.Bind("07 - Controls", "PitchKeyRate", 60f, new ConfigDescription("Degrees per second the pitch keys move the aim marker. They push the same marker the mouse does rather than commanding the nose directly, so the two add up instead of fighting over it.", (AcceptableValueBase)(object)new AcceptableValueRange(5f, 360f), Array.Empty())); PitchKeysInverted = file.Bind("07 - Controls", "PitchKeysInverted", false, "Swap the pitch keys. Off is the usual arrangement, where forward puts the nose down like a stick."); ExitHoldSeconds = file.Bind("07 - Controls", "ExitHoldSeconds", 0f, new ConfigDescription("How long the exit key must be held.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 3f), Array.Empty())); HudEnabled = file.Bind("08 - HUD", "Enabled", true, "Show the control indicator while flying."); HudReadout = file.Bind("08 - HUD", "Readout", true, "The two lines of instruments across the bottom of the screen."); HudPipperSize = file.Bind("08 - HUD", "PipperSize", 16f, new ConfigDescription("Size of the amber impact marker.", (AcceptableValueBase)(object)new AcceptableValueRange(4f, 100f), Array.Empty())); HudTextSize = file.Bind("08 - HUD", "TextSize", 22f, new ConfigDescription("Readout text size.", (AcceptableValueBase)(object)new AcceptableValueRange(8f, 80f), Array.Empty())); HudReadoutBottom = file.Bind("08 - HUD", "ReadoutBottom", 96f, new ConfigDescription("Height of the lower readout line above the screen edge.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 600f), Array.Empty())); HudHelp = file.Bind("08 - HUD", "ShowControls", true, "The list of controls in the corner. Toggled in game by HelpKey, and the choice is written here, so hiding it once hides it for good."); HelpMargin = file.Bind("08 - HUD", "ControlsMargin", 40f, new ConfigDescription("Gap between the control list and the right screen edge.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 800f), Array.Empty())); HelpHeight = file.Bind("08 - HUD", "ControlsHeight", 0f, new ConfigDescription("Control list offset from the middle of the screen.", (AcceptableValueBase)(object)new AcceptableValueRange(-600f, 600f), Array.Empty())); HelpKey = file.Bind("07 - Controls", "HelpKey", "H", "Key that shows and hides the control list. Any UnityEngine.KeyCode name."); FogFactor = file.Bind("06 - Camera", "FogFactor", 0.55f, new ConfigDescription("Fog density while flying, as a fraction of whatever the game currently has. Restored on the way out, and it follows the game's own sunset and underwater changes rather than a value captured at takeoff. 1 leaves fog alone.", (AcceptableValueBase)(object)new AcceptableValueRange(0.02f, 1f), Array.Empty())); ViewDistance = file.Bind("06 - Camera", "ViewDistance", 0f, new ConfigDescription("Camera far clip while flying, metres. 0 leaves the game's own. Only worth raising if thinning the fog reveals geometry being clipped rather than fogged.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 20000f), Array.Empty())); CrashParticle = file.Bind("05 - Flight", "CrashParticle", "", "Name of the particle effect for a crash. Blank picks the first one the game has whose name looks like an explosion; /a10 fx lists what there is."); CrashShake = file.Bind("05 - Flight", "CrashShake", 1.4f, new ConfigDescription("Screen shake on a crash.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 10f), Array.Empty())); HudTextColour = file.Bind("08 - HUD", "TextColour", "00FF41", "Readout colour, hex. Turns amber on a stall or an empty gun."); HudStickSize = file.Bind("08 - HUD", "StickSize", 150f, new ConfigDescription("Diameter of the corner stick circle, in reference pixels.", (AcceptableValueBase)(object)new AcceptableValueRange(60f, 400f), Array.Empty())); HideHotbar = file.Bind("08 - HUD", "HideHotbar", true, "Fade out the item hotbar while flying."); HideVanillaStats = file.Bind("08 - HUD", "HideVanillaStats", true, "Hide the money, health and hunger readouts while flying. None of them can change in the air anyway, and the radar takes the space they leave."); RespawnSeconds = file.Bind("01 - General", "RespawnSeconds", 25f, new ConfigDescription("Seconds after a wreck before a replacement jet is towed out. Negative leaves the pad empty until /a10 recover.", (AcceptableValueBase)(object)new AcceptableValueRange(-1f, 600f), Array.Empty())); CalmCreatures = file.Bind("01 - General", "CalmCreatures", true, "Stop creatures closing on a pilot. They keep their target and their teeth; what they lose is the force that pulls them towards you, which is what turned the whale fight into being chased across the map."); CalmAltitude = file.Bind("01 - General", "CalmAltitude", 40f, new ConfigDescription("Metres above the sea at which a player counts as flying even if this machine never saw them board. Stands in for the mount broadcast that does not exist yet; 0 leaves only pilots this machine knows about.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 500f), Array.Empty())); FreezeVitals = file.Bind("01 - General", "FreezeVitals", true, "Freeze hunger, starvation, regeneration, poison, fire and damage while flying. Takes effect wherever the vitals tick actually runs, so solo and hosting are covered and a joining client is not."); CrashKills = file.Bind("01 - General", "CrashKills", true, "Wrecking the jet explodes it and kills the pilot, through the game's own damage path so the death and respawn are the ones it already knows."); RadarEnabled = file.Bind("08 - HUD", "Radar", true, "Show the game's radar on the left while flying. It is cloned from the boat's, so it needs a boat to exist in the world."); RadarPixels = file.Bind("08 - HUD", "RadarPixels", 260f, new ConfigDescription("On-screen size the radar is normalised to, whatever the source measures. The boat's radar is a console screen built in world units, so it has to be rescaled rather than trusted.", (AcceptableValueBase)(object)new AcceptableValueRange(40f, 900f), Array.Empty())); RadarScale = file.Bind("08 - HUD", "RadarScale", 1f, new ConfigDescription("Size of the radar.", (AcceptableValueBase)(object)new AcceptableValueRange(0.2f, 3f), Array.Empty())); RadarCorner = file.Bind("08 - HUD", "RadarCorner", "BottomLeft", new ConfigDescription("Which screen corner the radar sits in. RadarMargin and RadarHeight are the gap from the two edges of that corner.", (AcceptableValueBase)(object)new AcceptableValueList(new string[6] { "BottomLeft", "TopLeft", "BottomRight", "TopRight", "Left", "Right" }), Array.Empty())); RadarMargin = file.Bind("08 - HUD", "RadarMargin", 40f, new ConfigDescription("Radar distance from the left edge, reference pixels.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1000f), Array.Empty())); RadarRange = file.Bind("08 - HUD", "RadarRange", 600f, new ConfigDescription("Metres from the centre of the radar to its edge. Contacts further out are pinned to the edge and drawn smaller, so the bearing to the next island survives even when the distance does not.", (AcceptableValueBase)(object)new AcceptableValueRange(50f, 20000f), Array.Empty())); RadarChrome = file.Bind("08 - HUD", "RadarChrome", 0.5f, new ConfigDescription("Opacity of the rings, ticks and sweep. Separate from RadarBackground so losing the backdrop does not cost the scale.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); RadarDotAlpha = file.Bind("08 - HUD", "RadarDotAlpha", 1f, new ConfigDescription("Opacity of the contacts.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); RadarSweepSpeed = file.Bind("08 - HUD", "RadarSweepSpeed", 0.5f, new ConfigDescription("Sweep rate in turns per second, purely cosmetic now that contacts are drawn live every frame. 0 removes the sweep line.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 5f), Array.Empty())); RadarHeight = file.Bind("08 - HUD", "RadarHeight", 40f, new ConfigDescription("Radar offset from the vertical middle, reference pixels.", (AcceptableValueBase)(object)new AcceptableValueRange(-500f, 500f), Array.Empty())); EngineVolume = file.Bind("09 - Sound", "Volume", 0.085f, new ConfigDescription("Engine loudness at full throttle.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); EngineVolumeIdle = file.Bind("09 - Sound", "VolumeIdle", 0.04f, new ConfigDescription("Engine loudness at idle.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); EnginePitchIdle = file.Bind("09 - Sound", "PitchIdle", 0.55f, new ConfigDescription("Playback pitch at idle. The clip is the engine at maximum rpm, so idle has to be pitched well down.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 3f), Array.Empty())); EnginePitchFull = file.Bind("09 - Sound", "PitchFull", 1.05f, new ConfigDescription("Playback pitch at full throttle.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 3f), Array.Empty())); EngineSpatialBlend = file.Bind("09 - Sound", "SpatialBlend", 1f, new ConfigDescription("0 is flat stereo, 1 is fully positional. The clip is stereo, so a fully positional blend collapses it to mono.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); EngineFadeIn = file.Bind("09 - Sound", "FadeIn", 1.4f, new ConfigDescription("Seconds for the engine to fade up when you climb in, so it does not slam in at full volume.", (AcceptableValueBase)(object)new AcceptableValueRange(0.05f, 10f), Array.Empty())); EngineFadeOut = file.Bind("09 - Sound", "FadeOut", 1.8f, new ConfigDescription("Seconds for the engine to fade away after shutdown.", (AcceptableValueBase)(object)new AcceptableValueRange(0.05f, 10f), Array.Empty())); EngineRange = file.Bind("09 - Sound", "Range", 900f, new ConfigDescription("Distance at which the engine fades out, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(30f, 3000f), Array.Empty())); EngineNearDistance = file.Bind("09 - Sound", "EngineNearDistance", 30f, new ConfigDescription("Distance within which the engine is at full volume, metres. The chase camera sits inside this, so the pilot hears it unchanged while the ground does not.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 500f), Array.Empty())); EngineDoppler = file.Bind("09 - Sound", "EngineDoppler", 0.6f, new ConfigDescription("Doppler on the engine, for everyone except the pilot. The pilot is forced to zero in code: the listener rides the chase camera rather than the seat, so it never quite matches the aircraft's velocity, and Doppler turns that small difference into a pitch that wobbles frame to frame.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 5f), Array.Empty())); SpeedOfSound = file.Bind("09 - Sound", "SpeedOfSound", 343f, new ConfigDescription("Metres per second used to delay sounds by how far away they happened. The light from an impact arrives at once and the noise does not, which is why being shot at from the carrier should be: see it, hear it land, then hear the gun. 0 makes everything instant, the way Unity does it by default.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2000f), Array.Empty())); GlowSize = file.Bind("06 - Camera", "GlowSize", 0f, new ConfigDescription("Diameter of the heat at each nozzle, metres. Off for now: it never quite looked right, and an effect that draws the eye to being wrong is worse than no effect. 0.58 is where the tuning had got to if it is wanted back.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 10f), Array.Empty())); GlowStretch = file.Bind("06 - Camera", "GlowStretch", 0.55f, new ConfigDescription("How much the glow is flattened along the airframe. A nozzle is a disc seen end on; a sphere of light behind the aircraft looks like a fire.", (AcceptableValueBase)(object)new AcceptableValueRange(0.05f, 4f), Array.Empty())); GlowThrottle = file.Bind("06 - Camera", "GlowThrottle", 0.35f, new ConfigDescription("Throttle below which no heat shows.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); GlowColour = file.Bind("06 - Camera", "GlowColour", "FF8A38A0", "Nozzle heat colour, hex with alpha. Warm and soft - the A-10 has no afterburner, so this is hot metal and exhaust, not flame."); TrailSeconds = file.Bind("06 - Camera", "TrailSeconds", 0f, new ConfigDescription("Contrail length in seconds, off by default. Not realistic down here, but it is the only thing that makes a jet findable from the ground, so it is here for anyone who wants that more than the look.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 30f), Array.Empty())); TrailWidth = file.Bind("06 - Camera", "TrailWidth", 0.7f, new ConfigDescription("Trail width at the engine, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(0.05f, 10f), Array.Empty())); TrailSpreadRate = file.Bind("06 - Camera", "TrailSpreadRate", 1.8f, new ConfigDescription("How much wider the trail gets by its far end.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 20f), Array.Empty())); TrailMinSpeed = file.Bind("06 - Camera", "TrailMinSpeed", 30f, new ConfigDescription("Airspeed below which nothing trails, m/s.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 200f), Array.Empty())); TrailSpread = file.Bind("06 - Camera", "TrailSpread", 1.3f, new ConfigDescription("Half the gap between the two trails, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 15f), Array.Empty())); TrailHeight = file.Bind("06 - Camera", "TrailHeight", 0.85f, new ConfigDescription("Trail origin height on the airframe, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(-10f, 10f), Array.Empty())); TrailBack = file.Bind("06 - Camera", "TrailBack", -4.65f, new ConfigDescription("Trail origin along the airframe, metres. Negative is aft.", (AcceptableValueBase)(object)new AcceptableValueRange(-30f, 30f), Array.Empty())); TrailFade = file.Bind("06 - Camera", "TrailFade", "8C8F99", "Exhaust colour as it cools and disappears, hex."); CameraDistance = file.Bind("06 - Camera", "Distance", 24f, new ConfigDescription("Chase camera distance behind the jet, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 120f), Array.Empty())); CameraHeight = file.Bind("06 - Camera", "Height", 6f, new ConfigDescription("Chase camera height above the jet, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(-20f, 60f), Array.Empty())); CameraFovBoost = file.Bind("06 - Camera", "FovBoost", 18f, new ConfigDescription("Extra field of view at top speed, degrees.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 60f), Array.Empty())); CameraRollFollow = file.Bind("06 - Camera", "RollFollow", 0.25f, new ConfigDescription("How much of the jet's roll the camera copies. 1 is accurate and unwatchable; keeping the horizon roughly level is what lets you tell which way is up.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); CameraLevelRate = file.Bind("06 - Camera", "LevelRate", 90f, new ConfigDescription("Degrees per second the view rolls back level with the horizon. It is a bounded turn rather than a chase, which is what stops it flipping: the level direction reverses as the nose crosses the vertical, and a view that flips reverses every input the pilot makes. 0 leaves the view wherever the flying left it.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 720f), Array.Empty())); CameraLag = file.Bind("06 - Camera", "Lag", 12f, new ConfigDescription("How quickly the camera catches up with the airframe.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 40f), Array.Empty())); CameraAimFollow = file.Bind("06 - Camera", "AimFollow", 1f, new ConfigDescription("How much the arcade view follows the mouse marker instead of the airframe. At 1 the view is steady and the jet swings underneath it, which is what makes a fast turn readable rather than a blur.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); FreeLookSensitivity = file.Bind("06 - Camera", "FreeLookSensitivity", 0.12f, new ConfigDescription("Degrees of view swing per unit of mouse movement while the right button is held. The mouse is the stick otherwise.", (AcceptableValueBase)(object)new AcceptableValueRange(0.01f, 2f), Array.Empty())); HideIslandWarning = file.Bind("01 - General", "HideIslandWarning", true, "Suppress the 'you will not progress without your friends' panel while flying. IslandWarning throws it up whenever you leave the island without the others, which is every second of every flight."); ImpactSparks = file.Bind("10 - Cannon", "ImpactSparks", 7f, new ConfigDescription("Fragments thrown out by a round landing.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 40f), Array.Empty())); ImpactSparkSpeed = file.Bind("10 - Cannon", "ImpactSparkSpeed", 14f, new ConfigDescription("How fast those fragments leave, m/s.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 100f), Array.Empty())); ImpactSparkLife = file.Bind("10 - Cannon", "ImpactSparkLife", 0.35f, new ConfigDescription("How long they last, seconds.", (AcceptableValueBase)(object)new AcceptableValueRange(0.05f, 3f), Array.Empty())); ImpactSparkWidth = file.Bind("10 - Cannon", "ImpactSparkWidth", 0.12f, new ConfigDescription("Fragment streak width, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(0.01f, 2f), Array.Empty())); ImpactSparkColour = file.Bind("10 - Cannon", "ImpactSparkColour", "FFB74DE0", "Fragment colour, hex with alpha. Warm, not white."); ImpactPuffSize = file.Bind("10 - Cannon", "ImpactPuffSize", 1.6f, new ConfigDescription("Diameter the dust puff grows to, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 20f), Array.Empty())); ImpactPuffLife = file.Bind("10 - Cannon", "ImpactPuffLife", 0.65f, new ConfigDescription("How long the dust hangs, seconds.", (AcceptableValueBase)(object)new AcceptableValueRange(0.05f, 10f), Array.Empty())); ImpactPuffColour = file.Bind("10 - Cannon", "ImpactPuffColour", "473D30B4", "Dust colour, hex with alpha. Soil thrown up, not a flash."); ImpactParticle = file.Bind("10 - Cannon", "ImpactParticle", "", "Name a game particle to play on impact as well as the mod's own dust and fragments. Blank is usually right - the only thing the game has that reads as an explosion is a boss dying, and it is far too big. /a10 fx lists them."); ImpactSound = file.Bind("10 - Cannon", "ImpactSound", "ItemImpactHeavy_V1,ItemImpactHeavy_V2,ItemImpactHeavy_V3", "Sound for a cannon round landing - a comma-separated list, picked from at random, because the same thud eleven times a second is worse than any one of them being slightly off. Explosion was the first choice here and it is wrong: a shell hitting dirt is a hard thud, not a detonation. /a10 fx lists every clip the game has."); ImpactVolume = file.Bind("10 - Cannon", "ImpactVolume", 0.55f, new ConfigDescription("Impact loudness.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2f), Array.Empty())); ImpactEvery = file.Bind("10 - Cannon", "ImpactEvery", 0.09f, new ConfigDescription("Minimum seconds between impact effects. The gun fires 65 rounds a second and one explosion each would bury the frame rate and the mix. 0 disables the extra impact entirely.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2f), Array.Empty())); ImpactSpacing = file.Bind("10 - Cannon", "ImpactSpacing", 6f, new ConfigDescription("A round landing this far from the last one gets its own effect regardless of the interval, so a burst walking across the ground marks its length.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 100f), Array.Empty())); CannonProjectileType = file.Bind("10 - Cannon", "ProjectileType", 0, "Index into ProjectileManager's projectile types - the bullet the cannon fires. The count is written to the log on the first shot; the index is clamped to it."); CannonDamage = file.Bind("10 - Cannon", "Damage", 126f, new ConfigDescription("Damage per round.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 2000f), Array.Empty())); CannonHitRadius = file.Bind("10 - Cannon", "HitRadius", 1.15f, new ConfigDescription("Radius in metres of the sphere a cannon round sweeps looking for a hit. The game's own bullets stay untouched: this is swapped in around the scan of one of your rounds and swapped straight back out, so nobody else's weapon changes and nothing about it leaves your machine. 0 disables it.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 5f), Array.Empty())); CannonRoundsPerSecond = file.Bind("10 - Cannon", "RoundsPerSecond", 65f, new ConfigDescription("Rate of fire. The real GAU-8 runs at about 65 rounds a second.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 120f), Array.Empty())); CannonRoundsPerBurst = file.Bind("10 - Cannon", "RoundsPerBurst", 4f, new ConfigDescription("Rounds sent per network message. One message carrying four rounds costs a quarter of the traffic of four messages and looks identical.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 20f), Array.Empty())); CannonMuzzleVelocity = file.Bind("10 - Cannon", "MuzzleVelocity", 800f, new ConfigDescription("Round speed, m/s, before the jet's own motion is added.", (AcceptableValueBase)(object)new AcceptableValueRange(50f, 2000f), Array.Empty())); CannonSpread = file.Bind("10 - Cannon", "Spread", 0.25f, new ConfigDescription("Half-angle of the cone the rounds scatter into, degrees.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 10f), Array.Empty())); CannonForce = file.Bind("10 - Cannon", "Force", 40f, new ConfigDescription("Impact force applied to what it hits.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2000f), Array.Empty())); CannonGravity = file.Bind("10 - Cannon", "Gravity", 1.5f, new ConfigDescription("Drop applied to rounds in flight.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 40f), Array.Empty())); CannonAmmo = file.Bind("10 - Cannon", "Ammo", 1174f, new ConfigDescription("Rounds carried. The real aircraft holds 1174.", (AcceptableValueBase)(object)new AcceptableValueRange(10f, 5000f), Array.Empty())); CannonReloadSeconds = file.Bind("10 - Cannon", "ReloadSeconds", 8f, new ConfigDescription("Seconds to rearm, which only happens on the ground.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 120f), Array.Empty())); CannonRecoil = file.Bind("10 - Cannon", "Recoil", 0.09f, new ConfigDescription("Deceleration per round. The GAU-8 is famous for slowing the aircraft down, and at 48 rounds a second this adds up to a noticeable drag.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2f), Array.Empty())); TracerLength = file.Bind("10 - Cannon", "TracerLength", 26f, new ConfigDescription("Length of the drawn tracer streak, metres. Zero draws none and leaves only the game's own bullet mesh, which is nearly invisible at range.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 400f), Array.Empty())); TracerWidth = file.Bind("10 - Cannon", "TracerWidth", 0.35f, new ConfigDescription("Thickness of the tracer streak, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(0.02f, 5f), Array.Empty())); TracerLife = file.Bind("10 - Cannon", "TracerLife", 0.5f, new ConfigDescription("Seconds a tracer stays visible.", (AcceptableValueBase)(object)new AcceptableValueRange(0.05f, 4f), Array.Empty())); TracerEvery = file.Bind("10 - Cannon", "TracerEvery", 2f, new ConfigDescription("Draw a tracer every Nth round. Real belts run about one in five; at 48 rounds a second, fewer reads better than more.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 20f), Array.Empty())); TracerMax = file.Bind("10 - Cannon", "TracerMax", 90f, new ConfigDescription("Most tracers alive at once before the oldest is recycled.", (AcceptableValueBase)(object)new AcceptableValueRange(4f, 400f), Array.Empty())); TracerColourHex = file.Bind("10 - Cannon", "TracerColour", "FF7A1EE0", "Tracer colour as RRGGBBAA hex."); PipperRange = file.Bind("10 - Cannon", "PipperRange", 500f, new ConfigDescription("Range the aiming pipper is computed for. It marks where the rounds actually arrive at that distance, drop included - the nose is not the aim point.", (AcceptableValueBase)(object)new AcceptableValueRange(50f, 3000f), Array.Empty())); CockpitVolume = file.Bind("09 - Sound", "CockpitVolume", 0.52f, new ConfigDescription("Cannon loudness for the pilot. The cockpit gets a plain, dry version of the loop - no echo, no distance filter, no travel time - because in there the gun is bolted to the airframe a few metres away. Everything that makes it sound like it is coming from somewhere is what makes it wrong from inside.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2f), Array.Empty())); CockpitCutoff = file.Bind("09 - Sound", "CockpitCutoff", 7000f, new ConfigDescription("Low-pass on the cockpit gun, Hz. It arrives through structure and a helmet, not through air.", (AcceptableValueBase)(object)new AcceptableValueRange(200f, 22000f), Array.Empty())); CannonSpatialBlend = file.Bind("09 - Sound", "CannonSpatialBlend", 1f, new ConfigDescription("How 3D the gun is. The engine sits at 0.35, which leaves most of the signal 2D and unattenuated - fine for something you are sitting on, wrong for something meant to be heard from a distance.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); CannonRange = file.Bind("09 - Sound", "CannonRange", 1200f, new ConfigDescription("How far the gun carries, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(50f, 5000f), Array.Empty())); CannonNearDistance = file.Bind("09 - Sound", "CannonNearDistance", 25f, new ConfigDescription("Distance within which the gun is at full volume, metres.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 500f), Array.Empty())); CannonFarCutoff = file.Bind("09 - Sound", "CannonFarCutoff", 600f, new ConfigDescription("Low-pass cutoff at maximum range, Hz. Air swallows the top end over distance, and that is most of what tells an ear how far away a gun is.", (AcceptableValueBase)(object)new AcceptableValueRange(100f, 22000f), Array.Empty())); CannonEcho = file.Bind("09 - Sound", "CannonEcho", 0.45f, new ConfigDescription("Wet mix of the echo on the gun. The rolling slap-back off terrain is a good part of what makes a GAU-8 recognisable. 0 removes it.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); CannonEchoDelay = file.Bind("09 - Sound", "CannonEchoDelay", 180f, new ConfigDescription("Echo delay, milliseconds.", (AcceptableValueBase)(object)new AcceptableValueRange(10f, 2000f), Array.Empty())); CannonEchoDecay = file.Bind("09 - Sound", "CannonEchoDecay", 0.45f, new ConfigDescription("How much of the echo survives each repeat.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 0.95f), Array.Empty())); CannonTailVolume = file.Bind("09 - Sound", "CannonTailVolume", 1.2f, new ConfigDescription("Loudness of the spool-up and the trailing echo relative to the loop. The tail is most of what makes a GAU-8 sound like one, so it carries a little.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 3f), Array.Empty())); CannonRelease = file.Bind("09 - Sound", "CannonRelease", 6f, new ConfigDescription("How fast the firing loop fades when the trigger comes off. Quick, because the tail clip is what should be heard, not the loop dying.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 40f), Array.Empty())); CannonVolume = file.Bind("09 - Sound", "CannonVolume", 0.4f, new ConfigDescription("Cannon loudness. Drop a10-cannon.wav next to the plugin and it plays as a loop while firing.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); CannonVfx = file.Bind("10 - Cannon", "MuzzleVfx", "", "Name of a VFXManager effect to play at the muzzle. Empty plays nothing; a name the game does not know logs a warning and is otherwise harmless."); } public int ResetStaleTuning() { if (Revision.Value == 50) { return 0; } int num = 0; FieldInfo[] fields = GetType().GetFields(BindingFlags.Instance | BindingFlags.Public); foreach (FieldInfo fieldInfo in fields) { if (fieldInfo.FieldType != typeof(ConfigEntry)) { continue; } ConfigEntry val = (ConfigEntry)fieldInfo.GetValue(this); if (val == null) { Plugin.Log.LogWarning((object)("Config entry '" + fieldInfo.Name + "' was never bound.")); continue; } float num2 = (float)((ConfigEntryBase)val).DefaultValue; if (!Mathf.Approximately(val.Value, num2)) { val.Value = num2; num++; } } Revision.Value = 50; return num; } public Color TracerColour() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); if (!ColorUtility.TryParseHtmlString("#" + TracerColourHex.Value.TrimStart(new char[1] { '#' }), ref result)) { return new Color(1f, 0.76f, 0.29f, 1f); } return result; } } [BepInPlugin("com.zpaulin.howtofish.warthog", "zPaulin's A10-Warthog", "1.0.0")] [BepInProcess("How to Fish.exe")] public sealed class Plugin : BaseUnityPlugin { private Harmony _harmony; private GameObject _host; internal static Plugin Instance { get; private set; } internal static ManualLogSource Log { get; private set; } internal static ModConfig Cfg { get; private set; } private void Awake() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; Cfg = new ModConfig(((BaseUnityPlugin)this).Config); int num = Cfg.ResetStaleTuning(); if (num > 0) { Log.LogWarning((object)("Config was written by an older build; reset " + num + " tuning value(s) to this version's numbers.")); } Cfg.HullDebug.Value = false; JetSales.Load(); JetNetwork.Prepare(); JetAssets.Load(this); _harmony = new Harmony("com.zpaulin.howtofish.warthog"); _harmony.PatchAll(typeof(Plugin).Assembly); _host = new GameObject("HowToFish.Warthog.Runtime") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)(object)_host); ((MonoBehaviour)_host.AddComponent()).StartCoroutine(JetAudio.Load(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location))); SceneHooks.Subscribe(); Log.LogInfo((object)("zPaulin's A10-Warthog v1.0.0 loaded - model " + (JetAssets.Ready ? "ready" : "MISSING"))); } private void OnDestroy() { JetNetwork.Detach(); JetFog.Restore(); GameFlags.Release(); JetCalm.Release(); JetHud.Destroy(); JetRadar.Destroy(); JetFleet.Destroy(); JetTracers.Clear(); ImpactFx.Clear(); VanillaHud.Restore(); SceneHooks.Unsubscribe(); Carrier.Clear(); if ((Object)(object)_host != (Object)null) { Object.Destroy((Object)(object)_host); } if (_harmony != null) { _harmony.UnpatchSelf(); } } } public static class PluginInfo { public const string Guid = "com.zpaulin.howtofish.warthog"; public const string Name = "zPaulin's A10-Warthog"; public const string Version = "1.0.0"; public const string CommandRoot = "a10"; public const string BundleFile = "warthog.bundle"; public const string JetPrefab = "Warthog"; } public static class VanillaHud { private static CanvasGroup _hotbar; private static bool _hidden; private static bool _searched; private static readonly List Stats = new List(); private static readonly List StatsWere = new List(); private static bool _statsHidden; private static bool _statsSearched; private static string _statsReport = "not searched"; public static string StatsReport { get { FindStats(); return _statsReport; } } public static void SetHotbarHidden(bool hide) { if (hide != _hidden) { CanvasGroup val = Hotbar(); if (!((Object)(object)val == (Object)null)) { val.alpha = (hide ? 0f : 1f); _hidden = hide; } } } private static CanvasGroup Hotbar() { if ((Object)(object)_hotbar != (Object)null) { return _hotbar; } if (_searched) { return null; } _searched = true; InventorySlot[] array = Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)0); if (array.Length == 0) { _searched = false; return null; } Transform val = CommonAncestor(array); if ((Object)(object)val == (Object)null) { Plugin.Log.LogWarning((object)"Found inventory slots but no shared parent to hide."); return null; } _hotbar = ((Component)val).GetComponent(); if ((Object)(object)_hotbar == (Object)null) { _hotbar = ((Component)val).gameObject.AddComponent(); } Plugin.Log.LogDebug((object)("Hotbar found: " + ((Object)val).name + " (" + array.Length + " slots)")); return _hotbar; } private static Transform CommonAncestor(InventorySlot[] slots) { Transform parent = ((Component)slots[0]).transform.parent; for (int i = 0; i < 8; i++) { if (!((Object)(object)parent != (Object)null)) { break; } bool flag = true; for (int j = 0; j < slots.Length; j++) { if (!((Component)slots[j]).transform.IsChildOf(parent)) { flag = false; break; } } if (flag) { return parent; } parent = parent.parent; } return null; } public static void SetStatsHidden(bool hide) { if (!hide && !_statsHidden) { return; } FindStats(); if (Stats.Count == 0) { return; } for (int i = 0; i < Stats.Count; i++) { if (!((Object)(object)Stats[i] == (Object)null)) { ((Behaviour)Stats[i]).enabled = !hide && StatsWere[i]; } } _statsHidden = hide; } private static void FindStats() { if (_statsSearched) { return; } PlayerUI val = Instance(); if ((Object)(object)val == (Object)null) { _statsReport = "PlayerUI instance not found"; return; } Component val2 = Private(val, "_moneyUI"); Component val3 = Private(val, "_vitalsUI"); Stats.Clear(); StatsWere.Clear(); HashSet hashSet = new HashSet(); Collect(val2, hashSet); Collect(val3, hashSet); foreach (Graphic item in hashSet) { if (!((Object)(object)item == (Object)null)) { Stats.Add(item); StatsWere.Add(((Behaviour)item).enabled); } } _statsSearched = Stats.Count > 0; _statsReport = string.Format("money {0}, vitals {1}, {2} graphic(s)", ((Object)(object)val2 == (Object)null) ? "MISSING" : ((Object)val2.gameObject).name, ((Object)(object)val3 == (Object)null) ? "MISSING" : ((Object)val3.gameObject).name, Stats.Count); Plugin.Log.LogDebug((object)("Vanilla stats: " + _statsReport)); } private static void Collect(Component script, HashSet into) { if ((Object)(object)script == (Object)null) { return; } Graphic[] componentsInChildren = script.GetComponentsInChildren(true); foreach (Graphic item in componentsInChildren) { into.Add(item); } FieldInfo[] fields = ((object)script).GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { if (!typeof(Component).IsAssignableFrom(fieldInfo.FieldType)) { continue; } object? value = fieldInfo.GetValue(script); Component val = (Component)((value is Component) ? value : null); if (!((Object)(object)val == (Object)null)) { componentsInChildren = val.GetComponentsInChildren(true); foreach (Graphic item2 in componentsInChildren) { into.Add(item2); } } } } private static PlayerUI Instance() { object? obj = typeof(PlayerUI).GetField("_instance", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null); PlayerUI val = (PlayerUI)((obj is PlayerUI) ? obj : null); if ((Object)(object)val != (Object)null) { return val; } return Object.FindAnyObjectByType((FindObjectsInactive)0); } private static Component Private(PlayerUI ui, string name) { object? obj = typeof(PlayerUI).GetField(name, BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(ui); return (Component)((obj is Component) ? obj : null); } public static void Restore() { SetHotbarHidden(hide: false); SetStatsHidden(hide: false); } } public static class Vendor { private static Vector3 _skin; private static string _outfitName; public static GameObject Root { get; private set; } public static GameObject BodyObject { get; private set; } public static bool Exists => (Object)(object)Root != (Object)null; public static void Build(Transform deck, float deckHeight, float length, ModConfig cfg) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Root != (Object)null)) { Root = new GameObject("A10_Vendor"); Root.transform.SetParent(deck, false); Root.transform.localPosition = new Vector3(cfg.VendorX.Value, deckHeight, length * cfg.VendorZ.Value); Root.transform.localRotation = Quaternion.Euler(0f, cfg.VendorYaw.Value, 0f); GameObject val = (BodyObject = Body()); if ((Object)(object)val != (Object)null) { val.transform.SetParent(Root.transform, false); val.transform.localRotation = Quaternion.identity; val.transform.localPosition = new Vector3(0f, 0f, cfg.VendorStand.Value); val.SetActive(true); Dress(val, cfg); } else { Plugin.Log.LogWarning((object)"No NPC to borrow a body from; the dealer is a signpost."); } Counter(cfg); VendorInteractable.Attach(Root.transform, (Object)(object)val == (Object)null); } } public static void Rebuild() { if (Carrier.Exists) { ModConfig cfg = Plugin.Cfg; Clear(); Build(Carrier.Root.transform, cfg.CarrierDeckHeight.Value, cfg.CarrierLength.Value, cfg); } } public static void Clear() { if ((Object)(object)Root != (Object)null) { Object.Destroy((Object)(object)Root); } Root = null; } private static GameObject Body() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) List list = Islanders(); if (list.Count == 0) { Plugin.Log.LogWarning((object)"No NPC in the world to borrow a body from."); return null; } GameObject val = new GameObject("A10_VendorHolder"); val.SetActive(false); try { NPC val2 = Pick(list); _skin = Read((Object)(object)val2, "_skinColor"); _outfitName = RendererName(val2, "_outfit"); GameObject val3 = Object.Instantiate(((Component)val2).gameObject, val.transform); ((Object)val3).name = "Dealer"; Strip(val3); Repair(list.ToArray()); Plugin.Log.LogDebug((object)("Dealer body cloned from " + ((Object)val2).name + " of " + list.Count + ": " + Names(list))); return val3; } finally { Object.Destroy((Object)(object)val); } } private static void Repair(NPC[] npcs) { if (!(typeof(NPCManager).GetField("_idToNpc", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null) is IDictionary dictionary)) { return; } foreach (NPC val in npcs) { if (!((Object)(object)val == (Object)null) && !dictionary.Contains(val.ID)) { dictionary[val.ID] = val; Plugin.Log.LogWarning((object)("Re-registered NPC " + val.ID + " - the inactive clone woke up after all.")); } } } public static List Islanders() { List list = new List(); NPC[] array = Object.FindObjectsByType((FindObjectsInactive)0, (FindObjectsSortMode)0); foreach (NPC val in array) { if ((Object)(object)val != (Object)null) { list.Add(val); } } list.Sort((NPC a, NPC b) => string.CompareOrdinal(((Object)a).name, ((Object)b).name)); return list; } private static NPC Pick(List npcs) { string value = Plugin.Cfg.VendorNpc.Value; if (!string.IsNullOrEmpty(value)) { string value2 = value.ToLowerInvariant(); foreach (NPC npc in npcs) { if (((Object)npc).name.ToLowerInvariant().Contains(value2)) { return npc; } } Plugin.Log.LogWarning((object)("No NPC called '" + value + "' here; using " + ((Object)npcs[0]).name + ". /a10 npcs lists them.")); } return npcs[0]; } public static string Names(List npcs) { List list = new List(); foreach (NPC npc in npcs) { list.Add(((Object)npc).name); } if (list.Count != 0) { return string.Join(", ", list.ToArray()); } return "(none)"; } private static void Strip(GameObject clone) { Component[] componentsInChildren = clone.GetComponentsInChildren(true); foreach (Component val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && !(val is Transform) && !(val is Renderer) && !(val is MeshFilter)) { Object.DestroyImmediate((Object)(object)val); } } } private static T Read(Object target, string field) { object obj = ((object)target).GetType().GetField(field, BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(target); if (obj is T) { return (T)obj; } return default(T); } private static string RendererName(NPC npc, string field) { object? obj = typeof(NPC).GetField(field, BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(npc); SkinnedMeshRenderer val = (SkinnedMeshRenderer)((obj is SkinnedMeshRenderer) ? obj : null); if (!((Object)(object)val == (Object)null)) { return ((Object)val).name; } return null; } private static void Dress(GameObject body, ModConfig cfg) { //IL_002e: 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_0038: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) bool flag = !string.IsNullOrEmpty(cfg.VendorSuitColour.Value); Color val = Mat.Parse(cfg.VendorSuitColour.Value, new Color(0.29f, 0.33f, 0.24f)); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.r, val.g, val.b); SkinnedMeshRenderer[] componentsInChildren = body.GetComponentsInChildren(true); foreach (SkinnedMeshRenderer val3 in componentsInChildren) { bool flag2 = flag && _outfitName != null && ((Object)val3).name == _outfitName; try { if (flag2) { ShaderManager.SetPlayerColors((Renderer)(object)val3, _skin, val2, val2, val2); } else { ShaderManager.SetPlayerColors((Renderer)(object)val3, _skin, default(Vector3), default(Vector3), default(Vector3)); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Could not colour " + ((Object)val3).name + ": " + ex.Message)); } } Plugin.Log.LogDebug((object)("Dealer dressed: skin " + ((Vector3)(ref _skin)).ToString("F2") + ", outfit renderer " + (_outfitName ?? "unknown"))); } private static void Counter(ModConfig cfg) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) Piece((PrimitiveType)3, "Counter", Root.transform, new Vector3(0f, 0.5f, 0.9f), new Vector3(2.4f, 1f, 0.7f), new Color(0.33f, 0.34f, 0.36f)); Color colour = default(Color); ((Color)(ref colour))..ctor(0.33f, 0.34f, 0.36f); for (int i = -1; i <= 1; i += 2) { Piece((PrimitiveType)3, "SignPost" + i, Root.transform, new Vector3((float)i * 1f, 1.4f, 0.9f), new Vector3(0.1f, 0.8f, 0.1f), colour); } Piece((PrimitiveType)3, "Sign", Root.transform, new Vector3(0f, 2f, 0.9f), new Vector3(2.4f, 0.45f, 0.1f), new Color(0.86f, 0.72f, 0.2f)); } private static GameObject Piece(PrimitiveType type, string name, Transform parent, Vector3 position, Vector3 scale, Color colour) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive(type); ((Object)val).name = name; val.transform.SetParent(parent, false); val.transform.localPosition = position; val.transform.localScale = scale; Material val2 = Mat.Solid(colour); if ((Object)(object)val2 != (Object)null) { ((Renderer)val.GetComponent()).sharedMaterial = val2; } Object.Destroy((Object)(object)val.GetComponent()); return val; } } public sealed class VendorInteractable : Purchasable { private static readonly FieldInfo InteractColField = typeof(Interactable).GetField("_interactCol", BindingFlags.Instance | BindingFlags.NonPublic); private static readonly FieldInfo TextTargetField = typeof(Interactable).GetField("_textTarget", BindingFlags.Instance | BindingFlags.NonPublic); private const string Sold = "She is fuelled and chocked. Try not to put her in the sea."; private static readonly string[] Lines = new string[5] { "You are standing on my deck asking about my aeroplane.", "Thirty millimetres of cannon. Seven barrels. She was built to fly low and slow over people having a very bad day.", "The wing will bring you home missing half of itself. I have seen it.", "Mind the islands. They are small, and she is a lot of aircraft for the room.", "Two hundred thousand. I do not haggle and I do not do finance." }; private static int _line; private Transform _mouth; private static bool Finished => _line >= Lines.Length; public override bool InteractableWhenHoldingItem => true; public static VendorInteractable Attach(Transform parent, bool bodyless) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_002d: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Interact"); val.transform.SetParent(parent, false); val.transform.localPosition = new Vector3(0f, 1f, 0f); val.SetActive(false); val.tag = "Interactable"; BoxCollider val2 = val.AddComponent(); val2.size = new Vector3(2.2f, 2.4f, bodyless ? 2.2f : 1.4f); ((Collider)val2).isTrigger = Physics.queriesHitTriggers; GameObject val3 = new GameObject("Mouth"); val3.transform.SetParent(val.transform, false); val3.transform.localPosition = new Vector3(0f, 0.95f, 0f); VendorInteractable vendorInteractable = val.AddComponent(); vendorInteractable._mouth = val3.transform; ((Interactable)vendorInteractable)._modelsToOutline = (GameObject[])(object)new GameObject[0]; InteractColField?.SetValue(vendorInteractable, val2); TextTargetField?.SetValue(vendorInteractable, val.transform); val.SetActive(true); ((Interactable)vendorInteractable).ToggleIsInteractable(true); return vendorInteractable; } protected override void OnStartHover() { Refresh(); } public override void Hover() { Refresh(); ((Purchasable)this).Hover(); } private void Say(string line) { try { PlayerUI.SetNpcText(line, ((Object)(object)_mouth != (Object)null) ? _mouth : ((Interactable)this).TextTarget); } catch (Exception ex) { Plugin.Log.LogWarning((object)("No speech bubble: " + ex.Message)); } } private void Refresh() { base._customCost = ((!JetSales.Available && Finished) ? JetSales.Price : 0); base._customCanBuy = true; base._hoverString = Prompt() + "\n" + SpriteManager.GetPickUpInput(); } private string Prompt() { if (JetSales.Available) { return "She is fuelled and on the pad"; } if (!Finished) { if (_line != 0) { return "Keep listening"; } return "Ask about the A-10"; } return "Buy the A-10 - $" + JetSales.Price.ToString("N0", Feedback.Numbers); } public override void Interact(Player player) { ((Interactable)this).Interact(player); if (!JetSales.Available && !Finished) { Say(Lines[_line]); _line++; Refresh(); if (((Interactable)this)._isHovering) { PlayerUI.UpdateLookAtText(base._hoverString); } } else if (!JetSales.Available && !JetSales.CanAfford()) { JetSales.Refused(); } else if (JetSales.Available) { Say("She is fuelled and chocked. Try not to put her in the sea."); } else { JetSales.Request(); Refresh(); if (JetSales.Available) { Say("She is fuelled and chocked. Try not to put her in the sea."); } } } public static void Reset() { _line = 0; } } public sealed class WarthogRuntime : MonoBehaviour { public static WarthogRuntime Instance { get; private set; } private void Awake() { Instance = this; } private void Update() { JetCalm.Tick(); JetFleet.Tick(); JetNetwork.Tick(); JetCannon.DemoTick(); JetControl.Tick(); } private void LateUpdate() { JetControl.LateTick(); } } } namespace HowToFish.Warthog.Patches { [HarmonyPatch(typeof(DazedCommands), "IsServerCommand")] public static class DazedCommandsPatch { [HarmonyPrefix] private static bool Prefix(string __0, ref bool __result) { if (!Commands.Handle(__0)) { return true; } __result = true; return false; } } public static class Flying { public static bool Is(Player player) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return false; } foreach (JetVehicle item in JetVehicle.All) { if ((Object)(object)item != (Object)null && (Object)(object)item.Pilot == (Object)(object)player) { return true; } } ModConfig cfg = Plugin.Cfg; if (cfg == null || cfg.CalmAltitude.Value <= 0f) { return false; } try { return (Object)(object)player.Transform != (Object)null && player.Transform.position.y - WaterManager.WaterHeight > cfg.CalmAltitude.Value; } catch { return false; } } public static Player Ground(Player chosen, Vector3 near) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)chosen == (Object)null || !Plugin.Cfg.CalmCreatures.Value || !Is(chosen)) { return chosen; } Player val = null; float num = float.MaxValue; try { foreach (Player alivePlayer in PlayerManager.AlivePlayers) { if (!((Object)(object)alivePlayer == (Object)null) && !((Object)(object)alivePlayer.Transform == (Object)null) && !Is(alivePlayer)) { Vector3 val2 = alivePlayer.Transform.position - near; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (!(sqrMagnitude >= num)) { num = sqrMagnitude; val = alivePlayer; } } } } catch { return chosen; } return val ?? chosen; } } [HarmonyPatch(typeof(PlayerManager), "GetNearestAlivePlayer")] internal static class NearestPlayerPatch { private static void Postfix(Vector3 __0, ref Player __result) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) __result = Flying.Ground(__result, __0); } } [HarmonyPatch(typeof(PlayerManager), "GetRandomAlivePlayer")] internal static class RandomPlayerPatch { private static void Postfix(ref Player __result) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) __result = Flying.Ground(__result, ((Object)(object)__result == (Object)null || (Object)(object)__result.Transform == (Object)null) ? Vector3.zero : __result.Transform.position); } } [HarmonyPatch(typeof(PlayerManager), "GetVisiblePlayer")] internal static class VisiblePlayerPatch { private static void Postfix(Vector3 __0, ref Player __result) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) __result = Flying.Ground(__result, __0); } } [HarmonyPatch(typeof(PlayerManager), "GetPlayerInFrontOf")] internal static class InFrontPlayerPatch { private static void Postfix(Transform __0, ref Player __result) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) __result = Flying.Ground(__result, ((Object)(object)__0 == (Object)null) ? Vector3.zero : __0.position); } } [HarmonyPatch(typeof(PlayerVitals), "TickUpdate")] internal static class VitalsTickPatch { private static bool Prefix(PlayerVitals __instance) { return !Frozen(__instance); } public static bool Frozen(PlayerVitals vitals) { ModConfig cfg = Plugin.Cfg; if (cfg == null || !cfg.FreezeVitals.Value || (Object)(object)vitals == (Object)null) { return false; } JetVehicle local = JetVehicle.Local; if ((Object)(object)local == (Object)null || (Object)(object)local.Pilot == (Object)null) { return false; } try { return (Object)(object)local.Pilot.Vitals == (Object)(object)vitals; } catch { return false; } } } [HarmonyPatch(typeof(PlayerUI), "ToggleIslandWarning")] internal static class IslandWarningPatch { private static bool Prefix(bool __0) { if (__0 && (Object)(object)JetVehicle.Local != (Object)null) { return !Plugin.Cfg.HideIslandWarning.Value; } return true; } } [HarmonyPatch(typeof(ShaderManager), "SetFog")] internal static class FogPatch { private static void Postfix() { JetFog.Rebase(); } } [HarmonyPatch(typeof(PlayerVitals), "TakeDamage")] internal static class VitalsDamagePatch { private static bool Prefix(PlayerVitals __instance) { if (!JetVehicle.KillingPilot) { return !VitalsTickPatch.Frozen(__instance); } return true; } } internal static class FatRounds { public static float Enter(Projectile projectile, ProjectileType type) { if (projectile == null || type == null) { return float.NaN; } if (!projectile.IsLocal || !JetCannon.Live) { return float.NaN; } ModConfig cfg = Plugin.Cfg; if (cfg == null || cfg.CannonHitRadius.Value <= 0f) { return float.NaN; } if ((Object)(object)projectile.Owner == (Object)null || (Object)(object)projectile.Owner != (Object)(object)Player.LocalPlayer) { return float.NaN; } float widthRadius = type.WidthRadius; type.WidthRadius = Mathf.Max(widthRadius, cfg.CannonHitRadius.Value); return widthRadius; } public static void Leave(ProjectileType type, float saved) { if (type != null && !float.IsNaN(saved)) { type.WidthRadius = saved; } } } [HarmonyPatch(typeof(ProjectileManager), "AddProjectiles")] internal static class RemoteGunAudioPatch { private static void Postfix(Player __0, bool __2) { if (__2 || (Object)(object)__0 == (Object)null) { return; } foreach (JetVehicle item in JetVehicle.All) { if ((Object)(object)item != (Object)null && item.RemotelyFlown && (Object)(object)item.Pilot == (Object)(object)__0) { item.RemoteFire(); break; } } } } [HarmonyPatch(typeof(ProjectileManager), "Hit")] internal static class ImpactPatch { private static void Postfix(Projectile __0, RaycastHit __2) { //IL_0036: 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) if (__0 != null && __0.IsLocal && JetCannon.Live && !((Object)(object)__0.Owner == (Object)null) && !((Object)(object)__0.Owner != (Object)(object)Player.LocalPlayer)) { JetImpacts.At(((RaycastHit)(ref __2)).point, ((RaycastHit)(ref __2)).normal); } } } [HarmonyPatch(typeof(ProjectileManager), "UpdateProjectileScan")] internal static class ProjectileScanPatch { private static void Prefix(Projectile __0, ProjectileType __1, out float __state) { __state = FatRounds.Enter(__0, __1); } private static void Postfix(ProjectileType __1, float __state) { FatRounds.Leave(__1, __state); } } [HarmonyPatch(typeof(ProjectileManager), "HitScan")] internal static class ProjectileHitScanPatch { private static void Prefix(Projectile __0, ProjectileType __1, out float __state) { __state = FatRounds.Enter(__0, __1); } private static void Postfix(ProjectileType __1, float __state) { FatRounds.Leave(__1, __state); } } public static class SceneHooks { private static bool _subscribed; public static void Subscribe() { if (!_subscribed) { SceneManager.sceneLoaded += OnSceneLoaded; SceneManager.sceneUnloaded += OnSceneUnloaded; _subscribed = true; } } public static void Unsubscribe() { if (_subscribed) { SceneManager.sceneLoaded -= OnSceneLoaded; SceneManager.sceneUnloaded -= OnSceneUnloaded; _subscribed = false; } } private unsafe static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) Plugin.Log.LogDebug((object)("scene loaded: " + ((Scene)(ref scene)).name + " (" + ((object)(*(LoadSceneMode*)(&mode))/*cast due to .constrained prefix*/).ToString() + ")")); Carrier.OnSceneLoaded(scene); if (((Scene)(ref scene)).name != null && ((Scene)(ref scene)).name.StartsWith("Island")) { JetFleet.OnIslandLoaded(); } } private static void OnSceneUnloaded(Scene scene) { if (Islands.IsCarrierIsland(((Scene)(ref scene)).name)) { Carrier.Clear(); } } } }