Decompiled source of Climbing Car and Secret Lab v1.0.0
plugins/SecretLab/SecretLab.dll
Decompiled 2 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SecretLab")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SecretLab")] [assembly: AssemblyTitle("SecretLab")] [assembly: AssemblyVersion("1.0.0.0")] namespace JimmySecretLab; [BepInPlugin("jimmy.wobblylife.secretlab", "Secret Lab", "1.0.0")] public class SecretLabPlugin : BaseUnityPlugin { internal static SecretLabPlugin Inst; internal Quest quest; private string mapFile; private void Awake() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown Inst = this; mapFile = Path.Combine(Paths.BepInExRootPath, "SecretLab_map.txt"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Secret Lab quest loaded! (J = do things)"); GameObject val = new GameObject("SecretLab_Runner"); ((Object)val).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)val); quest = val.AddComponent<Quest>(); } internal void Log(string s) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Secret Lab: " + s)); } internal void MapNote(string s) { try { File.AppendAllText(mapFile, s + Environment.NewLine); } catch { } } } internal static class Reflect { public const BindingFlags All = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; private static readonly Dictionary<string, Type> cache = new Dictionary<string, Type>(); public static Type FindType(string name) { if (cache.TryGetValue(name, out var value) && value != null) { return value; } Type type = null; try { type = Type.GetType(name + ", Game", throwOnError: false); } catch { } if (type == null) { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { try { type = assembly.GetType(name, throwOnError: false); } catch { } if (type != null) { break; } } } cache[name] = type; return type; } public static FieldInfo FindField(Type t, string name) { while (t != null) { FieldInfo field = t.GetField(name, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { return field; } t = t.BaseType; } return null; } public static object Get(object o, string field) { if (o != null) { return FindField(o.GetType(), field)?.GetValue(o); } return null; } public static object Call(object o, string method) { return o?.GetType().GetMethod(method, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null)?.Invoke(o, null); } public static bool IsLocal(object playerController) { try { object obj = Get(playerController, "networkObject"); if (obj == null) { return true; } MethodInfo method = obj.GetType().GetMethod("IsOwner", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); return method == null || (bool)method.Invoke(obj, null); } catch { return true; } } } internal static class Keys { private static readonly Dictionary<int, bool> was = new Dictionary<int, bool>(); public const int J = 74; public const int F12 = 123; public const int ESC = 27; public const int LBRACKET = 219; public const int RBRACKET = 221; public const int H = 72; public const int B = 66; public const int V = 86; public const int W = 87; public const int A = 65; public const int S = 83; public const int D = 68; public const int SPACE = 32; [DllImport("user32.dll")] private static extern short GetAsyncKeyState(int vKey); public static bool Down(int vk) { if (Application.isFocused) { return (GetAsyncKeyState(vk) & 0x8000) != 0; } return false; } public static bool Pressed(int vk) { bool flag = Application.isFocused && (GetAsyncKeyState(vk) & 0x8000) != 0; was.TryGetValue(vk, out var value); was[vk] = flag; if (flag) { return !value; } return false; } } internal static class Paint { private static Shader shader; private static readonly Dictionary<Color, Material> cache = new Dictionary<Color, Material>(); public static Material Get(Color c) { //IL_0069: 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_0089: 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_0091: Expected O, but got Unknown //IL_00ae: 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) if ((Object)(object)shader == (Object)null) { string[] array = new string[4] { "Standard", "Legacy Shaders/Diffuse", "Unlit/Color", "Sprites/Default" }; for (int i = 0; i < array.Length; i++) { Shader val = Shader.Find(array[i]); if ((Object)(object)val != (Object)null && val.isSupported) { shader = val; break; } } } if (!cache.TryGetValue(c, out var value) || (Object)(object)value == (Object)null) { value = new Material(shader) { color = c }; if (value.HasProperty("_Glossiness")) { value.SetFloat("_Glossiness", 0.3f); } if (c.a < 0.99f && value.HasProperty("_Mode")) { value.SetFloat("_Mode", 3f); value.SetInt("_SrcBlend", 5); value.SetInt("_DstBlend", 10); value.SetInt("_ZWrite", 0); value.EnableKeyword("_ALPHABLEND_ON"); value.renderQueue = 3000; } cache[c] = value; } return value; } } internal static class Build { private static Font font; public static GameObject Prim(PrimitiveType t, Transform parent, Vector3 pos, Vector3 size, Color c, bool solid = false, Quaternion? rot = null) { //IL_0000: 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_0035: 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_004c: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive(t); if (!solid) { Object.DestroyImmediate((Object)(object)val.GetComponent<Collider>()); } val.transform.SetParent(parent, false); val.transform.localPosition = pos; val.transform.localScale = size; if (rot.HasValue) { val.transform.localRotation = rot.Value; } val.GetComponent<Renderer>().sharedMaterial = Paint.Get(c); return val; } public static GameObject Box(Transform parent, Vector3 pos, Vector3 size, Color c, bool solid = true) { //IL_0002: 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) //IL_0004: Unknown result type (might be due to invalid IL or missing references) return Prim((PrimitiveType)3, parent, pos, size, c, solid); } public static GameObject Cyl(Transform parent, Vector3 pos, float radius, float length, Color c, Quaternion? rot = null) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) return Prim((PrimitiveType)2, parent, pos, new Vector3(radius * 2f, length / 2f, radius * 2f), c, solid: false, rot); } public static TextMesh Text(Transform parent, Vector3 pos, Quaternion rot, string text, float height, Color c) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_006a: 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_00b9: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)font == (Object)null) { font = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf"); } if ((Object)(object)font == (Object)null) { font = Resources.GetBuiltinResource<Font>("Arial.ttf"); } } catch { } if ((Object)(object)font == (Object)null) { return null; } GameObject val = new GameObject("Text"); val.transform.SetParent(parent, false); val.transform.localPosition = pos; val.transform.localRotation = rot; TextMesh obj2 = val.AddComponent<TextMesh>(); obj2.font = font; obj2.text = text; obj2.fontSize = 64; obj2.characterSize = height / 6.4f; obj2.anchor = (TextAnchor)4; obj2.alignment = (TextAlignment)1; obj2.color = c; ((Renderer)val.GetComponent<MeshRenderer>()).sharedMaterial = font.material; return obj2; } public static Light Lamp(Transform parent, Vector3 pos, float range, float intensity, Color c) { //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) //IL_0017: 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_003e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Lamp"); val.transform.SetParent(parent, false); val.transform.localPosition = pos; Light obj = val.AddComponent<Light>(); obj.type = (LightType)2; obj.range = range; obj.intensity = intensity; obj.color = c; obj.shadows = (LightShadows)0; return obj; } } public class Quest : MonoBehaviour { private class Thing { public Func<Vector3> at; public float range; public Func<string> label; public Action act; public Func<bool> on; } private class Bot { public Transform t; public Transform bang; public Vector3 dir; public Vector3 home; public float pause; public float seen; public float travel; public float grow; public bool jumper; public int n; } private static readonly Vector3 DOOR_AT = new Vector3(-141.52f, 223.17f, 893.72f); private static readonly Vector3 SPACEBOX_AT = new Vector3(-143.65f, 224.5f, 864.52f); private static readonly Vector3 WELDER_AT = new Vector3(-172.3f, 169.5f, 858.4f); private static readonly Vector3 TUBEJOB_AT = new Vector3(-111.07f, 178.45f, 793.97f); private static readonly Vector3 LAB = new Vector3(-155.8f, 110f, 903.4f); private static readonly Color WALL = new Color(0.86f, 0.87f, 0.9f); private static readonly Color FLOOR = new Color(0.55f, 0.57f, 0.62f); private static readonly Color DARK = new Color(0.15f, 0.15f, 0.18f); private static readonly Color WOOD = new Color(0.55f, 0.38f, 0.22f); private static readonly Color CARD = new Color(0.72f, 0.55f, 0.33f); private static readonly Color RED = new Color(0.9f, 0.15f, 0.12f); private static readonly Color STEEL = new Color(0.7f, 0.72f, 0.76f); private static readonly Color YELLOW = new Color(1f, 0.8f, 0.15f); private static readonly Color PURPLE = new Color(0.65f, 0.2f, 0.9f); private static readonly Color BLUE = new Color(0.2f, 0.45f, 0.95f); private static readonly Color WATER = new Color(0.25f, 0.45f, 0.8f, 0.6f); private readonly Dictionary<string, string> save = new Dictionary<string, string>(); private string saveFile; private Component me; private Transform head; private readonly List<Renderer> headRends = new List<Renderer>(); private float hatLift; private bool loggedHead; private Rigidbody hip; private float findT; private readonly List<Thing> things = new List<Thing>(); private Thing aimed; private string msg = ""; private float msgT; private string popTitle; private string popText; private Rigidbody door; private HingeJoint doorHinge; private float glitchT; private float blockT; private Light doorLight; private Component elevator; private Transform lift; private Transform panelRoot; private Transform panelPlate; private Transform panelButton; private Bounds liftBounds = new Bounds(new Vector3(0f, 1.5f, 0f), new Vector3(3f, 3f, 3f)); private float flipK; private float pressT = -1f; private Transform secBox; private Transform secLid; private Transform buttonItem; private Transform spaceBox; private Transform spaceLid; private Transform armItem; private Transform welderItem; private int ride; private float rideT; private Transform labRoot; private Transform tableParts; private Transform hatOnStand; private Transform finishedHat; private Transform wornHat; private Transform weldArm; private readonly List<Light> labLights = new List<Light>(); private float weldT = -1f; private Component wantTube; private float tubeScanT; private string tubeHint = ""; private bool built; private bool noCrates; private bool crateDone; private bool placedFloors; private float slowT; private GUIStyle big; private GUIStyle small; private GUIStyle box; private GUIStyle pop; private static readonly Vector3 ORB_AT = new Vector3(-141.4f, 224.2f, 901.4f); private static readonly Vector3 BIG_FLOOR1 = new Vector3(-92.61f, 169.86f, 856.67f); private static readonly Color ORBCOL = new Color(0.4f, 1f, 0.9f); private static readonly Color BOTWHITE = new Color(0.92f, 0.93f, 0.95f); private static readonly Color GLITCH = new Color(0.3f, 0.9f, 1f); private Rigidbody heldSmall; private Rigidbody heldCar; private bool walking; private Vector3 walkN = Vector3.up; private Vector3 walkPt; private float walkPhase; private float walkLost; private readonly Transform[] bigArm = (Transform[])(object)new Transform[6]; private Transform clawRod; private Transform usbRod; private Transform usbPlug; private float usbT = -1f; private Transform orbCase; private Transform orbDome; private Transform orb; private Light orbLight; private bool orbSnapped; private float alarmT = -1f; private readonly List<Bot> bots = new List<Bot>(); private float spawnT; private float bigFindT; private Transform bigLift; private bool jumpers; private bool saidJump; private Rigidbody nearCar; private Rigidbody orbCar; private float carScanT; private float carT = -1f; private float voiceT = -1f; private readonly List<Transform> glitch = new List<Transform>(); private static readonly string[] VOICE = new string[10] { "Hello! I am your car. The ORB gave me ALL MY GADGETS!", "1 TRUCK BACK: my back turns into a truck!", "2 SPIDER LEGS: I walk up mountains, walls... anywhere!", "3 SENTRY GRAPPLE: a hook pops out of my roof!", " (fall off a mountain and it shoots all by itself!)", "4 LET GO of the rope", "5 RAFT MODE: in water, my sides turn into a raft with a tarp!", "6 JET MODE: a jet, 2 wings... and I FLY! (SHIFT = boost)", "7 GET OUT", "Careful: when I get damaged, my gadgets get damaged too!" }; private Bounds bigBounds; private bool bigMeasured; private float scoutT; private float maxY = float.MinValue; private float loggedY = float.MinValue; private readonly HashSet<int> scouted = new HashSet<int>(); private static readonly string[] SCOUT_TYPES = new string[7] { "WobblySceneTransition", "WobblySceneTransitionActionInteract", "MissionToTheMoonComponentTransition", "MissionToTheMoonRocketFixedCutscene", "TransitionDoor", "SpaceWorldBound", "PlayerSpaceShipWorldBound" }; private bool Carrying { get { if (F("hasOrb")) { return !F("escaped"); } return false; } } private bool F(string k) { if (save.TryGetValue(k, out var value)) { return value == "1"; } return false; } private void Set(string k) { save[k] = "1"; Save(); } private void Save() { try { StringBuilder stringBuilder = new StringBuilder(); foreach (KeyValuePair<string, string> item in save) { stringBuilder.AppendLine(item.Key + "=" + item.Value); } File.WriteAllText(saveFile, stringBuilder.ToString()); } catch { } } private void Load() { try { if (!File.Exists(saveFile)) { return; } string[] array = File.ReadAllLines(saveFile); foreach (string text in array) { int num = text.IndexOf('='); if (num > 0) { save[text.Substring(0, num)] = text.Substring(num + 1); } } } catch { } } private static string V(Vector3 v) { //IL_000a: 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_0020: Unknown result type (might be due to invalid IL or missing references) return string.Format(CultureInfo.InvariantCulture, "{0} {1} {2}", v.x, v.y, v.z); } private static bool ParseV(string s, 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; string[] array = (s ?? "").Split(' '); if (array.Length != 3) { return false; } if (float.TryParse(array[0], NumberStyles.Float, CultureInfo.InvariantCulture, out v.x) && float.TryParse(array[1], NumberStyles.Float, CultureInfo.InvariantCulture, out v.y)) { return float.TryParse(array[2], NumberStyles.Float, CultureInfo.InvariantCulture, out v.z); } return false; } private Vector3 MyPos() { //IL_0014: 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_0054: 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) if ((Object)(object)hip != (Object)null) { return hip.position; } if ((Object)(object)me != (Object)null) { return me.transform.position; } Camera main = Camera.main; if (!((Object)(object)main != (Object)null)) { return Vector3.zero; } return ((Component)main).transform.position; } private void FindMe() { Type type = Reflect.FindType("PlayerCharacter"); if (type == null) { return; } Object[] array = Object.FindObjectsOfType(type); foreach (Object obj in array) { Component val = (Component)(object)((obj is Component) ? obj : null); if ((Object)(object)val == (Object)null) { continue; } object obj2 = null; try { obj2 = Reflect.Call(val, "GetPlayerController"); } catch { } if (obj2 != null && !Reflect.IsLocal(obj2)) { continue; } me = val; try { ref Rigidbody reference = ref hip; object obj4 = Reflect.Call(val, "GetHipRigidbody"); reference = (Rigidbody)((obj4 is Rigidbody) ? obj4 : null); } catch { } head = null; Transform[] componentsInChildren = val.GetComponentsInChildren<Transform>(); foreach (Transform val2 in componentsInChildren) { if (((Object)val2).name == "Head") { head = val2; break; } } headRends.Clear(); if (!((Object)(object)head != (Object)null)) { break; } Renderer[] componentsInChildren2 = ((Component)head).GetComponentsInChildren<Renderer>(); foreach (Renderer val3 in componentsInChildren2) { if ((Object)(object)val3 != (Object)null && val3.enabled && ((Object)(object)wornHat == (Object)null || !((Component)val3).transform.IsChildOf(wornHat)) && !(val3 is LineRenderer) && !((object)val3).GetType().Name.Contains("Particle")) { headRends.Add(val3); } } break; } } private void Teleport(Vector3 pos, Vector3 facing) { //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: 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_00b6: 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_00bc: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)me == (Object)null) { return; } try { MethodInfo[] methods = ((object)me).GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.Name != "SetPlayerPositionAndRotation" && methodInfo.Name != "SetPlayerPosition") { continue; } ParameterInfo[] parameters = methodInfo.GetParameters(); if (parameters.Length == 0 || parameters[0].ParameterType != typeof(Vector3)) { continue; } object[] array = new object[parameters.Length]; array[0] = pos; for (int j = 1; j < parameters.Length; j++) { if (parameters[j].ParameterType == typeof(Quaternion)) { array[j] = Quaternion.LookRotation(facing, Vector3.up); } else { array[j] = (parameters[j].HasDefaultValue ? parameters[j].DefaultValue : (parameters[j].ParameterType.IsValueType ? Activator.CreateInstance(parameters[j].ParameterType) : null)); } } methodInfo.Invoke(me, array); return; } } catch (Exception ex) { SecretLabPlugin.Inst?.Log("teleport: " + ex.Message); } if ((Object)(object)hip != (Object)null) { Vector3 val = pos - hip.position; Rigidbody[] componentsInChildren = me.GetComponentsInChildren<Rigidbody>(); foreach (Rigidbody obj in componentsInChildren) { obj.position += val; obj.velocity = Vector3.zero; } } } private Thing Add(Func<Vector3> at, float range, Func<string> label, Func<bool> on, Action act) { Thing thing = new Thing { at = at, range = range, label = label, on = on, act = act }; things.Add(thing); return thing; } private void Say(string s, float t = 4f) { msg = s; msgT = t; SecretLabPlugin.Inst?.Log(s); } private Vector3 LiftStandSpot() { //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_001c: 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_005a: 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_007a: 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_0089: 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_008f: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) Vector3 val = lift.TransformPoint(((Bounds)(ref liftBounds)).center); float num = ((Bounds)(ref liftBounds)).size.y * Mathf.Max(lift.lossyScale.y, 0.01f) + 1f; float num2 = float.MaxValue; Vector3 val2 = lift.TransformPoint(new Vector3(((Bounds)(ref liftBounds)).center.x, ((Bounds)(ref liftBounds)).min.y, ((Bounds)(ref liftBounds)).center.z)); RaycastHit[] array = Physics.RaycastAll(val, Vector3.down, num, -5, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { RaycastHit val3 = array[i]; if (!((Object)(object)((RaycastHit)(ref val3)).collider == (Object)null) && (!((Object)(object)me != (Object)null) || !((Component)((RaycastHit)(ref val3)).collider).transform.IsChildOf(me.transform)) && (((Component)((RaycastHit)(ref val3)).collider).transform.IsChildOf(lift) || !((Object)(object)((RaycastHit)(ref val3)).collider.attachedRigidbody == (Object)null)) && ((RaycastHit)(ref val3)).distance < num2) { num2 = ((RaycastHit)(ref val3)).distance; val2 = ((RaycastHit)(ref val3)).point; } } return val2 + Vector3.up * 0.9f; } private void Awake() { saveFile = Path.Combine(Paths.BepInExRootPath, "SecretLab_save.txt"); Load(); if (save.TryGetValue("hatLift", out var value)) { float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out hatLift); } } private void BuildAll() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) built = true; BuildLab(); BuildItems(); BuildThings(); BuildPart2(); if (F("hatOn")) { MakeWornHat(); } SecretLabPlugin.Inst?.Log("built the secret lab at " + ((object)LAB/*cast due to .constrained prefix*/).ToString()); } private void BuildLab() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0081: 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_00b6: 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_00cf: 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_00ff: 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_0120: 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_0139: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: 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_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: 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_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0270: 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_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: 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_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_0756: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_077c: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_07ac: Unknown result type (might be due to invalid IL or missing references) //IL_07bb: Unknown result type (might be due to invalid IL or missing references) //IL_07e0: Unknown result type (might be due to invalid IL or missing references) //IL_07ef: Unknown result type (might be due to invalid IL or missing references) //IL_0814: Unknown result type (might be due to invalid IL or missing references) //IL_0823: Unknown result type (might be due to invalid IL or missing references) //IL_0842: Unknown result type (might be due to invalid IL or missing references) //IL_0856: Unknown result type (might be due to invalid IL or missing references) //IL_085b: Unknown result type (might be due to invalid IL or missing references) //IL_0877: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_0890: Unknown result type (might be due to invalid IL or missing references) //IL_08ac: Unknown result type (might be due to invalid IL or missing references) //IL_08c0: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Unknown result type (might be due to invalid IL or missing references) //IL_08e1: Unknown result type (might be due to invalid IL or missing references) //IL_08f5: Unknown result type (might be due to invalid IL or missing references) //IL_08fa: Unknown result type (might be due to invalid IL or missing references) //IL_0916: Unknown result type (might be due to invalid IL or missing references) //IL_091b: Unknown result type (might be due to invalid IL or missing references) //IL_092a: Unknown result type (might be due to invalid IL or missing references) //IL_094b: Unknown result type (might be due to invalid IL or missing references) //IL_0969: Unknown result type (might be due to invalid IL or missing references) //IL_0989: Unknown result type (might be due to invalid IL or missing references) //IL_099d: Unknown result type (might be due to invalid IL or missing references) //IL_09a2: Unknown result type (might be due to invalid IL or missing references) //IL_09e0: Unknown result type (might be due to invalid IL or missing references) //IL_09fa: Unknown result type (might be due to invalid IL or missing references) //IL_09ff: Unknown result type (might be due to invalid IL or missing references) //IL_0a0e: Unknown result type (might be due to invalid IL or missing references) //IL_0a29: Unknown result type (might be due to invalid IL or missing references) //IL_0a3d: Unknown result type (might be due to invalid IL or missing references) //IL_0a42: Unknown result type (might be due to invalid IL or missing references) //IL_0a65: Unknown result type (might be due to invalid IL or missing references) //IL_0a6a: Unknown result type (might be due to invalid IL or missing references) //IL_0a80: Unknown result type (might be due to invalid IL or missing references) //IL_0a85: Unknown result type (might be due to invalid IL or missing references) //IL_0a9b: Unknown result type (might be due to invalid IL or missing references) //IL_0aa0: Unknown result type (might be due to invalid IL or missing references) //IL_0ab6: Unknown result type (might be due to invalid IL or missing references) //IL_0abb: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_0ac7: Unknown result type (might be due to invalid IL or missing references) //IL_0acc: Unknown result type (might be due to invalid IL or missing references) //IL_0acf: Unknown result type (might be due to invalid IL or missing references) //IL_0ae0: Unknown result type (might be due to invalid IL or missing references) //IL_0ae5: Unknown result type (might be due to invalid IL or missing references) //IL_0b0b: Unknown result type (might be due to invalid IL or missing references) //IL_0b10: Unknown result type (might be due to invalid IL or missing references) //IL_0b1f: Unknown result type (might be due to invalid IL or missing references) //IL_0b30: Unknown result type (might be due to invalid IL or missing references) //IL_0b61: Unknown result type (might be due to invalid IL or missing references) //IL_0b97: Unknown result type (might be due to invalid IL or missing references) //IL_0bbc: Unknown result type (might be due to invalid IL or missing references) //IL_0be1: Unknown result type (might be due to invalid IL or missing references) //IL_0c0c: Unknown result type (might be due to invalid IL or missing references) //IL_0c1c: Unknown result type (might be due to invalid IL or missing references) //IL_0c4d: Unknown result type (might be due to invalid IL or missing references) //IL_0c6c: Unknown result type (might be due to invalid IL or missing references) //IL_0c7b: Unknown result type (might be due to invalid IL or missing references) //IL_0ca5: Unknown result type (might be due to invalid IL or missing references) //IL_0cb4: Unknown result type (might be due to invalid IL or missing references) //IL_0cdf: Unknown result type (might be due to invalid IL or missing references) //IL_0ce4: Unknown result type (might be due to invalid IL or missing references) //IL_0cee: Unknown result type (might be due to invalid IL or missing references) //IL_0d02: Unknown result type (might be due to invalid IL or missing references) //IL_0d40: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05e2: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Unknown result type (might be due to invalid IL or missing references) //IL_062e: Unknown result type (might be due to invalid IL or missing references) //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_069f: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06c9: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_0d88: Unknown result type (might be due to invalid IL or missing references) //IL_0d9c: Unknown result type (might be due to invalid IL or missing references) //IL_0da1: Unknown result type (might be due to invalid IL or missing references) //IL_0dbd: Unknown result type (might be due to invalid IL or missing references) //IL_0dd1: Unknown result type (might be due to invalid IL or missing references) //IL_0dd6: Unknown result type (might be due to invalid IL or missing references) //IL_0df2: Unknown result type (might be due to invalid IL or missing references) //IL_0df7: Unknown result type (might be due to invalid IL or missing references) //IL_0e06: Unknown result type (might be due to invalid IL or missing references) //IL_0e21: Unknown result type (might be due to invalid IL or missing references) //IL_0e26: Unknown result type (might be due to invalid IL or missing references) //IL_0e35: Unknown result type (might be due to invalid IL or missing references) //IL_0e50: Unknown result type (might be due to invalid IL or missing references) //IL_0e55: Unknown result type (might be due to invalid IL or missing references) //IL_0e64: Unknown result type (might be due to invalid IL or missing references) //IL_0e7f: Unknown result type (might be due to invalid IL or missing references) //IL_0e84: Unknown result type (might be due to invalid IL or missing references) //IL_0e93: Unknown result type (might be due to invalid IL or missing references) //IL_0eae: Unknown result type (might be due to invalid IL or missing references) //IL_0eb3: Unknown result type (might be due to invalid IL or missing references) //IL_0ec2: Unknown result type (might be due to invalid IL or missing references) //IL_0edd: Unknown result type (might be due to invalid IL or missing references) //IL_0ee2: Unknown result type (might be due to invalid IL or missing references) //IL_0ef1: Unknown result type (might be due to invalid IL or missing references) //IL_0f1e: Unknown result type (might be due to invalid IL or missing references) //IL_0f32: Unknown result type (might be due to invalid IL or missing references) //IL_0f37: Unknown result type (might be due to invalid IL or missing references) //IL_0f6c: Unknown result type (might be due to invalid IL or missing references) //IL_0f80: Unknown result type (might be due to invalid IL or missing references) //IL_0fa1: Unknown result type (might be due to invalid IL or missing references) //IL_0f9a: Unknown result type (might be due to invalid IL or missing references) labRoot = new GameObject("SecretLab_Underground").transform; Object.DontDestroyOnLoad((Object)(object)((Component)labRoot).gameObject); labRoot.position = LAB; Transform val = labRoot; Build.Box(val, new Vector3(0f, -0.2f, 4f), new Vector3(18.4f, 0.4f, 26.4f), FLOOR); Build.Box(val, new Vector3(0f, 4.7f, 4f), new Vector3(18.4f, 0.4f, 26.4f), WALL); Build.Box(val, new Vector3(-9.1f, 2.25f, 4f), new Vector3(0.2f, 4.5f, 26.4f), WALL); Build.Box(val, new Vector3(9.1f, 2.25f, 4f), new Vector3(0.2f, 4.5f, 26.4f), WALL); Build.Box(val, new Vector3(0f, 2.25f, -9.1f), new Vector3(18.4f, 4.5f, 0.2f), WALL); Build.Box(val, new Vector3(0f, 2.25f, 17.1f), new Vector3(18.4f, 4.5f, 0.2f), WALL); Vector3[] array = (Vector3[])(object)new Vector3[2] { new Vector3(-8.98f, 1.1f, 4f), new Vector3(8.98f, 1.1f, 4f) }; foreach (Vector3 pos in array) { Build.Box(val, pos, new Vector3(0.02f, 0.08f, 26f), new Color(0.35f, 0.4f, 0.5f), solid: false); } array = (Vector3[])(object)new Vector3[2] { new Vector3(0f, 1.1f, -8.98f), new Vector3(0f, 1.1f, 16.98f) }; foreach (Vector3 pos2 in array) { Build.Box(val, pos2, new Vector3(18f, 0.08f, 0.02f), new Color(0.35f, 0.4f, 0.5f), solid: false); } array = (Vector3[])(object)new Vector3[4] { new Vector3(-5f, 0.01f, 1f), new Vector3(3.5f, 0.01f, -2f), new Vector3(6f, 0.01f, 5.5f), new Vector3(-2f, 0.01f, 13f) }; foreach (Vector3 pos3 in array) { Build.Prim((PrimitiveType)2, val, pos3, new Vector3(1.6f, 0.01f, 1.1f), WATER); } Transform transform = new GameObject("LabElevator").transform; transform.SetParent(val, false); transform.localPosition = new Vector3(0f, 0f, -7f); Build.Box(transform, new Vector3(-1.6f, 1.75f, 0f), new Vector3(0.15f, 3.5f, 3.6f), STEEL); Build.Box(transform, new Vector3(1.6f, 1.75f, 0f), new Vector3(0.15f, 3.5f, 3.6f), STEEL); Build.Box(transform, new Vector3(0f, 3.55f, 0f), new Vector3(3.35f, 0.15f, 3.6f), STEEL); Build.Box(transform, new Vector3(-1.2f, 1.75f, 1.8f), new Vector3(0.7f, 3.5f, 0.1f), DARK); Build.Box(transform, new Vector3(1.2f, 1.75f, 1.8f), new Vector3(0.7f, 3.5f, 0.1f), DARK); Build.Box(transform, new Vector3(1.5f, 1.3f, -0.6f), new Vector3(0.06f, 0.5f, 0.35f), DARK, solid: false); Build.Prim((PrimitiveType)0, transform, new Vector3(1.46f, 1.3f, -0.6f), new Vector3(0.06f, 0.16f, 0.16f), new Color(0.3f, 1f, 0.4f)); Build.Text(transform, new Vector3(0f, 3.1f, 1.86f), Quaternion.Euler(0f, 180f, 0f), "B-99", 0.3f, YELLOW); Vector3 val2 = default(Vector3); for (int j = 0; j < 2; j++) { for (int k = 0; k < 3; k++) { ((Vector3)(ref val2))..ctor(-5.5f + (float)k * 5.5f, 0f, 0f + (float)j * 4.2f); Build.Box(val, val2 + new Vector3(0f, 0.75f, 0f), new Vector3(1.9f, 0.08f, 0.9f), WOOD); float[] array2 = new float[2] { -0.85f, 0.85f }; foreach (float num in array2) { Build.Box(val, val2 + new Vector3(num, 0.37f, 0f), new Vector3(0.08f, 0.74f, 0.8f), DARK); } Build.Box(val, val2 + new Vector3(0f, 1.08f, 0.25f), new Vector3(0.75f, 0.5f, 0.05f), DARK, solid: false); Build.Box(val, val2 + new Vector3(0f, 1.08f, 0.22f), new Vector3(0.65f, 0.4f, 0.02f), new Color(0.2f, 0.6f, 0.9f), solid: false); Build.Box(val, val2 + new Vector3(0f, 0.45f, -0.75f), new Vector3(0.5f, 0.08f, 0.5f), DARK); Build.Box(val, val2 + new Vector3(0f, 0.75f, -1f), new Vector3(0.5f, 0.6f, 0.06f), DARK, solid: false); } } Build.Box(val, new Vector3(0.4f, 0.8f, -0.1f), new Vector3(0.3f, 0.01f, 0.4f), Color.white, solid: false); Build.Text(val, new Vector3(0f, 3.6f, -4.9f), Quaternion.identity, "SECRET LAB", 0.5f, BLUE); labLights.Add(Build.Lamp(val, new Vector3(0f, 3.8f, -6f), 10f, 1.4f, Color.white)); labLights.Add(Build.Lamp(val, new Vector3(-5f, 3.8f, 2f), 12f, 1.4f, Color.white)); labLights.Add(Build.Lamp(val, new Vector3(5f, 3.8f, 2f), 12f, 1.4f, Color.white)); Build.Box(val, new Vector3(-5.25f, 2.25f, 8f), new Vector3(7.5f, 4.5f, 0.2f), WALL); Build.Box(val, new Vector3(5.25f, 2.25f, 8f), new Vector3(7.5f, 4.5f, 0.2f), WALL); Build.Box(val, new Vector3(0f, 3.6f, 8f), new Vector3(3f, 1.8f, 0.2f), WALL); Build.Box(val, new Vector3(0f, 3.25f, 7.85f), new Vector3(2.8f, 0.5f, 0.06f), PURPLE, solid: false); Build.Text(val, new Vector3(0f, 3.25f, 7.8f), Quaternion.identity, "GADGET HATS", 0.32f, Color.white); labLights.Add(Build.Lamp(val, new Vector3(0f, 3.8f, 12.5f), 12f, 1.6f, new Color(1f, 0.95f, 0.85f))); Build.Prim((PrimitiveType)2, val, new Vector3(3.5f, 0.5f, 12f), new Vector3(0.9f, 0.5f, 0.9f), DARK); hatOnStand = MakeHat(val, finished: false).transform; hatOnStand.localPosition = new Vector3(3.5f, 1.02f, 12f); Build.Text(val, new Vector3(3.5f, 2.2f, 12f), Quaternion.identity, "NOT FINISHED", 0.18f, RED); Build.Box(val, new Vector3(-3.5f, 0.9f, 12f), new Vector3(2.6f, 0.1f, 1.4f), STEEL); array = (Vector3[])(object)new Vector3[4] { new Vector3(-4.7f, 0.45f, 11.4f), new Vector3(-2.3f, 0.45f, 11.4f), new Vector3(-4.7f, 0.45f, 12.6f), new Vector3(-2.3f, 0.45f, 12.6f) }; foreach (Vector3 pos4 in array) { Build.Box(val, pos4, new Vector3(0.1f, 0.9f, 0.1f), DARK); } Build.Text(val, new Vector3(-3.5f, 1.25f, 11.25f), Quaternion.identity, "WELDING TABLE", 0.12f, DARK); tableParts = new GameObject("TableParts").transform; tableParts.SetParent(val, false); tableParts.localPosition = new Vector3(-3.5f, 0.95f, 12f); ((Component)tableParts).gameObject.SetActive(false); MakeTube(tableParts).localPosition = new Vector3(-0.8f, 0f, 0f); MakeArm(tableParts).localPosition = new Vector3(0f, 0f, 0.2f); MakeWelder(tableParts).localPosition = new Vector3(0.8f, 0f, 0f); MakeHat(tableParts, finished: false).transform.localPosition = new Vector3(0f, 0f, -0.35f); weldArm = new GameObject("WeldArm").transform; weldArm.SetParent(val, false); weldArm.localPosition = new Vector3(-3.5f, 4.4f, 12f); Build.Cyl(weldArm, new Vector3(0f, -0.6f, 0f), 0.07f, 1.2f, STEEL); Build.Cyl(weldArm, new Vector3(0f, -1.3f, 0f), 0.12f, 0.3f, DARK); Build.Prim((PrimitiveType)0, weldArm, new Vector3(0f, -1.5f, 0f), Vector3.one * 0.12f, new Color(1f, 0.6f, 0.2f)); finishedHat = MakeHat(val, finished: true).transform; finishedHat.localPosition = new Vector3(-3.5f, 1.05f, 12f); ((Component)finishedHat).gameObject.SetActive(F("hatMade") && !F("hatOn")); Build.Box(val, new Vector3(0f, 1.9f, 16.9f), new Vector3(4.6f, 2.2f, 0.08f), Color.white); Build.Box(val, new Vector3(0f, 0.75f, 16.85f), new Vector3(4.6f, 0.06f, 0.15f), STEEL, solid: false); Build.Text(val, new Vector3(0f, 2.75f, 16.84f), Quaternion.identity, "HAT PARTS:", 0.22f, BLUE); Build.Text(val, new Vector3(0f, 2.35f, 16.84f), Quaternion.identity, "1. a TUBE from the tube job:", 0.14f, DARK); Build.Text(val, new Vector3(0f, 2.1f, 16.84f), Quaternion.identity, "PURPLE goo + DIAMONDS + TOMATOES", 0.14f, PURPLE); Build.Text(val, new Vector3(0f, 1.75f, 16.84f), Quaternion.identity, "2. a small ARM with 4 FINGERS", 0.14f, DARK); Build.Text(val, new Vector3(0f, 1.5f, 16.84f), Quaternion.identity, "(scrapped ideas box, by the ROCKET room)", 0.11f, DARK); Build.Text(val, new Vector3(0f, 1.15f, 16.84f), Quaternion.identity, "3. a WELDER (smallinator room, by the window)", 0.13f, DARK); for (int l = 0; l < 3; l++) { Build.Box(val, new Vector3(8.6f, 0.8f + (float)l * 0.9f, 12.5f), new Vector3(0.6f, 0.06f, 5f), WOOD); for (int m = 0; m < 4; m++) { Build.Box(val, new Vector3(8.6f, 1.05f + (float)l * 0.9f, 10.8f + (float)m * 1.1f), new Vector3(0.45f, 0.4f, 0.6f), (Color)((l % 2 == 0) ? CARD : new Color(0.6f, 0.45f, 0.3f))); } } } private GameObject MakeHat(Transform parent, bool finished) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0039: 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_006c: 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_008d: 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_00e0: 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_0173: 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_01ba: 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_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0220: 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_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_032d: 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_011b: 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_013c: 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_0155: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(finished ? "GadgetHat" : "UnfinishedHat"); val.transform.SetParent(parent, false); Transform transform = val.transform; Build.Cyl(transform, new Vector3(0f, 0.02f, 0f), 0.42f, 0.04f, DARK); Build.Cyl(transform, new Vector3(0f, 0.2f, 0f), 0.27f, 0.34f, finished ? new Color(0.25f, 0.25f, 0.32f) : new Color(0.5f, 0.5f, 0.55f)); Build.Cyl(transform, new Vector3(0f, 0.12f, 0f), 0.28f, 0.06f, finished ? PURPLE : STEEL); if (!finished) { Build.Box(transform, new Vector3(0f, 0.4f, 0f), new Vector3(0.12f, 0.04f, 0.12f), DARK); Build.Box(transform, new Vector3(0.28f, 0.22f, 0f), new Vector3(0.04f, 0.12f, 0.12f), DARK); return val; } Build.Cyl(transform, new Vector3(0.3f, 0.24f, 0f), 0.06f, 0.28f, new Color(0.85f, 0.9f, 1f, 0.5f)); Build.Cyl(transform, new Vector3(0.3f, 0.22f, 0f), 0.05f, 0.2f, PURPLE); Build.Cyl(transform, new Vector3(0f, 0.45f, 0f), 0.04f, 0.15f, STEEL); Build.Cyl(transform, new Vector3(0f, 0.55f, 0.08f), 0.03f, 0.16f, STEEL, Quaternion.Euler(90f, 0f, 0f)); Claw(transform, new Vector3(0f, 0.55f, 0.17f), 0.6f); Build.Prim((PrimitiveType)0, transform, new Vector3(-0.2f, 0.25f, -0.2f), Vector3.one * 0.07f, new Color(0.6f, 0.95f, 1f)); Build.Prim((PrimitiveType)0, transform, new Vector3(-0.27f, 0.22f, 0.05f), Vector3.one * 0.08f, RED); Build.Box(transform, new Vector3(0f, 0.36f, -0.27f), new Vector3(0.2f, 0.03f, 0.01f), new Color(1f, 0.6f, 0.2f)); return val; } private Transform MakeTube(Transform parent) { //IL_0005: 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_004b: 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_007e: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fb: 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_0125: 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) Transform transform = new GameObject("Tube").transform; transform.SetParent(parent, false); Build.Cyl(transform, new Vector3(0f, 0.2f, 0f), 0.08f, 0.4f, new Color(0.85f, 0.9f, 1f, 0.5f)); Build.Cyl(transform, new Vector3(0f, 0.15f, 0f), 0.07f, 0.28f, PURPLE); Build.Prim((PrimitiveType)0, transform, new Vector3(0f, 0.12f, 0f), Vector3.one * 0.06f, new Color(0.6f, 0.95f, 1f)); Build.Prim((PrimitiveType)0, transform, new Vector3(0.02f, 0.22f, 0f), Vector3.one * 0.06f, RED); Build.Cyl(transform, new Vector3(0f, 0.42f, 0f), 0.085f, 0.04f, DARK); return transform; } private Transform MakeArm(Transform parent) { //IL_0005: 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_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_005d: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00e3: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject("SmallArm").transform; transform.SetParent(parent, false); Build.Box(transform, new Vector3(0f, 0.05f, 0f), new Vector3(0.18f, 0.1f, 0.18f), DARK); Build.Cyl(transform, new Vector3(0f, 0.2f, 0.06f), 0.035f, 0.3f, STEEL, Quaternion.Euler(20f, 0f, 0f)); Build.Cyl(transform, new Vector3(0f, 0.34f, 0.2f), 0.03f, 0.28f, STEEL, Quaternion.Euler(80f, 0f, 0f)); Claw(transform, new Vector3(0f, 0.35f, 0.34f), 1f); Collider[] componentsInChildren = ((Component)transform).GetComponentsInChildren<Collider>(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } return transform; } private static void Claw(Transform parent, Vector3 at, float s) { //IL_0005: 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_0026: 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_0040: 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_007c: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_011b: 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_013b: 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_0154: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject("Claw").transform; transform.SetParent(parent, false); transform.localPosition = at; transform.localScale = Vector3.one * s; Build.Cyl(transform, Vector3.zero, 0.055f, 0.06f, YELLOW, Quaternion.Euler(90f, 0f, 0f)); for (int i = 0; i < 4; i++) { Transform transform2 = new GameObject("Finger" + i).transform; transform2.SetParent(transform, false); transform2.localRotation = Quaternion.Euler(0f, 0f, (float)i * 90f); Transform transform3 = new GameObject("Bend").transform; transform3.SetParent(transform2, false); transform3.localPosition = new Vector3(0f, 0.05f, 0.02f); transform3.localRotation = Quaternion.Euler(-25f, 0f, 0f); Build.Box(transform3, new Vector3(0f, 0f, 0.05f), new Vector3(0.025f, 0.02f, 0.1f), DARK, solid: false); Build.Box(transform3, new Vector3(0f, -0.02f, 0.105f), new Vector3(0.025f, 0.045f, 0.02f), DARK, solid: false); } } private Transform MakeWelder(Transform parent) { //IL_0005: 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_0036: 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_0069: 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_009c: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject("Welder").transform; transform.SetParent(parent, false); Build.Cyl(transform, new Vector3(0f, 0.25f, 0f), 0.1f, 0.5f, RED); Build.Cyl(transform, new Vector3(0f, 0.52f, 0f), 0.04f, 0.06f, STEEL); Build.Cyl(transform, new Vector3(0.18f, 0.12f, 0.1f), 0.03f, 0.28f, STEEL, Quaternion.Euler(90f, 0f, 0f)); Build.Cyl(transform, new Vector3(0.18f, 0.12f, 0.27f), 0.015f, 0.08f, DARK, Quaternion.Euler(90f, 0f, 0f)); Build.Cyl(transform, new Vector3(0.09f, 0.12f, 0.02f), 0.012f, 0.2f, DARK, Quaternion.Euler(0f, 0f, 80f)); return transform; } private Transform MakeBox(Vector3 at, string label, float yaw, out Transform lid) { //IL_0005: 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_002e: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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) Transform transform = new GameObject("ScrappedIdeasBox").transform; Object.DontDestroyOnLoad((Object)(object)((Component)transform).gameObject); transform.position = at; transform.rotation = Quaternion.Euler(0f, yaw, 0f); Build.Box(transform, new Vector3(0f, 0.3f, 0f), new Vector3(0.9f, 0.6f, 0.7f), CARD); Build.Box(transform, new Vector3(0f, 0.3f, -0.36f), new Vector3(0.7f, 0.22f, 0.01f), Color.white, solid: false); Build.Text(transform, new Vector3(0f, 0.3f, -0.37f), Quaternion.identity, label, 0.06f, DARK); lid = Build.Box(transform, new Vector3(0f, 0.62f, 0f), new Vector3(0.94f, 0.05f, 0.74f), new Color(0.65f, 0.5f, 0.3f), solid: false).transform; return transform; } private Transform MakeButton(Transform parent) { //IL_0005: 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_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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject("Button").transform; transform.SetParent(parent, false); Build.Box(transform, new Vector3(0f, 0.03f, 0f), new Vector3(0.16f, 0.06f, 0.16f), DARK); Build.Prim((PrimitiveType)0, transform, new Vector3(0f, 0.07f, 0f), new Vector3(0.11f, 0.07f, 0.11f), RED); return transform; } private static Vector3 OnFloor(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0087: 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_0061: 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) RaycastHit[] array = Physics.RaycastAll(p + Vector3.up * 1.5f, Vector3.down, 6f, -5, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { RaycastHit val = array[i]; if ((Object)(object)((RaycastHit)(ref val)).collider != (Object)null && (Object)(object)((RaycastHit)(ref val)).collider.attachedRigidbody == (Object)null) { p.y = Mathf.Min(p.y, ((RaycastHit)(ref val)).point.y); return ((RaycastHit)(ref val)).point; } } return p; } private void BuildItems() { //IL_0002: 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_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_005c: 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_00ce: 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_0105: 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_0156: Unknown result type (might be due to invalid IL or missing references) spaceBox = MakeBox(SPACEBOX_AT + Vector3.down * 0.9f, "SCRAPPED IDEAS\nFOR WOBBLY SPACE", 230f, out spaceLid); armItem = MakeArm(spaceBox); armItem.localPosition = new Vector3(-0.1f, 0.35f, 0f); if (F("spaceOpen")) { ((Component)spaceLid).gameObject.SetActive(false); } ((Component)armItem).gameObject.SetActive(F("spaceOpen") && !F("hasArm")); Transform transform = new GameObject("WelderSpot").transform; Object.DontDestroyOnLoad((Object)(object)((Component)transform).gameObject); transform.position = WELDER_AT; transform.rotation = Quaternion.Euler(0f, 70f, 0f); welderItem = MakeWelder(transform); welderItem.localScale = Vector3.one * 1.4f; ((Component)welderItem).gameObject.SetActive(!F("hasWelder")); if (save.TryGetValue("boxAt", out var value) && ParseV(value, out var v)) { PlaceSecurityBox(v, 0f, fresh: false); } } private static string PathOf(Transform t) { StringBuilder stringBuilder = new StringBuilder(((Object)t).name); Transform parent = t.parent; while ((Object)(object)parent != (Object)null) { stringBuilder.Insert(0, ((Object)parent).name + "/"); parent = parent.parent; } return stringBuilder.ToString(); } private void FindCrateStack() { //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_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_028d: 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_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0115: 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_013d: 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_0174: 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_01c9: 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_01df: 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_020e: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) if (crateDone) { return; } if ((Object)(object)secBox != (Object)null) { crateDone = true; } else { if (Vector3.Distance(MyPos(), TUBEJOB_AT) > 60f) { return; } crateDone = true; StringBuilder stringBuilder = new StringBuilder("CRATES near the tube job (" + DateTime.Now.ToString() + "):" + Environment.NewLine); Renderer val = null; float num = float.MinValue; Renderer[] array = Object.FindObjectsOfType<Renderer>(); foreach (Renderer val2 in array) { if ((Object)(object)val2 == (Object)null || val2 is LineRenderer) { continue; } string text = ((Object)val2).name.ToLowerInvariant(); string text2 = (((Object)(object)((Component)val2).transform.parent != (Object)null) ? ((Object)((Component)val2).transform.parent).name.ToLowerInvariant() : ""); if (!text.Contains("crate") && !text2.Contains("crate")) { continue; } Bounds bounds = val2.bounds; if (!(Vector3.Distance(new Vector3(((Bounds)(ref bounds)).center.x, 0f, ((Bounds)(ref bounds)).center.z), new Vector3(TUBEJOB_AT.x, 0f, TUBEJOB_AT.z)) > 35f) && !(((Bounds)(ref bounds)).max.y < TUBEJOB_AT.y - 15f) && !(((Bounds)(ref bounds)).max.y > TUBEJOB_AT.y + 6f)) { stringBuilder.AppendLine(" " + PathOf(((Component)val2).transform) + " top " + V(new Vector3(((Bounds)(ref bounds)).center.x, ((Bounds)(ref bounds)).max.y, ((Bounds)(ref bounds)).center.z)) + " size " + V(((Bounds)(ref bounds)).size)); if (((Bounds)(ref bounds)).max.y > num) { num = ((Bounds)(ref bounds)).max.y; val = val2; } } } SecretLabPlugin.Inst?.MapNote(stringBuilder.ToString()); if ((Object)(object)val == (Object)null) { noCrates = true; SecretLabPlugin.Inst?.Log("no crate stacks found near the tube job (J places the box instead)"); } else { Bounds bounds2 = val.bounds; PlaceSecurityBox(new Vector3(((Bounds)(ref bounds2)).center.x, ((Bounds)(ref bounds2)).max.y + 0.01f, ((Bounds)(ref bounds2)).center.z), 0f, fresh: true); SecretLabPlugin.Inst?.Log("put the scrapped ideas box on " + PathOf(((Component)val).transform)); } } } private void FixFloors() { //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_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_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) if (!placedFloors && !((Object)(object)spaceBox == (Object)null) && !(Vector3.Distance(MyPos(), SPACEBOX_AT) > 80f)) { placedFloors = true; spaceBox.position = OnFloor(SPACEBOX_AT); welderItem.parent.position = OnFloor(WELDER_AT); } } private void PlaceSecurityBox(Vector3 at, float yaw, bool fresh) { //IL_0002: 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_0042: 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_00d8: Unknown result type (might be due to invalid IL or missing references) secBox = MakeBox(at, "SCRAPPED IDEAS", yaw, out secLid); Build.Text(secBox, new Vector3(0f, 0.12f, -0.37f), Quaternion.identity, "from: THE TOOLS OF THE FUTURE", 0.035f, RED); buttonItem = MakeButton(secBox); buttonItem.localPosition = new Vector3(0f, 0.3f, 0f); if (F("secOpen")) { ((Component)secLid).gameObject.SetActive(false); } ((Component)buttonItem).gameObject.SetActive(F("secOpen") && !F("hasButton")); if (fresh) { save["boxAt"] = V(at); Save(); } } private unsafe void SetupPanel() { //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026b: 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_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0385: 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_0394: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0561: 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_0162: 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_016d: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: 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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f0: 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_00f7: 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) if ((Object)(object)panelRoot != (Object)null || (Object)(object)lift == (Object)null) { return; } Bounds val = default(Bounds); ((Bounds)(ref val))..ctor(Vector3.zero, Vector3.zero); bool flag = false; MeshFilter[] componentsInChildren = ((Component)lift).GetComponentsInChildren<MeshFilter>(); foreach (MeshFilter val2 in componentsInChildren) { if ((Object)(object)val2.sharedMesh == (Object)null) { continue; } Bounds bounds = val2.sharedMesh.bounds; for (int j = 0; j < 8; j++) { Vector3 val3 = lift.InverseTransformPoint(((Component)val2).transform.TransformPoint(new Vector3(((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))); if (!flag) { ((Bounds)(ref val))..ctor(val3, Vector3.zero); flag = true; } else { ((Bounds)(ref val)).Encapsulate(val3); } } } if (!flag) { ((Bounds)(ref val))..ctor(new Vector3(0f, 1.5f, 0f), new Vector3(3f, 3f, 3f)); } liftBounds = val; Vector3 val4 = Vector3.forward; try { object o = Reflect.Get(elevator, "elevatorDoor"); object obj = Reflect.Get(o, "leftSideDoor"); Component val5 = (Component)((obj is Component) ? obj : null); object obj2 = Reflect.Get(o, "rightSideDoor"); Component val6 = (Component)((obj2 is Component) ? obj2 : null); if ((Object)(object)val5 != (Object)null && (Object)(object)val6 != (Object)null) { Vector3 val7 = lift.InverseTransformPoint((val5.transform.position + val6.transform.position) * 0.5f) - ((Bounds)(ref val)).center; val7.y = 0f; if (((Vector3)(ref val7)).sqrMagnitude > 0.01f) { val4 = ((Vector3)(ref val7)).normalized; } } } catch { } val4 = ((Mathf.Abs(val4.x) > Mathf.Abs(val4.z)) ? new Vector3(Mathf.Sign(val4.x), 0f, 0f) : new Vector3(0f, 0f, Mathf.Sign(val4.z))); Vector3 val8 = Vector3.Cross(Vector3.up, val4); float num = Mathf.Abs(Vector3.Dot(((Bounds)(ref val)).extents, new Vector3(Mathf.Abs(val8.x), 0f, Mathf.Abs(val8.z)))); panelRoot = new GameObject("FlipPanel").transform; panelRoot.SetParent(lift, false); Vector3 lossyScale = lift.lossyScale; panelRoot.localScale = new Vector3(1f / Mathf.Max(lossyScale.x, 0.01f), 1f / Mathf.Max(lossyScale.y, 0.01f), 1f / Mathf.Max(lossyScale.z, 0.01f)); panelRoot.localPosition = new Vector3(((Bounds)(ref val)).center.x, ((Bounds)(ref val)).min.y, ((Bounds)(ref val)).center.z) + val8 * (num - 0.06f) + val4 * 0.4f + Vector3.up * 1.3f; panelRoot.localRotation = Quaternion.LookRotation(-val8, Vector3.up); Build.Box(panelRoot, new Vector3(0f, 0f, 0.02f), new Vector3(0.5f, 0.5f, 0.04f), DARK, solid: false); panelPlate = new GameObject("Plate").transform; panelPlate.SetParent(panelRoot, false); panelPlate.localPosition = new Vector3(0f, 0f, -0.03f); Build.Box(panelPlate, Vector3.zero, new Vector3(0.42f, 0.42f, 0.03f), STEEL, solid: false); Build.Box(panelPlate, new Vector3(0f, 0f, -0.017f), new Vector3(0.3f, 0.06f, 0.005f), YELLOW, solid: false); Build.Box(panelPlate, new Vector3(0f, 0f, 0.017f), new Vector3(0.18f, 0.18f, 0.005f), Color.black, solid: false); Build.Text(panelPlate, new Vector3(0f, -0.15f, 0.02f), Quaternion.Euler(0f, 180f, 0f), "B-99", 0.05f, YELLOW); panelButton = MakeButton(panelPlate); panelButton.localPosition = new Vector3(0f, 0f, 0.02f); panelButton.localRotation = Quaternion.Euler(90f, 0f, 0f); ((Component)panelButton).gameObject.SetActive(F("buttonIn")); flipK = (F("panelFlipped") ? 1f : 0f); SecretLabPlugin inst = SecretLabPlugin.Inst; if (inst != null) { Vector3 val9 = val4; inst.Log("the flip panel is on the elevator (doors face " + ((object)(*(Vector3*)(&val9))/*cast due to .constrained prefix*/).ToString() + ")"); } } private void BuildThings() { Add(() => (Vector3)((!((Object)(object)panelRoot != (Object)null)) ? new Vector3(0f, -9999f, 0f) : panelRoot.position), 2.2f, () => F("panelFlipped") ? ((F("hasButton") || F("buttonIn")) ? (F("buttonIn") ? "PRESS the button" : "put the BUTTON in the slot") : "the panel has NO BUTTON...") : "help the panel FLIP", () => (Object)(object)panelRoot != (Object)null && ride == 0, delegate { if (!F("panelFlipped")) { Set("panelFlipped"); Say("You helped it flip! But... there's NO BUTTON in the slot!", 5f); } else if (!F("buttonIn") && !F("hasButton")) { Say("It needs a button. Maybe it's in the SCRAPPED IDEAS box... on the crate stacks by the TUBE JOB?", 5f); } else if (!F("buttonIn")) { Set("buttonIn"); ((Component)panelButton).gameObject.SetActive(true); Say("CLICK! The button fits. Press it!"); } else { pressT = 0f; StartRide(1); } }); Add(() => (Vector3)((!((Object)(object)secBox != (Object)null)) ? new Vector3(0f, -9999f, 0f) : (secBox.position + Vector3.up * 0.5f)), 2.2f, () => F("secOpen") ? "take the BUTTON" : "open the SCRAPPED IDEAS box", () => (Object)(object)secBox != (Object)null && !F("hasButton"), delegate { if (!F("secOpen")) { Set("secOpen"); ((Component)secLid).gameObject.SetActive(false); ((Component)buttonItem).gameObject.SetActive(true); Say("Scrapped ideas... and a BUTTON!"); } else { Set("hasButton"); ((Component)buttonItem).gameObject.SetActive(false); Say("You got the BUTTON! Wobble back to the elevator!", 5f); } }); Add(() => (Vector3)((!((Object)(object)spaceBox != (Object)null)) ? new Vector3(0f, -9999f, 0f) : (spaceBox.position + Vector3.up * 0.5f)), 2.2f, () => F("spaceOpen") ? "take the small ARM with 4 FINGERS" : "open the box: SCRAPPED IDEAS FOR WOBBLY SPACE", () => (Object)(object)spaceBox != (Object)null && F("readBoard") && !F("hasArm"), delegate { if (!F("spaceOpen")) { Set("spaceOpen"); ((Component)spaceLid).gameObject.SetActive(false); ((Component)armItem).gameObject.SetActive(true); Say("A small arm with 4 fingers!"); } else { Set("hasArm"); ((Component)armItem).gameObject.SetActive(false); Say("You got the ARM WITH 4 FINGERS!"); } }); Add(() => (Vector3)((!((Object)(object)welderItem != (Object)null)) ? new Vector3(0f, -9999f, 0f) : (welderItem.position + Vector3.up * 0.4f)), 2.2f, () => "take the WELDER", () => (Object)(object)welderItem != (Object)null && ((Component)welderItem).gameObject.activeSelf && F("readBoard"), delegate { Set("hasWelder"); ((Component)welderItem).gameObject.SetActive(false); Say("You got the WELDER!"); }); Add(() => LAB + new Vector3(1.5f, 1.3f, -7.6f), 2.5f, () => "go back UP", () => ride == 0, delegate { StartRide(2); }); Add(() => LAB + new Vector3(0.4f, 0.8f, -0.1f), 2f, () => "read the NOTE", () => ride == 0, delegate { Set("readNote"); popTitle = "A NOTE"; popText = "A couple days ago Richard spilt water on the floor, and 5 minutes later it was not there. Water doesn't go away that fast, and we don't have anything to clean it up with. And if it evaporated, it would be on the ceiling. So that means it SEEPED into the floor and went into the mountain.\n\nNow, Richard has done this for years, but it's not his fault. It's just the world making him unlucky.\n\nBut once it reached the water, and there was no hole to let air in, but air out, the water was sucked in and the room FLOODED. So we all huddled into the elevator and went back up.\n\nSo I came back with this note to tell you why the button was never there. In the future. For future people to know."; }); Add(() => LAB + new Vector3(0f, 1.9f, 16.7f), 3.5f, () => "read the WHITEBOARD", () => ride == 0, delegate { if (!F("readBoard")) { Say("Now you know what to get! (check the list, top right)", 5f); } Set("readBoard"); popTitle = "HAT PARTS"; popText = "1. A TUBE from the TUBE JOB with PURPLE goo + DIAMONDS + TOMATOES\n (make it at the science machine!)\n\n2. A small ARM with 4 FINGERS\n (in the 'SCRAPPED IDEAS FOR WOBBLY SPACE' box, by the ROCKET room)\n\n3. A WELDER\n (in the SMALLINATOR room, by the window)\n\nThen WELD them onto the hat at the welding table!"; }); Add(() => LAB + new Vector3(-3.5f, 1.1f, 12f), 2.5f, () => HasAll() ? (F("onTable") ? "WELD!" : "put the PARTS on the table") : "the welding table (bring the parts!)", () => ride == 0 && !F("hatMade") && weldT < 0f, delegate { if (!HasAll()) { Say("You need: " + Missing(), 5f); } else if (!F("onTable")) { Set("onTable"); ((Component)tableParts).gameObject.SetActive(true); ((Component)hatOnStand).gameObject.SetActive(false); Say("All the parts are on the table. Now WELD!"); } else { weldT = 0f; Say("WELDING...", 6f); } }); Add(() => (Vector3)((!((Object)(object)finishedHat != (Object)null)) ? new Vector3(0f, -9999f, 0f) : (finishedHat.position + Vector3.up * 0.2f)), 2.5f, () => "put on the GADGET HAT!", () => (Object)(object)finishedHat != (Object)null && ((Component)finishedHat).gameObject.activeSelf, delegate { Set("hatOn"); ((Component)finishedHat).gameObject.SetActive(false); MakeWornHat(); Say("YOU MADE A GADGET HAT! (what does it do? coming soon...)", 7f); }); } private bool HasAll() { if (F("hasTube") && F("hasArm")) { return F("hasWelder"); } return false; } private string Missing() { List<string> list = new List<string>(); if (!F("hasTube")) { list.Add("the PURPLE + DIAMOND + TOMATO tube"); } if (!F("hasArm")) { list.Add("the 4-finger ARM"); } if (!F("hasWelder")) { list.Add("the WELDER"); } return string.Join(", ", list); } private void MakeWornHat() { //IL_0038: 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) if (!((Object)(object)wornHat != (Object)null)) { wornHat = MakeHat(null, finished: true).transform; Object.DontDestroyOnLoad((Object)(object)((Component)wornHat).gameObject); wornHat.localScale = Vector3.one * 0.9f; Collider[] componentsInChildren = ((Component)wornHat).GetComponentsInChildren<Collider>(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } } } private void StartRide(int dir) { ride = dir; rideT = 0f; Say((dir == 1) ? "...nothing is happening?" : "Going UP!", 2.5f); } private void RideTick(float dt) { //IL_00ff: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) rideT += dt; if (ride == 1) { if (rideT > 2.6f && rideT - dt <= 2.6f) { Say("WHOA!!! IT'S DROPPING!", 3f); } if (rideT > 6.2f && rideT - dt <= 6.2f) { Teleport(LAB + new Vector3(0f, 1f, -7.2f), Vector3.forward); Set("visitedLab"); } if (rideT > 7.4f) { ride = 0; if (!F("seenLab")) { Set("seenLab"); Say("A SECRET LAB... under the island!", 5f); } } } else { if (rideT > 2.2f && rideT - dt <= 2.2f && (Object)(object)lift != (Object)null) { Teleport(LiftStandSpot(), Vector3.forward); } if (rideT > 3f) { ride = 0; } } } private void Update() { try { Tick(Time.deltaTime); } catch (Exception ex) { SecretLabPlugin.Inst?.Log("oops: " + ex); } } private void Tick(float dt) { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06c6: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_06d9: Unknown result type (might be due to invalid IL or missing references) //IL_06dd: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_082f: Unknown result type (might be due to invalid IL or missing references) //IL_0834: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_026a: 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_025b: Unknown result type (might be due to invalid IL or missing references) //IL_083d: Unknown result type (might be due to invalid IL or missing references) //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_0845: Unknown result type (might be due to invalid IL or missing references) //IL_084c: Unknown result type (might be due to invalid IL or missing references) //IL_0851: Unknown result type (might be due to invalid IL or missing references) //IL_0856: Unknown result type (might be due to invalid IL or missing references) //IL_085b: Unknown result type (might be due to invalid IL or missing references) //IL_085e: Unknown result type (might be due to invalid IL or missing references) //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0862: Unknown result type (might be due to invalid IL or missing references) //IL_0867: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_0870: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result
plugins/ClimbingCar/ClimbingCar.dll
Decompiled 2 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Text; using System.Text.RegularExpressions; using BepInEx; using HarmonyLib; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ClimbingCar")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ClimbingCar")] [assembly: AssemblyTitle("ClimbingCar")] [assembly: AssemblyVersion("1.0.0.0")] namespace JimmyClimbingCar; [BepInPlugin("jimmy.wobblylife.climbingcar", "Climbing Car", "1.0.0")] public class ClimbingCarPlugin : BaseUnityPlugin { internal static ClimbingCarPlugin Inst; private Type vehicleType; private MethodInfo getDriver; private float scanT; internal CarRig current; private float lookT; private float carsLogT; private int lastCarCount = -1; internal static bool Unlocked; private float orbCheckT; private void Awake() { //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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) Inst = this; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Climbing Car loaded! Keys while driving: 1 truck, 2 legs, 3 grapple, 4 let go, 5 raft, 6 jet"); GameObject val = new GameObject("ClimbingCar_Runner") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); val.AddComponent<Runner>(); val.AddComponent<SkyRocket>(); } internal void Log(string s) { ((BaseUnityPlugin)this).Logger.LogInfo((object)s); } private static void CheckOrb() { try { string path = Path.Combine(Paths.BepInExRootPath, "SecretLab_save.txt"); Unlocked = File.Exists(path) && Array.IndexOf(File.ReadAllLines(path), "orbDone=1") >= 0; } catch { } } internal void Tick() { orbCheckT -= Time.unscaledDeltaTime; if (orbCheckT <= 0f) { orbCheckT = 3f; CheckOrb(); } scanT -= Time.unscaledDeltaTime; if (scanT > 0f) { return; } scanT = 0.4f; try { Scan(); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Climbing Car scan: " + ex.Message)); } } private void Scan() { if (vehicleType == null) { vehicleType = Reflect.FindType("PlayerVehicleRoad"); if (vehicleType == null) { lookT -= 0.4f; if (lookT <= 0f) { lookT = 15f; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Climbing Car: still looking for the game's cars..."); } return; } getDriver = vehicleType.GetMethod("GetDriverPlayerController", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Climbing Car: found the game's cars" + ((getDriver == null) ? " (but not their drivers!)" : ""))); PatchNoSink(); } if (getDriver == null) { return; } Component val = null; Object[] array = Object.FindObjectsOfType(vehicleType); int num = 0; Object[] array2 = array; foreach (Object obj in array2) { Component val2 = (Component)(object)((obj is Component) ? obj : null); if ((Object)(object)val2 == (Object)null) { continue; } object obj2 = null; try { obj2 = getDriver.Invoke(val2, null); } catch { } if (obj2 == null) { continue; } Object val3 = (Object)((obj2 is Object) ? obj2 : null); if (val3 == null || !(val3 == (Object)null)) { num++; if (Reflect.IsLocal(obj2)) { val = val2; break; } } } carsLogT -= 0.4f; if ((Object)(object)val == (Object)null && (array.Length != lastCarCount || carsLogT <= 0f)) { lastCarCount = array.Length; carsLogT = 30f; ((BaseUnityPlugin)this).Logger.LogInfo((object)("Climbing Car: " + array.Length + " cars around, " + num + " with a driver, none driven by you")); } if ((Object)(object)val == (Object)null) { if ((Object)(object)current != (Object)null) { current.SetDriving(on: false); } current = null; return; } CarRig carRig = val.GetComponent<CarRig>(); if ((Object)(object)carRig == (Object)null) { carRig = val.gameObject.AddComponent<CarRig>(); } if ((Object)(object)current != (Object)(object)carRig) { if ((Object)(object)current != (Object)null) { current.SetDriving(on: false); } current = carRig; carRig.SetDriving(on: true); } } internal void DrawGUI() { if ((Object)(object)current != (Object)null) { current.DrawHelp(); } } private void PatchNoSink() { //IL_0055: 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_007f: Expected O, but got Unknown try { MethodInfo methodInfo = Reflect.FindType("PlayerVehicleMovement")?.GetMethod("ShouldDestroyWhenUnderWaterTooLong", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (methodInfo == null || methodInfo.ReturnType != typeof(bool)) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"Climbing Car: couldn't find the sink check (the raft might sink after a while)"); return; } new Harmony("jimmy.wobblylife.climbingcar").Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(ClimbingCarPlugin).GetMethod("NoSinkPrefix", BindingFlags.Static | BindingFlags.NonPublic)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Climbing Car: rafts won't sink"); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Climbing Car: patch failed: " + ex.Message)); } } private static bool NoSinkPrefix(object __instance, ref bool __result) { Component val = (Component)((__instance is Component) ? __instance : null); CarRig carRig = (((Object)(object)val != (Object)null) ? val.GetComponentInParent<CarRig>() : null); if ((Object)(object)carRig != (Object)null && carRig.IsRafting) { __result = false; return false; } return true; } } public class Runner : MonoBehaviour { private void Update() { ClimbingCarPlugin.Inst?.Tick(); } private void OnGUI() { ClimbingCarPlugin.Inst?.DrawGUI(); } } internal static class Reflect { public const BindingFlags All = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; public static Type FindType(string name) { try { Type type = Type.GetType(name + ", Game", throwOnError: false); if (type != null) { return type; } } catch { } Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { Type type2 = null; try { type2 = assembly.GetType(name, throwOnError: false); } catch { } if (type2 != null) { return type2; } } return null; } public static FieldInfo FindField(Type t, string name) { while (t != null) { FieldInfo field = t.GetField(name, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { return field; } t = t.BaseType; } return null; } public static bool IsLocal(object playerController) { try { object obj = FindField(playerController.GetType(), "networkObject")?.GetValue(playerController); if (obj == null) { return true; } MethodInfo method = obj.GetType().GetMethod("IsOwner", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); if (method == null) { return true; } return (bool)method.Invoke(obj, null); } catch { return true; } } } internal static class Keys { private static readonly Dictionary<int, bool> was = new Dictionary<int, bool>(); public const int K6 = 54; public const int K7 = 55; public const int SPACE = 32; public const int SHIFT = 16; public const int CTRL = 17; public const int K1 = 49; public const int K2 = 50; public const int K3 = 51; public const int K4 = 52; public const int K5 = 53; public const int W = 87; public const int A = 65; public const int S = 83; public const int D = 68; public const int UP = 38; public const int DOWN = 40; public const int LEFT = 37; public const int RIGHT = 39; [DllImport("user32.dll")] private static extern short GetAsyncKeyState(int vKey); public static bool Down(int vk) { if (Application.isFocused) { return (GetAsyncKeyState(vk) & 0x8000) != 0; } return false; } public static bool Pressed(int vk) { bool flag = Down(vk); was.TryGetValue(vk, out var value); was[vk] = flag; if (flag) { return !value; } return false; } } internal static class Paint { private static Shader shader; private static Shader lineShader; private static readonly Dictionary<Color, Material> cache = new Dictionary<Color, Material>(); private static Shader First(params string[] names) { for (int i = 0; i < names.Length; i++) { Shader val = Shader.Find(names[i]); if ((Object)(object)val != (Object)null && val.isSupported) { return val; } } return null; } public static Material Get(Color c) { //IL_0042: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)shader == (Object)null) { shader = First("Standard", "Legacy Shaders/Diffuse", "Unlit/Color", "Sprites/Default"); } if (!cache.TryGetValue(c, out var value) || (Object)(object)value == (Object)null) { value = new Material(shader) { color = c }; if (value.HasProperty("_Glossiness")) { value.SetFloat("_Glossiness", 0.35f); } cache[c] = value; } return value; } public static Material Line() { //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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown if ((Object)(object)lineShader == (Object)null) { lineShader = First("Sprites/Default", "Unlit/Color", "Standard"); } return new Material(lineShader) { color = Color.white }; } } public class CarRig : MonoBehaviour { private enum Mode { Drive, Falling, PodOut, Hooked, Climb, Raft, Jet } private class PartInfo { public Transform t; public Renderer r; public Color c; public bool fixedPart; public Vector3 basePos; public Quaternion baseRot; public Vector3 bendRot; public Vector3 bendPos; public float scorch; public float breakAt; public bool broken; } private static readonly Color BLUE = new Color(0.3f, 0.75f, 1f); private static readonly Color FLAME = new Color(1f, 0.55f, 0.15f); private static readonly Color JETCOL = new Color(0.82f, 0.84f, 0.88f); private const float JET_T = 5.2f; private const float BED_BREAKS = 0.6f; private const float JET_BREAKS = 0.9f; private static readonly Color WOOD1 = new Color(0.55f, 0.36f, 0.2f); private static readonly Color WOOD2 = new Color(0.45f, 0.29f, 0.15f); private static readonly Color LOG = new Color(0.4f, 0.27f, 0.15f); private static readonly Color TARP = new Color(0.15f, 0.45f, 0.85f); private const float RAFT_SPEED = 9f; private static readonly Color GREY = new Color(0.25f, 0.26f, 0.29f); private static readonly Color DARK = new Color(0.1f, 0.1f, 0.12f); private static readonly Color YELLOW = new Color(1f, 0.78f, 0.1f); private static readonly Color RED = new Color(0.85f, 0.15f, 0.12f); private static readonly Color STEEL = new Color(0.7f, 0.72f, 0.76f); private static readonly Color ROPE = new Color(0.75f, 0.6f, 0.35f); private static readonly Color BEDCOL = new Color(0.95f, 0.55f, 0.12f); private const float FALL_WAIT = 1.5f; private const float HOOK_RANGE = 90f; private const float POD_SPEED = 70f; private const float WINCH = 5f; private const float CLIMB_SPEED = 7f; private const float LEG_UP_DEG = 55f; private Mode mode; private bool driving; private bool built; private Rigidbody rb; private Bounds lb; private Vector3 ls = Vector3.one; private readonly List<WheelCollider> wheels = new List<WheelCollider>(); private readonly Vector3[] hips = (Vector3[])(object)new Vector3[4]; private Vector3 roofL; private float halfH; private float halfLen; private float hover; private Transform bedRoot; private readonly List<Collider> bedCols = new List<Collider>(); private Vector3 bedOut; private Vector3 bedIn; private float bedK; private float bedTarget; private float fallT; private Vector3 lastGround; private bool haveGround; private Transform pod; private readonly Transform[] fingers = (Transform[])(object)new Transform[3]; private LineRenderer rope; private Vector3 podFrom; private Vector3 hookPoint; private Vector3 hookNormal; private float podT; private float podDur; private float fingerK; private float hookedT; private float retT = -1f; private float ropeLen; private float landT; private bool podLaunched; private Transform tBase; private Transform tPost; private Transform tHead; private Transform tBarrel; private float turretK; private Vector3 aimDir = Vector3.forward; private Vector3 lastTip; private ConfigurableJoint joint; private Vector3 upN = Vector3.up; private Vector3 climbFwd = Vector3.forward; private float legK; private float legTarget; private float climbT; private float flatT; private float lostT; private float walk; private Transform[][] leg = new Transform[4][]; private GameObject fx; private Transform raftRoot; private Transform backDeck; private Transform tarpRoot; private readonly Transform[] sidePivots = (Transform[])(object)new Transform[2]; private readonly List<Collider> raftCols = new List<Collider>(); private float raftK; private float raftTarget; private float raftYaw; private float waterY; private float dryT; private float backLen = 2.2f; private Component moveComp; private MethodInfo inWaterM; private FieldInfo waterF; private Type waterType; private Object[] allWater; private float allWaterT; private Transform jetRoot; private Transform jetEngine; private Transform jetFlame; private Transform noseStick; private readonly Transform[] wingPivots = (Transform[])(object)new Transform[2]; private readonly Vector3[] wingTipsL = (Vector3[])(object)new Vector3[2]; private readonly List<Transform> slowParts = new List<Transform>(); private readonly List<Vector3> slowScales = new List<Vector3>(); private readonly LineRenderer[] wingRopes = (LineRenderer[])(object)new LineRenderer[2]; private LineRenderer outline; private Vector3 engineIn; private Vector3 engineOut; private Vector3 stickIn; private Vector3 stickOut; private float jt; private float jetTarget; private float flySpeed; private float pitch; private float yaw; private float roll; private float flame; private bool flying; private bool wantTakeoff; private bool docked; private bool goingHome; private Vector3 dockPos; private Vector3 takeoffPos; private Vector3 homeTarget; private Quaternion dockRot = Quaternion.identity; private float homeT; private readonly List<Renderer[]> wheelRends = new List<Renderer[]>(); private readonly List<Vector3> wheelPosL = new List<Vector3>(); private readonly List<float> wheelRad = new List<float>(); private readonly List<Transform> wheelProxy = new List<Transform>(); private float foldK; private float foldTarget; private readonly List<PartInfo> partsInfo = new List<PartInfo>(); private readonly Vector3[] legBend = (Vector3[])(object)new Vector3[4]; private Component healthComp; private MethodInfo getHealthM; private FieldInfo initHealthF; private float maxHealth; private float dmg; private float dmgShown = -1f; private float healthT; private MaterialPropertyBlock mpb; private string msg = ""; private float msgT; private GUIStyle big; private GUIStyle small; private float dmgTarget; private float coastSpeed; private float coastT; private float coastLast; private Component pvComp; private Vector3 coastDir = Vector3.forward; private Transform tBoom2; private float boomLen = 0.95f; private float hookExt; public bool IsRafting => mode == Mode.Raft; public bool JetFlying { get { if (mode == Mode.Jet && flying) { return !goingHome; } return false; } } public bool Driving => driving; public bool Docked => docked; public Rigidbody Body => rb; public Vector3 RoofSpot() { //IL_0007: 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_0027: 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) return W(new Vector3(((Bounds)(ref lb)).center.x, ((Bounds)(ref lb)).max.y, ((Bounds)(ref lb)).center.z)); } public void Dock(Vector3 edge, Vector3 outward, float gap, float roofY) { //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_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) //IL_0032: 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_0044: 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_0064: 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_0074: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00a8: Unknown result type (might be due to invalid IL or missing references) if (flying) { outward.y = 0f; ((Vector3)(ref outward)).Normalize(); dockRot = Quaternion.LookRotation(Vector3.Cross(-outward, Vector3.up), Vector3.up); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(((Bounds)(ref lb)).max.x, ((Bounds)(ref lb)).max.y, ((Bounds)(ref lb)).center.z); Vector3 val2 = edge + outward * gap; val2.y = roofY; dockPos = val2 - dockRot * Vector3.Scale(val, ls); docked = true; goingHome = false; coastT = 0f; Say("DOCKED at the MOON ROCKET!", 4f); } } public void Undock(string why) { //IL_0051: 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_0040: Unknown result type (might be due to invalid IL or missing references) if (docked) { docked = false; if ((Object)(object)rb != (Object)null) { rb.isKinematic = false; rb.velocity = ((Component)this).transform.forward * 16f; } yaw = ((Quaternion)(ref dockRot)).eulerAngles.y; pitch = 0f; roll = 0f; flySpeed = 18f; if (why != null) { Say(why); } } } public void FlyHome() { //IL_0008: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) Undock(null); if (!(takeoffPos == Vector3.zero)) { homeTarget = takeoffPos; goingHome = true; homeT = 0f; } } private void DockTick(float dt) { //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_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_005a: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!rb.isKinematic) { rb.isKinematic = true; } float num = Vector3.Distance(rb.position, dockPos); rb.MovePosition(Vector3.MoveTowards(rb.position, dockPos, Mathf.Max(1.5f, num * 2.2f) * dt)); rb.MoveRotation(Quaternion.RotateTowards(rb.rotation, dockRot, 80f * dt)); flame = 0.25f; foldTarget = 1f; } private void HomeTick(float dt) { //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_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_0026: 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) //IL_005e: 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_00d2: 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_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_0181: 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_01a9: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: 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) homeT += dt; Vector3 position = rb.position; Vector3 val = homeTarget - position; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x, 0f, val.z); float magnitude = ((Vector3)(ref val2)).magnitude; float num = HeightAbove(); if (magnitude > 0.5f) { yaw = Mathf.MoveTowardsAngle(yaw, Mathf.Atan2(val2.x, val2.z) * 57.29578f, 55f * dt); } float num2 = ((magnitude > 70f) ? 38f : Mathf.Max(3f, magnitude * 0.55f)); float num3 = Mathf.Clamp((homeTarget.y + ((magnitude > 100f) ? (30f + magnitude * 0.12f) : (magnitude * 0.3f)) - position.y) * 0.6f, -16f, 8f); if (num < 12f && magnitude > 25f) { num3 = Mathf.Max(num3, 6f); } Vector3 val3 = Quaternion.Euler(0f, yaw, 0f) * Vector3.forward; pitch = Mathf.Lerp(pitch, Mathf.Clamp(Mathf.Atan2(num3, Mathf.Max(num2, 1f)) * 57.29578f, -30f, 30f), Mathf.Clamp01(3f * dt)); rb.MoveRotation(Quaternion.Slerp(rb.rotation, Quaternion.Euler(0f - pitch, yaw, 0f), Mathf.Clamp01(5f * dt))); rb.angularVelocity = Vector3.zero; rb.velocity = val3 * num2 + Vector3.up * num3; flame = 0.5f; foldTarget = ((num > 6f) ? 1f : 0f); if ((magnitude < 12f && num < 1.2f) || homeT > 120f) { goingHome = false; pitch = 0f; Land(null); } } private void Say(string s, float t = 3f) { msg = s; msgT = t; ClimbingCarPlugin.Inst?.Log("Climbing Car: " + s); } private Vector3 W(Vector3 local) { //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) return ((Component)this).transform.TransformPoint(local); } public void SetDriving(bool on) { driving = on; if (on) { if (!built) { Build(); } Say("CLIMBING CAR ready! 1 truck back 2 legs 3 grapple 4 let go", 5f); } } private static GameObject Prim(PrimitiveType t, Transform parent, Color c, bool collider = false) { //IL_0000: 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) GameObject val = GameObject.CreatePrimitive(t); Collider component = val.GetComponent<Collider>(); if (!collider && (Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } if ((Object)(object)parent != (Object)null) { val.transform.SetParent(parent, false); } Renderer component2 = val.GetComponent<Renderer>(); if ((Object)(object)component2 != (Object)null) { component2.sharedMaterial = Paint.Get(c); } return val; } private static void Bone(Transform t, Vector3 a, Vector3 b, float r) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_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_0013: 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_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_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_0030: 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) Vector3 val = b - a; float magnitude = ((Vector3)(ref val)).magnitude; t.position = (a + b) * 0.5f; t.rotation = ((magnitude > 0.0001f) ? Quaternion.FromToRotation(Vector3.up, val / magnitude) : Quaternion.identity); t.localScale = new Vector3(r * 2f, Mathf.Max(magnitude, 0.001f) * 0.5f, r * 2f); } private unsafe void Build() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0349: 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_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_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_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_0672: Unknown result type (might be due to invalid IL or missing references) //IL_0673: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Unknown result type (might be due to invalid IL or missing references) //IL_069a: Unknown result type (might be due to invalid IL or missing references) //IL_06a1: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06ae: Unknown result type (might be due to invalid IL or missing references) //IL_06b3: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06f4: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_015a: 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_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0824: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_082f: Unknown result type (might be due to invalid IL or missing references) //IL_0834: Unknown result type (might be due to invalid IL or missing references) //IL_0235: 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_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05b8: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) built = true; rb = ((Component)this).GetComponent<Rigidbody>() ?? ((Component)this).GetComponentInParent<Rigidbody>() ?? ((Component)this).GetComponentInChildren<Rigidbody>(); ls = ((Component)this).transform.lossyScale; bool any = false; lb = new Bounds(Vector3.zero, Vector3.zero); Type type = Reflect.FindType("PlayerCharacter"); MeshFilter[] componentsInChildren = ((Component)this).GetComponentsInChildren<MeshFilter>(); foreach (MeshFilter val in componentsInChildren) { MeshRenderer component = ((Component)val).GetComponent<MeshRenderer>(); if (!((Object)(object)val.sharedMesh == (Object)null) && !((Object)(object)component == (Object)null) && ((Renderer)component).enabled && ((Component)val).gameObject.activeInHierarchy && (!(type != null) || !((Object)(object)((Component)val).GetComponentInParent(type) != (Object)null))) { Bounds bounds = val.sharedMesh.bounds; for (int j = 0; j < 8; j++) { Add(((Component)this).transform.InverseTransformPoint(((Component)val).transform.TransformPoint(new Vector3(((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)))); } } } if (!any) { BoxCollider[] componentsInChildren2 = ((Component)this).GetComponentsInChildren<BoxCollider>(); foreach (BoxCollider val2 in componentsInChildren2) { if (!((Collider)val2).isTrigger && (!((Object)(object)rb != (Object)null) || !((Object)(object)((Collider)val2).attachedRigidbody != (Object)(object)rb))) { for (int k = 0; k < 8; k++) { Add(((Component)this).transform.InverseTransformPoint(((Component)val2).transform.TransformPoint(val2.center + Vector3.Scale(val2.size * 0.5f, new Vector3((float)(((k & 1) != 0) ? 1 : (-1)), (float)(((k & 2) != 0) ? 1 : (-1)), (float)(((k & 4) != 0) ? 1 : (-1))))))); } } } } if (!any) { lb = new Bounds(new Vector3(0f, 0.8f, 0f), new Vector3(2f, 1.6f, 4f)); } halfH = (((Bounds)(ref lb)).center.y - ((Bounds)(ref lb)).min.y) * ls.y; halfLen = ((Bounds)(ref lb)).extents.z * ls.z; hover = halfH + 1.5f; roofL = new Vector3(((Bounds)(ref lb)).center.x, ((Bounds)(ref lb)).max.y, ((Bounds)(ref lb)).center.z); wheels.Clear(); wheels.AddRange(((Component)this).GetComponentsInChildren<WheelCollider>(true)); Renderer[] componentsInChildren3 = ((Component)this).GetComponentsInChildren<Renderer>(true); Vector3 val4; foreach (WheelCollider wheel in wheels) { float num = wheel.radius * Mathf.Max(0.01f, Mathf.Abs(((Component)wheel).transform.lossyScale.y)); Vector3 position = ((Component)wheel).transform.position; List<Renderer> list = new List<Renderer>(); Renderer[] array = componentsInChildren3; foreach (Renderer val3 in array) { if ((Object)(object)val3 == (Object)null || val3 is LineRenderer || ((object)val3).GetType().Name.Contains("Particle")) { continue; } Bounds bounds2 = val3.bounds; if (Vector3.Distance(((Bounds)(ref bounds2)).center, position) < num * 1.6f + 0.15f) { val4 = ((Bounds)(ref bounds2)).size; if (((Vector3)(ref val4)).magnitude < num * 4f + 0.3f) { list.Add(val3); } } } if (list.Count != 0) { wheelRends.Add(list.ToArray()); wheelPosL.Add(((Component)this).transform.InverseTransformPoint(position)); wheelRad.Add(num); } } Vector3 val5 = default(Vector3); for (int l = 0; l < 4; l++) { float num2 = (((l & 1) != 0) ? 1 : (-1)); float num3 = (((l & 2) == 0) ? 1 : (-1)); ((Vector3)(ref val5))..ctor(((Bounds)(ref lb)).center.x + num2 * ((Bounds)(ref lb)).extents.x * 0.8f, ((Bounds)(ref lb)).min.y + 0.3f / Mathf.Max(ls.y, 0.01f), ((Bounds)(ref lb)).center.z + num3 * ((Bounds)(ref lb)).extents.z * 0.65f); float num4 = -1E+09f; foreach (WheelCollider wheel2 in wheels) { Vector3 val6 = ((Component)this).transform.InverseTransformPoint(((Component)wheel2).transform.position); float num5 = (val6.x - ((Bounds)(ref lb)).center.x) * num2 + (val6.z - ((Bounds)(ref lb)).center.z) * num3; if (Mathf.Sign(val6.x - ((Bounds)(ref lb)).center.x) == num2 && Mathf.Sign(val6.z - ((Bounds)(ref lb)).center.z) == num3 && num5 > num4) { num4 = num5; val5 = val6; } } hips[l] = val5; } Vector3 centerOfMass = Vector3.zero; Vector3 inertiaTensor = Vector3.one; Quaternion inertiaTensorRotation = Quaternion.identity; if ((Object)(object)rb != (Object)null) { centerOfMass = rb.centerOfMass; inertiaTensor = rb.inertiaTensor; inertiaTensorRotation = rb.inertiaTensorRotation; } BuildBed(); BuildRaft(); BuildJet(); if ((Object)(object)rb != (Object)null) { rb.centerOfMass = centerOfMass; rb.inertiaTensor = inertiaTensor; rb.inertiaTensorRotation = inertiaTensorRotation; } BuildFx(); Type type2 = Reflect.FindType("PlayerVehicleMovement"); if (type2 != null) { moveComp = ((Component)this).GetComponentInChildren(type2, true); if ((Object)(object)moveComp == (Object)null) { moveComp = ((Component)this).GetComponentInParent(type2); } inWaterM = type2.GetMethod("IsInWater", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); waterF = Reflect.FindField(type2, "water"); } waterType = Reflect.FindType("Water"); Type type3 = Reflect.FindType("PlayerVehicleDestructable"); if (type3 != null) { healthComp = ((Component)this).GetComponentInChildren(type3, true); if ((Object)(object)healthComp == (Object)null) { healthComp = ((Component)this).GetComponentInParent(type3); } getHealthM = type3.GetMethod("GetHealth", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); initHealthF = Reflect.FindField(type3, "vehicleInitalHealth"); } RegisterParts(); ClimbingCarPlugin inst = ClimbingCarPlugin.Inst; if (inst != null) { string[] obj = new string[7] { "Climbing Car: built on ", ((Object)this).name, " (size ", null, null, null, null }; val4 = Vector3.Scale(((Bounds)(ref lb)).size, ls); obj[3] = ((object)(*(Vector3*)(&val4))/*cast due to .constrained prefix*/).ToString(); obj[4] = ", "; obj[5] = wheels.Count.ToString(); obj[6] = " wheels)"; inst.Log(string.Concat(obj)); } void Add(Vector3 p) { //IL_0027: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!any) { lb = new Bounds(p, Vector3.zero); any = true; } else { ((Bounds)(ref lb)).Encapsulate(p); } } } private void BuildBed() { //IL_0006: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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_00fb: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_018c: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_022a: 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_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0290: 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) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) bedRoot = new GameObject("ClimbingCar_TruckBed").transform; bedRoot.SetParent(((Component)this).transform, false); bedRoot.localScale = new Vector3(1f / Mathf.Max(ls.x, 0.01f), 1f / Mathf.Max(ls.y, 0.01f), 1f / Mathf.Max(ls.z, 0.01f)); float num = ((Bounds)(ref lb)).size.x * ls.x * 0.92f; float num2 = ((Bounds)(ref lb)).size.z * ls.z * 0.6f; float num3 = 0.55f; bedOut = new Vector3(((Bounds)(ref lb)).center.x, ((Bounds)(ref lb)).min.y + ((Bounds)(ref lb)).size.y * 0.3f, ((Bounds)(ref lb)).min.z + 0.1f / Mathf.Max(ls.z, 0.01f)); bedIn = bedOut + new Vector3(0f, 0f, num2 / Mathf.Max(ls.z, 0.01f)); Piece(new Vector3(0f, 0f, (0f - num2) / 2f), new Vector3(num, 0.1f, num2), GREY, solid: true); Piece(new Vector3((0f - num) / 2f, num3 / 2f, (0f - num2) / 2f), new Vector3(0.08f, num3, num2), BEDCOL, solid: true); Piece(new Vector3(num / 2f, num3 / 2f, (0f - num2) / 2f), new Vector3(0.08f, num3, num2), BEDCOL, solid: true); Piece(new Vector3(0f, num3 / 2f, 0f - num2), new Vector3(num, num3, 0.08f), BEDCOL, solid: true); Piece(new Vector3(0f, num3 + 0.03f, 0f - num2), new Vector3(num, 0.06f, 0.1f), STEEL, solid: false); for (int i = -1; i <= 1; i += 2) { Piece(new Vector3((float)i * (num / 2f - 0.15f), num3 * 0.6f, 0f - num2 - 0.05f), new Vector3(0.18f, 0.1f, 0.03f), RED, solid: false); GameObject obj = Prim((PrimitiveType)2, bedRoot, DARK); obj.transform.localPosition = new Vector3((float)i * (num / 2f - 0.1f), -0.25f, (0f - num2) * 0.75f); obj.transform.localRotation = Quaternion.Euler(0f, 0f, 90f); obj.transform.localScale = new Vector3(0.6f, 0.12f, 0.6f); } ((Component)bedRoot).gameObject.SetActive(false); void Piece(Vector3 pos, Vector3 size, Color c, bool solid) { //IL_0007: 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_0022: Unknown result type (might be due to invalid IL or missing references) GameObject val = Prim((PrimitiveType)3, bedRoot, c, solid); val.transform.localPosition = pos; val.transform.localScale = size; val.layer = ((Component)this).gameObject.layer; if (solid) { bedCols.Add(val.GetComponent<Collider>()); } } } private void BuildRaft() { //IL_0006: 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_0094: 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_00d0: 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_00ea: 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_02de: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0343: 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_034e: 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_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_0493: 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_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05b7: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: 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_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0295: 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_02af: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Unknown result type (might be due to invalid IL or missing references) raftRoot = new GameObject("ClimbingCar_Raft").transform; raftRoot.SetParent(((Component)this).transform, false); raftRoot.localScale = new Vector3(1f / Mathf.Max(ls.x, 0.01f), 1f / Mathf.Max(ls.y, 0.01f), 1f / Mathf.Max(ls.z, 0.01f)); raftRoot.localPosition = new Vector3(((Bounds)(ref lb)).center.x, ((Bounds)(ref lb)).min.y + 0.3f / Mathf.Max(ls.y, 0.01f), ((Bounds)(ref lb)).center.z); float num = ((Bounds)(ref lb)).extents.x * ls.x; float num2 = ((Bounds)(ref lb)).size.z * ls.z; for (int i = 0; i < 2; i++) { float num3 = ((i == 0) ? (-1f) : 1f); Transform transform = new GameObject((i == 0) ? "LeftSide" : "RightSide").transform; transform.SetParent(raftRoot, false); transform.localPosition = new Vector3(num3 * (num - 0.05f), 0f, 0f); for (int j = 0; j < 6; j++) { Part(transform, (PrimitiveType)3, new Vector3(num3 * (0.13f + (float)j * 0.23f), 0f, 0f), new Vector3(0.21f, 0.08f, num2 * 0.95f), (j % 2 == 0) ? WOOD1 : WOOD2, solid: true); } float[] array = new float[2] { (0f - num2) * 0.35f, num2 * 0.35f }; foreach (float num4 in array) { Part(transform, (PrimitiveType)3, new Vector3(num3 * 0.7f, -0.07f, num4), new Vector3(1.4f, 0.06f, 0.12f), LOG, solid: false); } Part(transform, (PrimitiveType)2, new Vector3(num3 * 1.15f, -0.25f, 0f), new Vector3(0.5f, num2 * 0.46f, 0.5f), LOG, solid: false, Quaternion.Euler(90f, 0f, 0f)); sidePivots[i] = transform; } backDeck = new GameObject("BackDeck").transform; backDeck.SetParent(raftRoot, false); float num5 = 2f * (num + 1.4f); for (int l = 0; l < 9; l++) { Part(backDeck, (PrimitiveType)3, new Vector3(0f, 0f, -0.13f - (float)l * 0.24f), new Vector3(num5, 0.08f, 0.22f), (l % 2 == 0) ? WOOD1 : WOOD2, solid: true); } for (int m = -1; m <= 1; m += 2) { Part(backDeck, (PrimitiveType)2, new Vector3((float)m * (num + 1.15f), -0.25f, -1.1f), new Vector3(0.5f, 1.1f, 0.5f), LOG, solid: false, Quaternion.Euler(90f, 0f, 0f)); } tarpRoot = new GameObject("Tarp").transform; tarpRoot.SetParent(backDeck, false); float num6 = num + 1.1f; float num7 = -0.3f; float num8 = -2f; float num9 = 1.7f; float num10 = 1.15f; Vector3[] array2 = (Vector3[])(object)new Vector3[4] { new Vector3(0f - num6, num9, num7), new Vector3(num6, num9, num7), new Vector3(0f - num6, num10, num8), new Vector3(num6, num10, num8) }; foreach (Vector3 val in array2) { Part(tarpRoot, (PrimitiveType)2, new Vector3(val.x, val.y / 2f, val.z), new Vector3(0.07f, val.y / 2f, 0.07f), STEEL, solid: false); } float num11 = (0f - Mathf.Atan2(num9 - num10, num7 - num8)) * 57.29578f; float num12 = Mathf.Sqrt((num9 - num10) * (num9 - num10) + (num7 - num8) * (num7 - num8)) + 0.3f; Part(tarpRoot, (PrimitiveType)3, new Vector3(0f, (num9 + num10) / 2f + 0.03f, (num7 + num8) / 2f), new Vector3(2f * num6 + 0.3f, 0.04f, num12), TARP, solid: false, Quaternion.Euler(num11, 0f, 0f)); array2 = (Vector3[])(object)new Vector3[2] { new Vector3(0f - num6, 0f, (num7 + num8) / 2f), new Vector3(num6, 0f, (num7 + num8) / 2f) }; foreach (Vector3 val2 in array2) { Part(tarpRoot, (PrimitiveType)3, new Vector3(val2.x, (num9 + num10) / 2f + 0.06f, val2.z), new Vector3(0.05f, 0.05f, num12), ROPE, solid: false, Quaternion.Euler(num11, 0f, 0f)); } backLen = 2.2f; ((Component)raftRoot).gameObject.SetActive(false); Transform Part(Transform parent, PrimitiveType t, Vector3 pos, Vector3 size, Color c, bool solid, Quaternion? rot = null) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_001e: 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 val3 = Prim(t, parent, c, solid); val3.transform.localPosition = pos; val3.transform.localScale = size; if (rot.HasValue) { val3.transform.localRotation = rot.Value; } val3.layer = ((Component)this).gameObject.layer; if (solid) { raftCols.Add(val3.GetComponent<Collider>()); } return val3.transform; } } private void BuildJet() { //IL_0006: 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_0094: 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_00d1: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: 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_0175: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_0212: 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_023b: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_046d: 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_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) jetRoot = new GameObject("ClimbingCar_Jet").transform; jetRoot.SetParent(((Component)this).transform, false); jetRoot.localScale = new Vector3(1f / Mathf.Max(ls.x, 0.01f), 1f / Mathf.Max(ls.y, 0.01f), 1f / Mathf.Max(ls.z, 0.01f)); jetRoot.localPosition = ((Bounds)(ref lb)).center; float num = ((Bounds)(ref lb)).extents.x * ls.x; float num2 = (((Bounds)(ref lb)).max.y - ((Bounds)(ref lb)).center.y) * ls.y; Quaternion value = Quaternion.Euler(90f, 0f, 0f); jetEngine = new GameObject("Engine").transform; jetEngine.SetParent(jetRoot, false); engineOut = new Vector3(0f, num2 * 0.6f, 0f - halfLen - 0.4f); engineIn = new Vector3(0f, num2 * 0.2f, 0f - halfLen + 1f); Part(jetEngine, (PrimitiveType)2, Vector3.zero, new Vector3(0.9f, 0.9f, 0.9f), JETCOL, value); Part(jetEngine, (PrimitiveType)2, new Vector3(0f, 0f, 0.9f), new Vector3(1f, 0.06f, 1f), DARK, value); Part(jetEngine, (PrimitiveType)2, new Vector3(0f, 0f, 0.3f), new Vector3(0.93f, 0.06f, 0.93f), RED, value); Part(jetEngine, (PrimitiveType)2, new Vector3(0f, 0f, -1f), new Vector3(0.7f, 0.15f, 0.7f), DARK, value); Part(jetEngine, (PrimitiveType)3, new Vector3(0f, -0.5f, 0.2f), new Vector3(0.3f, 0.4f, 1.2f), STEEL); jetFlame = Part(jetEngine, (PrimitiveType)2, new Vector3(0f, 0f, -1.4f), new Vector3(0.55f, 0.3f, 0.55f), FLAME, value); Part(jetEngine, (PrimitiveType)3, new Vector3(0f, 0.85f, -0.5f), new Vector3(0.08f, 0.9f, 0.8f), JETCOL, null, slow: true); Part(jetEngine, (PrimitiveType)3, new Vector3(0f, 1.28f, -0.6f), new Vector3(0.1f, 0.06f, 0.5f), RED, null, slow: true); for (int i = -1; i <= 1; i += 2) { Part(jetEngine, (PrimitiveType)3, new Vector3((float)i * 0.8f, 0.1f, -0.6f), new Vector3(1.1f, 0.06f, 0.5f), JETCOL, null, slow: true); } for (int j = 0; j < 2; j++) { float num3 = ((j == 0) ? (-1f) : 1f); Transform transform = new GameObject((j == 0) ? "LeftWing" : "RightWing").transform; transform.SetParent(jetRoot, false); transform.localPosition = new Vector3(num3 * (num - 0.08f), num2 * 0.1f, (0f - halfLen) * 0.1f); Part(transform, (PrimitiveType)3, new Vector3(num3 * 1.2f, 0f, 0f), new Vector3(2.4f, 0.08f, 1.3f), JETCOL); Part(transform, (PrimitiveType)3, new Vector3(num3 * 2.35f, 0.02f, -0.05f), new Vector3(0.12f, 0.1f, 1.2f), RED); Part(transform, (PrimitiveType)3, new Vector3(num3 * 1.2f, 0.05f, 0.5f), new Vector3(2.2f, 0.02f, 0.12f), STEEL); wingPivots[j] = transform; wingTipsL[j] = new Vector3(num3 * 2.4f, 0f, 0f); } for (int k = -1; k <= 1; k += 2) { Part(jetRoot, (PrimitiveType)3, new Vector3((float)k * (num + 0.35f), 0f, halfLen - 0.6f), new Vector3(0.7f, 0.05f, 0.4f), JETCOL, null, slow: true); } noseStick = new GameObject("NoseStick").transform; noseStick.SetParent(jetRoot, false); stickOut = new Vector3(0f, 0f, halfLen + 0.45f); stickIn = new Vector3(0f, 0f, halfLen - 0.55f); Part(noseStick, (PrimitiveType)2, Vector3.zero, new Vector3(0.08f, 0.5f, 0.08f), STEEL, value); Part(noseStick, (PrimitiveType)0, new Vector3(0f, 0f, 0.5f), new Vector3(0.12f, 0.12f, 0.12f), RED); ((Component)jetRoot).gameObject.SetActive(false); Transform Part(Transform parent, PrimitiveType t, Vector3 pos, Vector3 size, Color c, Quaternion? rot = null, bool slow = false) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_001d: 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_005a: Unknown result type (might be due to invalid IL or missing references) GameObject val = Prim(t, parent, c); val.transform.localPosition = pos; val.transform.localScale = size; if (rot.HasValue) { val.transform.localRotation = rot.Value; } if (slow) { slowParts.Add(val.transform); slowScales.Add(size); } return val.transform; } } private void RegisterParts() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) Random rnd = new Random(((Object)this).GetInstanceID()); Reg(bedRoot, fixedParts: true); Reg(raftRoot, fixedParts: true); Reg(jetRoot, fixedParts: true); if ((Object)(object)fx != (Object)null) { Reg(fx.transform, fixedParts: false); } for (int i = 0; i < 4; i++) { legBend[i] = new Vector3(R(-1f, 1f), R(-0.5f, 1f), R(-1f, 1f)) * 0.35f; } float R(float a, float b) { return a + (float)rnd.NextDouble() * (b - a); } void Reg(Transform root, bool fixedParts) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_0139: 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) if (!((Object)(object)root == (Object)null)) { Renderer[] componentsInChildren = ((Component)root).GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { if (!(val is LineRenderer) && !((Object)(object)((Component)val).transform == (Object)(object)root)) { Transform transform = ((Component)val).transform; bool fixedPart = fixedParts && (Object)(object)transform != (Object)(object)jetFlame; partsInfo.Add(new PartInfo { t = transform, r = val, c = (((Object)(object)val.sharedMaterial != (Object)null) ? val.sharedMaterial.color : Color.grey), fixedPart = fixedPart, basePos = transform.localPosition, baseRot = transform.localRotation, bendRot = new Vector3(R(-1f, 1f), R(-1f, 1f), R(-1f, 1f)) * 22f, bendPos = new Vector3(R(-1f, 1f), R(-1f, 1f), R(-1f, 1f)) * 0.12f, scorch = R(0.5f, 1.1f), breakAt = ((R(0f, 1f) < 0.45f) ? R(0.55f, 0.95f) : 2f) }); } } } } } private void DamageTick(float dt) { //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_01a3: 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_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_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_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) healthT -= dt; if (healthT <= 0f && (Object)(object)healthComp != (Object)null && getHealthM != null) { healthT = 0.3f; try { float num = Convert.ToSingle(getHealthM.Invoke(healthComp, null)); float num2 = ((initHealthF != null) ? Convert.ToSingle(initHealthF.GetValue(healthComp)) : 0f); maxHealth = Mathf.Max(new float[3] { maxHealth, num2, num }); if (maxHealth > 0.01f) { dmgTarget = Mathf.Clamp01(1f - num / maxHealth); } } catch { } } dmg = Mathf.MoveTowards(dmg, dmgTarget, dt * 0.6f); if (Mathf.Abs(dmg - dmgShown) < 0.01f) { return; } dmgShown = dmg; if (mpb == null) { mpb = new MaterialPropertyBlock(); } Color val = default(Color); ((Color)(ref val))..ctor(0.13f, 0.1f, 0.08f); foreach (PartInfo item in partsInfo) { if ((Object)(object)item.t == (Object)null) { continue; } if ((Object)(object)item.r != (Object)null) { item.r.GetPropertyBlock(mpb); mpb.SetColor("_Color", Color.Lerp(item.c, val, Mathf.Clamp01(dmg * 0.7f * item.scorch))); item.r.SetPropertyBlock(mpb); } if (!item.fixedPart) { continue; } item.t.localRotation = item.baseRot * Quaternion.Euler(item.bendRot * dmg); item.t.localPosition = item.basePos + item.bendPos * dmg; if (!item.broken && dmg >= item.breakAt) { item.broken = true; if (((Component)item.t).gameObject.activeInHierarchy) { DropPiece(item.t); } ((Component)item.t).gameObject.SetActive(false); } else if (item.broken && dmg < item.breakAt - 0.1f) { item.broken = false; ((Component)item.t).gameObject.SetActive(true); } } } private void DropPiece(Transform t) { //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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(((Component)t).gameObject, t.position, t.rotation); val.transform.localScale = t.lossyScale; if ((Object)(object)val.GetComponent<Collider>() == (Object)null) { val.AddComponent<BoxCollider>(); } Collider[] componentsInChildren = val.GetComponentsInChildren<Collider>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = true; } Rigidbody obj = val.AddComponent<Rigidbody>(); obj.mass = 5f; obj.velocity = (((Object)(object)rb != (Object)null) ? rb.velocity : Vector3.zero) + new Vector3(Random.Range(-2f, 2f), Random.Range(1f, 3f), Random.Range(-2f, 2f)); obj.angularVelocity = Random.insideUnitSphere * 6f; Object.Destroy((Object)(object)val, 8f); } private float Step(float a, float b) { float num = Mathf.Clamp01((jt - a) / (b - a)); return num * num * (3f - 2f * num); } private void JetVisuals(float dt) { //IL_0101: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0431: 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_044a: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)jetRoot == (Object)null) { return; } jt = Mathf.MoveTowards(jt, jetTarget * 5.2f, dt * ((jetTarget > 0.5f) ? 1f : 1.6f)); bool flag = jt > 0.001f; if (((Component)jetRoot).gameObject.activeSelf != flag) { ((Component)jetRoot).gameObject.SetActive(flag); } float num = Step(0f, 0.8f); float num2 = Step(0.8f, 1.5f); float num3 = Step(1.5f, 2.1f); float num4 = Step(2.1f, 2.8f); float num5 = Step(2.8f, 4f); float num6 = Step(4f, 4.5f); float num7 = Step(4.5f, 5.2f); if (flag) { jetEngine.localPosition = Vector3.Lerp(engineIn, engineOut, num); jetEngine.localScale = Vector3.one * Mathf.Lerp(0.25f, 1f, num); for (int i = 0; i < 2; i++) { wingPivots[i].localRotation = Quaternion.Euler(0f, 0f, ((i == 0) ? 90f : (-90f)) * (1f - num2)); } for (int j = 0; j < slowParts.Count; j++) { slowParts[j].localScale = slowScales[j] * Mathf.Max(0.001f, num5); } noseStick.localPosition = Vector3.Lerp(stickIn, stickOut, num6); ((Component)noseStick).gameObject.SetActive(num6 > 0.01f); bool flag2 = jt >= 5.1899996f && mode == Mode.Jet && (flying || flame > 0.5f); if (flag2 && dmg > 0.35f && Random.value < (dmg - 0.3f) * 0.6f) { flag2 = false; } ((Component)jetFlame).gameObject.SetActive(flag2); if (flag2) { jetFlame.localScale = new Vector3(0.55f, (0.25f + flame * 0.9f) * Random.Range(0.8f, 1.2f), 0.55f); } } Vector3 val = (((Object)(object)jetEngine != (Object)null) ? jetEngine.position : W(((Bounds)(ref lb)).center)); for (int k = 0; k < 2; k++) { LineRenderer val2 = wingRopes[k]; if (!((Object)(object)val2 == (Object)null)) { float num8 = num3 * (1f - num7); ((Renderer)val2).enabled = flag && num8 > 0.01f; if (((Renderer)val2).enabled) { Vector3 val3 = wingPivots[k].position + wingPivots[k].rotation * wingTipsL[k]; val2.SetPosition(0, val3); val2.SetPosition(1, Vector3.Lerp(val3, val, num8)); } } } if (!((Object)(object)outline != (Object)null)) { return; } float num9 = num4 * (1f - num7); ((Renderer)outline).enabled = flag && num9 > 0.01f; if (((Renderer)outline).enabled) { Vector3 val4 = W(new Vector3(((Bounds)(ref lb)).center.x, ((Bounds)(ref lb)).center.y, ((Bounds)(ref lb)).max.z)) + ((Component)this).transform.forward * 0.9f; Vector3 val5 = wingPivots[0].position + wingPivots[0].rotation * wingTipsL[0]; Vector3 val6 = wingPivots[1].position + wingPivots[1].rotation * wingTipsL[1]; Vector3 val7 = val - ((Component)this).transform.forward * 1.6f; Vector3[] array = (Vector3[])(object)new Vector3[5] { val4, val5, val7, val6, val4 }; float num10 = num9 * 4f; int num11 = Mathf.Min(4, Mathf.FloorToInt(num10)); outline.positionCount = ((num11 + 2 > 5) ? 5 : (num11 + 2)); for (int l = 0; l <= num11 && l < 5; l++) { outline.SetPosition(l, array[l]); } if (num11 < 4) { outline.SetPosition(num11 + 1, Vector3.Lerp(array[num11], array[num11 + 1], num10 - (float)num11)); } } } private void FoldWheels(float dt) { //IL_00f4: 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_012d: 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_013d: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: 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_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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) foldK = Mathf.MoveTowards(foldK, foldTarget, dt * 2f); bool flag = foldK <= 0.001f; for (int i = 0; i < wheelRends.Count; i++) { Renderer[] array = wheelRends[i]; foreach (Renderer val in array) { if ((Object)(object)val != (Object)null && val.enabled != flag) { val.enabled = flag; } } if (i < wheelProxy.Count && !((Object)(object)wheelProxy[i] == (Object)null)) { Transform val2 = wheelProxy[i]; bool flag2 = foldK > 0.001f && foldK < 0.999f; if (((Component)val2).gameObject.activeSelf != flag2) { ((Component)val2).gameObject.SetActive(flag2); } if (flag2) { float num = Mathf.Sign(wheelPosL[i].x - ((Bounds)(ref lb)).center.x); float num2 = wheelRad[i]; val2.position = W(wheelPosL[i]) + ((Component)this).transform.up * (num2 + 0.1f) * foldK - ((Component)this).transform.right * num * 0.15f * foldK; val2.rotation = Quaternion.AngleAxis(90f * foldK * num, ((Component)this).transform.forward) * (((Component)this).transform.rotation * Quaternion.Euler(0f, 0f, 90f)); val2.localScale = new Vector3(2f * num2, 0.13f, 2f * num2) * Mathf.Lerp(1f, 0.6f, foldK); } } } } private void BuildFx() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0016: 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_0063: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_0101: 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_011a: 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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_021a: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Expected O, but got Unknown //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) fx = new GameObject("ClimbingCar_FX"); pod = new GameObject("Pod").transform; pod.SetParent(fx.transform, false); GameObject obj = Prim((PrimitiveType)2, pod, RED); obj.transform.localRotation = Quaternion.Euler(90f, 0f, 0f); obj.transform.localScale = new Vector3(0.4f, 0.32f, 0.4f); GameObject obj2 = Prim((PrimitiveType)0, pod, STEEL); obj2.transform.localPosition = new Vector3(0f, 0f, 0.3f); obj2.transform.localScale = new Vector3(0.4f, 0.4f, 0.3f); GameObject obj3 = Prim((PrimitiveType)0, pod, YELLOW); obj3.transform.localPosition = new Vector3(0f, 0f, -0.33f); obj3.transform.localScale = Vector3.one * 0.2f; for (int i = 0; i < 3; i++) { Transform transform = new GameObject("Finger" + i).transform; transform.SetParent(pod, false); GameObject obj4 = Prim((PrimitiveType)3, transform, STEEL); obj4.transform.localPosition = new Vector3(0f, 0f, 0.22f); obj4.transform.localScale = new Vector3(0.17f, 0.03f, 0.45f); GameObject obj5 = Prim((PrimitiveType)3, transform, DARK); obj5.transform.localPosition = new Vector3(0f, -0.04f, 0.44f); obj5.transform.localScale = new Vector3(0.17f, 0.08f, 0.04f); fingers[i] = transform; } ((Component)pod).gameObject.SetActive(false); tBase = Prim((PrimitiveType)2, fx.transform, DARK).transform; tPost = Prim((PrimitiveType)2, fx.transform, STEEL).transform; tHead = Prim((PrimitiveType)3, fx.transform, YELLOW).transform; tBarrel = Prim((PrimitiveType)2, fx.transform, GREY).transform; tBoom2 = Prim((PrimitiveType)2, fx.transform, YELLOW).transform; ((Component)tBoom2).gameObject.SetActive(false); Transform[] array = (Transform[])(object)new Transform[4] { tBase, tPost, tHead, tBarrel }; for (int j = 0; j < array.Length; j++) { ((Component)array[j]).gameObject.SetActive(false); } GameObject val = new GameObject("Rope"); val.transform.SetParent(fx.transform, false); rope = val.AddComponent<LineRenderer>(); ((Renderer)rope).material = Paint.Line(); LineRenderer obj6 = rope; Color startColor = (rope.endColor = ROPE); obj6.startColor = startColor; rope.widthMultiplier = 0.06f; rope.positionCount = 2; rope.useWorldSpace = true; ((Renderer)rope).enabled = false; wingRopes[0] = Blue("BlueRopeL", 0.06f); wingRopes[1] = Blue("BlueRopeR", 0.06f); outline = Blue("BlueArrow", 0.05f); for (int k = 0; k < wheelRends.Count; k++) { Transform transform2 = Prim((PrimitiveType)2, fx.transform, DARK).transform; ((Component)transform2).gameObject.SetActive(false); wheelProxy.Add(transform2); } for (int l = 0; l < 4; l++) { leg[l] = (Transform[])(object)new Transform[7]; for (int m = 0; m < 3; m++) { leg[l][m] = Prim((PrimitiveType)2, fx.transform, GREY).transform; } for (int n = 0; n < 3; n++) { Transform transform3 = Prim((PrimitiveType)0, fx.transform, YELLOW).transform; transform3.localScale = Vector3.one * 0.2f; leg[l][3 + n] = transform3; } Transform transform4 = Prim((PrimitiveType)2, fx.transform, DARK).transform; leg[l][6] = transform4; } LineRenderer Blue(string nm, float width) { //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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) GameObject val2 = new GameObject(nm); val2.transform.SetParent(fx.transform, false); LineRenderer obj7 = val2.AddComponent<LineRenderer>(); ((Renderer)obj7).material = Paint.Line(); Color startColor2 = (obj7.endColor = BLUE); obj7.startColor = startColor2; obj7.widthMultiplier = width; obj7.positionCount = 2; obj7.useWorldSpace = true; ((Renderer)obj7).enabled = false; return obj7; } } private void OnDestroy() { if ((Object)(object)fx != (Object)null) { Object.Destroy((Object)(object)fx); } if ((Object)(object)joint != (Object)null) { Object.Destroy((Object)(object)joint); } } private void Update() { //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_0542: 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_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_071f: Unknown result type (might be due to invalid IL or missing references) //IL_06bd: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0421: 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) if (!built) { return; } float deltaTime = Time.deltaTime; msgT -= deltaTime; DamageTick(deltaTime); if (dmg >= 0.6f && bedTarget > 0.5f) { bedTarget = 0f; Say("CRUNCH! The truck back is too damaged. It folds away.", 3.5f); } if (dmg >= 0.9f && mode == Mode.Jet && jetTarget > 0.5f) { jetTarget = 0f; StartCoast(); if (flying) { Land("THE JET BROKE! You're falling!"); } else { Say("The jet is too wrecked! Jet mode off.", 3.5f); } } if (driving && ClimbingCarPlugin.Unlocked) { if ((Object)(object)fx != (Object)null && !fx.activeSelf) { fx.SetActive(true); } if (docked) { if (Keys.Pressed(55)) { GetOut(); return; } if (!Keys.Pressed(87) && !Keys.Pressed(32)) { int[] array = new int[6] { 49, 50, 51, 52, 53, 54 }; for (int i = 0; i < array.Length; i++) { Keys.Pressed(array[i]); } goto IL_04af; } Undock("Bye bye, rocket! (flying again)"); } bool flag = Keys.Pressed(49); bool flag2 = Keys.Pressed(50); bool flag3 = Keys.Pressed(51); bool flag4 = Keys.Pressed(53); bool flag5 = Keys.Pressed(54); bool flag6 = Keys.Pressed(32); if (flag5 && dmg >= 0.9f && (mode != Mode.Jet || !(jetTarget > 0.5f))) { Say("The jet is too wrecked to fly! (fix your car)"); flag5 = false; } if (flag5) { if (mode == Mode.Jet) { if (jetTarget > 0.5f) { jetTarget = 0f; StartCoast(); if (flying) { Land("Jet mode off! (you keep your speed)"); } else { Say("Jet mode off: the parts go away"); } } else { jetTarget = 1f; Say("JET MODE!"); } } else if (mode == Mode.Drive || mode == Mode.Falling) { mode = Mode.Jet; jetTarget = 1f; bedTarget = 0f; flying = false; Say("JET MODE: building the jet...", 4f); } else { Say("Can't turn into a jet right now!"); } } if (Keys.Pressed(55)) { GetOut(); return; } if (mode == Mode.Jet && (flag || flag2 || flag3 || flag4)) { Say("Turn jet mode off first (6)"); flag = (flag2 = (flag3 = (flag4 = false))); } if (mode == Mode.Jet && flag6 && !flying) { if (jt >= 5.2f) { wantTakeoff = true; } else { Say("Wait for the jet to finish building!"); } } if (flag4) { float surfaceY; if (mode == Mode.Raft) { ExitRaft("Raft folded away!"); } else if (InWater(out surfaceY)) { waterY = surfaceY; StartRaft(); } else { Say("Raft mode only works in the WATER!"); } } if (mode == Mode.Raft && (flag || flag2 || flag3)) { Say("Fold the raft away first (5)"); flag = (flag2 = (flag3 = false)); } if (flag && bedTarget < 0.5f && dmg >= 0.6f) { Say("The truck back is too damaged! (fix your car)"); flag = false; } if (flag) { bedTarget = ((bedTarget > 0.5f) ? 0f : 1f); Say((bedTarget > 0.5f) ? "TRUCK BACK: out!" : "Truck back: folded away"); } if (flag2) { RaycastHit hit; if (mode == Mode.Climb) { ExitClimb("Legs away!"); } else if (Cast(W(((Bounds)(ref lb)).center), -((Component)this).transform.up, hover + 2.5f, out hit)) { StartClimb(((RaycastHit)(ref hit)).normal); } else { Say("Get close to a wall or the ground first!"); } } if (flag3 && (mode == Mode.Drive || mode == Mode.Falling || mode == Mode.Climb)) { FireGrapple(byHand: true); } if (Keys.Pressed(52) && (mode == Mode.PodOut || mode == Mode.Hooked)) { LetGo(); Say("Let go of the rope!"); } } goto IL_04af; IL_04af: bedK = Mathf.MoveTowards(bedK, bedTarget, deltaTime * 1.4f); if ((Object)(object)bedRoot != (Object)null) { bool flag7 = bedK > 0.01f; if (((Component)bedRoot).gameObject.activeSelf != flag7) { ((Component)bedRoot).gameObject.SetActive(flag7); } float num = bedK * bedK * (3f - 2f * bedK); bedRoot.localPosition = Vector3.Lerp(bedIn, bedOut, num); bool flag8 = bedK > 0.98f; foreach (Collider bedCol in bedCols) { if ((Object)(object)bedCol != (Object)null && bedCol.enabled != flag8) { bedCol.enabled = flag8; } } } raftK = Mathf.MoveTowards(raftK, raftTarget, deltaTime * 1.2f); if ((Object)(object)raftRoot != (Object)null) { bool flag9 = raftK > 0.01f; if (((Component)raftRoot).gameObject.activeSelf != flag9) { ((Component)raftRoot).gameObject.SetActive(flag9); } float num2 = Mathf.Clamp01(raftK / 0.6f); float num3 = Mathf.Clamp01((raftK - 0.3f) / 0.5f); float num4 = Mathf.Clamp01((raftK - 0.75f) / 0.25f); num2 = num2 * num2 * (3f - 2f * num2); num3 = num3 * num3 * (3f - 2f * num3); for (int j = 0; j < 2; j++) { sidePivots[j].localRotation = Quaternion.Euler(0f, 0f, ((j == 0) ? (-1f) : 1f) * 90f * (1f - num2)); } backDeck.localPosition = new Vector3(0f, 0f, 0f - halfLen + backLen * (1f - num3)); tarpRoot.localScale = new Vector3(1f, Mathf.Max(0.01f, num4), 1f); bool flag10 = raftK > 0.98f; foreach (Collider raftCol in raftCols) { if ((Object)(object)raftCol != (Object)null && raftCol.enabled != flag10) { raftCol.enabled = flag10; } } } JetVisuals(deltaTime); FoldWheels(deltaTime); PlacePodAndRope(deltaTime); PlaceLegs(deltaTime); } private void TopSpeed(float mph) { try { if (!((Object)(object)moveComp == (Object)null)) { if (mph > 0f) { ((object)moveComp).GetType().GetMethod("SetTopSpeedMPH", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[1] { typeof(float) }, null)?.Invoke(moveComp, new object[1] { mph }); } else { ((object)moveComp).GetType().GetMethod("SetTopSpeedMPHDefault", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null)?.Invoke(moveComp, null); } } } catch { } } private void StartCoast