Decompiled source of WhoneedsAbilityCoresAnyways v1.0.0

Mods/ClaudeFlyV2.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BoneLib;
using BoneLib.BoneMenu;
using BoneLib.Notifications;
using BonelabFly;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSLZ.Marrow;
using MelonLoader;
using MelonLoader.Preferences;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(FlyMod), "Claudesv2fly", "2.4.0.0", "Claude", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: AssemblyTitle("ClaudeFlyV2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ClaudeFlyV2")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("bbcc6b16-d3d0-45c7-9d41-3cd32409266b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace BonelabFly;

public class FlyMod : MelonMod
{
	private MelonPreferences_Category _prefCat;

	private MelonPreferences_Entry<bool> _prefEnabled;

	private MelonPreferences_Entry<float> _prefMoveSpeed;

	private MelonPreferences_Entry<float> _prefVerticalSpeed;

	private MelonPreferences_Entry<float> _prefDamping;

	private MelonPreferences_Entry<float> _prefDeadzone;

	private MelonPreferences_Entry<float> _prefDoublePressDelay;

	private MelonPreferences_Entry<bool> _prefNoclipEnabled;

	private MelonPreferences_Entry<float> _prefNoclipDoubleTapWindow;

	private float _lastBPressTime;

	private Vector3 _currentVelocity;

	private bool _isFlying;

	private float[] _savedDrags;

	private bool _physicsModified;

	private bool _loggedFirstFly;

	private List<Rigidbody> _kinematicArms = new List<Rigidbody>();

	private float _speedStep = 5f;

	private bool _isNoclip;

	private float _lastThumbstickPressTime;

	private bool _thumbstickWasPressed;

	private List<Collider> _disabledColliders = new List<Collider>();

	public override void OnInitializeMelon()
	{
		_prefCat = MelonPreferences.CreateCategory("BonelabFly");
		_prefEnabled = _prefCat.CreateEntry<bool>("Enabled", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		_prefMoveSpeed = _prefCat.CreateEntry<float>("MoveSpeed", 15f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		_prefVerticalSpeed = _prefCat.CreateEntry<float>("VerticalSpeed", 10f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		_prefDamping = _prefCat.CreateEntry<float>("FlyDamp", 5f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		_prefDeadzone = _prefCat.CreateEntry<float>("Deadzone", 0.15f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		_prefDoublePressDelay = _prefCat.CreateEntry<float>("DoublePressDelay", 0.35f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		_prefNoclipEnabled = _prefCat.CreateEntry<bool>("NoclipEnabled", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		_prefNoclipDoubleTapWindow = _prefCat.CreateEntry<float>("NoclipDoubleTapWindow", 0.3f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
		try
		{
			SetupBoneMenu();
		}
		catch (Exception arg)
		{
			((MelonBase)this).LoggerInstance.Error($"BoneMenu FAILED: {arg}");
		}
		Hooking.OnLevelLoaded += OnLevelWasLoaded;
		((MelonBase)this).LoggerInstance.Msg("ClaudesFlyingMod v2.4 ready! Double-tap B to fly. Double-tap R-stick to noclip.");
	}

	public override void OnDeinitializeMelon()
	{
		Hooking.OnLevelLoaded -= OnLevelWasLoaded;
	}

	private void OnLevelWasLoaded(LevelInfo info)
	{
		if (_isFlying)
		{
			StopFlying();
		}
	}

	private void SetupBoneMenu()
	{
		//IL_000a: 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_0044: 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_00b2: 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_0120: 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_017e: 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_01ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0204: Unknown result type (might be due to invalid IL or missing references)
		//IL_0221: 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_025b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		Page obj = Menu.CurrentPage.CreatePage("ClaudesFlyBone", Color.cyan, 0, true);
		obj.CreateBool("Mod Enabled", Color.green, _prefEnabled.Value, (Action<bool>)delegate(bool val)
		{
			_prefEnabled.Value = val;
			_prefCat.SaveToFile(true);
			if (!val && _isFlying)
			{
				StopFlying();
			}
		});
		obj.CreateFloat("Move Speed", Color.white, _prefMoveSpeed.Value, 5f, 0f, 1000f, (Action<float>)delegate(float val)
		{
			_prefMoveSpeed.Value = val;
			_prefCat.SaveToFile(true);
		});
		obj.CreateFloat("Vertical Speed", Color.white, _prefVerticalSpeed.Value, 5f, 0f, 1000f, (Action<float>)delegate(float val)
		{
			_prefVerticalSpeed.Value = val;
			_prefCat.SaveToFile(true);
		});
		obj.CreateFloat("Damping", Color.white, _prefDamping.Value, 0.5f, 0f, 50f, (Action<float>)delegate(float val)
		{
			_prefDamping.Value = val;
			_prefCat.SaveToFile(true);
		});
		obj.CreateFloat("DoubleTap Window", Color.gray, _prefDoublePressDelay.Value, 0.05f, 0.1f, 1f, (Action<float>)delegate(float val)
		{
			_prefDoublePressDelay.Value = val;
			_prefCat.SaveToFile(true);
		});
		obj.CreateBool("Noclip Enabled", Color.green, _prefNoclipEnabled.Value, (Action<bool>)delegate(bool val)
		{
			_prefNoclipEnabled.Value = val;
			_prefCat.SaveToFile(true);
			if (!val && _isNoclip)
			{
				DisableNoclip();
			}
		});
		obj.CreateFloat("Noclip Tap Window", Color.gray, _prefNoclipDoubleTapWindow.Value, 0.05f, 0.1f, 1f, (Action<float>)delegate(float val)
		{
			_prefNoclipDoubleTapWindow.Value = val;
			_prefCat.SaveToFile(true);
		});
		Page obj2 = obj.CreatePage("Speed Step", Color.yellow, 0, true);
		obj2.CreateFunction("1 per click", Color.white, (Action)delegate
		{
			_speedStep = 1f;
		});
		obj2.CreateFunction("5 per click", Color.white, (Action)delegate
		{
			_speedStep = 5f;
		});
		obj2.CreateFunction("10 per click", Color.green, (Action)delegate
		{
			_speedStep = 10f;
		});
		obj2.CreateFunction("50 per click", Color.yellow, (Action)delegate
		{
			_speedStep = 50f;
		});
		obj2.CreateFunction("100 per click", Color.red, (Action)delegate
		{
			_speedStep = 100f;
		});
		obj2.CreateFunction("Move Speed +", Color.green, (Action)delegate
		{
			_prefMoveSpeed.Value = Mathf.Min(_prefMoveSpeed.Value + _speedStep, 1000f);
			_prefCat.SaveToFile(true);
		});
		obj2.CreateFunction("Move Speed -", Color.red, (Action)delegate
		{
			_prefMoveSpeed.Value = Mathf.Max(_prefMoveSpeed.Value - _speedStep, 0f);
			_prefCat.SaveToFile(true);
		});
		obj2.CreateFunction("Vert Speed +", Color.green, (Action)delegate
		{
			_prefVerticalSpeed.Value = Mathf.Min(_prefVerticalSpeed.Value + _speedStep, 1000f);
			_prefCat.SaveToFile(true);
		});
		obj2.CreateFunction("Vert Speed -", Color.red, (Action)delegate
		{
			_prefVerticalSpeed.Value = Mathf.Max(_prefVerticalSpeed.Value - _speedStep, 0f);
			_prefCat.SaveToFile(true);
		});
	}

	private Rigidbody[] GetAllBodyRigidbodies(PhysicsRig physRig)
	{
		List<Rigidbody> list = new List<Rigidbody>();
		PhysTorso torso = physRig.torso;
		if ((Object)(object)torso != (Object)null)
		{
			AddIfNotNull(list, torso.rbPelvis);
			AddIfNotNull(list, torso.rbSpine);
			AddIfNotNull(list, torso.rbChest);
			AddIfNotNull(list, torso.rbNeck);
			AddIfNotNull(list, torso.rbHead);
		}
		PhysSoftBody softbody = physRig.softbody;
		if ((Object)(object)softbody != (Object)null)
		{
			AddIfNotNull(list, softbody.rbArmUpperLf);
			AddIfNotNull(list, softbody.rbArmUpperRt);
			AddIfNotNull(list, softbody.rbForearmLf);
			AddIfNotNull(list, softbody.rbForearmRt);
			AddIfNotNull(list, softbody.rbSoftHandLf);
			AddIfNotNull(list, softbody.rbSoftHandRt);
		}
		AddIfNotNull(list, physRig.rbKnee);
		AddIfNotNull(list, physRig.rbFeet);
		return list.ToArray();
	}

	private Rigidbody[] GetCoreBodyRigidbodies(PhysicsRig physRig)
	{
		List<Rigidbody> list = new List<Rigidbody>();
		PhysTorso torso = physRig.torso;
		if ((Object)(object)torso != (Object)null)
		{
			AddIfNotNull(list, torso.rbPelvis);
			AddIfNotNull(list, torso.rbSpine);
			AddIfNotNull(list, torso.rbChest);
			AddIfNotNull(list, torso.rbNeck);
			AddIfNotNull(list, torso.rbHead);
		}
		AddIfNotNull(list, physRig.rbKnee);
		AddIfNotNull(list, physRig.rbFeet);
		return list.ToArray();
	}

	private Rigidbody[] GetArmRigidbodies(PhysicsRig physRig)
	{
		List<Rigidbody> list = new List<Rigidbody>();
		PhysSoftBody softbody = physRig.softbody;
		if ((Object)(object)softbody != (Object)null)
		{
			AddIfNotNull(list, softbody.rbArmUpperLf);
			AddIfNotNull(list, softbody.rbArmUpperRt);
			AddIfNotNull(list, softbody.rbForearmLf);
			AddIfNotNull(list, softbody.rbForearmRt);
			AddIfNotNull(list, softbody.rbSoftHandLf);
			AddIfNotNull(list, softbody.rbSoftHandRt);
		}
		return list.ToArray();
	}

	private void AddIfNotNull(List<Rigidbody> list, Rigidbody rb)
	{
		if ((Object)(object)rb != (Object)null)
		{
			list.Add(rb);
		}
	}

	private void StopFlying()
	{
		//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_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_0040: 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_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: 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_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Expected O, but got Unknown
		_isFlying = false;
		if (_isNoclip)
		{
			DisableNoclip();
		}
		RestorePhysics();
		((MelonBase)this).LoggerInstance.Msg("FLY OFF");
		Notifier.Send(new Notification
		{
			Title = NotificationText.op_Implicit("ClaudesFlyBone"),
			Message = NotificationText.op_Implicit("Ai slop fly off"),
			ShowTitleOnPopup = true,
			PopupLength = 1f,
			Type = (NotificationType)1
		});
	}

	private void RestorePhysics()
	{
		try
		{
			if (!_physicsModified)
			{
				return;
			}
			PhysicsRig physicsRig = Player.PhysicsRig;
			if ((Object)(object)physicsRig == (Object)null)
			{
				return;
			}
			Rigidbody[] coreBodyRigidbodies = GetCoreBodyRigidbodies(physicsRig);
			for (int i = 0; i < coreBodyRigidbodies.Length && i < _savedDrags.Length; i++)
			{
				coreBodyRigidbodies[i].useGravity = true;
				coreBodyRigidbodies[i].drag = _savedDrags[i];
			}
			foreach (Rigidbody kinematicArm in _kinematicArms)
			{
				if ((Object)(object)kinematicArm != (Object)null)
				{
					kinematicArm.isKinematic = false;
				}
			}
			_kinematicArms.Clear();
			_physicsModified = false;
		}
		catch (Exception ex)
		{
			((MelonBase)this).LoggerInstance.Error("RestorePhysics: " + ex.Message);
		}
	}

	private void EnableNoclip()
	{
		try
		{
			PhysicsRig physicsRig = Player.PhysicsRig;
			if ((Object)(object)physicsRig == (Object)null)
			{
				return;
			}
			_disabledColliders.Clear();
			Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(((Component)physicsRig).gameObject.GetComponentsInChildren<Collider>(true));
			foreach (Collider val in array)
			{
				if ((Object)(object)val != (Object)null && val.enabled)
				{
					val.enabled = false;
					_disabledColliders.Add(val);
				}
			}
			_isNoclip = true;
			((MelonBase)this).LoggerInstance.Msg($"NOCLIP ON  – disabled {_disabledColliders.Count} colliders");
		}
		catch (Exception ex)
		{
			((MelonBase)this).LoggerInstance.Error("EnableNoclip: " + ex.Message);
		}
	}

	private void DisableNoclip()
	{
		try
		{
			foreach (Collider disabledCollider in _disabledColliders)
			{
				if ((Object)(object)disabledCollider != (Object)null)
				{
					disabledCollider.enabled = true;
				}
			}
			_disabledColliders.Clear();
			_isNoclip = false;
			((MelonBase)this).LoggerInstance.Msg("NOCLIP OFF");
		}
		catch (Exception ex)
		{
			((MelonBase)this).LoggerInstance.Error("DisableNoclip: " + ex.Message);
		}
	}

	public override void OnUpdate()
	{
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0173: 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_017e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: 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_01a1: Expected O, but got Unknown
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: 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_0127: 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_0133: Expected O, but got Unknown
		try
		{
			if (!_prefEnabled.Value || !Player.HandsExist)
			{
				return;
			}
			if (Player.RightController.GetBButtonDown())
			{
				float unscaledTime = Time.unscaledTime;
				if (unscaledTime - _lastBPressTime <= _prefDoublePressDelay.Value)
				{
					if (_isFlying)
					{
						StopFlying();
					}
					else
					{
						StartFlying();
					}
					_lastBPressTime = 0f;
				}
				else
				{
					_lastBPressTime = unscaledTime;
				}
			}
			if (!_prefNoclipEnabled.Value || !_isFlying)
			{
				return;
			}
			bool flag = false;
			try
			{
				flag = Player.RightController.GetThumbStickDown();
			}
			catch
			{
				bool thumbStick = Player.RightController.GetThumbStick();
				flag = thumbStick && !_thumbstickWasPressed;
				_thumbstickWasPressed = thumbStick;
			}
			if (!flag)
			{
				return;
			}
			float unscaledTime2 = Time.unscaledTime;
			if (unscaledTime2 - _lastThumbstickPressTime <= _prefNoclipDoubleTapWindow.Value)
			{
				if (_isNoclip)
				{
					DisableNoclip();
					try
					{
						Notifier.Send(new Notification
						{
							Title = NotificationText.op_Implicit("ClaudesFlyBone"),
							Message = NotificationText.op_Implicit("ai slop no clip off"),
							ShowTitleOnPopup = true,
							PopupLength = 1f,
							Type = (NotificationType)1
						});
					}
					catch (Exception ex)
					{
						((MelonBase)this).LoggerInstance.Error("Noclip OFF notif: " + ex.Message);
					}
				}
				else
				{
					EnableNoclip();
					try
					{
						Notifier.Send(new Notification
						{
							Title = NotificationText.op_Implicit("ClaudesFlyBone"),
							Message = NotificationText.op_Implicit("ai slop no clip on"),
							ShowTitleOnPopup = true,
							PopupLength = 1f,
							Type = (NotificationType)3
						});
					}
					catch (Exception ex2)
					{
						((MelonBase)this).LoggerInstance.Error("Noclip ON notif: " + ex2.Message);
					}
				}
				_lastThumbstickPressTime = 0f;
			}
			else
			{
				_lastThumbstickPressTime = unscaledTime2;
			}
		}
		catch (Exception ex3)
		{
			((MelonBase)this).LoggerInstance.Error("OnUpdate: " + ex3.Message);
		}
	}

	private void StartFlying()
	{
		//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_00f3: 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_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_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: 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_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Expected O, but got Unknown
		try
		{
			PhysicsRig physicsRig = Player.PhysicsRig;
			if ((Object)(object)physicsRig == (Object)null)
			{
				return;
			}
			_isFlying = true;
			_currentVelocity = Vector3.zero;
			Rigidbody[] coreBodyRigidbodies = GetCoreBodyRigidbodies(physicsRig);
			_savedDrags = new float[coreBodyRigidbodies.Length];
			for (int i = 0; i < coreBodyRigidbodies.Length; i++)
			{
				_savedDrags[i] = coreBodyRigidbodies[i].drag;
				coreBodyRigidbodies[i].useGravity = false;
				coreBodyRigidbodies[i].drag = _prefDamping.Value;
			}
			_physicsModified = true;
			_kinematicArms.Clear();
			Rigidbody[] armRigidbodies = GetArmRigidbodies(physicsRig);
			foreach (Rigidbody val in armRigidbodies)
			{
				if (!val.isKinematic)
				{
					val.isKinematic = true;
					_kinematicArms.Add(val);
				}
			}
			((MelonBase)this).LoggerInstance.Msg($"Physics modified on {coreBodyRigidbodies.Length} core + {_kinematicArms.Count} arms set kinematic.");
			Notifier.Send(new Notification
			{
				Title = NotificationText.op_Implicit("ClaudesFlyBone"),
				Message = NotificationText.op_Implicit("Ai slop fly on"),
				ShowTitleOnPopup = true,
				PopupLength = 1f,
				Type = (NotificationType)3
			});
			if (!_loggedFirstFly)
			{
				((MelonBase)this).LoggerInstance.Msg("FLY ON \n L-stick: move, R-stick Y: up/down");
				_loggedFirstFly = true;
			}
		}
		catch (Exception ex)
		{
			((MelonBase)this).LoggerInstance.Error("StartFlying: " + ex.Message);
		}
	}

	public override void OnFixedUpdate()
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: 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_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_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_0093: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: 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_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0161: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: 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_01a0: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			if (!_isFlying)
			{
				return;
			}
			PhysicsRig physicsRig = Player.PhysicsRig;
			if (!((Object)(object)physicsRig == (Object)null))
			{
				float value = _prefDeadzone.Value;
				Vector2 thumbStickAxis = Player.LeftController.GetThumbStickAxis();
				float num = ((Mathf.Abs(thumbStickAxis.x) > value) ? thumbStickAxis.x : 0f);
				float num2 = ((Mathf.Abs(thumbStickAxis.y) > value) ? thumbStickAxis.y : 0f);
				Vector2 thumbStickAxis2 = Player.RightController.GetThumbStickAxis();
				float num3 = ((Mathf.Abs(thumbStickAxis2.y) > value) ? thumbStickAxis2.y : 0f);
				Transform head = Player.Head;
				Vector3 val = head.forward;
				Vector3 val2 = head.right;
				val.y = 0f;
				val = ((Vector3)(ref val)).normalized;
				val2.y = 0f;
				val2 = ((Vector3)(ref val2)).normalized;
				Vector3 val3 = (val * num2 + val2 * num) * _prefMoveSpeed.Value + Vector3.up * num3 * _prefVerticalSpeed.Value;
				_currentVelocity = Vector3.Lerp(_currentVelocity, val3, Time.deltaTime * _prefDamping.Value);
				Rigidbody[] coreBodyRigidbodies = GetCoreBodyRigidbodies(physicsRig);
				Rigidbody[] array = coreBodyRigidbodies;
				foreach (Rigidbody val4 in array)
				{
					Vector3 val5 = _currentVelocity - val4.velocity;
					val4.AddForce(val5, (ForceMode)2);
				}
				if (!_loggedFirstFly)
				{
					((MelonBase)this).LoggerInstance.Msg($"Flying! velocity={_currentVelocity} bodies={coreBodyRigidbodies.Length}");
				}
			}
		}
		catch (Exception ex)
		{
			((MelonBase)this).LoggerInstance.Error("OnFixedUpdate: " + ex.Message);
		}
	}
}