Decompiled source of CWSkate v1.0.0
plugins/CWSkate/CWSkate.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.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.Localization; using UnityEngine.Localization.Settings; using UnityEngine.Rendering; using Zorro.Core; using Zorro.Core.Serizalization; using Zorro.Settings; [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("CWSkate")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CWSkate")] [assembly: AssemblyTitle("CWSkate")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CWSkate { internal class AuraHalo : MonoBehaviour { private const int LocalHiddenLayer = 29; private static Material sharedMat; private static Texture2D tex; private static bool additive; private Material mat; private MeshRenderer rend; private static readonly int BaseColorId = Shader.PropertyToID("_BaseColor"); private int hasBaseColor = -1; private float strength; public static AuraHalo Create(bool localPlayer) { //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) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown GameObject val = GameObject.CreatePrimitive((PrimitiveType)5); ((Object)val).name = "CWSkate_AuraHalo"; Collider component = val.GetComponent<Collider>(); if (Object.op_Implicit((Object)(object)component)) { Object.DestroyImmediate((Object)(object)component); } if (localPlayer) { val.layer = 29; } val.transform.localScale = Vector3.one * 1.7f; AuraHalo auraHalo = val.AddComponent<AuraHalo>(); auraHalo.rend = val.GetComponent<MeshRenderer>(); ((Renderer)auraHalo.rend).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)auraHalo.rend).receiveShadows = false; auraHalo.mat = new Material(SharedMaterial()); ((Renderer)auraHalo.rend).sharedMaterial = auraHalo.mat; ((Renderer)auraHalo.rend).enabled = false; return auraHalo; } private static Material SharedMaterial() { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown if ((Object)(object)sharedMat != (Object)null) { return sharedMat; } Texture2D val = Texture(); Shader val2 = Shader.Find("Universal Render Pipeline/Particles/Unlit"); if ((Object)(object)val2 != (Object)null && val2.isSupported) { Material val3 = new Material(val2); val3.SetFloat("_Surface", 1f); val3.SetFloat("_Blend", 2f); val3.SetFloat("_SrcBlend", 5f); val3.SetFloat("_DstBlend", 1f); val3.SetFloat("_ZWrite", 0f); val3.SetFloat("_Cull", 0f); val3.EnableKeyword("_SURFACE_TYPE_TRANSPARENT"); val3.renderQueue = 3000; if (val3.HasProperty("_BaseMap")) { val3.SetTexture("_BaseMap", (Texture)(object)val); } val3.mainTexture = (Texture)(object)val; sharedMat = val3; additive = true; } else { sharedMat = new Material(Shader.Find("Sprites/Default")) { mainTexture = (Texture)(object)val, renderQueue = 3000 }; } ((Object)sharedMat).hideFlags = (HideFlags)32; SkatePlugin.Log.LogInfo((object)("Aura halo shader: " + ((Object)sharedMat.shader).name)); return sharedMat; } private static Texture2D Texture() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_00cd: 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) if ((Object)(object)tex != (Object)null) { return tex; } tex = new Texture2D(64, 64, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1, hideFlags = (HideFlags)32 }; Color[] array = (Color[])(object)new Color[4096]; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num = ((float)j + 0.5f) / 64f * 2f - 1f; float num2 = ((float)i + 0.5f) / 64f * 2f - 1f; float num3 = Mathf.Sqrt(num * num + num2 * num2); float num4 = Mathf.Clamp01(1f - num3); num4 = num4 * num4 * (3f - 2f * num4); array[i * 64 + j] = new Color(1f, 1f, 1f, num4 * num4); } } tex.SetPixels(array); tex.Apply(); return tex; } public void Set(Vector3 pos, Color color, float target, float dt) { //IL_0046: 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_00d9: 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_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_0090: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) strength = Mathf.MoveTowards(strength, target, dt * 2f); ((Renderer)rend).enabled = strength > 0.01f; if (((Renderer)rend).enabled) { ((Component)this).transform.position = pos; Camera val = (((Object)(object)MainCamera.instance != (Object)null) ? MainCamera.instance.Cam : Camera.main); if ((Object)(object)val != (Object)null) { ((Component)this).transform.rotation = Quaternion.LookRotation(((Component)this).transform.position - ((Component)val).transform.position); } float num = 1f + Mathf.Sin(Time.time * 3f) * 0.06f; ((Component)this).transform.localScale = Vector3.one * (1.4f + strength * 0.8f) * num; color.a = Mathf.Clamp01(strength) * (additive ? 0.8f : 0.45f); mat.color = color; if (hasBaseColor < 0) { hasBaseColor = (mat.HasProperty(BaseColorId) ? 1 : 0); } if (hasBaseColor == 1) { mat.SetColor(BaseColorId, color); } } } public void Hide() { strength = 0f; if (Object.op_Implicit((Object)(object)rend)) { ((Renderer)rend).enabled = false; } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)mat)) { Object.Destroy((Object)(object)mat); } } } internal class BoardVisual : MonoBehaviour { public const float WheelBase = 0.069f; public Transform model; [SerializeField] private MeshRenderer deckRenderer; [SerializeField] private Renderer[] wheelRenderers; private int skinVersion = -1; private int upgrades = -1; private Material edge; private Rigidbody flyRig; private BoxCollider flyCol; private float flyTime; [SerializeField] private GameObject rocketModel; [SerializeField] private Transform rocketNozzle; private ParticleSystem flame; private ParticleSystem smoke; private bool flameOn = true; private Transform flameCore; private static PhysicsMaterial slipperyMat; public bool isItem; public bool pro; private float skinCheck; private ItemInstance itemInstance; private bool shadowsOn = true; public bool Flying => (Object)(object)flyRig != (Object)null; public Vector3 FlyVelocity { get { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)flyRig != (Object)null)) { return Vector3.zero; } return flyRig.linearVelocity; } } public Rigidbody FlyRig => flyRig; public bool OutOfWorld => ((Component)this).transform.position.y < -150f; public static BoardVisual Create(string name) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_00cb: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_0161: 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_0216: Expected O, but got Unknown //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); BoardVisual boardVisual = val.AddComponent<BoardVisual>(); Transform transform = new GameObject("Model").transform; transform.SetParent(val.transform, false); boardVisual.model = transform; GameObject val2 = new GameObject("Deck"); val2.transform.SetParent(transform, false); val2.AddComponent<MeshFilter>().sharedMesh = SkateArt.DeckMesh(); boardVisual.deckRenderer = val2.AddComponent<MeshRenderer>(); ((Renderer)boardVisual.deckRenderer).sharedMaterials = (Material[])(object)new Material[3] { SkateArt.Grip, SkateArt.Graphic, SkateArt.Wood }; List<Renderer> list = new List<Renderer>(); float[] array = new float[2] { 0.215f, -0.215f }; foreach (float num in array) { Part(transform, (PrimitiveType)3, new Vector3(0f, -0.0125f, num), new Vector3(0.07f, 0.012f, 0.085f), Quaternion.identity, SkateArt.Metal); Part(transform, (PrimitiveType)3, new Vector3(0f, -0.03f, num), new Vector3(0.15f, 0.022f, 0.035f), Quaternion.identity, SkateArt.Metal); Part(transform, (PrimitiveType)2, new Vector3(0f, -0.042f, num), new Vector3(0.008f, 0.1f, 0.008f), Quaternion.Euler(0f, 0f, 90f), SkateArt.Metal); float[] array2 = new float[2] { 0.087f, -0.087f }; foreach (float num2 in array2) { list.Add(Part(transform, (PrimitiveType)2, new Vector3(num2, -0.042f, num), new Vector3(0.054f, 0.016f, 0.054f), Quaternion.Euler(0f, 0f, 90f), SkateArt.Wheel)); } } boardVisual.wheelRenderers = list.ToArray(); GameObject val3 = new GameObject("Rocket"); val3.transform.SetParent(transform, false); val3.transform.localPosition = new Vector3(0f, -0.034f, -0.39f); boardVisual.rocketNozzle = BuildRocket(val3.transform, 1f); val3.SetActive(false); boardVisual.rocketModel = val3; return boardVisual; } public static Transform BuildRocket(Transform parent, float k) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0162: 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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_01a8: 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_01d0: 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) Quaternion rot = Quaternion.Euler(90f, 0f, 0f); Part(parent, (PrimitiveType)2, Vector3.zero, new Vector3(0.062f, 0.1f, 0.062f) * k, rot, SkateArt.RocketRed); Part(parent, (PrimitiveType)0, new Vector3(0f, 0f, 0.1f) * k, new Vector3(0.062f, 0.062f, 0.09f) * k, Quaternion.identity, SkateArt.RocketRed); Part(parent, (PrimitiveType)2, new Vector3(0f, 0f, 0.035f) * k, new Vector3(0.064f, 0.008f, 0.064f) * k, rot, SkateArt.Wheel); Part(parent, (PrimitiveType)2, new Vector3(0f, 0f, -0.115f) * k, new Vector3(0.05f, 0.022f, 0.05f) * k, rot, SkateArt.Metal); for (int i = 0; i < 3; i++) { Quaternion val = Quaternion.Euler(0f, 0f, 90f + (float)i * 120f); Part(parent, (PrimitiveType)3, val * new Vector3(0.042f, 0f, 0f) * k + new Vector3(0f, 0f, -0.075f) * k, new Vector3(0.035f, 0.004f, 0.05f) * k, val, SkateArt.RocketRed); } Transform transform = new GameObject("NozzleEnd").transform; transform.SetParent(parent, false); transform.localPosition = new Vector3(0f, 0f, -0.14f) * k; transform.localRotation = Quaternion.Euler(0f, 180f, 0f); return transform; } public void SetRocketFlame(bool on) { //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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rocketNozzle == (Object)null) { return; } if (on && (Object)(object)flame == (Object)null) { flame = SkateFx.Flame(rocketNozzle); smoke = SkateFx.Smoke(rocketNozzle); flameCore = SkateFx.FlameCore(rocketNozzle); } if ((Object)(object)flame == (Object)null || (!on && !flameOn)) { return; } flameOn = on; EmissionModule emission = flame.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit((!on) ? 0f : (Perf.Low ? 90f : 220f)); EmissionModule emission2 = smoke.emission; ((EmissionModule)(ref emission2)).rateOverTime = MinMaxCurve.op_Implicit((on && !Perf.Low) ? 45f : 0f); if ((Object)(object)flameCore != (Object)null) { if (((Component)flameCore).gameObject.activeSelf != on) { ((Component)flameCore).gameObject.SetActive(on); } if (on) { float num = Random.Range(0.8f, 1.3f); float num2 = Random.Range(0.85f, 1.1f); flameCore.localScale = new Vector3(0.05f * num2, 0.05f * num2, 0.18f * num); flameCore.localPosition = new Vector3(0f, 0f, 0.09f * num); } } } public void ApplyUpgrades(int flags) { if (flags == upgrades) { return; } upgrades = flags; Material sharedMaterial = (((flags & 1) != 0) ? SkateArt.WheelSpeed : (((flags & 2) != 0) ? SkateArt.WheelSoft : SkateArt.Wheel)); if (wheelRenderers != null) { Renderer[] array = wheelRenderers; foreach (Renderer val in array) { if ((Object)(object)val != (Object)null) { val.sharedMaterial = sharedMaterial; } } } if ((Object)(object)rocketModel != (Object)null) { rocketModel.SetActive((flags & 8) != 0); } edge = (((flags & 4) != 0) ? SkateArt.Maple : SkateArt.Wood); if ((Object)(object)deckRenderer != (Object)null) { Material[] sharedMaterials = ((Renderer)deckRenderer).sharedMaterials; if (sharedMaterials.Length > 2) { sharedMaterials[2] = edge; ((Renderer)deckRenderer).sharedMaterials = sharedMaterials; } } } private static Renderer Part(Transform parent, PrimitiveType type, Vector3 pos, Vector3 scale, Quaternion rot, Material mat) { //IL_0000: 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_003a: 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 obj = GameObject.CreatePrimitive(type); Collider component = obj.GetComponent<Collider>(); if (Object.op_Implicit((Object)(object)component)) { Object.DestroyImmediate((Object)(object)component); } obj.transform.SetParent(parent, false); obj.transform.localPosition = pos; obj.transform.localRotation = rot; obj.transform.localScale = scale; Renderer component2 = obj.GetComponent<Renderer>(); component2.sharedMaterial = mat; return component2; } public void ApplySkin(SkinSet skin) { if (skin != null && !((Object)(object)deckRenderer == (Object)null) && skin.Version != skinVersion) { skinVersion = skin.Version; ((Renderer)deckRenderer).sharedMaterials = (Material[])(object)new Material[3] { Object.op_Implicit((Object)(object)skin.Grip) ? skin.Grip : SkateArt.Grip, Object.op_Implicit((Object)(object)skin.Graphic) ? skin.Graphic : SkateArt.Graphic, Object.op_Implicit((Object)(object)edge) ? edge : SkateArt.Wood }; } } public void Place(Vector3 pos, Quaternion rot, Quaternion localRot, Vector3 localOffset) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) if (!Flying) { ((Component)this).transform.SetPositionAndRotation(pos, rot); model.localRotation = localRot; model.localPosition = localOffset; } } public void PlaceOnBack(Player p) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_010b: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) if (Flying || (Object)(object)p == (Object)null) { return; } PlayerRagdoll ragdoll = p.refs.ragdoll; Bodypart bodypart = ragdoll.GetBodypart((BodypartType)0); Bodypart bodypart2 = ragdoll.GetBodypart((BodypartType)2); if (Object.op_Implicit((Object)(object)bodypart) && Object.op_Implicit((Object)(object)bodypart2)) { Bodypart bodypart3 = ragdoll.GetBodypart((BodypartType)3); Vector3 val = (Object.op_Implicit((Object)(object)bodypart3) ? ((Component)bodypart3).transform.position : (((Component)bodypart2).transform.position + Vector3.up * 0.3f)) - ((Component)bodypart).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.ProjectOnPlane(((Component)bodypart2).transform.forward, normalized); if (((Vector3)(ref val2)).sqrMagnitude < 0.0001f) { val2 = Vector3.ProjectOnPlane(p.data.lookDirection, normalized); } ((Vector3)(ref val2)).Normalize(); Vector3 val3 = Vector3.Lerp(((Component)bodypart).transform.position, ((Component)bodypart2).transform.position, 0.7f) - val2 * 0.2f; Quaternion val4 = Quaternion.AngleAxis(22f, val2) * Quaternion.LookRotation(normalized, val2); ((Component)this).transform.SetPositionAndRotation(val3, val4); ((Component)this).transform.localScale = Vector3.one; model.localRotation = Quaternion.identity; model.localPosition = Vector3.zero; } } public void Fling(Vector3 velocity, float spin = 14f, bool slippery = false) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Expected O, but got Unknown if (Flying) { return; } Vector3 position = model.position; Quaternion rotation = model.rotation; model.localRotation = Quaternion.identity; model.localPosition = Vector3.zero; ((Component)this).transform.SetPositionAndRotation(position + Vector3.up * 0.05f, rotation); flyCol = ((Component)this).gameObject.AddComponent<BoxCollider>(); flyCol.size = new Vector3(0.21f, 0.08f, 0.8f); flyCol.center = new Vector3(0f, -0.025f, 0f); if (slippery) { if ((Object)(object)slipperyMat == (Object)null) { slipperyMat = new PhysicsMaterial("CWSkate_Wheels") { dynamicFriction = 0.03f, staticFriction = 0.05f, frictionCombine = (PhysicsMaterialCombine)2, bounciness = 0.05f }; } ((Collider)flyCol).sharedMaterial = slipperyMat; } flyRig = ((Component)this).gameObject.AddComponent<Rigidbody>(); flyRig.mass = 1.5f; flyRig.interpolation = (RigidbodyInterpolation)1; flyRig.collisionDetectionMode = (CollisionDetectionMode)2; flyRig.linearVelocity = velocity; flyRig.angularVelocity = Random.insideUnitSphere * spin; flyTime = 0f; } public void StopFling() { if (Object.op_Implicit((Object)(object)flyRig)) { Object.DestroyImmediate((Object)(object)flyRig); } if (Object.op_Implicit((Object)(object)flyCol)) { Object.DestroyImmediate((Object)(object)flyCol); } flyRig = null; flyCol = null; } public static void SetSkinOwner(ItemInstanceData data, int actor) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (data != null && actor > 0) { IntEntry val = default(IntEntry); if (!data.TryGetEntry<IntEntry>(ref val)) { val = new IntEntry(); data.AddDataEntry((ItemDataEntry)(object)val); } val.i = actor; } } private static int SkinOwner(ItemInstanceData data) { IntEntry val = default(IntEntry); if (data == null || !data.TryGetEntry<IntEntry>(ref val)) { return 0; } return val.i; } private static SkinSet SkinOfActor(int actor) { Player localPlayer = PhotonNetwork.LocalPlayer; if (localPlayer == null || actor == localPlayer.ActorNumber) { return Skins.Local; } return Skins.ForActor(actor); } private void UpdateShadows() { bool flag = !Perf.Low; if (flag == shadowsOn) { return; } shadowsOn = flag; MeshRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<MeshRenderer>(true); foreach (MeshRenderer val in componentsInChildren) { if (!((Object)val).name.StartsWith("CWSkate_")) { ((Renderer)val).shadowCastingMode = (ShadowCastingMode)(flag ? 1 : 0); } } } private void Update() { //IL_0151: Unknown result type (might be due to invalid IL or missing references) UpdateShadows(); if (isItem) { skinCheck -= Time.deltaTime; if (skinCheck <= 0f) { skinCheck = 0.5f; if ((Object)(object)itemInstance == (Object)null) { itemInstance = ((Component)this).GetComponentInParent<ItemInstance>(); } ItemInstanceData data = (((Object)(object)itemInstance != (Object)null) ? itemInstance.instanceData : null); ApplyUpgrades(BoardUpgrades.Of(data)); Player componentInParent = ((Component)this).GetComponentInParent<Player>(); if (pro) { ApplySkin(Skins.RideToHell); } else if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.refs.view != (Object)null) { int ownerActorNr = componentInParent.refs.view.OwnerActorNr; SetSkinOwner(data, ownerActorNr); ApplySkin(componentInParent.IsLocal ? Skins.Local : Skins.ForActor(ownerActorNr)); } else { int num = SkinOwner(data); if (num > 0) { ApplySkin(SkinOfActor(num)); } else if (skinVersion < 0) { ApplySkin(Skins.Default); } } } } if (Flying) { flyTime += Time.deltaTime; if (OutOfWorld && !flyRig.isKinematic) { flyRig.linearVelocity = Vector3.zero; flyRig.isKinematic = true; } } } } internal static class EmoteBlock { [HarmonyPatch(typeof(PlayerEmotes), "Update")] private static class Patch_EmoteKey { private static bool Prefix(PlayerEmotes __instance) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) try { Player component = ((Component)__instance).GetComponent<Player>(); if ((Object)(object)component == (Object)null || !component.IsLocal || !component.input.emoteIsPressed || component.data.emoteTime > 0f || !Riding(component)) { return true; } PlayerInventory val = default(PlayerInventory); if (!component.TryGetInventory(ref val) || !IsBlocked(val.emote)) { return true; } if (Time.time - lastPopup > 2f) { lastPopup = Time.time; SkateHUD.Popup(Lang.T("НА ДОСКЕ ТАК НЕЛЬЗЯ", "CAN'T DO THAT ON A BOARD"), new Color(1f, 0.7f, 0.4f), 1.6f, small: true); } return false; } catch { return true; } } } [HarmonyPatch(typeof(PlayerEmotes), "DoEmote")] private static class Patch_DoEmote { private static bool Prefix(PlayerEmotes __instance, Item emote) { try { return !Riding(((Component)__instance).GetComponent<Player>()) || !IsBlocked(emote); } catch { return true; } } } private static string cachedSetting; private static string[] blocked = new string[0]; private static float lastPopup = -10f; public static bool IsBlocked(Item emote) { if ((Object)(object)emote == (Object)null) { return false; } string text = SkatePlugin.BlockedEmotes.Value ?? ""; if (text != cachedSetting) { cachedSetting = text; blocked = text.Split(new char[2] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < blocked.Length; i++) { blocked[i] = blocked[i].Trim().ToLowerInvariant(); } } string text2 = ((emote.emoteInfo != null) ? (emote.emoteInfo.animationName ?? "") : ""); string text3 = (text2 + "|" + ((Object)emote).name + "|" + emote.displayName).ToLowerInvariant(); string[] array = blocked; foreach (string text4 in array) { if (text4.Length != 0 && (text2.ToLowerInvariant() == text4 || text3.Contains(text4))) { return true; } } return false; } private static bool Riding(Player p) { if ((Object)(object)p == (Object)null) { return false; } if (p.IsLocal) { if ((Object)(object)SkateController.Local != (Object)null && (Object)(object)SkateController.Local.player == (Object)(object)p) { return SkateController.Local.Riding; } return false; } return NetSync.GetState(p) == 2; } } internal static class ExternalForces { [HarmonyPatch(typeof(PlayerRagdoll), "AddForce", new Type[] { typeof(Vector3), typeof(ForceMode) })] private static class Patch_AddForce { private static void Prefix(PlayerRagdoll __instance, Vector3 force, ForceMode forceMode) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (IsRider(__instance)) { Add(force, forceMode, 1f); } } } [HarmonyPatch(typeof(PlayerRagdoll), "AddForce", new Type[] { typeof(Vector3), typeof(ForceMode), typeof(Vector3), typeof(float) })] private static class Patch_AddForceFalloff { private static void Prefix(PlayerRagdoll __instance, Vector3 force, ForceMode forceMode) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (IsRider(__instance)) { Add(force, forceMode, 0.6f); } } } [HarmonyPatch(typeof(Player), "RPCA_AddForceToBodyParts")] private static class Patch_BodyParts { private static void Prefix(Player __instance, Vector3[] vector3s) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (vector3s == null || !IsRider(__instance.refs.ragdoll)) { return; } Vector3 force = Vector3.zero; for (int i = 0; i < vector3s.Length; i++) { Vector3 val = vector3s[i]; if (((Vector3)(ref val)).sqrMagnitude > ((Vector3)(ref force)).sqrMagnitude) { force = val; } } Add(force, (ForceMode)2, 0.4f); } } [HarmonyPatch(typeof(Player), "TakeDamage")] private static class Patch_Damage { private static void Prefix(Player __instance, float damage) { if (!SponsorItems.Invulnerable && !fromTrampoline && IsRider(__instance.refs.ragdoll)) { Damage += damage; } } } [HarmonyPatch(typeof(PlayerController), "FixedUpdate")] private static class Patch_OwnController { private static void Prefix(out bool __state) { __state = Self; Self = true; } private static void Finalizer(bool __state) { Self = __state; } } [HarmonyPatch(typeof(BlackHole), "FixedUpdate")] private static class Patch_BlackHole { private static void Postfix(BlackHole __instance) { //IL_0048: 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_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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d3: 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) try { Player localPlayer = Player.localPlayer; if (!((Object)(object)localPlayer == (Object)null) && IsRider(localPlayer.refs.ragdoll) && !((Object)(object)__instance.scale == (Object)null) && !((Object)(object)__instance.inner == (Object)null)) { float num = __instance.scale.localScale.x * 0.5f; float num2 = num * __instance.inner.localScale.x; num = num * 1.2f + 20f; Vector3 val = localPlayer.Center(); float num3 = Vector3.Distance(((Component)__instance).transform.position, val); if (!(num3 > num)) { float num4 = Mathf.InverseLerp(num, num2, num3); Accel += (((Component)__instance).transform.position - val) * (__instance.force * num4 * num4 * 0.5f); } } } catch { } } } [HarmonyPatch(typeof(Trampoline), "CollideWithSurface")] private static class Patch_TrampolineCollide { private static bool Prefix(Bodypart part) { try { Player val = (((Object)(object)part != (Object)null) ? ((Component)part).GetComponentInParent<Player>() : null); return (Object)(object)val == (Object)null || !IsRider(val.refs.ragdoll); } catch { return true; } } } [HarmonyPatch(typeof(Trampoline), "FixedUpdate")] private static class Patch_TrampolineFixed { private static void Prefix() { fromTrampoline = true; } private static void Finalizer() { fromTrampoline = false; } } public static Vector3 Impulse; public static Vector3 Accel; public static float Damage; public static bool Self; private static bool fromTrampoline; private static bool IsRider(PlayerRagdoll rag) { SkateController local = SkateController.Local; if ((Object)(object)local != (Object)null && local.Riding && (Object)(object)local.player != (Object)null) { return (Object)(object)local.player.refs.ragdoll == (Object)(object)rag; } return false; } private static void Add(Vector3 force, ForceMode mode, float scale) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected I4, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (!Self && !fromTrampoline) { switch ((int)mode) { case 2: Impulse += force * scale; break; case 5: Accel += force * scale; break; case 1: Impulse += force * (scale / 60f); break; case 0: Accel += force * (scale / 60f); break; case 3: case 4: break; } } } public static void Clear() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Impulse = (Accel = Vector3.zero); Damage = 0f; } } internal static class GrabPose { private class BoneMemo { public Quaternion baseRot; public Quaternion setRot; } [HarmonyPatch(typeof(PlayerRagdoll), "FollowAnim")] private static class Patch_GrabIK { private static void Prefix(PlayerRagdoll __instance) { try { Player player = __instance.player; if ((Object)(object)player == (Object)null || player.ai) { return; } if (player.IsLocal) { SkateController local = SkateController.Local; if ((Object)(object)local != (Object)null && (Object)(object)local.player == (Object)(object)player) { local.ApplyPoseIK(); } } else { RemoteBoard component = ((Component)player).GetComponent<RemoteBoard>(); if ((Object)(object)component != (Object)null) { component.ApplyPoseIK(); } } } catch (Exception ex) { SkatePlugin.Log.LogWarning((object)("Grab pose: " + ex.Message)); } } } private static readonly Dictionary<Transform, BoneMemo> memo = new Dictionary<Transform, BoneMemo>(); private static bool warnedChain; public static bool IsBody(Grab g) { if (g != Grab.Airwalk) { return g == Grab.Superman; } return true; } public static void Target(Grab g, bool goofy, out BodypartType hand, out Vector3 local) { //IL_0018: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected I4, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected I4, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected I4, but got Unknown //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_00ab: Expected I4, but got Unknown //IL_00be: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected I4, but got Unknown //IL_00dc: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected I4, but got Unknown //IL_00fa: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Expected I4, but got Unknown //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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Expected I4, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) float num = (goofy ? (-1f) : 1f); BodypartType val = (BodypartType)(goofy ? 10 : 7); BodypartType val2 = (BodypartType)(goofy ? 7 : 10); switch (g) { case Grab.Melon: hand = (BodypartType)(int)val; local = new Vector3((0f - num) * 0.105f, -0.01f, 0.05f); break; case Grab.Nosegrab: hand = (BodypartType)(int)val; local = new Vector3(0f, -0.005f, 0.37f); break; case Grab.Tailgrab: hand = (BodypartType)(int)val2; local = new Vector3(0f, -0.005f, -0.37f); break; case Grab.Stalefish: hand = (BodypartType)(int)val2; local = new Vector3((0f - num) * 0.105f, -0.01f, -0.13f); break; case Grab.Crail: hand = (BodypartType)(int)val2; local = new Vector3(0f, -0.005f, 0.37f); break; case Grab.Airwalk: hand = (BodypartType)(int)val; local = new Vector3(0f, -0.005f, 0.37f); break; case Grab.Superman: hand = (BodypartType)(int)val; local = new Vector3((0f - num) * 0.1f, -0.01f, 0.28f); break; default: hand = (BodypartType)(int)val2; local = new Vector3(num * 0.105f, -0.01f, -0.04f); break; } } private static bool SecondHand(Grab g, bool goofy, out BodypartType hand, out Vector3 local) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) float num = (goofy ? (-1f) : 1f); hand = (BodypartType)(goofy ? 7 : 10); local = new Vector3(num * 0.1f, -0.01f, 0.28f); return g == Grab.Superman; } public static Vector3 MeetOffset(PlayerRagdoll rag, BodypartType hand, Vector3 grabPointWorld, float blend) { //IL_0001: 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_0022: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Bodypart bodypart = rag.GetBodypart(hand); if ((Object)(object)bodypart == (Object)null) { return Vector3.zero; } return Vector3.ClampMagnitude((((Component)bodypart).transform.position - grabPointWorld) * (0.6f * blend), 0.45f); } public static Vector3 BodyAnchor(PlayerRagdoll rag, Grab g, Vector3 hipPos, Vector3 nose) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: 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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (g == Grab.Superman) { Bodypart bodypart = rag.GetBodypart((BodypartType)2); return (Object.op_Implicit((Object)(object)bodypart) ? ((Component)bodypart).transform.position : (hipPos + Vector3.up * 0.3f)) - Vector3.up * 0.35f + nose * 0.3f; } return hipPos - Vector3.up * 0.5f + nose * 0.12f; } public static Quaternion SupermanRotation(Quaternion normal, Vector3 nose, float blend) { //IL_000a: 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_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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (blend <= 0.001f) { return normal; } Vector3 val = nose * 0.9f + Vector3.up * 0.45f; Vector3 normalized = ((Vector3)(ref val)).normalized; val = Vector3.ProjectOnPlane(Vector3.down, normalized); Vector3 normalized2 = ((Vector3)(ref val)).normalized; return Quaternion.Slerp(normal, Quaternion.LookRotation(normalized2, normalized), blend * 0.85f); } public static void ApplyForces(PlayerRagdoll rag, Grab g, bool goofy, Transform deck, float blend) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rag == (Object)null || (Object)(object)deck == (Object)null || blend <= 0.01f || g == Grab.None) { return; } Bodypart bodypart = rag.GetBodypart((BodypartType)0); if (!((Object)(object)bodypart == (Object)null) && !((Object)(object)bodypart.rig == (Object)null)) { Vector3 linearVelocity = bodypart.rig.linearVelocity; Target(g, goofy, out var hand, out var local); Hand(rag, hand, deck.TransformPoint(local), linearVelocity, blend); if (SecondHand(g, goofy, out var hand2, out var local2)) { Hand(rag, hand2, deck.TransformPoint(local2), linearVelocity, blend); } } } private static Transform Anim(PlayerRagdoll rag, BodypartType t) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Bodypart bodypart = rag.GetBodypart(t); if (!((Object)(object)bodypart != (Object)null) || !((Object)(object)bodypart.animationTarget != (Object)null)) { return null; } return ((Component)bodypart.animationTarget).transform; } private static void Restore(Transform t) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0069: 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) if (!((Object)(object)t == (Object)null)) { if (!memo.TryGetValue(t, out var value)) { memo[t] = new BoneMemo { baseRot = t.localRotation, setRot = t.localRotation }; } else if (Quaternion.Angle(t.localRotation, value.setRot) > 0.05f) { value.baseRot = t.localRotation; } else { t.localRotation = value.baseRot; } } } private static void Remember(Transform t) { //IL_001a: 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) if ((Object)(object)t != (Object)null && memo.TryGetValue(t, out var value)) { value.setRot = t.localRotation; } } public static void ApplyIK(PlayerRagdoll rag, Grab g, bool goofy, Transform deck, float blend) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: 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_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_022b: 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_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0249: 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_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028b: 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_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: 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_030a: 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_0327: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //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_0365: 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_0371: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: 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_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: 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_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: 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_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: 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_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rag == (Object)null || (Object)(object)deck == (Object)null || g == Grab.None || blend <= 0.01f || (Object)(object)rag.player == (Object)null) { return; } Bodypart bodypart = rag.GetBodypart((BodypartType)0); Transform animatorTransform = rag.player.refs.animatorTransform; Vector3 physHip; Vector3 animHip; if (!((Object)(object)bodypart == (Object)null) && !((Object)(object)bodypart.animationTarget == (Object)null) && !((Object)(object)animatorTransform == (Object)null)) { if (memo.Count > 400) { memo.Clear(); } Vector3 forward = animatorTransform.forward; Vector3 up = animatorTransform.up; Vector3 right = animatorTransform.right; physHip = ((Component)bodypart).transform.position; animHip = ((Component)bodypart.animationTarget).transform.position; Transform val = Anim(rag, (BodypartType)2); Transform val2 = Anim(rag, (BodypartType)5); Transform val3 = Anim(rag, (BodypartType)6); Transform handL = Anim(rag, (BodypartType)7); Transform val4 = Anim(rag, (BodypartType)8); Transform val5 = Anim(rag, (BodypartType)9); Transform handR = Anim(rag, (BodypartType)10); Transform val6 = Anim(rag, (BodypartType)11); Transform val7 = Anim(rag, (BodypartType)12); Transform val8 = Anim(rag, (BodypartType)13); Transform val9 = Anim(rag, (BodypartType)14); Transform val10 = Anim(rag, (BodypartType)15); Transform val11 = Anim(rag, (BodypartType)16); Transform[] array = (Transform[])(object)new Transform[9] { val, val2, val3, val4, val5, val6, val7, val9, val10 }; Transform[] array2 = array; for (int i = 0; i < array2.Length; i++) { Restore(array2[i]); } if (!IsBody(g) && (Object)(object)val != (Object)null) { float num = ((g == Grab.Stalefish || g == Grab.Melon) ? 20f : 30f); val.rotation = Quaternion.Slerp(Quaternion.identity, Quaternion.AngleAxis(num, right), blend) * val.rotation; } bool num2 = !goofy; Transform val12 = (num2 ? val6 : val9); Transform val13 = (num2 ? val7 : val10); Transform val14 = (num2 ? val8 : val11); Transform val15 = (num2 ? val9 : val6); Transform val16 = (num2 ? val10 : val7); Transform val17 = (num2 ? val11 : val8); Vector3 val18 = forward + up * 0.3f; switch (g) { case Grab.Airwalk: LegOut(val12, val13, val14, forward * 0.6f - up * 0.8f, val18, blend); LegOut(val15, val16, val17, -forward * 0.55f - up * 0.83f, val18, blend); break; case Grab.Superman: LegOut(val12, val13, val14, -up + right * 0.08f, val18, blend); LegOut(val15, val16, val17, -up - right * 0.08f, val18, blend); break; default: { Vector3 val19 = deck.up * 0.075f; Solve(val12, val13, val14, ToAnim(deck.TransformPoint(new Vector3(0f, 0.012f, 0.19f)) + val19), val18, blend); Solve(val15, val16, val17, ToAnim(deck.TransformPoint(new Vector3(0f, 0.012f, -0.19f)) + val19), val18, blend); break; } } Target(g, goofy, out var hand, out var local); Arm(hand, ToAnim(deck.TransformPoint(local)), right, up, val2, val3, handL, val4, val5, handR, blend); if (SecondHand(g, goofy, out var hand2, out var local2)) { Arm(hand2, ToAnim(deck.TransformPoint(local2)), right, up, val2, val3, handL, val4, val5, handR, blend); } array2 = array; for (int i = 0; i < array2.Length; i++) { Remember(array2[i]); } } Vector3 ToAnim(Vector3 world) { //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_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_0012: Unknown result type (might be due to invalid IL or missing references) return animHip + (world - physHip); } } public static void ApplyReach(PlayerRagdoll rag, BodypartType hand, Vector3 worldPoint, float blend) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Invalid comparison between Unknown and I4 //IL_00c1: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_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_0108: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0151: 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) if ((Object)(object)rag == (Object)null || blend <= 0.01f || (Object)(object)rag.player == (Object)null) { return; } Bodypart bodypart = rag.GetBodypart((BodypartType)0); Transform animatorTransform = rag.player.refs.animatorTransform; if (!((Object)(object)bodypart == (Object)null) && !((Object)(object)bodypart.animationTarget == (Object)null) && !((Object)(object)animatorTransform == (Object)null)) { if (memo.Count > 400) { memo.Clear(); } Vector3 val = ((Component)bodypart.animationTarget).transform.position + (worldPoint - ((Component)bodypart).transform.position); bool flag = (int)hand == 7; Transform val2 = Anim(rag, (BodypartType)(flag ? 5 : 8)); Transform val3 = Anim(rag, (BodypartType)(flag ? 6 : 9)); Transform val4 = Anim(rag, hand); if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val3 == (Object)null) && !((Object)(object)val4 == (Object)null)) { Restore(val2); Restore(val3); Vector3 val5 = val2.position - val; Vector3 target = val + ((Vector3)(ref val5)).normalized * 0.05f; Solve(val2, val3, val4, target, (flag ? (-animatorTransform.right) : animatorTransform.right) * 0.6f - animatorTransform.up * 0.4f, blend); Remember(val2); Remember(val3); } } } public static void ApplyTrainHold(PlayerRagdoll rag, Player front, Vector3 myRight, float blend) { //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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_0101: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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) if ((Object)(object)rag == (Object)null || (Object)(object)front == (Object)null || (Object)(object)front.refs.ragdoll == (Object)null || blend <= 0.01f) { return; } PlayerRagdoll ragdoll = front.refs.ragdoll; Bodypart bodypart = ragdoll.GetBodypart((BodypartType)0); Bodypart bodypart2 = ragdoll.GetBodypart((BodypartType)2); if (!((Object)(object)bodypart == (Object)null)) { Vector3 val = (((Object)(object)bodypart2 != (Object)null) ? (((Component)bodypart2).transform.position + Vector3.up * 0.15f) : (((Component)bodypart).transform.position + Vector3.up * 0.55f)); Bodypart bodypart3 = ragdoll.GetBodypart((BodypartType)25); Bodypart bodypart4 = ragdoll.GetBodypart((BodypartType)26); Vector3 val2 = (((Object)(object)bodypart3 != (Object)null) ? ((Component)bodypart3).transform.position : (val - myRight * 0.18f)); Vector3 val3 = (((Object)(object)bodypart4 != (Object)null) ? ((Component)bodypart4).transform.position : (val + myRight * 0.18f)); if (Vector3.Dot(val2 - val3, myRight) > 0f) { Vector3 val4 = val2; val2 = val3; val3 = val4; } ApplyReach(rag, (BodypartType)7, val2 + Vector3.up * 0.04f, blend); ApplyReach(rag, (BodypartType)10, val3 + Vector3.up * 0.04f, blend); } } public static Vector3 KickFootSpot(Transform deck, Vector3 faceDir, float t) { //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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_0137: 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_014b: 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_0162: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_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_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_017f: 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_0190: Unknown result type (might be due to invalid IL or missing references) Vector3 val = deck.TransformPoint(new Vector3(0f, 0.012f, -0.19f)) + deck.up * 0.075f; Vector3 forward = deck.forward; Vector3 val2 = Vector3.ProjectOnPlane(Vector3.ProjectOnPlane(faceDir, deck.up), forward); val2 = ((((Vector3)(ref val2)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val2)).normalized : deck.right); Vector3 val3 = deck.position + val2 * 0.24f; RaycastHit val5 = default(RaycastHit); Vector3 val4 = (Physics.Raycast(val3 + Vector3.up * 0.4f, Vector3.down, ref val5, 1.2f, LayerMask.op_Implicit(HelperFunctions.GetMask((LayerType)1)), (QueryTriggerInteraction)1) ? ((RaycastHit)(ref val5)).point : (val3 - deck.up * 0.1f)); Vector3 val6 = Vector3.up * 0.07f; Vector3 val7 = val4 + forward * 0.12f + val6; Vector3 val8 = val4 - forward * 0.42f - val2 * 0.04f + val6; if (t < 0.22f) { float num = t / 0.22f; return Vector3.Lerp(val, val7, Mathf.SmoothStep(0f, 1f, num)) + Vector3.up * Mathf.Sin(num * MathF.PI) * 0.08f; } if (t < 0.72f) { return Vector3.Lerp(val7, val8, (t - 0.22f) / 0.5f); } float num2 = Mathf.Clamp01((t - 0.72f) / 0.28f); return Vector3.Lerp(val8, val, Mathf.SmoothStep(0f, 1f, num2)) + Vector3.up * Mathf.Sin(num2 * MathF.PI) * 0.12f; } public static void ApplyFeetOnDeck(PlayerRagdoll rag, bool goofy, Transform deck, float blend, float kick = -1f) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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_0147: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rag == (Object)null || (Object)(object)deck == (Object)null || blend <= 0.01f || (Object)(object)rag.player == (Object)null) { return; } Bodypart bodypart = rag.GetBodypart((BodypartType)0); Transform animatorTransform = rag.player.refs.animatorTransform; Vector3 physHip; Vector3 animHip; if (!((Object)(object)bodypart == (Object)null) && !((Object)(object)bodypart.animationTarget == (Object)null) && !((Object)(object)animatorTransform == (Object)null)) { if (memo.Count > 400) { memo.Clear(); } physHip = ((Component)bodypart).transform.position; animHip = ((Component)bodypart.animationTarget).transform.position; Transform val = Anim(rag, (BodypartType)11); Transform val2 = Anim(rag, (BodypartType)12); Transform val3 = Anim(rag, (BodypartType)13); Transform val4 = Anim(rag, (BodypartType)14); Transform val5 = Anim(rag, (BodypartType)15); Transform val6 = Anim(rag, (BodypartType)16); Transform[] array = (Transform[])(object)new Transform[4] { val, val2, val4, val5 }; Transform[] array2 = array; for (int i = 0; i < array2.Length; i++) { Restore(array2[i]); } bool flag = !goofy; Vector3 val7 = deck.up * 0.075f; Vector3 poleDir = animatorTransform.forward + animatorTransform.up * 0.3f; Solve(flag ? val : val4, flag ? val2 : val5, flag ? val3 : val6, ToAnim(deck.TransformPoint(new Vector3(0f, 0.012f, 0.19f)) + val7), poleDir, blend); Vector3 world = ((kick >= 0f && kick < 1f) ? KickFootSpot(deck, animatorTransform.forward, kick) : (deck.TransformPoint(new Vector3(0f, 0.012f, -0.19f)) + val7)); Solve(flag ? val4 : val, flag ? val5 : val2, flag ? val6 : val3, ToAnim(world), poleDir, blend); array2 = array; for (int i = 0; i < array2.Length; i++) { Remember(array2[i]); } } Vector3 ToAnim(Vector3 val8) { //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_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_0012: Unknown result type (might be due to invalid IL or missing references) return animHip + (val8 - physHip); } } public static void ApplyTuck(PlayerRagdoll rag, float blend, bool back) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017d: 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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: 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_01a8: 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_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: 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_01ca: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_0172: 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_020c: 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_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0236: 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_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0277: 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_0288: 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_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: 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) if ((Object)(object)rag == (Object)null || blend <= 0.01f || (Object)(object)rag.player == (Object)null) { return; } Transform animatorTransform = rag.player.refs.animatorTransform; if (!((Object)(object)animatorTransform == (Object)null)) { if (memo.Count > 400) { memo.Clear(); } Vector3 forward = animatorTransform.forward; Vector3 up = animatorTransform.up; Vector3 right = animatorTransform.right; Transform val = Anim(rag, (BodypartType)2); Transform val2 = Anim(rag, (BodypartType)5); Transform val3 = Anim(rag, (BodypartType)6); Transform end = Anim(rag, (BodypartType)7); Transform val4 = Anim(rag, (BodypartType)8); Transform val5 = Anim(rag, (BodypartType)9); Transform end2 = Anim(rag, (BodypartType)10); Transform val6 = Anim(rag, (BodypartType)11); Transform val7 = Anim(rag, (BodypartType)12); Transform val8 = Anim(rag, (BodypartType)13); Transform val9 = Anim(rag, (BodypartType)14); Transform val10 = Anim(rag, (BodypartType)15); Transform val11 = Anim(rag, (BodypartType)16); Transform[] array = (Transform[])(object)new Transform[9] { val, val2, val3, val4, val5, val6, val7, val9, val10 }; Transform[] array2 = array; for (int i = 0; i < array2.Length; i++) { Restore(array2[i]); } if ((Object)(object)val != (Object)null) { val.rotation = Quaternion.Slerp(Quaternion.identity, Quaternion.AngleAxis(back ? 8f : 38f, right), blend) * val.rotation; } Vector3 pole = forward + up * 0.8f; float reach = (back ? 0.12f : 0.42f); Tuck(val6, val7, val8, forward, up, -right * 0.04f, pole, reach, blend); Tuck(val9, val10, val11, forward, up, right * 0.04f, pole, reach, blend); if ((Object)(object)val7 != (Object)null && (Object)(object)val8 != (Object)null && (Object)(object)val2 != (Object)null) { Solve(val2, val3, end, Vector3.Lerp(val7.position, val8.position, 0.4f) + forward * 0.05f, -right * 0.7f - up * 0.2f, blend); } if ((Object)(object)val10 != (Object)null && (Object)(object)val11 != (Object)null && (Object)(object)val4 != (Object)null) { Solve(val4, val5, end2, Vector3.Lerp(val10.position, val11.position, 0.4f) + forward * 0.05f, right * 0.7f - up * 0.2f, blend); } array2 = array; for (int i = 0; i < array2.Length; i++) { Remember(array2[i]); } } } private static void Tuck(Transform leg, Transform knee, Transform foot, Vector3 fwd, Vector3 up, Vector3 side, Vector3 pole, float reach, float blend) { //IL_001d: 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_0036: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)leg == (Object)null) && !((Object)(object)knee == (Object)null) && !((Object)(object)foot == (Object)null)) { Vector3 val = knee.position - leg.position; float magnitude = ((Vector3)(ref val)).magnitude; val = foot.position - knee.position; float num = magnitude + ((Vector3)(ref val)).magnitude; Vector3 position = leg.position; val = -up * 0.62f + fwd * reach; Vector3 target = position + ((Vector3)(ref val)).normalized * (num * 0.4f) + side; Solve(leg, knee, foot, target, pole, blend); } } private static void Arm(BodypartType hand, Vector3 grabPoint, Vector3 right, Vector3 up, Transform armL, Transform elbowL, Transform handL, Transform armR, Transform elbowR, Transform handR, float blend) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_002d: 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_003a: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) bool flag = (int)hand == 7; Transform val = (flag ? armL : armR); Transform lower = (flag ? elbowL : elbowR); Transform end = (flag ? handL : handR); if (!((Object)(object)val == (Object)null)) { Vector3 val2 = val.position - grabPoint; Vector3 target = grabPoint + ((Vector3)(ref val2)).normalized * 0.05f; Vector3 poleDir = (flag ? (-right) : right) * 0.7f - up * 0.2f; Solve(val, lower, end, target, poleDir, blend); } } private static void LegOut(Transform leg, Transform knee, Transform foot, Vector3 dir, Vector3 pole, float blend) { //IL_001d: 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_0036: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unkn