using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BoneLib;
using BoneLib.BoneMenu;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSLZ.Marrow;
using MelonLoader;
using NoClipMod;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("NoClipMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0")]
[assembly: AssemblyProduct("NoClipMod")]
[assembly: AssemblyTitle("NoClipMod")]
[assembly: MelonInfo(typeof(global::NoClipMod.NoClipMod), "NoClipMod", "1.3.0", "Sansw", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.0.0")]
[module: UnverifiableCode]
namespace NoClipMod;
public class NoClipMod : MelonMod
{
private bool yWasPressed;
private float lastYPressTime = -10f;
private bool noclipEnabled;
private bool groundDetectorEnabled;
private int calculatedGroundMask;
private Collider[] noclipDisabledColliders;
private const float MinimumGroundNormalY = 0.7f;
private Vector3 smoothedGroundPoint;
private Vector3 smoothedGroundNormal = Vector3.up;
private bool hasSmoothedGround;
private int currentSceneHandle = -1;
private bool groundMaskReady;
private float probeRadius = 0.035f;
private float probeSpread = 0.15f;
private float footSupportDistance = 0.08f;
private float correctionSpeed = 4f;
private float jumpProtectionUntil = -10f;
private bool customGrounded;
private float recoveryRange = 0.5f;
private float nextMaskRefreshTime;
private float maskRefreshUntil;
private const float MaskRefreshDuration = 5f;
private const float MaskRefreshInterval = 0.5f;
private float headToFeetDistance = 1.7f;
private float groundClearance = 0.025f;
private float rayDistance = 3f;
private float groundPointSmooth = 10f;
private float groundNormalSmooth = 10f;
private float supportRange = 0.2f;
private bool jumpRequested;
private bool jumpButtonWasDown;
private FieldInfo aButtonDownField;
private PropertyInfo aButtonDownProperty;
private Vector2 thumbstickInput;
private const float StickDeadzone = 0.12f;
private bool jumpActive;
private bool jumpBindingSearched;
private const float AirWalkGroundNormalY = 0.55f;
private bool airWalkEnabled;
private bool wallTransferEnabled;
private bool menuCreated;
private bool rightBWasPressed;
private bool wallTransferRequested;
private bool wallTransferActive;
private Vector3 currentMoveVelocity;
private Vector3 lastMoveDirection = Vector3.forward;
private float movementSpeed = 3.9f;
private float movementAcceleration = 14f;
private float movementDeceleration = 18f;
private float airControl = 0.9f;
private float airWalkAssistSpeed = 4.5f;
private float airWalkSearchDistance = 7f;
private float airWalkSearchStep = 0.4f;
private bool airWalkVoidHold = true;
private float airWalkSafetyOffset = 0.035f;
private float airWalkHoldFeetY;
private bool hasAirWalkHoldHeight;
private float wallDetectionDistance = 1.8f;
private float wallScanDistance = 8f;
private float wallScanStep = 0.15f;
private float wallClearance = 0.12f;
private float wallProbeRadius = 0.16f;
private float wallTransferCooldownUntil;
private readonly Collider[] transferOverlapBuffer = (Collider[])(object)new Collider[64];
private Collider[] temporaryTransferColliders;
private Page mainPage;
private float jumpVelocity = 5.5f;
private float wallOpenSpaceDepth = 0.9f;
private const float ReferenceJumpVelocity = 5.5f;
private const float JumpProtectionDuration = 0.18f;
private const float JumpUpwardVelocityThreshold = 0.5f;
private const float GroundDeadbandMinimum = 0.012f;
private const float GroundDeadbandMaximum = 0.035f;
public override void OnInitializeMelon()
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
MelonLogger.Msg("NoClip V3 - Natural Movement / Ground / Air Walk / Wall Transfer");
Hooking.OnLevelLoaded += OnLevelLoaded;
Hooking.OnLevelUnloaded += OnLevelUnloaded;
Scene activeScene = SceneManager.GetActiveScene();
currentSceneHandle = ((Scene)(ref activeScene)).handle;
BeginLevelSetup();
TryCreateBoneMenu();
}
public override void OnUpdate()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
try
{
if (!menuCreated)
{
TryCreateBoneMenu();
}
Scene activeScene = SceneManager.GetActiveScene();
int handle = ((Scene)(ref activeScene)).handle;
if (handle != currentSceneHandle)
{
currentSceneHandle = handle;
BeginLevelSetup();
MelonLogger.Msg("Scene changed - ground detector state reset.");
}
if ((Object)(object)Player.PhysicsRig != (Object)null && Time.time <= maskRefreshUntil && Time.time >= nextMaskRefreshTime)
{
BuildGroundMask();
nextMaskRefreshTime = Time.time + 0.5f;
}
if (!Player.HandsExist)
{
thumbstickInput = Vector2.zero;
return;
}
bool flag = false;
bool flag2 = false;
try
{
Hand leftHand = Player.LeftHand;
if ((Object)(object)leftHand != (Object)null && (Object)(object)leftHand.Controller != (Object)null)
{
flag = leftHand.Controller._bButtonDown;
}
}
catch (Exception ex)
{
MelonLogger.Error("Y button input error: " + ex.Message);
}
try
{
Hand rightHand = Player.RightHand;
if ((Object)(object)rightHand != (Object)null && (Object)(object)rightHand.Controller != (Object)null)
{
flag2 = rightHand.Controller._bButtonDown;
}
}
catch (Exception ex2)
{
MelonLogger.Error("Wall transfer button input error: " + ex2.Message);
}
if (flag && !yWasPressed)
{
if (Time.time - lastYPressTime < 0.35f)
{
SetGroundDetectorState(!groundDetectorEnabled);
}
else
{
SetNoClipState(!noclipEnabled);
}
lastYPressTime = Time.time;
}
if (flag2 && !rightBWasPressed && wallTransferEnabled)
{
wallTransferRequested = true;
}
yWasPressed = flag;
rightBWasPressed = flag2;
if (noclipEnabled && !wallTransferActive)
{
ReadThumbstick();
}
else
{
thumbstickInput = Vector2.zero;
}
bool flag3 = ReadJumpButton();
if (flag3 && !jumpButtonWasDown)
{
jumpRequested = true;
}
jumpButtonWasDown = flag3;
}
catch (Exception ex3)
{
MelonLogger.Error("NoClip V3 update error: " + ex3.Message);
}
}
public override void OnFixedUpdate()
{
if ((Object)(object)Player.PhysicsRig == (Object)null)
{
return;
}
try
{
UpdatePlayerMeasurements();
if (wallTransferRequested && !wallTransferActive && Time.time >= wallTransferCooldownUntil)
{
wallTransferRequested = false;
ExecuteWallTransfer();
}
if (wallTransferActive)
{
return;
}
if (noclipEnabled)
{
ApplyNoclipMovement();
}
if (jumpRequested)
{
jumpRequested = false;
if (noclipEnabled && groundDetectorEnabled && customGrounded && !jumpActive)
{
PerformFixedJump();
}
}
RunGroundDetector();
if (noclipEnabled && airWalkEnabled && !wallTransferActive)
{
ApplyAirWalkAssist();
}
}
catch (Exception ex)
{
MelonLogger.Error("NoClip V3 fixed update error: " + ex.Message);
}
}
private void EnableNoClip()
{
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)Player.PhysicsRig == (Object)null)
{
return;
}
try
{
float num = MeasureFootSupportDistance();
if (num > 0.01f)
{
footSupportDistance = num;
}
Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(((Component)Player.PhysicsRig).GetComponentsInChildren<Collider>(true));
noclipDisabledColliders = (Collider[])(object)new Collider[array.Length];
int num2 = 0;
Collider[] array2 = array;
foreach (Collider val in array2)
{
if (!((Object)(object)val == (Object)null) && val.enabled)
{
val.enabled = false;
noclipDisabledColliders[num2++] = val;
}
}
BuildGroundMask();
nextMaskRefreshTime = Time.time;
maskRefreshUntil = Time.time + 5f;
Transform feetTransform = GetFeetTransform();
if ((Object)(object)feetTransform != (Object)null)
{
airWalkHoldFeetY = feetTransform.position.y;
hasAirWalkHoldHeight = true;
}
MelonLogger.Msg("NOCLIP ON - disabled " + num2 + " body collider(s).");
}
catch (Exception ex)
{
MelonLogger.Error("Enable noclip error: " + ex.Message);
}
}
private void DisableNoClip()
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
try
{
int num = 0;
if (noclipDisabledColliders != null)
{
Collider[] array = noclipDisabledColliders;
foreach (Collider val in array)
{
if ((Object)(object)val != (Object)null && !val.enabled)
{
val.enabled = true;
num++;
}
}
}
noclipDisabledColliders = null;
currentMoveVelocity = Vector3.zero;
StopAllRigVelocity();
MelonLogger.Msg("NOCLIP OFF - restored " + num + " player collider(s).");
}
catch (Exception ex)
{
MelonLogger.Error("Disable noclip error: " + ex.Message);
}
}
public override void OnDeinitializeMelon()
{
Hooking.OnLevelLoaded -= OnLevelLoaded;
Hooking.OnLevelUnloaded -= OnLevelUnloaded;
if (wallTransferActive)
{
RestoreTemporaryTransferColliders();
}
if (noclipEnabled)
{
DisableNoClip();
noclipEnabled = false;
}
groundDetectorEnabled = false;
customGrounded = false;
airWalkEnabled = false;
wallTransferEnabled = false;
menuCreated = false;
MelonLogger.Msg("NoClip V3 unloaded - player collisions restored.");
}
private void OnLevelLoaded(LevelInfo info)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
MelonLogger.Msg("=== NOCLIP V3 LEVEL LOADED ===");
Scene activeScene = SceneManager.GetActiveScene();
currentSceneHandle = ((Scene)(ref activeScene)).handle;
BeginLevelSetup();
BuildGroundMask();
UpdatePlayerMeasurements();
SearchJumpBinding();
if (noclipEnabled)
{
noclipDisabledColliders = null;
EnableNoClip();
}
}
private void OnLevelUnloaded()
{
//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_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
groundMaskReady = false;
calculatedGroundMask = 0;
hasSmoothedGround = false;
customGrounded = false;
jumpRequested = false;
jumpActive = false;
jumpButtonWasDown = false;
rightBWasPressed = false;
thumbstickInput = Vector2.zero;
aButtonDownField = null;
aButtonDownProperty = null;
jumpBindingSearched = false;
wallTransferRequested = false;
wallTransferActive = false;
currentMoveVelocity = Vector3.zero;
ResetAirWalkHold();
RestoreTemporaryTransferColliders();
MelonLogger.Msg("NoClip V3: level unloaded.");
}
private void BeginLevelSetup()
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
groundMaskReady = false;
calculatedGroundMask = 0;
hasSmoothedGround = false;
customGrounded = false;
jumpRequested = false;
jumpActive = false;
jumpProtectionUntil = -10f;
nextMaskRefreshTime = Time.time;
maskRefreshUntil = Time.time + 5f;
currentMoveVelocity = Vector3.zero;
ResetAirWalkHold();
}
private float MeasureFootSupportDistance()
{
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
try
{
Transform feetTransform = GetFeetTransform();
if ((Object)(object)feetTransform == (Object)null)
{
return 0f;
}
Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(((Component)feetTransform).GetComponents<Collider>());
if (array == null || array.Length == 0)
{
return 0f;
}
float num = float.MaxValue;
Collider[] array2 = array;
foreach (Collider val in array2)
{
if ((Object)(object)val != (Object)null)
{
float num2 = num;
Bounds bounds = val.bounds;
num = Mathf.Min(num2, ((Bounds)(ref bounds)).min.y);
}
}
if (num == float.MaxValue)
{
return 0f;
}
return Mathf.Clamp(feetTransform.position.y - num, 0.02f, Mathf.Max(0.15f, headToFeetDistance * 0.12f));
}
catch
{
return 0f;
}
}
private void SmoothGround(Vector3 point, Vector3 normal)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_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_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_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_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)
float num = 1f - Mathf.Exp((0f - groundPointSmooth) * Time.fixedDeltaTime);
float num2 = 1f - Mathf.Exp((0f - groundNormalSmooth) * Time.fixedDeltaTime);
if (!hasSmoothedGround)
{
smoothedGroundPoint = point;
smoothedGroundNormal = normal;
hasSmoothedGround = true;
}
else
{
smoothedGroundPoint = Vector3.Lerp(smoothedGroundPoint, point, num);
Vector3 val = Vector3.Slerp(smoothedGroundNormal, normal, num2);
smoothedGroundNormal = ((Vector3)(ref val)).normalized;
}
}
private void UpdatePlayerMeasurements()
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
try
{
Transform feetTransform = GetFeetTransform();
if ((Object)(object)feetTransform == (Object)null)
{
return;
}
if ((Object)(object)Player.Head != (Object)null)
{
float num = Vector3.Distance(Player.Head.position, feetTransform.position);
if (num > 0.1f)
{
headToFeetDistance = num;
}
}
if (!noclipEnabled)
{
float num2 = MeasureFootSupportDistance();
if (num2 > 0.01f)
{
footSupportDistance = num2;
}
}
probeRadius = Mathf.Clamp(headToFeetDistance * 0.025f, 0.025f, 0.08f);
probeSpread = Mathf.Clamp(headToFeetDistance * 0.12f, 0.08f, 0.3f);
rayDistance = Mathf.Clamp(headToFeetDistance * 1.2f, 1.5f, 8f);
groundClearance = Mathf.Clamp(headToFeetDistance * 0.01f, 0.01f, 0.05f);
supportRange = Mathf.Clamp(headToFeetDistance * 0.12f, 0.12f, 0.6f);
recoveryRange = Mathf.Clamp(headToFeetDistance * 0.3f, 0.3f, 2f);
correctionSpeed = Mathf.Clamp(headToFeetDistance * 2.5f, 3f, 8f);
}
catch (Exception ex)
{
MelonLogger.Warning("Player measurement error: " + ex.Message);
}
}
private Transform GetFeetTransform()
{
try
{
if ((Object)(object)Player.PhysicsRig == (Object)null || (Object)(object)Player.PhysicsRig.feet == (Object)null)
{
return null;
}
return Player.PhysicsRig.feet.transform;
}
catch
{
return null;
}
}
private bool FindGround(Vector3 feetPosition, out Vector3 groundPoint, out Vector3 groundNormal)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_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_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_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: 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_023b: 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_0248: Unknown result type (might be due to invalid IL or missing references)
//IL_024c: Unknown result type (might be due to invalid IL or missing references)
//IL_0251: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_0226: Unknown result type (might be due to invalid IL or missing references)
//IL_022e: Unknown result type (might be due to invalid IL or missing references)
//IL_0233: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
//IL_0278: Unknown result type (might be due to invalid IL or missing references)
//IL_0264: Unknown result type (might be due to invalid IL or missing references)
//IL_0269: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: 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_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: 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_01e1: 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_01ec: Unknown result type (might be due to invalid IL or missing references)
//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//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)
groundPoint = Vector3.zero;
groundNormal = Vector3.up;
Vector3 forward = ((Component)Player.PhysicsRig).transform.forward;
forward.y = 0f;
if (((Vector3)(ref forward)).sqrMagnitude < 0.0001f)
{
forward = Vector3.forward;
}
else
{
((Vector3)(ref forward)).Normalize();
}
Vector3 val = Vector3.Cross(Vector3.up, forward);
Vector3 normalized = ((Vector3)(ref val)).normalized;
Vector3[] array = (Vector3[])(object)new Vector3[5]
{
Vector3.zero,
forward * probeSpread,
-forward * probeSpread,
normalized * probeSpread,
-normalized * probeSpread
};
Vector3 val2 = Vector3.zero;
Vector3 val3 = Vector3.zero;
float num = 0f;
bool flag = false;
RaycastHit val4 = default(RaycastHit);
RaycastHit val5 = default(RaycastHit);
for (int i = 0; i < array.Length; i++)
{
if (Physics.SphereCast(feetPosition + array[i] + Vector3.up * Mathf.Min(0.2f, headToFeetDistance * 0.1f), probeRadius, Vector3.down, ref val5, rayDistance, calculatedGroundMask, (QueryTriggerInteraction)1) && ((RaycastHit)(ref val5)).normal.y >= 0.7f && ((Object)(object)((RaycastHit)(ref val5)).collider == (Object)null || (Object)(object)Player.PhysicsRig == (Object)null || !((Component)((RaycastHit)(ref val5)).collider).transform.IsChildOf(((Component)Player.PhysicsRig).transform)))
{
if (i == 0)
{
flag = true;
val4 = val5;
}
float num2 = 1f / Mathf.Max(((RaycastHit)(ref val5)).distance, 0.05f);
if (i == 0)
{
num2 *= 2f;
}
val2 += ((RaycastHit)(ref val5)).point * num2;
val3 += ((RaycastHit)(ref val5)).normal * num2;
num += num2;
}
}
if (!flag)
{
return false;
}
if (num <= 0.0001f)
{
groundPoint = ((RaycastHit)(ref val4)).point;
groundNormal = ((RaycastHit)(ref val4)).normal;
return true;
}
groundPoint = val2 / num;
Vector3 val6 = val3 / num;
if (((Vector3)(ref val6)).sqrMagnitude < 0.0001f)
{
groundNormal = ((RaycastHit)(ref val4)).normal;
}
else
{
groundNormal = ((Vector3)(ref val6)).normalized;
}
if (groundNormal.y < 0.7f)
{
groundNormal = ((RaycastHit)(ref val4)).normal;
}
return groundNormal.y >= 0.7f;
}
private void ApplyGroundAlignment(float deltaY)
{
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_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_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)
try
{
Rigidbody[] array = Il2CppArrayBase<Rigidbody>.op_Implicit(((Component)Player.PhysicsRig).GetComponentsInChildren<Rigidbody>(true));
int num = 0;
Rigidbody[] array2 = array;
foreach (Rigidbody val in array2)
{
if ((Object)(object)val != (Object)null && !val.isKinematic)
{
val.position += Vector3.up * deltaY;
num++;
}
}
if (num == 0)
{
Transform transform = ((Component)Player.PhysicsRig).transform;
transform.position += Vector3.up * deltaY;
}
}
catch (Exception ex)
{
MelonLogger.Error("Ground alignment error: " + ex.Message);
}
}
private void BuildGroundMask()
{
int num = 0;
int num2 = LayerMask.NameToLayer("Ground");
int num3 = LayerMask.NameToLayer("Platform");
int num4 = LayerMask.NameToLayer("Static");
if (num2 != -1)
{
num |= 1 << num2;
}
if (num3 != -1)
{
num |= 1 << num3;
}
if (num4 != -1)
{
num |= 1 << num4;
}
if (num == 0)
{
num = -1;
int num5 = LayerMask.NameToLayer("Player");
int num6 = LayerMask.NameToLayer("Water");
if (num5 != -1)
{
num &= ~(1 << num5);
}
if (num6 != -1)
{
num &= ~(1 << num6);
}
num &= -17;
MelonLogger.Warning("Ground/Platform/Static not found. Using original broad ground mask.");
}
else
{
MelonLogger.Msg("Using Ground/Platform/Static ground mask.");
}
calculatedGroundMask = num;
groundMaskReady = num != 0;
}
private void ApplyNoclipMovement()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: 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_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_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_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00cc: 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_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: 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)
if (noclipEnabled && !((Object)(object)Player.PhysicsRig == (Object)null) && !wallTransferActive)
{
Vector3 planarMovementDirection = GetPlanarMovementDirection();
float num = Mathf.Clamp01(((Vector2)(ref thumbstickInput)).magnitude);
Vector3 val = planarMovementDirection * movementSpeed * num;
if (jumpActive)
{
val *= Mathf.Clamp(airControl, 0.35f, 1f);
}
float num2 = ((((Vector3)(ref val)).sqrMagnitude > ((Vector3)(ref currentMoveVelocity)).sqrMagnitude) ? movementAcceleration : movementDeceleration);
currentMoveVelocity = Vector3.MoveTowards(currentMoveVelocity, val, num2 * Time.fixedDeltaTime);
if (!(((Vector3)(ref currentMoveVelocity)).sqrMagnitude < 1E-06f))
{
lastMoveDirection = ((Vector3)(ref currentMoveVelocity)).normalized;
Vector3 val2 = currentMoveVelocity * Time.fixedDeltaTime;
Transform transform = ((Component)Player.PhysicsRig).transform;
Vector3 position = transform.position;
position.x += val2.x;
position.y += val2.y;
position.z += val2.z;
transform.position = position;
}
}
}
private bool ReadJumpButton()
{
bool result = false;
try
{
if (Input.GetButtonDown("Jump"))
{
result = true;
}
}
catch
{
}
if (Input.GetKeyDown((KeyCode)32))
{
result = true;
}
try
{
if (!jumpBindingSearched)
{
SearchJumpBinding();
}
Hand rightHand = Player.RightHand;
if ((Object)(object)rightHand == (Object)null || (Object)(object)rightHand.Controller == (Object)null)
{
return result;
}
object controller = rightHand.Controller;
bool flag = default(bool);
int num;
if (aButtonDownField != null)
{
object value = aButtonDownField.GetValue(controller);
if (value is bool)
{
flag = (bool)value;
num = 1;
}
else
{
num = 0;
}
}
else
{
num = 0;
}
if (((uint)num & (flag ? 1u : 0u)) != 0)
{
result = true;
}
bool flag2 = default(bool);
int num2;
if (aButtonDownProperty != null)
{
object value = aButtonDownProperty.GetValue(controller);
if (value is bool)
{
flag2 = (bool)value;
num2 = 1;
}
else
{
num2 = 0;
}
}
else
{
num2 = 0;
}
if (((uint)num2 & (flag2 ? 1u : 0u)) != 0)
{
result = true;
}
}
catch
{
}
return result;
}
private void ReadThumbstick()
{
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: 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)
try
{
if ((Object)(object)Player.LeftController == (Object)null)
{
thumbstickInput = Vector2.zero;
return;
}
Vector2 thumbStickAxis = Player.LeftController.GetThumbStickAxis();
float magnitude = ((Vector2)(ref thumbStickAxis)).magnitude;
if (magnitude < 0.12f)
{
thumbstickInput = Vector2.zero;
return;
}
float num = Mathf.InverseLerp(0.12f, 1f, Mathf.Clamp01(magnitude));
thumbstickInput = ((Vector2)(ref thumbStickAxis)).normalized * num;
}
catch
{
thumbstickInput = Vector2.zero;
}
}
private void SearchJumpBinding()
{
jumpBindingSearched = true;
try
{
Hand rightHand = Player.RightHand;
if (!((Object)(object)rightHand == (Object)null) && !((Object)(object)rightHand.Controller == (Object)null))
{
Type type = ((object)rightHand.Controller).GetType();
aButtonDownField = type.GetField("_aButtonDown", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (aButtonDownField == null)
{
aButtonDownField = type.GetField("aButtonDown", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
}
aButtonDownProperty = type.GetProperty("_aButtonDown", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (aButtonDownProperty == null)
{
aButtonDownProperty = type.GetProperty("AButtonDown", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
}
}
}
catch
{
}
}
private void TryCreateBoneMenu()
{
//IL_0021: 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_0065: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: 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_01ed: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0220: Unknown result type (might be due to invalid IL or missing references)
//IL_0232: Unknown result type (might be due to invalid IL or missing references)
//IL_0264: Unknown result type (might be due to invalid IL or missing references)
//IL_0296: Unknown result type (might be due to invalid IL or missing references)
//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
//IL_0301: Unknown result type (might be due to invalid IL or missing references)
//IL_0333: Unknown result type (might be due to invalid IL or missing references)
//IL_0365: 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_03c9: 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_041c: Unknown result type (might be due to invalid IL or missing references)
//IL_042e: Unknown result type (might be due to invalid IL or missing references)
//IL_044b: 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_0484: Unknown result type (might be due to invalid IL or missing references)
if (menuCreated)
{
return;
}
try
{
if (Page.Root != null)
{
mainPage = Page.Root.CreatePage("NoClip V3", Color.cyan, 0, true);
mainPage.CreateBool("Noclip", Color.cyan, noclipEnabled, (Action<bool>)delegate(bool value)
{
SetNoClipState(value);
});
mainPage.CreateBool("Ground Detector", Color.green, groundDetectorEnabled, (Action<bool>)delegate(bool value)
{
SetGroundDetectorState(value);
});
mainPage.CreateBool("Air Walk", Color.yellow, airWalkEnabled, (Action<bool>)delegate(bool value)
{
airWalkEnabled = value;
});
mainPage.CreateBool("Wall Transfer", Color.magenta, wallTransferEnabled, (Action<bool>)delegate(bool value)
{
wallTransferEnabled = value;
});
Page obj = mainPage.CreatePage("Movement", Color.white, 0, true);
obj.CreateFloat("Move Speed", Color.white, movementSpeed, 0.25f, 1f, 8f, (Action<float>)delegate(float value)
{
movementSpeed = Mathf.Clamp(value, 1f, 8f);
});
obj.CreateFloat("Acceleration", Color.white, movementAcceleration, 0.5f, 2f, 30f, (Action<float>)delegate(float value)
{
movementAcceleration = Mathf.Clamp(value, 2f, 30f);
});
obj.CreateFloat("Deceleration", Color.white, movementDeceleration, 0.5f, 2f, 35f, (Action<float>)delegate(float value)
{
movementDeceleration = Mathf.Clamp(value, 2f, 35f);
});
obj.CreateFloat("Air Control", Color.white, airControl, 0.05f, 0f, 1f, (Action<float>)delegate(float value)
{
airControl = Mathf.Clamp01(value);
});
obj.CreateFloat("Jump Height", Color.white, jumpVelocity, 0.25f, 3.5f, 7f, (Action<float>)delegate(float value)
{
jumpVelocity = Mathf.Clamp(value, 3.5f, 7f);
});
mainPage.CreatePage("Ground Detector", Color.green, 0, true).CreateFunction("Refresh Layer Mask", Color.white, (Action)RefreshGroundMaskNow);
Page obj2 = mainPage.CreatePage("Air Walk", Color.yellow, 0, true);
obj2.CreateFloat("Assist Speed", Color.white, airWalkAssistSpeed, 0.25f, 0.25f, 5f, (Action<float>)delegate(float value)
{
airWalkAssistSpeed = Mathf.Clamp(value, 0.25f, 5f);
});
obj2.CreateFloat("Search Distance", Color.white, airWalkSearchDistance, 0.5f, 1f, 15f, (Action<float>)delegate(float value)
{
airWalkSearchDistance = Mathf.Clamp(value, 1f, 15f);
});
obj2.CreateFloat("Search Step", Color.white, airWalkSearchStep, 0.05f, 0.1f, 1f, (Action<float>)delegate(float value)
{
airWalkSearchStep = Mathf.Clamp(value, 0.1f, 1f);
});
obj2.CreateBool("Hold Over Void", Color.cyan, airWalkVoidHold, (Action<bool>)delegate(bool value)
{
airWalkVoidHold = value;
});
Page obj3 = mainPage.CreatePage("Wall Transfer", Color.magenta, 0, true);
obj3.CreateFloat("Wall Detection", Color.white, wallDetectionDistance, 0.1f, 0.5f, 4f, (Action<float>)delegate(float value)
{
wallDetectionDistance = Mathf.Clamp(value, 0.5f, 4f);
});
obj3.CreateFloat("Wall Clearance", Color.white, wallClearance, 0.02f, 0.03f, 0.5f, (Action<float>)delegate(float value)
{
wallClearance = Mathf.Clamp(value, 0.03f, 0.5f);
});
obj3.CreateFloat("Search Distance", Color.white, wallScanDistance, 0.25f, 1f, 20f, (Action<float>)delegate(float value)
{
wallScanDistance = Mathf.Clamp(value, 1f, 20f);
});
obj3.CreateFloat("Search Step", Color.white, wallScanStep, 0.05f, 0.05f, 1f, (Action<float>)delegate(float value)
{
wallScanStep = Mathf.Clamp(value, 0.05f, 1f);
});
obj3.CreateFloat("Open Space Depth", Color.white, wallOpenSpaceDepth, 0.05f, 0.3f, 2f, (Action<float>)delegate(float value)
{
wallOpenSpaceDepth = Mathf.Clamp(value, 0.3f, 2f);
});
obj3.CreateFunction("Transfer Now", Color.magenta, (Action)delegate
{
wallTransferRequested = true;
});
Page obj4 = mainPage.CreatePage("Presets", Color.cyan, 0, true);
obj4.CreateFunction("Default", Color.white, (Action)delegate
{
ApplyPreset(0);
});
obj4.CreateFunction("Fast", Color.white, (Action)delegate
{
ApplyPreset(1);
});
obj4.CreateFunction("Precision", Color.white, (Action)delegate
{
ApplyPreset(2);
});
obj4.CreateFunction("Stable Ground", Color.white, (Action)delegate
{
ApplyPreset(3);
});
menuCreated = true;
MelonLogger.Msg("BoneLib NoClip V3 menu created.");
}
}
catch (Exception ex)
{
MelonLogger.Error("BoneLib menu creation error: " + ex.Message);
}
}
private void SetGroundDetectorState(bool enabled)
{
groundDetectorEnabled = enabled;
if (enabled)
{
EnableGroundDetector();
MelonLogger.Msg("GROUND DETECTOR: ON - layer mask refreshed.");
}
else
{
customGrounded = false;
hasSmoothedGround = false;
MelonLogger.Msg("GROUND DETECTOR: OFF");
}
}
private void RefreshGroundMaskNow()
{
BuildGroundMask();
nextMaskRefreshTime = Time.time;
maskRefreshUntil = Time.time + 5f;
hasSmoothedGround = false;
}
private void EnableGroundDetector()
{
BuildGroundMask();
nextMaskRefreshTime = Time.time;
maskRefreshUntil = Time.time + 5f;
hasSmoothedGround = false;
customGrounded = false;
}
private void SetNoClipState(bool enabled)
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
if (noclipEnabled != enabled)
{
noclipEnabled = enabled;
customGrounded = false;
hasSmoothedGround = false;
jumpActive = false;
currentMoveVelocity = Vector3.zero;
wallTransferRequested = false;
ResetAirWalkHold();
if (enabled)
{
EnableNoClip();
}
else
{
DisableNoClip();
}
MelonLogger.Msg("NOCLIP STATE: " + (enabled ? "ON" : "OFF"));
}
}
private Vector3 GetPlanarLookDirection()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_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_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_006b: Unknown result type (might be due to invalid IL or missing references)
Vector3 forward = Vector3.forward;
try
{
if ((Object)(object)Player.Head != (Object)null)
{
forward = Player.Head.forward;
}
else if ((Object)(object)Player.PhysicsRig != (Object)null)
{
forward = ((Component)Player.PhysicsRig).transform.forward;
}
}
catch
{
}
forward.y = 0f;
if (((Vector3)(ref forward)).sqrMagnitude < 0.0001f)
{
forward = Vector3.forward;
}
else
{
((Vector3)(ref forward)).Normalize();
}
return forward;
}
private Vector3 GetPlanarMovementDirection()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: 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_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
Vector3 planarLookDirection = GetPlanarLookDirection();
Vector3 val = Vector3.Cross(Vector3.up, planarLookDirection);
Vector3 normalized = ((Vector3)(ref val)).normalized;
Vector3 val2 = planarLookDirection * thumbstickInput.y + normalized * thumbstickInput.x;
val2.y = 0f;
if (((Vector3)(ref val2)).sqrMagnitude < 1E-06f)
{
if (!(((Vector3)(ref lastMoveDirection)).sqrMagnitude > 0.0001f))
{
return planarLookDirection;
}
return lastMoveDirection;
}
return ((Vector3)(ref val2)).normalized;
}
private void ApplyRigDelta(Vector3 delta)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)Player.PhysicsRig == (Object)null || ((Vector3)(ref delta)).sqrMagnitude <= 1E-08f)
{
return;
}
try
{
Transform transform = ((Component)Player.PhysicsRig).transform;
transform.position += delta;
}
catch (Exception ex)
{
MelonLogger.Error("Rig movement error: " + ex.Message);
}
}
private void RunGroundDetector()
{
//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_008b: 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_00a8: 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)
if (!noclipEnabled || !groundDetectorEnabled)
{
customGrounded = false;
return;
}
if (!groundMaskReady || calculatedGroundMask == 0)
{
customGrounded = false;
return;
}
Transform feetTransform = GetFeetTransform();
if ((Object)(object)feetTransform == (Object)null)
{
customGrounded = false;
return;
}
Vector3 position = feetTransform.position;
float feetVerticalVelocity = GetFeetVerticalVelocity();
if (jumpActive)
{
if (feetVerticalVelocity > 0.5f)
{
customGrounded = false;
return;
}
jumpActive = false;
}
if (Time.time < jumpProtectionUntil)
{
customGrounded = false;
return;
}
if (!FindGround(position, out var groundPoint, out var groundNormal))
{
customGrounded = false;
hasSmoothedGround = false;
return;
}
SmoothGround(groundPoint, groundNormal);
float num = smoothedGroundPoint.y + footSupportDistance + groundClearance - position.y;
if (num < 0f - supportRange && feetVerticalVelocity < -1f)
{
customGrounded = false;
return;
}
if (Mathf.Abs(num) > recoveryRange)
{
customGrounded = false;
return;
}
customGrounded = true;
if (num > -0.08f)
{
StopDownwardVelocity();
}
float num2 = Mathf.Clamp(num, (0f - correctionSpeed) * Time.fixedDeltaTime, correctionSpeed * Time.fixedDeltaTime);
if (num2 < 0f && feetVerticalVelocity < -0.35f)
{
num2 = 0f;
}
if (Mathf.Abs(num2) > 1E-05f)
{
ApplyGroundAlignment(num2);
}
}
private bool FindGroundAtPosition(Vector3 feetPosition, Vector3 forwardDirection, out Vector3 groundPoint, out Vector3 groundNormal)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return FindGround(feetPosition, out groundPoint, out groundNormal);
}
private void ApplyAirWalkAssist()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: 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_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: 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_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
Transform feetTransform = GetFeetTransform();
if ((Object)(object)feetTransform == (Object)null)
{
return;
}
Vector3 position = feetTransform.position;
Vector3 searchDirection = ((((Vector2)(ref thumbstickInput)).sqrMagnitude > 0.0001f) ? GetPlanarMovementDirection() : GetPlanarLookDirection());
searchDirection.y = 0f;
if (((Vector3)(ref searchDirection)).sqrMagnitude < 0.0001f)
{
searchDirection = Vector3.forward;
}
else
{
((Vector3)(ref searchDirection)).Normalize();
}
if (customGrounded)
{
airWalkHoldFeetY = position.y;
hasAirWalkHoldHeight = true;
return;
}
if (!hasAirWalkHoldHeight)
{
airWalkHoldFeetY = position.y;
hasAirWalkHoldHeight = true;
}
float feetVerticalVelocity = GetFeetVerticalVelocity();
if (jumpActive && feetVerticalVelocity > 0.2f)
{
airWalkHoldFeetY = position.y;
return;
}
Vector3 groundPoint;
Vector3 groundNormal;
bool flag = FindAirWalkGround(position, searchDirection, out groundPoint, out groundNormal);
float num = airWalkHoldFeetY;
if (flag)
{
float num2 = Mathf.Clamp(headToFeetDistance * 0.018f, 0.02f, 0.06f);
float num3 = groundPoint.y + footSupportDistance + groundClearance + num2;
float num4 = 1f - Mathf.Exp(-8f * Time.fixedDeltaTime);
airWalkHoldFeetY = Mathf.Lerp(airWalkHoldFeetY, num3, num4);
num = airWalkHoldFeetY;
}
float num5 = num - position.y;
float num6 = airWalkAssistSpeed * Time.fixedDeltaTime;
float num7 = Mathf.Clamp(num5, 0f - num6, num6);
if (airWalkVoidHold || num5 >= 0f)
{
StopDownwardVelocity();
}
if (Mathf.Abs(num7) > 1E-05f)
{
ApplyRigDelta(Vector3.up * num7);
}
if (jumpActive && flag && feetVerticalVelocity <= 0.2f && Mathf.Abs(num5) < 0.05f)
{
jumpActive = false;
}
}
private bool FindAirWalkGround(Vector3 feetPosition, Vector3 searchDirection, out Vector3 groundPoint, out Vector3 groundNormal)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0029: 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_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: Unknown result type (might be due to invalid IL or missing references)
//IL_018d: Unknown result type (might be due to invalid IL or missing references)
//IL_0192: Unknown result type (might be due to invalid IL or missing references)
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
//IL_01bb: 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_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_0210: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: 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)
groundPoint = Vector3.zero;
groundNormal = Vector3.up;
if (!groundMaskReady || calculatedGroundMask == 0)
{
return false;
}
Vector3 val = searchDirection;
val.y = 0f;
if (((Vector3)(ref val)).sqrMagnitude < 0.0001f)
{
val = Vector3.forward;
}
else
{
((Vector3)(ref val)).Normalize();
}
float num = Mathf.Clamp(airWalkSearchStep, 0.15f, 1f);
float num2 = Mathf.Clamp(airWalkSearchDistance, 1f, 15f);
float num3 = Mathf.Clamp(headToFeetDistance * 1.6f, 2.5f, 4.5f);
float num4 = Mathf.Clamp(num3 + Mathf.Max(3f, recoveryRange) + 3f, 7f, 18f);
float num5 = float.MaxValue;
bool flag = false;
for (float num6 = 0f; num6 <= num2; num6 += num)
{
RaycastHit[] array = Il2CppArrayBase<RaycastHit>.op_Implicit((Il2CppArrayBase<RaycastHit>)(object)Physics.SphereCastAll(feetPosition + val * num6 + Vector3.up * num3, Mathf.Max(probeRadius, 0.045f), Vector3.down, num4, calculatedGroundMask, (QueryTriggerInteraction)1));
for (int i = 0; i < array.Length; i++)
{
RaycastHit val2 = array[i];
if ((Object)(object)((RaycastHit)(ref val2)).collider == (Object)null || ((RaycastHit)(ref val2)).normal.y < 0.55f || ((Object)(object)Player.PhysicsRig != (Object)null && ((Component)((RaycastHit)(ref val2)).collider).transform.IsChildOf(((Component)Player.PhysicsRig).transform)))
{
continue;
}
Vector3 val3 = ((RaycastHit)(ref val2)).point - feetPosition;
val3.y = 0f;
float num7 = Vector3.Dot(val3, val);
if (!(num7 < -0.25f))
{
Vector3 val4 = val3 - val * num7;
float magnitude = ((Vector3)(ref val4)).magnitude;
float num8 = Mathf.Abs(((RaycastHit)(ref val2)).point.y - feetPosition.y);
float num9 = num6 + magnitude * 0.45f + num8 * 0.08f;
if (num9 < num5)
{
num5 = num9;
groundPoint = ((RaycastHit)(ref val2)).point;
groundNormal = ((RaycastHit)(ref val2)).normal;
flag = true;
}
}
}
if (flag && num6 >= num * 2f && num5 <= num6 + 0.1f)
{
break;
}
}
return flag;
}
private void ResetAirWalkHold()
{
hasAirWalkHoldHeight = false;
airWalkHoldFeetY = 0f;
}
private void ExecuteWallTransfer()
{
//IL_0071: 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_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: 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_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_0298: 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_02b5: Unknown result type (might be due to invalid IL or missing references)
//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_0213: Unknown result type (might be due to invalid IL or missing references)
//IL_021a: Unknown result type (might be due to invalid IL or missing references)
//IL_021f: Unknown result type (might be due to invalid IL or missing references)
//IL_0224: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Unknown result type (might be due to invalid IL or missing references)
//IL_024b: Unknown result type (might be due to invalid IL or missing references)
//IL_024d: Unknown result type (might be due to invalid IL or missing references)
if (!wallTransferEnabled || (Object)(object)Player.PhysicsRig == (Object)null || Time.time < wallTransferCooldownUntil)
{
return;
}
wallTransferActive = true;
StopAllRigMovement();
bool flag = noclipEnabled;
if (!flag)
{
TemporarilyDisablePlayerColliders();
}
try
{
Transform feetTransform = GetFeetTransform();
if ((Object)(object)feetTransform == (Object)null)
{
return;
}
Vector3 val = ((((Vector2)(ref thumbstickInput)).sqrMagnitude > 0.0001f) ? GetPlanarMovementDirection() : GetPlanarLookDirection());
val.y = 0f;
if (((Vector3)(ref val)).sqrMagnitude < 0.0001f)
{
val = Vector3.forward;
}
else
{
((Vector3)(ref val)).Normalize();
}
RaycastHit val2 = default(RaycastHit);
if (!Physics.SphereCast(feetTransform.position + Vector3.up * Mathf.Clamp(headToFeetDistance * 0.42f, 0.45f, 0.9f), wallProbeRadius, val, ref val2, wallDetectionDistance, -1, (QueryTriggerInteraction)1) || (Object)(object)((RaycastHit)(ref val2)).collider == (Object)null || ((RaycastHit)(ref val2)).normal.y > 0.65f || !IsUsableWallHit(((RaycastHit)(ref val2)).collider))
{
MelonLogger.Msg("Wall Transfer: no usable wall detected.");
return;
}
float num = Mathf.Max(Vector3.Dot(((RaycastHit)(ref val2)).point - feetTransform.position, val), 0.05f) + wallProbeRadius + wallClearance;
float num2 = num + wallScanDistance;
Vector3 val3 = Vector3.zero;
Vector3 groundPoint = Vector3.zero;
Vector3 groundNormal = Vector3.up;
bool flag2 = false;
for (float num3 = num; num3 <= num2; num3 += wallScanStep)
{
Vector3 val4 = feetTransform.position + val * num3;
if (!IsWallTransferDestinationEmpty(val4, val))
{
continue;
}
bool flag3 = false;
float num4 = Mathf.Clamp(headToFeetDistance * 0.35f, 0.35f, 0.75f);
float[] array = new float[7]
{
0f,
num4,
0f - num4,
num4 * 2f,
(0f - num4) * 2f,
num4 * 3f,
(0f - num4) * 3f
};
foreach (float num5 in array)
{
Vector3 feetPosition = val4 + Vector3.up * num5;
if (FindGround(feetPosition, out groundPoint, out groundNormal))
{
flag3 = true;
break;
}
}
if (flag3)
{
val3 = val4;
flag2 = true;
break;
}
}
if (!flag2)
{
MelonLogger.Msg("Wall Transfer: no open space with valid ground found.");
return;
}
float num6 = Mathf.Clamp(headToFeetDistance * 0.018f, 0.02f, 0.06f);
float num7 = groundPoint.y + footSupportDistance + groundClearance + num6;
Vector3 delta = val3 - feetTransform.position;
delta.y = num7 - feetTransform.position.y;
ApplyRigDelta(delta);
StopAllRigMovement();
hasSmoothedGround = false;
customGrounded = false;
hasAirWalkHoldHeight = true;
airWalkHoldFeetY = num7;
wallTransferCooldownUntil = Time.time + 0.25f;
MelonLogger.Msg("Wall Transfer complete.");
}
catch (Exception ex)
{
MelonLogger.Error("Wall Transfer error: " + ex.Message);
}
finally
{
if (!flag)
{
RestoreTemporaryTransferColliders();
}
wallTransferActive = false;
wallTransferRequested = false;
StopAllRigMovement();
}
}
private bool IsUsableWallHit(Collider collider)
{
if ((Object)(object)collider == (Object)null)
{
return false;
}
try
{
if ((Object)(object)Player.PhysicsRig != (Object)null && ((Component)collider).transform.IsChildOf(((Component)Player.PhysicsRig).transform))
{
return false;
}
if ((Object)(object)((Component)collider).GetComponentInParent<PhysicsRig>() != (Object)null)
{
return false;
}
}
catch
{
}
return true;
}
private bool IsWallTransferHorizontalPositionClear(Vector3 feetPosition)
{
//IL_0032: 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_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
float num = Mathf.Clamp(headToFeetDistance * 0.1f, 0.1f, 0.24f);
float num2 = Mathf.Clamp(headToFeetDistance, 1.1f, 2.1f);
Vector3 val = feetPosition + Vector3.up * (num + 0.03f);
Vector3 val2 = feetPosition + Vector3.up * Mathf.Max(num + 0.08f, num2 - num * 0.5f);
int num3 = Physics.OverlapCapsuleNonAlloc(val, val2, num, Il2CppReferenceArray<Collider>.op_Implicit(transferOverlapBuffer), -1, (QueryTriggerInteraction)1);
for (int i = 0; i < num3; i++)
{
Collider val3 = transferOverlapBuffer[i];
if ((Object)(object)val3 == (Object)null || ((Component)val3).transform.IsChildOf(((Component)Player.PhysicsRig).transform))
{
continue;
}
try
{
if ((Object)(object)((Component)val3).GetComponentInParent<PhysicsRig>() != (Object)null)
{
continue;
}
}
catch
{
}
return false;
}
return true;
}
private void TemporarilyDisablePlayerColliders()
{
if ((Object)(object)Player.PhysicsRig == (Object)null)
{
return;
}
try
{
Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(((Component)Player.PhysicsRig).GetComponentsInChildren<Collider>(true));
temporaryTransferColliders = (Collider[])(object)new Collider[array.Length];
int num = 0;
Collider[] array2 = array;
foreach (Collider val in array2)
{
if ((Object)(object)val != (Object)null && val.enabled)
{
val.enabled = false;
temporaryTransferColliders[num++] = val;
}
}
}
catch
{
}
}
private void RestoreTemporaryTransferColliders()
{
if (temporaryTransferColliders == null)
{
return;
}
try
{
Collider[] array = temporaryTransferColliders;
foreach (Collider val in array)
{
if ((Object)(object)val != (Object)null && !val.enabled && !noclipEnabled)
{
val.enabled = true;
}
}
}
catch
{
}
temporaryTransferColliders = null;
}
private void StopAllRigMovement()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
currentMoveVelocity = Vector3.zero;
StopAllRigVelocity();
}
private void PerformFixedJump()
{
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: 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)
if ((Object)(object)Player.PhysicsRig == (Object)null)
{
return;
}
try
{
float y = Mathf.Clamp(jumpVelocity, 3.5f, 7f);
int num = 0;
foreach (Rigidbody componentsInChild in ((Component)Player.PhysicsRig).GetComponentsInChildren<Rigidbody>(true))
{
if (!((Object)(object)componentsInChild == (Object)null) && !componentsInChild.isKinematic)
{
Vector3 velocity = componentsInChild.velocity;
if (velocity.y < 0f)
{
velocity.y = 0f;
}
velocity.y = y;
componentsInChild.velocity = velocity;
num++;
}
}
if (num == 0)
{
MelonLogger.Warning("Jump cancelled: no dynamic rig rigidbodies were found.");
return;
}
customGrounded = false;
hasSmoothedGround = false;
jumpActive = true;
jumpProtectionUntil = Time.time + 0.18f;
Transform feetTransform = GetFeetTransform();
if ((Object)(object)feetTransform != (Object)null)
{
airWalkHoldFeetY = feetTransform.position.y;
hasAirWalkHoldHeight = true;
}
MelonLogger.Msg("JUMP - fixed velocity=" + y.ToString("F2") + "m/s");
}
catch (Exception ex)
{
MelonLogger.Error("Jump error: " + ex.Message);
}
}
private void ApplyPreset(int preset)
{
switch (preset)
{
case 0:
movementSpeed = 3.9f;
movementAcceleration = 14f;
movementDeceleration = 18f;
airControl = 0.9f;
jumpVelocity = 5.5f;
airWalkAssistSpeed = 4.5f;
airWalkSearchDistance = 7f;
break;
case 1:
movementSpeed = 5.25f;
movementAcceleration = 20f;
movementDeceleration = 23f;
airControl = 0.95f;
jumpVelocity = 5.5f;
airWalkAssistSpeed = 3.25f;
airWalkSearchDistance = 8f;
break;
case 2:
movementSpeed = 2.75f;
movementAcceleration = 10f;
movementDeceleration = 14f;
airControl = 0.75f;
jumpVelocity = 5.5f;
airWalkAssistSpeed = 1.6f;
airWalkSearchDistance = 4f;
break;
case 3:
movementSpeed = 3.75f;
movementAcceleration = 13f;
movementDeceleration = 18f;
airControl = 0.88f;
jumpVelocity = 5.5f;
airWalkAssistSpeed = 2.25f;
airWalkSearchDistance = 7f;
break;
}
}
private bool IsWallTransferDestinationEmpty(Vector3 feetPosition, Vector3 forwardDirection)
{
//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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: 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_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_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)Player.PhysicsRig == (Object)null)
{
return false;
}
Vector3 val = forwardDirection;
val.y = 0f;
if (((Vector3)(ref val)).sqrMagnitude < 0.0001f)
{
val = Vector3.forward;
}
else
{
((Vector3)(ref val)).Normalize();
}
if (!IsWallTransferHorizontalPositionClear(feetPosition))
{
return false;
}
float num = Mathf.Clamp(wallOpenSpaceDepth, 0.3f, 2f);
int num2 = Mathf.Clamp(Mathf.CeilToInt(num / 0.15f), 4, 14);
for (int i = 1; i <= num2; i++)
{
float num3 = (float)i / (float)num2;
Vector3 feetPosition2 = feetPosition + val * (num * num3);
if (!IsWallTransferHorizontalPositionClear(feetPosition2))
{
return false;
}
}
return true;
}
private void StopAllRigVelocity()
{
//IL_002c: 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)
try
{
foreach (Rigidbody componentsInChild in ((Component)Player.PhysicsRig).GetComponentsInChildren<Rigidbody>(true))
{
if (!((Object)(object)componentsInChild == (Object)null) && !componentsInChild.isKinematic)
{
componentsInChild.velocity = Vector3.zero;
componentsInChild.angularVelocity = Vector3.zero;
}
}
}
catch
{
}
}
private void StopDownwardVelocity()
{
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
try
{
if ((Object)(object)Player.PhysicsRig == (Object)null)
{
return;
}
foreach (Rigidbody componentsInChild in ((Component)Player.PhysicsRig).GetComponentsInChildren<Rigidbody>(true))
{
if (!((Object)(object)componentsInChild == (Object)null) && !componentsInChild.isKinematic)
{
Vector3 velocity = componentsInChild.velocity;
if (velocity.y < 0f)
{
velocity.y = 0f;
componentsInChild.velocity = velocity;
}
}
}
}
catch
{
}
}
private float GetFeetVerticalVelocity()
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
try
{
Transform feetTransform = GetFeetTransform();
if ((Object)(object)feetTransform == (Object)null)
{
return 0f;
}
Rigidbody component = ((Component)feetTransform).GetComponent<Rigidbody>();
if ((Object)(object)component != (Object)null)
{
return component.velocity.y;
}
}
catch
{
}
return 0f;
}
}