using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Threading;
using BoneLib;
using BoneLib.BoneMenu;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSLZ.Marrow;
using MelonLoader;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(CloneMod), "CloneMod", "1.0.0", "CloneMod", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: MelonGame("Stress Level Zero", "com.StressLevelZero.BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("CloneMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+c7143c360c4e0db90877bab38c68d9d6369fbcc7")]
[assembly: AssemblyProduct("CloneMod")]
[assembly: AssemblyTitle("CloneMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
public class CloneMod : MelonMod
{
public override void OnInitializeMelon()
{
//IL_0014: 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)
MelonLogger.Msg("CloneMod loaded!");
Page.Root.CreatePage("CloneMod", Color.white, 0, true).CreateFunction("Spawn Clone", Color.white, (Action)StartCloneCountdown);
}
private static void StartCloneCountdown()
{
//IL_006b: 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)
if ((Object)(object)Player.Avatar == (Object)null || (Object)(object)Player.RigManager == (Object)null)
{
MelonLogger.Warning("Could not spawn clone because the player avatar is not ready.");
return;
}
PlayBeep();
Thread.Sleep(1000);
PlayBeep();
Thread.Sleep(1000);
PlayBeep();
Thread.Sleep(1000);
foreach (MonoBehaviour componentsInChild in Object.Instantiate<GameObject>(((Component)Player.Avatar).gameObject, ((Rig)Player.RigManager.physicsRig).m_head.position, ((Component)Player.RigManager).transform.rotation).GetComponentsInChildren<MonoBehaviour>())
{
if ((Object)(object)componentsInChild != (Object)null)
{
((Behaviour)componentsInChild).enabled = false;
}
}
MelonLogger.Msg("Player clone spawned.");
}
private static void PlayBeep()
{
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
AudioClip val = AudioClip.Create("beep", 4410, 1, 44100, false);
float[] array = new float[4410];
for (int i = 0; i < array.Length; i++)
{
array[i] = Mathf.Sin((float)Math.PI * 1760f * (float)i / 44100f);
}
val.SetData(Il2CppStructArray<float>.op_Implicit(array), 0);
AudioSource.PlayClipAtPoint(val, ((Rig)Player.RigManager.physicsRig).m_head.position);
}
}