using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BoneLib;
using BoneLib.BoneMenu;
using BoneLib.Notifications;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppSLZ.Marrow;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using RagdollExt;
using RagdollPlayer;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Core), "RagdollExt", "1.7.0", "CAitVR", "https://github.com/RTX9999ti/RagdollExtBL")]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("RagdollExt")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+eb8d974c1dc43123a84f1f26e070af624dab34eb")]
[assembly: AssemblyProduct("RagdollExt")]
[assembly: AssemblyTitle("RagdollExt")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace RagdollExt
{
public class Core : MelonMod
{
[HarmonyPatch(typeof(Player_Health), "Death")]
private static class DeathPatch
{
[HarmonyPostfix]
private static void Postfix(Player_Health __instance)
{
if (ModEnabled)
{
RagdollPlayerMod.UnragdollRig(Player.RigManager);
Instance._ragdollCooldownUntil = Time.time + Instance._deathRagdollCooldown;
}
}
}
private PhysGrounder _grounder;
private bool _sceneLoaded;
public const string ModVersion = "1.7.0";
public static bool ModEnabled = true;
public static bool FallEnabled = true;
public static float FVT = 10f;
public static bool ImpactEnabled = true;
public static float ImpactThreshold = 10f;
public static bool LaunchEnabled = true;
public static float LaunchThreshold = 10f;
public static bool SlipEnabled = true;
public static float SlipFrictionThreshold = 0.15f;
public static float SlipVelocityThreshold = 3f;
public static bool WallPushFallEnabled = true;
public static float WallPushVelocityThreshold = 3.2f;
private Vector3 _lastVelocity;
private float _nextRagdollTime;
private const float COOLDOWN = 2f;
private Page _mainPage;
private Page _fallpage;
private Page _impactpage;
private Page _tackoffpage;
private Page _slippage;
private Page _pushwallpage;
private Page _Commit;
private float _ragdollCooldownUntil = 0f;
private float _deathRagdollCooldown = 5f;
public static Core Instance;
private static MelonPreferences_Category _cat;
private static MelonPreferences_Entry<bool> _prefModEnabled;
private static MelonPreferences_Entry<bool> _prefFallEnabled;
private static MelonPreferences_Entry<float> _prefFVT;
private static MelonPreferences_Entry<bool> _prefImpactEnabled;
private static MelonPreferences_Entry<float> _prefImpactThreshold;
private static MelonPreferences_Entry<bool> _prefLaunchEnabled;
private static MelonPreferences_Entry<float> _prefLaunchThreshold;
private static MelonPreferences_Entry<bool> _prefSlipEnabled;
private static MelonPreferences_Entry<float> _prefSlipFriction;
private static MelonPreferences_Entry<float> _prefSlipVelocity;
private static MelonPreferences_Entry<bool> _prefWallPushEnabled;
private static MelonPreferences_Entry<float> _prefWallPushVelocity;
private static MelonPreferences_Entry<float> _prefDeathCooldown;
public override void OnInitializeMelon()
{
((MelonBase)this).LoggerInstance.Msg("RagdollExt Initialized");
Hooking.OnLevelLoaded += delegate
{
OnSceneLoaded();
};
Instance = this;
SetupPreferences();
((MelonBase)this).HarmonyInstance.PatchAll();
CreateBoneMenu();
}
private void SetupPreferences()
{
_cat = MelonPreferences.CreateCategory("RagdollExt");
_prefModEnabled = _cat.CreateEntry<bool>("ModEnabled", ModEnabled, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefFallEnabled = _cat.CreateEntry<bool>("FallEnabled", FallEnabled, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefFVT = _cat.CreateEntry<float>("FallVelocityThreshold", FVT, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefImpactEnabled = _cat.CreateEntry<bool>("ImpactEnabled", ImpactEnabled, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefImpactThreshold = _cat.CreateEntry<float>("ImpactThreshold", ImpactThreshold, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefLaunchEnabled = _cat.CreateEntry<bool>("LaunchEnabled", LaunchEnabled, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefLaunchThreshold = _cat.CreateEntry<float>("LaunchThreshold", LaunchThreshold, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefSlipEnabled = _cat.CreateEntry<bool>("SlipEnabled", SlipEnabled, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefSlipFriction = _cat.CreateEntry<float>("SlipFrictionThreshold", SlipFrictionThreshold, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefSlipVelocity = _cat.CreateEntry<float>("SlipVelocityThreshold", SlipVelocityThreshold, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefWallPushEnabled = _cat.CreateEntry<bool>("WallPushEnabled", WallPushFallEnabled, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefWallPushVelocity = _cat.CreateEntry<float>("WallPushVelocityThreshold", WallPushVelocityThreshold, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
_prefDeathCooldown = _cat.CreateEntry<float>("DeathCooldown", _deathRagdollCooldown, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
ModEnabled = _prefModEnabled.Value;
FallEnabled = _prefFallEnabled.Value;
FVT = _prefFVT.Value;
ImpactEnabled = _prefImpactEnabled.Value;
ImpactThreshold = _prefImpactThreshold.Value;
LaunchEnabled = _prefLaunchEnabled.Value;
LaunchThreshold = _prefLaunchThreshold.Value;
SlipEnabled = _prefSlipEnabled.Value;
SlipFrictionThreshold = _prefSlipFriction.Value;
SlipVelocityThreshold = _prefSlipVelocity.Value;
WallPushFallEnabled = _prefWallPushEnabled.Value;
WallPushVelocityThreshold = _prefWallPushVelocity.Value;
_deathRagdollCooldown = _prefDeathCooldown.Value;
((MelonBase)this).LoggerInstance.Msg("MelonpreferencesSetup");
}
private void CreateBoneMenu()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: 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_024a: Unknown result type (might be due to invalid IL or missing references)
//IL_0294: Unknown result type (might be due to invalid IL or missing references)
//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
//IL_02ea: 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_0368: Unknown result type (might be due to invalid IL or missing references)
//IL_038b: Unknown result type (might be due to invalid IL or missing references)
//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
//IL_042a: Unknown result type (might be due to invalid IL or missing references)
//IL_045f: Unknown result type (might be due to invalid IL or missing references)
//IL_0494: Unknown result type (might be due to invalid IL or missing references)
_Commit = Page.Root.CreatePage(".debug-info-", Color.green, 0, true);
_Commit.CreateFunction("Kill-Your-Self", Color.red, (Action)delegate
{
Player_Health component = ((Component)Player.RigManager).GetComponent<Player_Health>();
((Health)component).TAKEDAMAGE(6.767677E+13f);
});
_mainPage = Page.Root.CreatePage("Ragdoll Ext", Color.red, 0, true);
_mainPage.CreateBool("Mod Enabled", Color.green, ModEnabled, (Action<bool>)delegate(bool v)
{
ModEnabled = v;
_prefModEnabled.Value = v;
_cat.SaveToFile(false);
});
_fallpage = _mainPage.CreatePage("Fall Setting", Color.yellow, 0, true);
_fallpage.CreateBool("Fall Enabled", Color.yellow, FallEnabled, (Action<bool>)delegate(bool v)
{
FallEnabled = v;
_prefFallEnabled.Value = v;
_cat.SaveToFile(false);
});
_fallpage.CreateFloat("Fall Velocity Threshold", Color.yellow, FVT, 0.5f, 1f, 30f, (Action<float>)delegate(float v)
{
FVT = v;
_prefFVT.Value = v;
_cat.SaveToFile(false);
});
_impactpage = _mainPage.CreatePage("Impact Setting", Color.cyan, 0, true);
_impactpage.CreateBool("Impact Enabled", Color.cyan, ImpactEnabled, (Action<bool>)delegate(bool v)
{
ImpactEnabled = v;
_prefImpactEnabled.Value = v;
_cat.SaveToFile(false);
});
_impactpage.CreateFloat("Impact Threshold", Color.cyan, ImpactThreshold, 1f, 2f, 40f, (Action<float>)delegate(float v)
{
ImpactThreshold = v;
_prefImpactThreshold.Value = v;
_cat.SaveToFile(false);
});
_tackoffpage = _mainPage.CreatePage("Launch Setting", Color.magenta, 0, true);
_tackoffpage.CreateBool("Launch Enabled", Color.magenta, LaunchEnabled, (Action<bool>)delegate(bool v)
{
LaunchEnabled = v;
_prefLaunchEnabled.Value = v;
_cat.SaveToFile(false);
});
_tackoffpage.CreateFloat("Launch Threshold", Color.magenta, LaunchThreshold, 1f, 2f, 50f, (Action<float>)delegate(float v)
{
LaunchThreshold = v;
_prefLaunchThreshold.Value = v;
_cat.SaveToFile(false);
});
_slippage = _mainPage.CreatePage("Slip Setting", Color.blue, 0, true);
_slippage.CreateBool("Slip Enabled", Color.blue, SlipEnabled, (Action<bool>)delegate(bool v)
{
SlipEnabled = v;
_prefSlipEnabled.Value = v;
_cat.SaveToFile(false);
});
_slippage.CreateFloat("Slip Friction Threshold", Color.blue, SlipFrictionThreshold, 0.01f, 0f, 1f, (Action<float>)delegate(float v)
{
SlipFrictionThreshold = v;
_prefSlipFriction.Value = v;
_cat.SaveToFile(false);
});
_slippage.CreateFunction("Slip Info", Color.blue, (Action)delegate
{
//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_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Expected O, but got Unknown
Notifier.Send(new Notification
{
Title = NotificationText.op_Implicit("Slip"),
Message = NotificationText.op_Implicit("Running fast across low-friction surfaces or performing a hard landing on slippery ground may cause loss of balance and trigger ragdoll"),
PopupLength = 5f,
ShowTitleOnPopup = true
});
});
_slippage.CreateFunction("Debug-Info", Color.red, (Action)delegate
{
//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_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: 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_0050: Expected O, but got Unknown
Notifier.Send(new Notification
{
Title = NotificationText.op_Implicit("Current Ground Friction"),
Message = NotificationText.op_Implicit("Current Ground Friction is:" + GetGroundFriction()),
PopupLength = 5f,
ShowTitleOnPopup = true
});
});
_pushwallpage = _mainPage.CreatePage("WallPush Setting", Color.gray, 0, true);
_pushwallpage.CreateBool("Wall Push Fall Enabled", Color.gray, WallPushFallEnabled, (Action<bool>)delegate(bool v)
{
WallPushFallEnabled = v;
_prefWallPushEnabled.Value = v;
_cat.SaveToFile(false);
});
_pushwallpage.CreateFloat("Wall Push Velocity Threshold", Color.gray, WallPushVelocityThreshold, 0.1f, 0f, 20f, (Action<float>)delegate(float v)
{
WallPushVelocityThreshold = v;
_prefWallPushVelocity.Value = v;
_cat.SaveToFile(false);
});
_pushwallpage.CreateFunction("Wall push Info", Color.gray, (Action)delegate
{
//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_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Expected O, but got Unknown
Notifier.Send(new Notification
{
Title = NotificationText.op_Implicit("Wall Push"),
Message = NotificationText.op_Implicit("Jump toward a wall and push it with your hands while airborne. The reaction force may destabilize your rig and triggerr ragdoll"),
PopupLength = 5f,
ShowTitleOnPopup = true
});
});
_mainPage.CreateFunction("Mod Info", Color.white, (Action)delegate
{
//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_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Expected O, but got Unknown
Notifier.Send(new Notification
{
Title = NotificationText.op_Implicit("Mod Info"),
Message = NotificationText.op_Implicit("Version:1.7.0 Author:CAitVR"),
PopupLength = 5f,
ShowTitleOnPopup = true
});
});
_mainPage.CreateFloat("Death Ragdoll Cooldown (s)", Color.magenta, _deathRagdollCooldown, 0.1f, 1f, 20f, (Action<float>)delegate(float v)
{
_deathRagdollCooldown = v;
_prefDeathCooldown.Value = v;
_cat.SaveToFile(false);
});
}
private void OnSceneLoaded()
{
//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)
_sceneLoaded = true;
if ((Object)(object)Player.PhysicsRig != (Object)null)
{
_grounder = Player.PhysicsRig.feet.GetComponent<PhysGrounder>();
}
_lastVelocity = Vector3.zero;
_nextRagdollTime = 0f;
}
private float GetGroundFriction()
{
//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 ((Object)(object)Player.PhysicsRig == (Object)null)
{
return 1f;
}
RaycastHit val = default(RaycastHit);
if (Physics.Raycast(Player.PhysicsRig.feet.transform.position, Vector3.down, ref val, 2f))
{
PhysicMaterial sharedMaterial = ((RaycastHit)(ref val)).collider.sharedMaterial;
if ((Object)(object)sharedMaterial != (Object)null)
{
return sharedMaterial.dynamicFriction;
}
}
return 1f;
}
private bool CheckWallPushFall(RigManager rig, Vector3 velocity)
{
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
PhysicsRig physicsRig = rig.physicsRig;
if ((Object)(object)_grounder == (Object)null || _grounder.isGrounded)
{
return false;
}
Hand leftHand = physicsRig.leftHand;
Hand rightHand = physicsRig.rightHand;
if ((!((Object)(object)leftHand != (Object)null) || !leftHand.physHand._colliding) && (!((Object)(object)rightHand != (Object)null) || !rightHand.physHand._colliding))
{
return false;
}
Vector3 val = velocity;
val.y = 0f;
if (((Vector3)(ref val)).magnitude > WallPushVelocityThreshold)
{
return true;
}
return false;
}
public override void OnUpdate()
{
//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_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: 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_01d3: Unknown result type (might be due to invalid IL or missing references)
//IL_028b: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_029a: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_0348: Unknown result type (might be due to invalid IL or missing references)
//IL_0370: Unknown result type (might be due to invalid IL or missing references)
//IL_0371: Unknown result type (might be due to invalid IL or missing references)
//IL_0367: Unknown result type (might be due to invalid IL or missing references)
//IL_0368: Unknown result type (might be due to invalid IL or missing references)
//IL_024e: Unknown result type (might be due to invalid IL or missing references)
//IL_024f: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: Unknown result type (might be due to invalid IL or missing references)
//IL_0307: Unknown result type (might be due to invalid IL or missing references)
if (!ModEnabled || Time.time < _ragdollCooldownUntil || !_sceneLoaded || (Object)(object)Player.PhysicsRig == (Object)null)
{
return;
}
RigManager rigManager = Player.RigManager;
if ((Object)(object)rigManager == (Object)null)
{
return;
}
PhysicsRig physicsRig = rigManager.physicsRig;
if ((Object)(object)physicsRig == (Object)null || Time.time < _nextRagdollTime)
{
return;
}
Vector3 wholeBodyVelocity = physicsRig.wholeBodyVelocity;
Vector3 val = wholeBodyVelocity - _lastVelocity;
float y = wholeBodyVelocity.y;
float magnitude = ((Vector3)(ref val)).magnitude;
if (physicsRig.torso.shutdown || !physicsRig.ballLocoEnabled)
{
_lastVelocity = wholeBodyVelocity;
return;
}
bool flag = ((Object)(object)physicsRig.leftHand != (Object)null && (Object)(object)physicsRig.leftHand.m_CurrentAttachedGO != (Object)null && (Object)(object)physicsRig.leftHand.m_CurrentAttachedGO.GetComponentInParent<FlyingGun>() != (Object)null) || ((Object)(object)physicsRig.rightHand != (Object)null && (Object)(object)physicsRig.rightHand.m_CurrentAttachedGO != (Object)null && (Object)(object)physicsRig.rightHand.m_CurrentAttachedGO.GetComponentInParent<FlyingGun>() != (Object)null);
if (FallEnabled && !flag && (Object)(object)_grounder != (Object)null && !_grounder.isGrounded && y < 0f - FVT)
{
TriggerRagdoll(rigManager, "Fall", Drop: false);
_lastVelocity = wholeBodyVelocity;
return;
}
if (magnitude > 0.1f)
{
float num = Vector3.Dot(((Vector3)(ref val)).normalized, ((Vector3)(ref wholeBodyVelocity)).normalized);
if (ImpactEnabled && num < -0.5f && magnitude > ImpactThreshold)
{
TriggerRagdoll(rigManager, "Impact", Drop: true);
_lastVelocity = wholeBodyVelocity;
return;
}
if (LaunchEnabled && num > 0.5f && magnitude > LaunchThreshold)
{
TriggerRagdoll(rigManager, "tack——offfffffffffff!", Drop: false);
_lastVelocity = wholeBodyVelocity;
return;
}
}
if (SlipEnabled && !flag && (Object)(object)_grounder != (Object)null && _grounder.isGrounded)
{
Vector3 val2 = wholeBodyVelocity;
val2.y = 0f;
bool flag2 = Mathf.Abs(val.y) > 4f;
if ((GetGroundFriction() < SlipFrictionThreshold && ((Vector3)(ref val2)).magnitude > SlipVelocityThreshold) || (GetGroundFriction() < SlipFrictionThreshold && flag2))
{
if (GetGroundFriction() < SlipFrictionThreshold)
{
TriggerRagdoll(rigManager, "Slip", Drop: false);
_lastVelocity = wholeBodyVelocity;
((MelonBase)this).LoggerInstance.Msg(GetGroundFriction() + "<" + SlipFrictionThreshold);
}
return;
}
}
if (WallPushFallEnabled && CheckWallPushFall(rigManager, wholeBodyVelocity))
{
TriggerRagdoll(rigManager, "WPF", Drop: true);
_lastVelocity = wholeBodyVelocity;
}
else
{
_lastVelocity = wholeBodyVelocity;
}
}
private bool TryDrop(Hand hand)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
if (hand.HasAttachedObject())
{
Grip val = ((Il2CppObjectBase)hand.AttachedReceiver).TryCast<Grip>();
if ((Object)val != (Object)null)
{
val.ForceDetach(true);
((MelonBase)this).LoggerInstance.Msg("i drop object in your hand hahahahahahahahahahahahahhahahahahahahha");
return true;
}
}
((MelonBase)this).LoggerInstance.Msg("i can not drop object in your hand idk y");
return false;
}
private void TriggerRagdoll(RigManager rig, string reason, bool Drop)
{
RagdollPlayerMod.RagdollRig(rig);
if (Drop)
{
TryDrop(Player.LeftHand);
TryDrop(Player.RightHand);
}
_nextRagdollTime = Time.time + 2f;
((MelonBase)this).LoggerInstance.Msg("Ragdoll Triggered: " + reason);
}
private void OnPlayerDead()
{
if ((Object)(object)Player.RigManager != (Object)null)
{
RagdollPlayerMod.UnragdollRig(Player.RigManager);
((MelonBase)this).LoggerInstance.Msg("YOU ARE DEAD [IDIOT]");
}
}
}
}