Decompiled source of IWannaBreak v1.0.0

IWannaBreak.dll

Decompiled 2 weeks ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("PEAK_Press_to_ragdoll")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PEAK_Press_to_ragdoll")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9afeb295-486e-4504-b25e-7c68a31c535e")]
[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")]
[BepInPlugin("RyBy.IWannaBreak", "IWannaBreak", "1.0")]
public class StaminaSmoothFall : BaseUnityPlugin
{
	private Character local;

	private bool isFalling = false;

	private float fallStartTime = 0f;

	private void Update()
	{
		if ((Object)(object)local == (Object)null)
		{
			local = Character.localCharacter;
		}
		if ((Object)(object)local == (Object)null)
		{
			return;
		}
		float currentStamina = local.data.currentStamina;
		if (isFalling || !(currentStamina > 0.01f))
		{
			if (!isFalling && currentStamina <= 0.01f)
			{
				isFalling = true;
				fallStartTime = Time.time;
				local.data.currentRagdollControll = 0f;
				local.data.fallSeconds = 5f;
				local.data.passedOut = false;
				local.data.fullyPassedOut = false;
			}
			if (isFalling && Time.time - fallStartTime >= 5f)
			{
				isFalling = false;
				local.data.currentRagdollControll = 1f;
				local.data.fallSeconds = 0f;
				local.data.passedOut = false;
				local.data.fullyPassedOut = false;
			}
		}
	}
}