using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BoneLib.BoneMenu;
using HarmonyLib;
using Il2CppSLZ.Marrow;
using MelonLoader;
using RagdollPlayer;
using Ragdoll_Death;
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(Class1), "Ragdoll Death", "1.0.0", "YourName", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Ragdoll Death")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Ragdoll Death")]
[assembly: AssemblyTitle("Ragdoll Death")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Ragdoll_Death;
public class Class1 : MelonMod
{
[HarmonyPatch(typeof(RigManager), "Awake")]
public class RigManagerPatch
{
public static void Postfix(RigManager __instance)
{
myRigManager = __instance;
}
}
public static RigManager myRigManager = null;
private static bool wasDead = false;
private static bool modEnabled = true;
public override void OnInitializeMelon()
{
//IL_0016: 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)
MelonLogger.Msg("Мод Ragdoll Death загружен!");
Page val = Page.Root.CreatePage("Ragdoll Death", Color.red, 0, true);
val.CreateBool("Toggle", Color.white, modEnabled, (Action<bool>)delegate(bool value)
{
modEnabled = value;
MelonLogger.Msg($"Мод включен: {modEnabled}");
});
}
public override void OnUpdate()
{
if ((Object)(object)myRigManager == (Object)null || !modEnabled)
{
return;
}
if (myRigManager.health.curr_Health <= 0f)
{
RagdollPlayerMod.RagdollRig(myRigManager);
if (!wasDead)
{
MelonLogger.Msg("Игрок умер, регдолл включен!");
wasDead = true;
}
}
else if (wasDead)
{
RagdollPlayerMod.UnragdollRig(myRigManager);
MelonLogger.Msg("Игрок жив, регдолл выключен!");
wasDead = false;
}
}
}