Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Quads Parkour v0.1.0
plugins/Parkour.dll
Decompiled 4 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using DHack.Shared; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json.Linq; using TMPro; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyMetadata("AI_Assisted_Creation", "This assembly was partially or fully created with the assistance of Generative AI (Claude Code).")] [assembly: AssemblyMetadata("AI_Model_Vendor", "Anthropic")] [assembly: AssemblyMetadata("ClaudeTools.Reload", "world")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Parkour { internal static class Bar { private const string Name = "parkour_bar"; private static readonly Color Blue = new Color(0.3f, 0.62f, 1f); private static readonly Color PaleBlue = new Color(0.62f, 0.82f, 1f); private static GameObject _bar; private static RectTransform _rect; private static GuiBar _fast; private static GuiBar _slow; private static TMP_Text _count; private static Animator _anim; private static CanvasGroup _group; private static float _shownAt = -10f; private static float _value; public static bool Showing { get { if ((Object)(object)_bar != (Object)null) { return Time.time - _shownAt < 1f; } return false; } } public static float Value => _value; public static void Destroy() { if ((Object)(object)_bar != (Object)null) { Object.Destroy((Object)(object)_bar); } _bar = null; _rect = null; _fast = (_slow = null); _count = null; _anim = null; _group = null; _shownAt = -10f; } public static void Late() { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; Hud instance = Hud.instance; if ((Object)(object)localPlayer == (Object)null || (Object)(object)instance == (Object)null || (Object)(object)instance.m_staminaBar2Root == (Object)null) { return; } float num = ((Plugin.Enabled.Value && Plugin.ShowBar.Value) ? Moves.BarValue(localPlayer) : (-1f)); if (num >= 0f) { _shownAt = Time.time; _value = num; } bool flag = Time.time - _shownAt < 1f; if ((Object)(object)_bar == (Object)null && (!flag || !Make(instance))) { return; } RectTransform staminaBar2Root = instance.m_staminaBar2Root; Rect rect = staminaBar2Root.rect; float num2 = Mathf.Max(32f, ((Rect)(ref rect)).width - 16f); RectTransform rect2 = _rect; Vector2 anchoredPosition = staminaBar2Root.anchoredPosition; rect = staminaBar2Root.rect; rect2.anchoredPosition = anchoredPosition + new Vector2(0f, ((Rect)(ref rect)).height + 2f); _rect.SetSizeWithCurrentAnchors((Axis)0, num2 + 16f); GuiBar fast = _fast; if (fast != null) { fast.SetWidth(num2); } GuiBar slow = _slow; if (slow != null) { slow.SetWidth(num2); } GuiBar fast2 = _fast; if (fast2 != null) { fast2.SetValue(_value); } GuiBar slow2 = _slow; if (slow2 != null) { slow2.SetValue(_value); } if ((Object)(object)_count != (Object)null) { string text = ((Moves.State == Move.WallRun || (Moves.State == Move.None && Moves.KicksUsed > 0)) ? Moves.KicksLeft(localPlayer).ToString() : ""); if (_count.text != text) { _count.text = text; } } if ((Object)(object)_anim != (Object)null) { _anim.SetBool("Visible", flag); } else if ((Object)(object)_group != (Object)null) { _group.alpha = Mathf.MoveTowards(_group.alpha, flag ? 1f : 0f, Time.deltaTime * 3f); } } private static bool Make(Hud hud) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) RectTransform staminaBar2Root = hud.m_staminaBar2Root; Transform parent = ((Transform)staminaBar2Root).parent; if ((Object)(object)parent == (Object)null) { return false; } foreach (Transform item in (from Transform t in (IEnumerable)parent where ((Object)t).name == "parkour_bar" select t).ToList()) { Object.Destroy((Object)(object)((Component)item).gameObject); } _bar = Object.Instantiate<GameObject>(((Component)staminaBar2Root).gameObject, parent); ((Object)_bar).name = "parkour_bar"; _bar.SetActive(true); _rect = (RectTransform)_bar.transform; GuiBar[] componentsInChildren = _bar.GetComponentsInChildren<GuiBar>(true); _fast = ((IEnumerable<GuiBar>)componentsInChildren).FirstOrDefault((Func<GuiBar, bool>)((GuiBar b) => (Object)(object)hud.m_staminaBar2Fast != (Object)null && ((Object)b).name == ((Object)hud.m_staminaBar2Fast).name)) ?? componentsInChildren.FirstOrDefault(); _slow = ((IEnumerable<GuiBar>)componentsInChildren).FirstOrDefault((Func<GuiBar, bool>)((GuiBar b) => (Object)(object)b != (Object)(object)_fast && (Object)(object)hud.m_staminaBar2Slow != (Object)null && ((Object)b).name == ((Object)hud.m_staminaBar2Slow).name)); Tint(_fast, Blue); if ((Object)(object)_slow != (Object)null) { ((Component)_slow).gameObject.SetActive(false); _slow = null; } if ((Object)(object)_fast != (Object)null) { _fast.m_smoothFill = false; _fast.m_smoothDrain = false; } _count = (((Object)(object)hud.m_staminaText != (Object)null) ? ((IEnumerable<TMP_Text>)_bar.GetComponentsInChildren<TMP_Text>(true)).FirstOrDefault((Func<TMP_Text, bool>)((TMP_Text t) => ((Object)t).name == ((Object)hud.m_staminaText).name)) : null); if ((Object)(object)_count != (Object)null) { _count.text = ""; } _anim = null; Animator staminaAnimator = hud.m_staminaAnimator; if ((Object)(object)staminaAnimator != (Object)null && ((Object)(object)((Component)staminaAnimator).transform == (Object)(object)staminaBar2Root || ((Component)staminaAnimator).transform.IsChildOf((Transform)(object)staminaBar2Root))) { string text = Path((Transform)(object)staminaBar2Root, ((Component)staminaAnimator).transform); Transform val = ((text.Length == 0) ? _bar.transform : _bar.transform.Find(text)); _anim = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent<Animator>() : null); if ((Object)(object)_anim != (Object)null && !_anim.parameters.Any((AnimatorControllerParameter x) => x.name == "Visible")) { _anim = null; } } _group = null; if ((Object)(object)_anim == (Object)null) { _group = _bar.GetComponent<CanvasGroup>(); if ((Object)(object)_group == (Object)null) { _group = _bar.AddComponent<CanvasGroup>(); } _group.alpha = 0f; } return (Object)(object)_fast != (Object)null; } private static void Tint(GuiBar bar, Color color) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)bar == (Object)null)) { bar.SetColor(color); Image val = (((Object)(object)bar.m_bar != (Object)null) ? ((Component)bar.m_bar).GetComponent<Image>() : null); if ((Object)(object)val != (Object)null) { ((Graphic)val).color = color; } } } private static string Path(Transform root, Transform t) { string text = ""; while ((Object)(object)t != (Object)null && (Object)(object)t != (Object)(object)root) { text = ((text.Length == 0) ? ((Object)t).name : (((Object)t).name + "/" + text)); t = t.parent; } return text; } } internal static class Compat { public const string SmoothClimbingGuid = "hansenbansen.smoothclimbing"; public const string JustVaultGuid = "com.igentuman.justvault"; public const string ClimbingGuid = "com.rabid-wolf.valheim.skills.climbing"; public static bool SmoothClimbing; public static bool JustVault; public static bool Climbing; private static bool _checked; private static MethodInfo _isClimbing; private static MethodInfo _isMantling; private static readonly int ClimbingKey = StringExtensionMethods.GetStableHashCode("IsClimbing"); public static bool ClimbOff => SmoothClimbing; public static bool LedgeOff => SmoothClimbing; public static void Reset() { _checked = false; SmoothClimbing = (JustVault = (Climbing = false)); _isClimbing = (_isMantling = null); } public static void Check() { if (!_checked) { _checked = true; SmoothClimbing = Installed("hansenbansen.smoothclimbing", "Valheim_Climbing_Mod.ClimbingState"); JustVault = Installed("com.igentuman.justvault", "JustVault.VaultController"); Climbing = Installed("com.rabid-wolf.valheim.skills.climbing", null); if (SmoothClimbing) { _isClimbing = Method("Valheim_Climbing_Mod.ClimbingState", "IsClimbing"); _isMantling = Method("Valheim_Climbing_Mod.ClimbRig", "IsMantling"); Plugin.Log.LogInfo((object)"Smooth Climbing is installed: Parkour's wall climb and ledge grab are off (it climbs walls and pulls up over the top itself). Wall runs, wall jumps and landing rolls stay, and wait while it climbs."); } if (JustVault) { Plugin.Log.LogInfo((object)"Just Vault is installed: the two take turns (a move ends while it vaults). To vault up from a ledge instead of pulling up, turn Parkour's PullUp setting off."); } if (Climbing) { Plugin.Log.LogInfo((object)"Climbing (the skill) is installed: no overlap with Parkour."); } } } public static bool SmoothClimbingBusy(Player p, ZDO zdo) { if (!SmoothClimbing) { return false; } if (zdo != null && zdo.GetBool(ClimbingKey, false)) { return true; } if (!Ask(_isClimbing, p)) { return Ask(_isMantling, p); } return true; } public static string Summary() { return (SmoothClimbing ? "Smooth Climbing: wall climb and ledge grab off; " : "") + (JustVault ? "Just Vault: taking turns; " : "") + (Climbing ? "Climbing: no overlap; " : "") + ((!SmoothClimbing && !JustVault && !Climbing) ? "none of the climbing mods installed" : ""); } private static bool Installed(string guid, string typeName) { if (Chainloader.PluginInfos.ContainsKey(guid)) { return true; } if (typeName == null) { return false; } try { return AccessTools.TypeByName(typeName) != null; } catch (Exception) { return false; } } private static MethodInfo Method(string type, string name) { try { MethodInfo methodInfo = AccessTools.TypeByName(type)?.GetMethod(name, BindingFlags.Static | BindingFlags.Public, null, new Type[1] { typeof(Player) }, null); return (methodInfo != null && methodInfo.ReturnType == typeof(bool)) ? methodInfo : null; } catch (Exception) { return null; } } private static bool Ask(MethodInfo m, Player p) { if (m == null) { return false; } try { return (bool)m.Invoke(null, new object[1] { p }); } catch (Exception) { return false; } } } internal static class Controls { internal sealed class Drive { public Vector3 Move; public bool Run; public float Until; public readonly List<float> Jumps = new List<float>(); public readonly List<float> Crouches = new List<float>(); public float HoldCrouchFrom = -1f; public float HoldCrouchUntil = -1f; public bool CrouchDown { get { if (Time.time >= HoldCrouchFrom) { return Time.time <= HoldCrouchUntil; } return false; } } public bool Over => Time.time > Until; public static bool Take(List<float> presses) { for (int i = 0; i < presses.Count; i++) { if (Time.time >= presses[i]) { presses.RemoveAt(i); return true; } } return false; } } [HarmonyPatch(typeof(Player), "CheckRun")] private static class Player_CheckRun { private static bool Prefix(Player __instance, ref bool __result) { if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer || Moves.State == Parkour.Move.None) { return true; } __result = true; return false; } } [HarmonyPatch(typeof(Player), "SetControls")] private static class Player_SetControls { [HarmonyPriority(200)] private static void Prefix(Player __instance, ref Vector3 movedir, ref bool attack, ref bool attackHold, ref bool secondaryAttack, ref bool secondaryAttackHold, ref bool block, ref bool blockHold, ref bool jump, ref bool crouch, ref bool run, ref bool autoRun, ref bool dodge) { //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_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) if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer)) { Drive drive = Driving; if (drive != null && drive.Over) { drive = (Driving = null); } if (drive != null) { movedir = drive.Move; run = drive.Run; jump = Drive.Take(drive.Jumps); crouch = Drive.Take(drive.Crouches); attack = (attackHold = (secondaryAttack = (secondaryAttackHold = (block = (blockHold = (autoRun = (dodge = false))))))); } Move = movedir; Run = run; CrouchHeld = drive?.CrouchDown ?? (Moves.TakingInput(__instance) && !InventoryGui.IsVisible() && (ZInput.GetButton("Crouch") || ZInput.GetButton("JoyCrouch"))); if (jump) { _jumpAt = Time.time; } if (jump && Moves.TakesJump(__instance)) { jump = false; } if (crouch && Moves.TakesCrouch(__instance)) { crouch = false; } } } } public static Vector3 Move; public static bool Run; public static bool CrouchHeld; private static float _jumpAt = -10f; public static Drive Driving; public static bool Forward => Move.z > 0.3f; public static bool Back => Move.z < -0.3f; public static bool JumpPressed(float within) { return Time.time - _jumpAt <= within; } public static void Reset() { //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) Move = Vector3.zero; Run = false; _jumpAt = -10f; Driving = null; } } internal static class Feel { [HarmonyPatch(typeof(FootStep), "OnFoot", new Type[] { typeof(Transform) })] private static class FootStep_OnFoot { private static bool Prefix(FootStep __instance) { if (Plugin.Sounds.Value && (Moves.State == Move.WallRun || Moves.State == Move.Climb) && !((Object)(object)Player.m_localPlayer == (Object)null)) { return (Object)(object)((Component)__instance).gameObject != (Object)(object)((Component)Player.m_localPlayer).gameObject; } return true; } } [HarmonyPatch(typeof(GameCamera), "LateUpdate")] private static class GameCamera_LateUpdate { private static void Postfix(GameCamera __instance) { try { Apply(__instance); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Parkour camera: " + ex.Message)); } } } private const float StepEvery = 0.3f; private const float RollDegrees = 8f; private const float RollEase = 0.25f; private const float FovAdd = 6f; private const float FovSeconds = 0.4f; private static float _nextStep; private static float _roll; private static float _fovAt = -10f; private static int _pieceLayer; private static readonly Func<FootStep, GroundMaterial, MotionType, int> BestStep = AccessTools.MethodDelegate<Func<FootStep, GroundMaterial, MotionType, int>>(AccessTools.Method(typeof(FootStep), "FindBestStepEffect", (Type[])null, (Type[])null), (object)null, true); private static readonly FieldRef<GameCamera, Camera> CameraOf = AccessTools.FieldRefAccess<GameCamera, Camera>("m_camera"); private static readonly FieldRef<Character, bool> GameSliding = AccessTools.FieldRefAccess<Character, bool>("m_sliding"); private static bool _cleaned; public static void Reset() { _nextStep = 0f; _roll = 0f; _fovAt = -10f; } public static void Touch(Player p, Walls.Wall wall) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Step(p, wall.Collider, wall.Normal, Foot(p, wall), (MotionType)32); _nextStep = Time.time + 0.3f; } public static void OnWall(Player p, Walls.Wall wall) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (!(Time.time < _nextStep)) { _nextStep = Time.time + 0.3f; Step(p, wall.Collider, wall.Normal, Foot(p, wall), (MotionType)8); } } public static void Grab(Player p, Walls.Ledge ledge) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) Step(p, ledge.Top, Vector3.up, ledge.Edge, (MotionType)32); } public static void PullUp(Player p) { //IL_0018: 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_0035: Unknown result type (might be due to invalid IL or missing references) if (Plugin.Sounds.Value) { ((Character)p).m_jumpEffects.Create(((Component)p).transform.position, ((Component)p).transform.rotation, ((Component)p).transform, 1f, -1, ((Character)p).GetZDOID()); } Widen(); } public static void Ground(Player p, MotionType motion) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) Step(p, ((Character)p).GetLastGroundCollider(), ((Character)p).GetLastGroundNormal(), ((Component)p).transform.position, motion); } public static void SlideDust(Player p) { if (Plugin.Sounds.Value) { GameSliding.Invoke((Character)(object)p) = true; } } public static void CleanUpOnce() { Player localPlayer = Player.m_localPlayer; if (_cleaned || (Object)(object)localPlayer == (Object)null || (Object)(object)ZNetScene.instance == (Object)null) { return; } _cleaned = true; HashSet<string> hashSet = new HashSet<string>(); EffectData[] effectPrefabs = ((Character)localPlayer).m_slideEffects.m_effectPrefabs; foreach (EffectData val in effectPrefabs) { if ((Object)(object)val.m_prefab != (Object)null) { hashSet.Add(((Object)val.m_prefab).name + "(Clone)"); } } if (hashSet.Count == 0) { return; } int num = 0; GameObject[] array = Object.FindObjectsByType<GameObject>((FindObjectsSortMode)0); foreach (GameObject val2 in array) { if ((Object)(object)val2 == (Object)null || (Object)(object)val2.transform.parent != (Object)null || !hashSet.Contains(((Object)val2).name)) { continue; } ZNetView component = val2.GetComponent<ZNetView>(); if ((Object)(object)component != (Object)null && component.IsValid()) { if (component.IsOwner()) { ZNetScene.instance.Destroy(val2); num++; } } else { Object.Destroy((Object)(object)val2); num++; } } if (num > 0) { Plugin.Log.LogInfo((object)$"Removed {num} slide effect(s) an earlier build left running"); } } public static void OnTop(Player p, Walls.Ledge ledge) { //IL_0007: 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) Step(p, ledge.Top, Vector3.up, ((Component)p).transform.position, (MotionType)32); } public static void RollLanding(Player p, float height) { //IL_0010: 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) if (height <= 0.8f) { Step(p, ((Character)p).GetLastGroundCollider(), ((Character)p).GetLastGroundNormal(), ((Component)p).transform.position, (MotionType)32); } } private static void Step(Player p, Collider surface, Vector3 normal, Vector3 at, MotionType motion) { //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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between Unknown and I4 //IL_0095: 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) if (!Plugin.Sounds.Value || (Object)(object)p == (Object)null || BestStep == null) { return; } FootStep component = ((Component)p).GetComponent<FootStep>(); ZNetView component2 = ((Component)p).GetComponent<ZNetView>(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component2 == (Object)null) && component2.IsValid()) { GroundMaterial arg = MaterialOf(surface, normal, at); int num = BestStep(component, arg, motion); if (num < 0 && (int)motion != 2) { num = BestStep(component, arg, (MotionType)2); } if (num >= 0) { component2.InvokeRPC(ZNetView.Everybody, "Step", new object[2] { num, at }); } } } private static GroundMaterial MaterialOf(Collider c, Vector3 normal, Vector3 at) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected I4, but got Unknown if ((Object)(object)c == (Object)null) { return (GroundMaterial)1; } Heightmap component = ((Component)c).GetComponent<Heightmap>(); if ((Object)(object)component != (Object)null) { return component.GetGroundMaterial(normal, at, 0.6f); } FootStepCollider component2 = ((Component)c).GetComponent<FootStepCollider>(); if ((Object)(object)component2 != (Object)null) { return component2.m_material; } if (_pieceLayer == 0) { _pieceLayer = LayerMask.NameToLayer("piece"); } if (((Component)c).gameObject.layer != _pieceLayer) { return (GroundMaterial)1; } WearNTear componentInParent = ((Component)c).GetComponentInParent<WearNTear>(); if ((Object)(object)componentInParent == (Object)null) { return (GroundMaterial)1; } MaterialType materialType = componentInParent.m_materialType; switch ((int)materialType) { case 0: case 3: return (GroundMaterial)8; case 1: case 4: case 5: case 6: return (GroundMaterial)4; case 2: return (GroundMaterial)256; case 7: return (GroundMaterial)16384; default: return (GroundMaterial)1; } } private static Vector3 Foot(Player p, Walls.Wall wall) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0097: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_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) FootStep component = ((Component)p).GetComponent<FootStep>(); Vector3 val = ((Component)p).transform.position + Vector3.up * 0.3f; float num = float.MaxValue; if ((Object)(object)component != (Object)null) { Transform[] feet = component.m_feet; foreach (Transform val2 in feet) { if (!((Object)(object)val2 == (Object)null)) { float num2 = Vector3.Dot(val2.position - wall.Point, wall.Normal); if (num2 < num) { num = num2; val = val2.position; } } } } return val - wall.Normal * Vector3.Dot(val - wall.Point, wall.Normal); } public static void Widen() { _fovAt = Time.unscaledTime; } private static void Apply(GameCamera cam) { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; float unscaledDeltaTime = Time.unscaledDeltaTime; if (!((Object)(object)localPlayer != (Object)null) || ((Character)localPlayer).IsDead() || ((Character)localPlayer).InCutscene() || ((Character)localPlayer).IsAttached() || GameCamera.InFreeFly() || Menu.IsVisible() || Minimap.IsOpen() || InventoryGui.IsVisible() || StoreGui.IsVisible() || !Plugin.Enabled.Value) { _roll = 0f; return; } float num = 0f; if (Plugin.CameraTilt.Value && Moves.State == Move.WallRun) { float num2 = ((Vector3.Dot(((Component)cam).transform.right, -Moves.WallNormal) >= 0f) ? 1f : (-1f)); num = -8f * num2; } _roll = Mathf.MoveTowards(_roll, num, 32f * unscaledDeltaTime); if (Mathf.Abs(_roll) > 0.01f) { Transform transform = ((Component)cam).transform; transform.rotation *= Quaternion.Euler(0f, 0f, _roll); } float num3 = (Time.unscaledTime - _fovAt) / 0.4f; if (Plugin.FovKick.Value && !(num3 < 0f) && !(num3 >= 1f)) { float fieldOfView = cam.m_fov + 6f * (1f - num3) * (1f - num3); Camera val = CameraOf.Invoke(cam); if ((Object)(object)val != (Object)null) { val.fieldOfView = fieldOfView; } if ((Object)(object)cam.m_skyCamera != (Object)null) { cam.m_skyCamera.fieldOfView = fieldOfView; } } } } internal static class Look { [HarmonyPatch(typeof(Player), "UpdateCrouch")] private static class Player_UpdateCrouch { private static readonly int Crouching = ZSyncAnimation.GetHash("crouching"); private static void Postfix(Player __instance) { if (Moves.State == Move.Slide && __instance == Player.m_localPlayer) { ZSyncAnimation obj = Anim.Invoke((Character)(object)__instance); if (obj != null) { obj.SetBool(Crouching, true); } } } } [HarmonyPatch(typeof(Character), "UpdateGroundTilt")] private static class Character_UpdateGroundTilt { private static Vector3 _saved; private static bool _swapped; private static void Prefix(Character __instance) { //IL_0023: 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_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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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) if (_leaning && Moves.State != Move.None && (object)__instance == Player.m_localPlayer) { float num = _leanDegrees * ((float)Math.PI / 180f); Vector3 val = Vector3.up * Mathf.Cos(num) + _leanNormal * Mathf.Sin(num); _saved = GroundNormal.Invoke(__instance); GroundNormal.Invoke(__instance) = (val - Vector3.up * 0.35f) / 0.65f; _swapped = true; } } private static void Finalizer(Character __instance) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (_swapped) { GroundNormal.Invoke(__instance) = _saved; _swapped = false; } } } private sealed class Body { public Player Player; public Transform Root; public Transform LArm; public Transform LFore; public Transform LHand; public Transform RArm; public Transform RFore; public Transform RHand; public Transform Hips; public Transform LLeg; public Transform RLeg; public Transform LKnee; public Transform LFoot; public Transform LToe; public Transform RKnee; public Transform RFoot; public Transform RToe; public Transform Neck; public Transform Head; public Vector3 LToeAxis; public Vector3 LTopAxis; public Vector3 RToeAxis; public Vector3 RTopAxis; public float ArmW; public float HangW; public float PullW; public float PullT; public float PullOver; public bool Vault; public float SlideW; public Vector3 SlideDir; public Transform Spine1; public Transform Spine2; public Vector3 LPlant; public Vector3 RPlant; public Vector3 FootFrom; public Vector3 FootTo; public bool PlantsSet; public bool LWall; public bool RWall; public int FootStepping; public int LastFoot; public float FootT; public int Pose; public float PoseAt; public Vector3 Edge; public Vector3 EdgeNormal; public float Hold; public Vector3 LGrip; public Vector3 RGrip; public Vector3 StepFrom; public Vector3 StepTo; public bool GripsSet; public int Stepping; public int LastHand; public float StepT; public float ShimmySide; public float ShimmySpeed; public float ShimmyAt = -10f; public float Swing; } private static Vector3 _leanNormal; private static float _leanDegrees; private static bool _leaning; private static readonly FieldRef<Character, ZSyncAnimation> Anim = AccessTools.FieldRefAccess<Character, ZSyncAnimation>("m_zanim"); private static readonly FieldRef<Character, Vector3> GroundNormal = AccessTools.FieldRefAccess<Character, Vector3>("m_lastGroundNormal"); private static readonly int OnGround = ZSyncAnimation.GetHash("onGround"); private static readonly int Falling = ZSyncAnimation.GetHash("falling"); private static readonly int ForwardSpeed = ZSyncAnimation.GetHash("forward_speed"); private static readonly int SidewaySpeed = ZSyncAnimation.GetHash("sideway_speed"); private static readonly Dictionary<Player, Body> Bodies = new Dictionary<Player, Body>(); private static readonly List<Player> Gone = new List<Player>(); private static float _nextSweep; private const float PoseRange = 40f; private const float Blend = 0.15f; private const bool PlantFeet = false; public static float LocalShimmy { get { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer != (Object)null) || !Bodies.TryGetValue(localPlayer, out var value) || !(Time.time - value.ShimmyAt < 0.15f)) { return 0f; } return value.ShimmySide * value.ShimmySpeed; } } public static void Reset() { Stop(); Bodies.Clear(); Gone.Clear(); _nextSweep = 0f; } public static void Stop() { _leaning = false; Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null && Bodies.TryGetValue(localPlayer, out var value)) { value.Hold = 0f; } } public static void Lean(Vector3 normal, float degrees) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) _leanNormal = normal; _leanDegrees = degrees; _leaning = true; } public static void Running(Player p, float speed) { Animate(p, feetDown: true, speed); } public static void Sliding(Player p, Vector3 dir) { //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) Animate(p, feetDown: true, 0f); Body body = BodyOf(p); body.SlideDir = dir; } public static void Hanging(Player p, Vector3 edge, Vector3 normal) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_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) Animate(p, feetDown: true, 0f); Body body = BodyOf(p); if (Moves.State == Move.Hang && body.Hold <= 0f) { body.GripsSet = false; } body.Edge = edge; body.EdgeNormal = normal; body.Hold = 1f; } public static void Shimmying(float side, float speed) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { Body body = BodyOf(localPlayer); body.ShimmySide = side; body.ShimmySpeed = speed; body.ShimmyAt = Time.time; } } public static void PullingUp(Player p, Vector3 edge, Vector3 normal, float over, float progress, bool vault) { //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_001b: 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) Animate(p, feetDown: true, 0f); Body body = BodyOf(p); body.Edge = edge; body.EdgeNormal = normal; body.Hold = 1f - over; body.PullT = progress; body.PullOver = over; body.Vault = vault; } private static void Animate(Player p, bool feetDown, float speed) { ZSyncAnimation val = Anim.Invoke((Character)(object)p); if (!((Object)(object)val == (Object)null)) { val.SetBool(OnGround, feetDown); val.SetBool(Falling, false); val.SetFloat(ForwardSpeed, speed); val.SetFloat(SidewaySpeed, 0f); } } private static Body BodyOf(Player p) { if (!Bodies.TryGetValue(p, out var value)) { Dictionary<Player, Body> bodies = Bodies; Body obj = new Body { Player = p }; value = obj; bodies[p] = obj; } return value; } public static void Late() { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_011a: 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_0120: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_029e: 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_02ac: 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_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: 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_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null && Bodies.TryGetValue(localPlayer, out var value)) { if (Moves.State == Move.Hang || Moves.State == Move.PullUp) { value.Pose = ((Moves.State == Move.Hang) ? 1 : 2); } else { value.Pose = ((Moves.State == Move.Slide) ? 5 : 0); value.Hold = 0f; } if (value.Pose != 0 || value.ArmW > 0f || value.HangW > 0f || value.PullW > 0f || value.SlideW > 0f) { Pose(value); } } Vector3 val = (((Object)(object)localPlayer != (Object)null) ? ((Component)localPlayer).transform.position : (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.position : Vector3.zero)); List<Player> allPlayers = Player.GetAllPlayers(); for (int i = 0; i < allPlayers.Count; i++) { Player val2 = allPlayers[i]; if ((Object)(object)val2 == (Object)null || (Object)(object)val2 == (Object)(object)localPlayer) { continue; } Vector3 val3 = ((Component)val2).transform.position - val; if (((Vector3)(ref val3)).sqrMagnitude > 1600f) { continue; } ZDO val4 = Share.ZdoOf(val2); Vector3 edge = Vector3.zero; Vector3 normal = Vector3.zero; float shimmy = 0f; int num = ((val4 != null) ? Share.Read(val4, out edge, out normal, out shimmy) : 0); bool flag = num == 6; if (flag) { num = 2; } if (num == 1 || num == 2 || num == 5) { if (num != 5) { val3 = ((Component)val2).transform.position - edge; if (((Vector3)(ref val3)).sqrMagnitude > 9f) { goto IL_01b4; } } Body body = BodyOf(val2); if (body.Pose != num) { if (num == 1) { body.GripsSet = false; } else if (body.Pose != 1) { body.PlantsSet = false; } body.Pose = num; body.PoseAt = Time.time; } if (num == 5) { body.SlideDir = -normal; body.Hold = 0f; Pose(body); continue; } Vector3 val5 = Vector3.Cross(Vector3.up, -normal); body.Edge = edge + val5 * Vector3.Dot(((Component)val2).transform.position - edge, val5); body.EdgeNormal = normal; if (Mathf.Abs(shimmy) > 0.05f) { body.ShimmySide = Mathf.Sign(shimmy); body.ShimmySpeed = Mathf.Abs(shimmy); body.ShimmyAt = Time.time; } body.Vault = flag; body.PullT = (Time.time - body.PoseAt) / 0.4f; body.PullOver = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01((body.PullT - 0.6f) / 0.4f)); body.Hold = ((num == 1) ? 1f : (1f - body.PullOver)); Pose(body); continue; } goto IL_01b4; IL_01b4: if (Bodies.TryGetValue(val2, out var value2)) { value2.Pose = 0; value2.Hold = 0f; if (value2.ArmW > 0f || value2.HangW > 0f || value2.PullW > 0f || value2.SlideW > 0f) { Pose(value2); } } } if (Time.time < _nextSweep) { return; } _nextSweep = Time.time + 2f; foreach (KeyValuePair<Player, Body> body2 in Bodies) { if ((Object)(object)body2.Key == (Object)null || ((Object)(object)body2.Key != (Object)(object)localPlayer && body2.Value.Pose == 0 && body2.Value.ArmW <= 0f && body2.Value.HangW <= 0f && body2.Value.PullW <= 0f && body2.Value.SlideW <= 0f)) { Gone.Add(body2.Key); } } for (int j = 0; j < Gone.Count; j++) { Bodies.Remove(Gone[j]); } Gone.Clear(); } private static void Pose(Body b) { //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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0064: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_008c: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: 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_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: 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_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: 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_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)b.LHand == (Object)null) { Rig(b); } if ((Object)(object)b.LHand == (Object)null || (Object)(object)b.RHand == (Object)null) { return; } Vector3 val = -b.EdgeNormal; Vector3 val2 = Vector3.Cross(Vector3.up, val); Vector3 val3 = b.Edge + b.EdgeNormal * 0.06f + Vector3.up * 0.03f; Vector3 val4 = val3 - val2 * 0.22f; Vector3 val5 = val3 + val2 * 0.22f; bool flag = b.Pose == 1; bool flag2 = flag && Time.time - b.ShimmyAt < 0.15f; b.ArmW = Mathf.MoveTowards(b.ArmW, b.Hold, Time.deltaTime / 0.15f); b.HangW = Mathf.MoveTowards(b.HangW, flag ? 1f : 0f, Time.deltaTime / 0.15f); b.PullW = Mathf.MoveTowards(b.PullW, (b.Pose == 2) ? 1f : 0f, Time.deltaTime / 0.15f); b.SlideW = Mathf.MoveTowards(b.SlideW, (b.Pose == 5) ? 1f : 0f, Time.deltaTime / ((b.Pose == 5) ? 0.12f : 0.15f)); if (!b.GripsSet) { b.LGrip = val4; b.RGrip = val5; b.GripsSet = true; b.Stepping = 0; b.PlantsSet = false; } if (flag) { Shuffle(b, val4, val5, val2, flag2); } else if (b.Pose == 2) { float num = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(b.PullOver * 2f)); Vector3 val6 = b.Edge - b.EdgeNormal * 0.18f + Vector3.up * 0.02f; b.LGrip = Vector3.Lerp(val4, val6 - val2 * 0.28f, num); b.RGrip = Vector3.Lerp(val5, val6 + val2 * 0.28f, num); } b.Swing = Mathf.MoveTowards(b.Swing, flag2 ? 1f : 0f, Time.deltaTime * 4f); if (b.Swing > 0f && (Object)(object)b.Hips != (Object)null) { float num2 = Mathf.Sin(Time.time * (float)Math.PI * 2f * Mathf.Max(1.2f, b.ShimmySpeed * 1.4f)); b.Hips.rotation = Quaternion.AngleAxis(num2 * 6f * b.Swing, val) * Quaternion.AngleAxis(b.ShimmySide * 4f * b.Swing, Vector3.up) * b.Hips.rotation; if ((Object)(object)b.LLeg != (Object)null) { b.LLeg.rotation = Quaternion.AngleAxis(num2 * 12f * b.Swing, val2) * b.LLeg.rotation; } if ((Object)(object)b.RLeg != (Object)null) { b.RLeg.rotation = Quaternion.AngleAxis((0f - num2) * 12f * b.Swing, val2) * b.RLeg.rotation; } } if (b.HangW > 0f) { HangingBody(b, val, val2, flag2); } if (b.PullW > 0f) { PullingBody(b, val, val2); } if (b.SlideW > 0f) { SlidingBody(b); } Reach(b.LArm, b.LFore, b.LHand, Lifted(b, b.LGrip, -1), -val2 - Vector3.up * 0.4f + b.EdgeNormal * 0.3f, b.ArmW); Reach(b.RArm, b.RFore, b.RHand, Lifted(b, b.RGrip, 1), val2 - Vector3.up * 0.4f + b.EdgeNormal * 0.3f, b.ArmW); } private static void HangingBody(Body b, Vector3 forward, Vector3 right, bool moving) { //IL_0050: 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_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_00c1: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_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_0102: 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_011f: 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_0156: 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_0158: 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_0178: 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_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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) float hangW = b.HangW; if ((Object)(object)b.Hips != (Object)null) { float num = Mathf.Sin(Time.time * (float)Math.PI * 2f / 2.5f) * 2.5f * (1f - b.Swing) * hangW; b.Hips.rotation = Quaternion.AngleAxis(num, forward) * b.Hips.rotation; } if (!((Object)(object)b.LLeg == (Object)null) && !((Object)(object)b.LKnee == (Object)null) && !((Object)(object)b.LFoot == (Object)null) && !((Object)(object)b.RLeg == (Object)null) && !((Object)(object)b.RKnee == (Object)null) && !((Object)(object)b.RFoot == (Object)null)) { Vector3 edgeNormal = b.EdgeNormal; Vector3 val = FootHome(b.LLeg.position, LegLength(b.LLeg, b.LKnee, b.LFoot), edgeNormal, right, -1f, out b.LWall); Vector3 val2 = FootHome(b.RLeg.position, LegLength(b.RLeg, b.RKnee, b.RFoot), edgeNormal, right, 1f, out b.RWall); if (!b.PlantsSet) { b.LPlant = val; b.RPlant = val2; b.PlantsSet = true; b.FootStepping = 0; } Feet(b, val, val2, right, moving); Leg(b.LLeg, b.LKnee, b.LFoot, b.LToeAxis, b.LTopAxis, Raised(b, b.LPlant, -1), edgeNormal, b.LWall, hangW); Leg(b.RLeg, b.RKnee, b.RFoot, b.RToeAxis, b.RTopAxis, Raised(b, b.RPlant, 1), edgeNormal, b.RWall, hangW); } } private static void PullingBody(Body b, Vector3 forward, Vector3 right) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_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_013e: 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_0146: 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_0156: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00ac: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_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_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0387: 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_038d: Unknown result type (might be due to invalid IL or missing references) //IL_038e: 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_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: 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) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024a: 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_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028c: 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_0292: 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_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: 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_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: 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_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) float pullW = b.PullW; if (!((Object)(object)b.LLeg == (Object)null) && !((Object)(object)b.LKnee == (Object)null) && !((Object)(object)b.LFoot == (Object)null) && !((Object)(object)b.RLeg == (Object)null) && !((Object)(object)b.RKnee == (Object)null) && !((Object)(object)b.RFoot == (Object)null)) { Vector3 edgeNormal = b.EdgeNormal; if (!b.PlantsSet) { b.LPlant = FootHome(b.LLeg.position, LegLength(b.LLeg, b.LKnee, b.LFoot), edgeNormal, right, -1f, out b.LWall); b.RPlant = FootHome(b.RLeg.position, LegLength(b.RLeg, b.RKnee, b.RFoot), edgeNormal, right, 1f, out b.RWall); b.PlantsSet = true; } float pullOver = b.PullOver; float num = Mathf.Sin(Mathf.Clamp01(b.PullT / 0.35f) * (float)Math.PI) * 0.15f; Vector3 val = b.LPlant + Vector3.up * num; Vector3 val2 = b.RPlant + Vector3.up * num; Vector3 val3 = b.Edge - edgeNormal * 0.28f + Vector3.up * 0.03f; float num2 = (b.Vault ? 12f : 25f) * pullOver * pullW; Turn(b.Spine1, right, num2 * 0.5f); Turn(b.Spine2, right, num2 * 0.5f); Vector3 val4 = edgeNormal + Vector3.up * 0.2f; if (b.Vault) { float num3 = Mathf.Sin(pullOver * (float)Math.PI); Vector3 val5 = val3 - edgeNormal * (0.4f * pullOver) + right * (0.45f * num3) + Vector3.up * (0.2f * num3); float num4 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(pullOver * 1.5f)); Vector3 pole = Vector3.Lerp(val4, right + Vector3.up, num4); LegAt(b.LLeg, b.LKnee, b.LFoot, b.LToeAxis, b.LTopAxis, Vector3.Lerp(val, val5 - right * 0.1f, num4), pole, Vector3.Lerp(-edgeNormal, right, num4), pullW); LegAt(b.RLeg, b.RKnee, b.RFoot, b.RToeAxis, b.RTopAxis, Vector3.Lerp(val2, val5 + right * 0.06f, num4), pole, Vector3.Lerp(-edgeNormal, right, num4), pullW); } else { float num5 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(pullOver * 2f)); float num6 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(pullOver * 2f - 1f)); LegAt(b.RLeg, b.RKnee, b.RFoot, b.RToeAxis, b.RTopAxis, Vector3.Lerp(val2, val3 + right * 0.1f, num5), Vector3.Lerp(val4, forward * 0.3f + Vector3.up, num5), Vector3.Lerp(-edgeNormal, forward - Vector3.up * 0.5f, num5), pullW); LegAt(b.LLeg, b.LKnee, b.LFoot, b.LToeAxis, b.LTopAxis, Vector3.Lerp(val, val3 - edgeNormal * 0.15f - right * 0.1f, num6), Vector3.Lerp(val4, forward * 0.3f + Vector3.up, num6), Vector3.Lerp(-edgeNormal, forward - Vector3.up * 0.5f, num6), pullW); } } } private static void SlidingBody(Body b) { //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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_006b: 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_00b8: 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_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) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024a: 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_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_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_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_0285: 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_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_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) float slideW = b.SlideW; Vector3 slideDir = b.SlideDir; slideDir.y = 0f; if (!(((Vector3)(ref slideDir)).sqrMagnitude < 0.01f)) { ((Vector3)(ref slideDir)).Normalize(); Vector3 val = Vector3.Cross(Vector3.up, slideDir); float y = ((Component)b.Player).transform.position.y; Turn(b.Spine1, val, -6f * slideW); Turn(b.Spine2, val, -6f * slideW); if ((Object)(object)b.RLeg != (Object)null && (Object)(object)b.RKnee != (Object)null && (Object)(object)b.RFoot != (Object)null) { Vector3 position = b.RLeg.position; Vector3 target = new Vector3(position.x, y + 0.12f, position.z) + slideDir * 0.75f; LegAt(b.RLeg, b.RKnee, b.RFoot, b.RToeAxis, b.RTopAxis, target, Vector3.up + slideDir * 0.2f, Vector3.up + slideDir * 0.4f, slideW); } if ((Object)(object)b.LLeg != (Object)null && (Object)(object)b.LKnee != (Object)null && (Object)(object)b.LFoot != (Object)null) { Vector3 position2 = b.LLeg.position; Vector3 target2 = new Vector3(position2.x, y + 0.08f, position2.z) - slideDir * 0.35f - val * 0.05f; LegAt(b.LLeg, b.LKnee, b.LFoot, b.LToeAxis, b.LTopAxis, target2, slideDir + Vector3.down * 0.5f, -slideDir, slideW); } if ((Object)(object)b.LArm != (Object)null && (Object)(object)b.LFore != (Object)null && (Object)(object)b.LHand != (Object)null) { Vector3 val2 = ((Component)b.Player).transform.position - slideDir * 0.35f - val * 0.35f + Vector3.up * 0.6f; RaycastHit val3 = default(RaycastHit); Vector3 target3 = (Vector3)(Physics.Raycast(val2, Vector3.down, ref val3, 1.2f, Walls.Mask, (QueryTriggerInteraction)1) ? (((RaycastHit)(ref val3)).point + Vector3.up * 0.03f) : new Vector3(val2.x, y + 0.03f, val2.z)); Reach(b.LArm, b.LFore, b.LHand, target3, -val + Vector3.up * 0.3f, slideW); } if ((Object)(object)b.RArm != (Object)null && (Object)(object)b.RFore != (Object)null && (Object)(object)b.RHand != (Object)null) { Reach(b.RArm, b.RFore, b.RHand, b.RArm.position + val * 0.45f + slideDir * 0.25f + Vector3.up * 0.05f, Vector3.down - slideDir * 0.3f, slideW); } } } private static Vector3 FootHome(Vector3 hip, float leg, Vector3 n, Vector3 right, float side, out bool wall) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00b8: 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) Vector3 val = hip + right * (side * 0.11f) + Vector3.down * 0.7f + n * 0.4f; RaycastHit val2 = default(RaycastHit); wall = false; float num = (wall ? Vector3.Dot(hip - ((RaycastHit)(ref val2)).point, n) : 0f); if (wall && num > 0f && num < leg * 0.9f) { float num2 = Mathf.Clamp(Mathf.Sqrt(leg * leg - num * num) - 0.12f, 0.55f, 0.85f); Vector3 point = ((RaycastHit)(ref val2)).point; point.y = hip.y - num2; return point + n * 0.07f; } wall = false; return hip + Vector3.down * (leg * 0.96f) + right * (side * 0.05f) - n * 0.05f; } private static float LegLength(Transform hip, Transform knee, Transform foot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) return Vector3.Distance(hip.position, knee.position) + Vector3.Distance(knee.position, foot.position); } private static void Feet(Body b, Vector3 lHome, Vector3 rHome, Vector3 right, bool moving) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_007f: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: 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_01b1: 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_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) b.LPlant = (b.LWall ? (lHome + right * Vector3.Dot(b.LPlant - lHome, right)) : lHome); b.RPlant = (b.RWall ? (rHome + right * Vector3.Dot(b.RPlant - rHome, right)) : rHome); if (b.FootStepping != 0) { b.FootT += Time.deltaTime / 0.22f; Vector3 val = Vector3.Lerp(b.FootFrom, b.FootTo, Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(b.FootT))); if (b.FootStepping < 0) { b.LPlant = val; } else { b.RPlant = val; } if (b.FootT >= 1f) { b.FootStepping = 0; } return; } if (!moving) { b.LPlant = Vector3.MoveTowards(b.LPlant, lHome, Time.deltaTime * 0.8f); b.RPlant = Vector3.MoveTowards(b.RPlant, rHome, Time.deltaTime * 0.8f); return; } float shimmySide = b.ShimmySide; int num = ((shimmySide > 0f) ? 1 : (-1)); int num2 = ((b.LastFoot == num) ? (-num) : num); if ((num2 > 0) ? (!b.RWall) : (!b.LWall)) { b.LastFoot = num2; return; } Vector3 val2 = ((num2 > 0) ? b.RPlant : b.LPlant); Vector3 val3 = ((num2 > 0) ? rHome : lHome); float num3 = 0f - Vector3.Dot(val2 - val3, right * shimmySide); if (num2 == num && num3 > 0.04f) { StepFoot(b, num, val2, val3 + right * shimmySide * 0.12f); } else if (num2 != num && num3 > 0.08f) { StepFoot(b, -num, val2, val3 + right * shimmySide * 0.04f); } } private static void StepFoot(Body b, int foot, Vector3 from, Vector3 to) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) b.FootStepping = foot; b.LastFoot = foot; b.FootT = 0f; b.FootFrom = from; b.FootTo = to; } private static Vector3 Raised(Body b, Vector3 plant, int foot) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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) if (b.FootStepping == foot) { return plant + b.EdgeNormal * (0.1f * Mathf.Sin(Mathf.Clamp01(b.FootT) * (float)Math.PI)); } return plant; } private static void Leg(Transform hip, Transform knee, Transform foot, Vector3 toeAxis, Vector3 topAxis, Vector3 target, Vector3 n, bool wall, float w) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_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_003e: 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) LegAt(hip, knee, foot, toeAxis, topAxis, target, wall ? (n + Vector3.down * 0.5f) : (-n), wall ? (-n * 0.8f + Vector3.down * 0.4f) : (Vector3.down * 0.8f - n * 0.5f), w); } private static void LegAt(Transform hip, Transform knee, Transform foot, Vector3 toeAxis, Vector3 topAxis, Vector3 target, Vector3 pole, Vector3 toes, float w) { //IL_0003: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0040: 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_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_0069: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_009d: 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) Reach(hip, knee, foot, target, pole, w); if (!(w <= 0f) && !(toeAxis == Vector3.zero)) { Vector3 val = Vector3.ProjectOnPlane(Vector3.up, toes); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = Vector3.ProjectOnPlane(pole, toes); } if (!(((Vector3)(ref val)).sqrMagnitude < 0.0001f) && !(((Vector3)(ref toes)).sqrMagnitude < 1E-06f)) { Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref toes)).normalized, ((Vector3)(ref val)).normalized) * Quaternion.Inverse(Quaternion.LookRotation(toeAxis, topAxis)); foot.rotation = ((w >= 1f) ? val2 : Quaternion.Slerp(foot.rotation, val2, w)); } } } private static void FootAxes(Player p, Transform foot, Transform toe, out Vector3 toeAxis, out Vector3 topAxis) { //IL_0003: 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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (toeAxis = (topAxis = Vector3.zero)); if ((Object)(o