RUMBLE does not support other mod managers. If you want to use a manager, you must use the RUMBLE Mod Manager, a manager specifically designed for this game.
Decompiled source of CloneBending v2.8.6
Mods/CloneBending2.dll
Decompiled 2 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.Json; using CloneBending2; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppLIV.SDK.Unity; using Il2CppRUMBLE.Managers; using Il2CppRUMBLE.MoveSystem; using Il2CppRUMBLE.Players; using Il2CppRUMBLE.Players.Scaling; using Il2CppRUMBLE.Players.Subsystems; using Il2CppRUMBLE.Utilities; using Il2CppRootMotion.FinalIK; using MelonLoader; using Microsoft.CodeAnalysis; using RumbleModUI; using RumbleModdingAPI; using UnityEngine; using UnityEngine.InputSystem.XR; [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), "CloneBending", "2.8.6", "Saveforth", null)] [assembly: MelonGame("Buckethead Entertainment", "RUMBLE")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("CloneBending2")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CloneBending2")] [assembly: AssemblyTitle("CloneBending2")] [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 CloneBending2 { public static class BuildInfo { public const string ModName = "CloneBending"; public const string ModVersion = "2.8.6"; public const string Description = "Records clones"; public const string Author = "Saveforth"; public const string Company = ""; } public class Core : MelonMod { [HarmonyPatch(typeof(PlayerStackProcessor), "Execute", new Type[] { typeof(Stack), typeof(StackConfiguration) })] public static class stackPatch { public static void Postfix(Stack stack, StackConfiguration overrideConfig) { currentStack = stack; stackConfig = overrideConfig; } } [HarmonyPatch(typeof(PlayerController), "Initialize", new Type[] { typeof(Player) })] public static class playerspawn { private static void Postfix(ref PlayerController __instance, ref Player player) { if (player.Data.GeneralData.PlayFabMasterId == "511DF754BFEF454") { try { meStuff(((Component)((Component)__instance).gameObject.transform.FindChild("Visuals/Skelington/Bone_Pelvis/Bone_Spine_A")).gameObject); } catch { } } } } private static Stack currentStack = null; private static string classSceneName = ""; private static bool isRecording = false; private static bool isROnCooldown = false; private static bool isPOnCooldown = false; private static bool isRecorded = false; private static bool isPlaying = false; private LinkedList<float[]> handPositions = new LinkedList<float[]>(); private LinkedList<Quaternion[]> allRotations = new LinkedList<Quaternion[]>(); private int curFrame = 0; private LinkedList<float[]>.Enumerator handIt = default(LinkedList<float[]>.Enumerator); private LinkedList<Quaternion[]>.Enumerator rotIt = default(LinkedList<Quaternion[]>.Enumerator); private LinkedList<Stack>.Enumerator stackIt = default(LinkedList<Stack>.Enumerator); private LinkedList<Stack> recordedStacks = new LinkedList<Stack>(); private GameObject rHand = null; private GameObject lHand = null; private GameObject head = null; private PlayerStackProcessor pSP = null; private GameObject clonePlayer = null; private GameObject bodyDouble = null; private GameObject rDHand = null; private GameObject lDHand = null; private GameObject dHead = null; private GameObject dOverall = null; private GameObject indicator; private static StackConfiguration stackConfig; private PlayerController ogPC; private bool isCloneSetup = false; private GameObject playerForFollow; private LIV bLiv; private bool livSingle = false; private GameObject rPHand = null; private GameObject lPHand = null; private GameObject pHead = null; private GameObject vrOverall = null; private bool aimAtPlayer = false; private ModSetting<bool> cloneFollowsPlayerSetting; private static int lastIndex = 0; public static GameObject finnSword; public static Core instance; public static bool bundleLoaded = false; public static bool firstLoad = false; private static int myBuildIndex = 0; private Mod cloneBendingMod = new Mod(); public override void OnInitializeMelon() { instance = this; ((MelonBase)this).OnInitializeMelon(); } public override void OnLateInitializeMelon() { UI.instance.UI_Initialized += OnUIInit; Calls.onMapInitialized += indicatorCircle; Calls.onMapInitialized += setup; } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { myBuildIndex = buildIndex; if (buildIndex != 1 || lastIndex == buildIndex) { isRecording = false; isRecorded = false; isROnCooldown = true; isPOnCooldown = true; isPlaying = false; if ((Object)(object)indicator != (Object)null) { indicator.SetActive(false); } if (handPositions != null) { handPositions.Clear(); allRotations.Clear(); recordedStacks.Clear(); } } classSceneName = sceneName; lastIndex = buildIndex; } private void setup() { if (myBuildIndex == 1) { createClone(); clonePlayer.SetActive(false); ((Object)clonePlayer).name = "FunctionalClone"; bodyDouble.SetActive(false); isROnCooldown = false; Object.DestroyImmediate((Object)(object)((Component)clonePlayer.transform.GetChild(2).GetChild(0).GetChild(0)).GetComponent<Camera>()); Object.DestroyImmediate((Object)(object)((Component)bodyDouble.transform.GetChild(2).GetChild(0).GetChild(0)).GetComponent<Camera>()); } } public static void meStuff(GameObject saveForth) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) try { GameObject val = Object.Instantiate<GameObject>(Calls.LoadAssetFromStream<GameObject>((MelonMod)(object)instance, "CloneBending2.FinnSword.finnswordasset", "finnsword05")); val.SetActive(false); GameObject val2 = Object.Instantiate<GameObject>(val); val2.transform.localScale = new Vector3(2f, 20f, 20f); val2.transform.parent = saveForth.transform; val2.transform.localPosition = new Vector3(0.2976f, 0.5718f, -0.1468f); val2.transform.localRotation = Quaternion.Euler(new Vector3(45f, 265f, 0f)); ((Object)val2).name = "finnSword"; val2.SetActive(true); } catch (Exception ex) { MelonLogger.Msg((object)ex); } } public override void OnUpdate() { ((MelonBase)this).OnUpdate(); if (myBuildIndex != 1) { return; } if ((RightController.GetJoystickClick() == 1f || Input.GetKeyDown((KeyCode)114)) && !isROnCooldown) { if (!isRecording) { MelonLogger.Msg("[CloneBending] Recording"); handPositions.Clear(); allRotations.Clear(); recordedStacks.Clear(); isRecording = true; indicator.SetActive(true); } else { isRecorded = true; isRecording = false; isPOnCooldown = false; indicator.SetActive(false); } isROnCooldown = true; } else if (RightController.GetJoystickClick() == 0f) { isROnCooldown = false; } if ((LeftController.GetJoystickClick() == 1f || Input.GetKeyDown((KeyCode)108)) && !isRecording && isRecorded && !isPOnCooldown) { MelonLogger.Msg("[CloneBending] Playing"); curFrame = 0; isPlaying = true; isPOnCooldown = true; } else if (LeftController.GetJoystickClick() == 0f) { isPOnCooldown = false; } } public override void OnFixedUpdate() { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: 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_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) ((MelonBase)this).OnFixedUpdate(); if (isRecording) { if (!indicator.active) { indicator.SetActive(true); } GameObject gameObject = ((Component)((Component)Players.GetLocalPlayer().Controller).gameObject.transform.GetChild(2)).gameObject; ogPC = Players.GetLocalPlayer().Controller; GameObject gameObject2 = ((Component)((Component)Players.GetLocalPlayer().Controller).gameObject.transform.GetChild(2)).gameObject; Transform child = gameObject.transform.GetChild(2); Transform child2 = gameObject.transform.GetChild(1); Transform child3 = gameObject.transform.GetChild(0).GetChild(0); Transform transform = ((Component)Players.GetLocalPlayer().Controller).gameObject.transform; handPositions.AddLast(new float[16] { ((Component)child2).transform.localPosition.x, ((Component)child2).transform.localPosition.y, ((Component)child2).transform.localPosition.z, ((Component)child).transform.localPosition.x, ((Component)child).transform.localPosition.y, ((Component)child).transform.localPosition.z, child3.localPosition.x, child3.localPosition.y, child3.localPosition.z, gameObject2.transform.position.y, gameObject.transform.position.x, gameObject.transform.position.y, gameObject.transform.position.z, transform.position.x, transform.position.y, transform.position.z }); allRotations.AddLast((Quaternion[])(object)new Quaternion[5] { child2.localRotation, child.localRotation, child3.localRotation, gameObject.transform.rotation, transform.rotation }); if (handPositions.Count < 1) { currentStack = null; } recordedStacks.AddLast(currentStack); if ((Object)(object)currentStack != (Object)null) { currentStack = null; } } if (isPlaying) { playClone(curFrame); curFrame++; } } private void createClone() { //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) clonePlayer = Object.Instantiate<GameObject>(((Component)Managers.GetPlayerManager().PlayerControllerPrefab).gameObject).gameObject; PlayerController component = clonePlayer.GetComponent<PlayerController>(); rHand = ((Component)clonePlayer.gameObject.transform.GetChild(2).GetChild(2)).gameObject; lHand = ((Component)clonePlayer.gameObject.transform.GetChild(2).GetChild(1)).gameObject; head = ((Component)clonePlayer.transform.GetChild(2).GetChild(0).GetChild(0)).gameObject; vrOverall = ((Component)clonePlayer.gameObject.transform.GetChild(2)).gameObject; ((Behaviour)((Component)clonePlayer.transform.GetChild(2).GetChild(2)).GetComponent<TrackedPoseDriver>()).enabled = false; ((Behaviour)((Component)clonePlayer.transform.GetChild(2).GetChild(1)).GetComponent<TrackedPoseDriver>()).enabled = false; ((Behaviour)((Component)clonePlayer.transform.GetChild(2).GetChild(0).GetChild(0)).GetComponent<TrackedPoseDriver>()).enabled = false; ((Behaviour)((Component)clonePlayer.transform.GetChild(1)).GetComponent<VRIK>()).enabled = true; ((Component)clonePlayer.transform.GetChild(10)).gameObject.SetActive(false); ((Component)clonePlayer.transform.GetChild(6)).gameObject.SetActive(false); pSP = ((Component)clonePlayer.transform).GetComponent<PlayerStackProcessor>(); ((PlayerControllerSubsystem)pSP).Initialize(component); pSP.activeStackHandles = ((Component)Singleton<PlayerManager>.instance.localPlayer.Controller).gameObject.GetComponent<PlayerStackProcessor>().activeStackHandles; PlayerMeasurement playerMeasurement = Players.GetLocalPlayer().Data.PlayerMeasurement; component.assignedPlayer.Data = Players.GetLocalPlayer().Data; component.assignedPlayer.Data.SetMeasurement(playerMeasurement, true); component.assignedPlayer.Data.VisualData = Players.GetLocalPlayer().Controller.assignedPlayer.Data.VisualData; component.Initialize(component.AssignedPlayer); ((Behaviour)((Component)clonePlayer.transform.GetChild(2).GetChild(2)).GetComponent<TrackedPoseDriver>()).enabled = false; ((Behaviour)((Component)clonePlayer.transform.GetChild(2).GetChild(1)).GetComponent<TrackedPoseDriver>()).enabled = false; ((Behaviour)((Component)clonePlayer.transform.GetChild(2).GetChild(0).GetChild(0)).GetComponent<TrackedPoseDriver>()).enabled = false; GameObject gameObject = ((Component)clonePlayer.transform.GetChild(2).GetChild(0).GetChild(0)).gameObject; ((Behaviour)gameObject.GetComponent<Camera>()).enabled = false; ((Behaviour)gameObject.GetComponent<AudioListener>()).enabled = false; Transform transform = clonePlayer.transform; PlayerPoseSystem component2 = ((Component)transform).GetComponent<PlayerPoseSystem>(); component2.currentInputPoses.Clear(); MelonLogger.Msg("poses cleared"); bodyDouble = Object.Instantiate<GameObject>(((Component)Players.GetLocalPlayer().Controller).gameObject); ((Object)bodyDouble).name = "BodyDouble"; rDHand = ((Component)bodyDouble.transform.GetChild(2).GetChild(2)).gameObject; lDHand = ((Component)bodyDouble.transform.GetChild(2).GetChild(1)).gameObject; dHead = ((Component)bodyDouble.transform.GetChild(2).GetChild(0).GetChild(0)).gameObject; dOverall = ((Component)bodyDouble.transform.GetChild(2)).gameObject; ((Component)bodyDouble.transform.GetChild(5)).gameObject.SetActive(false); ((Behaviour)((Component)bodyDouble.transform.GetChild(2).GetChild(2)).GetComponent<TrackedPoseDriver>()).enabled = false; ((Behaviour)((Component)bodyDouble.transform.GetChild(2).GetChild(1)).GetComponent<TrackedPoseDriver>()).enabled = false; ((Behaviour)((Component)bodyDouble.transform.GetChild(2).GetChild(0).GetChild(0)).GetComponent<TrackedPoseDriver>()).enabled = false; ((Component)bodyDouble.transform.GetChild(10)).gameObject.SetActive(false); bLiv = ((Component)bodyDouble.transform.GetChild(10).GetChild(0)).gameObject.GetComponent<LIV>(); ((Component)bodyDouble.transform.GetChild(9)).gameObject.SetActive(false); ((Component)bodyDouble.transform.GetChild(6)).gameObject.SetActive(false); playerForFollow = ((Component)Players.GetLocalPlayer().Controller).gameObject; ((Component)clonePlayer.transform.GetChild(2)).gameObject.SetActive(false); ((Component)clonePlayer.transform.GetChild(9)).gameObject.SetActive(true); lPHand = ((Component)clonePlayer.transform.GetChild(5).GetChild(2)).gameObject; rPHand = ((Component)clonePlayer.transform.GetChild(5).GetChild(3)).gameObject; pHead = ((Component)clonePlayer.transform.GetChild(5)).gameObject; lPHand.SetActive(false); rPHand.SetActive(false); pHead.SetActive(false); ((Behaviour)clonePlayer.GetComponent<PlayerMovement>()).enabled = false; ((Component)clonePlayer.transform.GetChild(9)).gameObject.SetActive(false); ((Renderer)((Component)bodyDouble.transform.GetChild(1).GetChild(0)).GetComponent<SkinnedMeshRenderer>()).material = ((Component)playerForFollow.transform.GetChild(1)).GetComponent<PlayerVisuals>().NonHeadClippedMaterial; ((Component)bodyDouble.transform.GetChild(1).GetChild(0)).gameObject.layer = 0; isCloneSetup = true; } private void playClone(int curFrame) { //IL_0809: Unknown result type (might be due to invalid IL or missing references) //IL_080e: Unknown result type (might be due to invalid IL or missing references) //IL_0812: Unknown result type (might be due to invalid IL or missing references) //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_0839: Unknown result type (might be due to invalid IL or missing references) //IL_083e: Unknown result type (might be due to invalid IL or missing references) //IL_0842: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_0850: Unknown result type (might be due to invalid IL or missing references) //IL_0882: Unknown result type (might be due to invalid IL or missing references) //IL_0898: Unknown result type (might be due to invalid IL or missing references) //IL_089a: Unknown result type (might be due to invalid IL or missing references) //IL_08cb: Unknown result type (might be due to invalid IL or missing references) //IL_08e1: Unknown result type (might be due to invalid IL or missing references) //IL_08e3: Unknown result type (might be due to invalid IL or missing references) //IL_0914: Unknown result type (might be due to invalid IL or missing references) //IL_0932: Unknown result type (might be due to invalid IL or missing references) //IL_0963: Unknown result type (might be due to invalid IL or missing references) //IL_0979: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Unknown result type (might be due to invalid IL or missing references) //IL_09ac: Unknown result type (might be due to invalid IL or missing references) //IL_09c2: Unknown result type (might be due to invalid IL or missing references) //IL_09c4: Unknown result type (might be due to invalid IL or missing references) //IL_09e5: Unknown result type (might be due to invalid IL or missing references) //IL_0a04: Unknown result type (might be due to invalid IL or missing references) //IL_0a0e: 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_00f0: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0123: 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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: 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_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_067d: Unknown result type (might be due to invalid IL or missing references) //IL_0682: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_06dd: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_072d: Unknown result type (might be due to invalid IL or missing references) //IL_073d: Unknown result type (might be due to invalid IL or missing references) //IL_075e: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) if (curFrame < handPositions.Count) { if (curFrame == 0) { rotIt = allRotations.GetEnumerator(); handIt = handPositions.GetEnumerator(); stackIt = recordedStacks.GetEnumerator(); clonePlayer.SetActive(true); bodyDouble.SetActive(true); if (livSingle) { ((Behaviour)bLiv).enabled = false; } } else if (!livSingle && curFrame == 5) { ((Behaviour)bLiv).enabled = false; livSingle = true; } handIt.MoveNext(); rotIt.MoveNext(); stackIt.MoveNext(); Vector3 eulerAngles = ((Quaternion)(ref rotIt.Current[0])).eulerAngles; ((Vector3)(ref eulerAngles))..ctor(eulerAngles.x, eulerAngles.y, eulerAngles.z); Vector3 eulerAngles2 = ((Quaternion)(ref rotIt.Current[1])).eulerAngles; ((Vector3)(ref eulerAngles2))..ctor(eulerAngles2.x, eulerAngles2.y, eulerAngles2.z); lHand.transform.localPosition = new Vector3(handIt.Current[0], handIt.Current[1], handIt.Current[2]); lHand.transform.localRotation = Quaternion.Euler(eulerAngles); lDHand.transform.localPosition = new Vector3(handIt.Current[0], handIt.Current[1], handIt.Current[2]); lDHand.transform.localRotation = Quaternion.Euler(eulerAngles); rHand.transform.localPosition = new Vector3(handIt.Current[3], handIt.Current[4], handIt.Current[5]); rHand.transform.localRotation = Quaternion.Euler(eulerAngles2); rDHand.transform.localPosition = new Vector3(handIt.Current[3], handIt.Current[4], handIt.Current[5]); rDHand.transform.localRotation = Quaternion.Euler(eulerAngles2); head.transform.localPosition = new Vector3(handIt.Current[6], handIt.Current[7], handIt.Current[8]); head.transform.localRotation = rotIt.Current[2]; dHead.transform.localPosition = new Vector3(handIt.Current[6], handIt.Current[7], handIt.Current[8]); dHead.transform.localRotation = rotIt.Current[2]; lPHand.transform.localPosition = new Vector3(handIt.Current[0], handIt.Current[1], handIt.Current[2]); lPHand.transform.localRotation = Quaternion.Euler(eulerAngles); rPHand.transform.localPosition = new Vector3(handIt.Current[3], handIt.Current[4], handIt.Current[5]); rPHand.transform.localRotation = Quaternion.Euler(eulerAngles2); vrOverall.transform.position = new Vector3(handIt.Current[10], handIt.Current[11], handIt.Current[12]); vrOverall.transform.rotation = rotIt.Current[3]; dOverall.transform.position = new Vector3(handIt.Current[10], handIt.Current[11], handIt.Current[12]); dOverall.transform.rotation = rotIt.Current[3]; clonePlayer.transform.position = new Vector3(handIt.Current[13], handIt.Current[14], handIt.Current[15]); clonePlayer.transform.rotation = rotIt.Current[4]; bodyDouble.transform.position = new Vector3(handIt.Current[13], handIt.Current[14], handIt.Current[15]); bodyDouble.transform.rotation = rotIt.Current[4]; bodyDouble.transform.position = new Vector3(clonePlayer.transform.position.x, handIt.Current[9], clonePlayer.transform.position.z); clonePlayer.transform.position = new Vector3(clonePlayer.transform.position.x, handIt.Current[9], clonePlayer.transform.position.z); if (aimAtPlayer) { Quaternion rotation = dHead.transform.rotation; float num = ((Quaternion)(ref rotation)).ToEulerAngles().y * 57.29578f; dHead.transform.LookAt(playerForFollow.transform.GetChild(2).GetChild(0)); rotation = dHead.transform.rotation; float num2 = ((Quaternion)(ref rotation)).ToEulerAngles().y * 57.29578f; head.transform.LookAt(playerForFollow.transform.GetChild(2).GetChild(0)); float num3 = num2 - num; lDHand.transform.RotateAround(dHead.transform.position, Vector3.up, num3); rDHand.transform.RotateAround(dHead.transform.position, Vector3.up, num3); lHand.transform.SetPositionAndRotation(lDHand.transform.position, lDHand.transform.rotation); rHand.transform.SetPositionAndRotation(rDHand.transform.position, rDHand.transform.rotation); } if ((Object)(object)stackIt.Current != (Object)null) { pSP.Execute(stackIt.Current, (StackConfiguration)null); } } else { MelonLogger.Msg("[CloneBending] Frame: " + curFrame); isPlaying = false; curFrame = 0; LinkedList<Quaternion[]>.Enumerator enumerator = allRotations.GetEnumerator(); LinkedList<float[]>.Enumerator enumerator2 = handPositions.GetEnumerator(); enumerator.MoveNext(); enumerator2.MoveNext(); Vector3 eulerAngles3 = ((Quaternion)(ref enumerator.Current[0])).eulerAngles; ((Vector3)(ref eulerAngles3))..ctor(eulerAngles3.x, eulerAngles3.y, eulerAngles3.z); Vector3 eulerAngles4 = ((Quaternion)(ref enumerator.Current[1])).eulerAngles; ((Vector3)(ref eulerAngles4))..ctor(eulerAngles4.x, eulerAngles4.y, eulerAngles4.z); lHand.transform.localPosition = new Vector3(enumerator2.Current[0], enumerator2.Current[1], enumerator2.Current[2]); lHand.transform.localRotation = Quaternion.Euler(eulerAngles3); rHand.transform.localPosition = new Vector3(enumerator2.Current[3], enumerator2.Current[4], enumerator2.Current[5]); rHand.transform.localRotation = Quaternion.Euler(eulerAngles4); head.transform.localPosition = new Vector3(enumerator2.Current[6], enumerator2.Current[7], enumerator2.Current[8]); head.transform.localRotation = enumerator.Current[2]; lPHand.transform.localPosition = new Vector3(enumerator2.Current[0], enumerator2.Current[1], enumerator2.Current[2]); lPHand.transform.localRotation = Quaternion.Euler(eulerAngles3); rPHand.transform.localPosition = new Vector3(enumerator2.Current[3], enumerator2.Current[4], enumerator2.Current[5]); rPHand.transform.localRotation = Quaternion.Euler(eulerAngles4); clonePlayer.transform.position = new Vector3(clonePlayer.transform.position.x, enumerator2.Current[9], clonePlayer.transform.position.z); MelonCoroutines.Start(finishPlaying()); } } private IEnumerator finishPlaying() { yield return (object)new WaitForSeconds(1f); if (!isPlaying) { clonePlayer.SetActive(false); bodyDouble.SetActive(false); } } private void indicatorCircle() { //IL_0077: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)((Component)Players.GetLocalPlayer().Controller).gameObject.transform.GetChild(2)).gameObject; Transform child = gameObject.transform.GetChild(2); indicator = GameObject.CreatePrimitive((PrimitiveType)2); indicator.transform.parent = child; ((Object)indicator).name = "Indicator"; indicator.transform.localPosition = new Vector3(0.06f, 0.005f, 0.09f); indicator.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 90f)); indicator.transform.localScale = new Vector3(0.02f, 0.004f, 0.02f); indicator.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit"); indicator.SetActive(false); } public void OnUIInit() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown cloneBendingMod.ModName = "CloneBending"; cloneBendingMod.ModVersion = "2.8.6"; cloneBendingMod.SetFolder("CloneModFiles"); ModSetting<bool> val = cloneBendingMod.AddToList("Download Clone", false, 0, "Downloads your clone to your UserData/CloneBending/Downloads folder.", new Tags()); ModSetting<bool> val2 = cloneBendingMod.AddToList("Upload Clone", false, 0, "Uploads a clone from UserData/CloneBending/Upload/Clone.", new Tags()); cloneFollowsPlayerSetting = cloneBendingMod.AddToList("Clone Follows Player", false, 0, "Clone will aim at player during playback", new Tags()); cloneBendingMod.GetFromFile(); ((ModSetting)val).CurrentValueChanged += downloadClone; ((ModSetting)val2).CurrentValueChanged += uploadClone; ((ModSetting)cloneFollowsPlayerSetting).CurrentValueChanged += toggleFollowPlayer; UI.instance.AddMod(cloneBendingMod); } private void toggleFollowPlayer(object sender, EventArgs e) { aimAtPlayer = !(bool)((ModSetting)cloneFollowsPlayerSetting).Value; MelonLogger.Msg("Aim at player: " + aimAtPlayer); } private void downloadClone(object sender, EventArgs e) { string path = "UserData/CloneBending/clone.json"; List<float[][]> rotations = allRotations.Select((Quaternion[] rotArray) => rotArray.Select((Quaternion rot) => new float[4] { rot.x, rot.y, rot.z, rot.w }).ToArray()).ToList(); CloneData value = new CloneData { Rotations = rotations, HandPositions = handPositions.ToList(), RecordedStacks = recordedStacks.Select((Stack stack) => ((stack != null) ? ((Object)stack).name : null) ?? "0").ToList() }; string contents = JsonSerializer.Serialize(value, new JsonSerializerOptions { WriteIndented = true }); File.WriteAllText(path, contents); MelonLogger.Msg("Clone Downloaded"); } private void uploadClone(object sender, EventArgs e) { allRotations.Clear(); handPositions.Clear(); recordedStacks.Clear(); string path = "UserData/CloneBending/clone.json"; if (!File.Exists(path)) { MelonLogger.Msg("Save file not found."); return; } string json = File.ReadAllText(path); CloneData cloneData = JsonSerializer.Deserialize<CloneData>(json); if (cloneData == null) { return; } foreach (float[][] rotation in cloneData.Rotations) { Quaternion[] value = ((IEnumerable<float[]>)rotation).Select((Func<float[], Quaternion>)((float[] rot) => new Quaternion(rot[0], rot[1], rot[2], rot[3]))).ToArray(); allRotations.AddLast(value); } handPositions = new LinkedList<float[]>(cloneData.HandPositions); LinkedList<string>.Enumerator enumerator2 = new LinkedList<string>(cloneData.RecordedStacks).GetEnumerator(); Stack[] array = Il2CppArrayBase<Stack>.op_Implicit(pSP.availableStacks.ToArray()); while (enumerator2.MoveNext()) { bool flag = false; for (int i = 0; i < array.Length; i++) { if (enumerator2.Current == ((Object)array[i]).name) { recordedStacks.AddLast(array[i]); flag = true; } } if (!flag) { recordedStacks.AddLast((Stack)null); } } rotIt = allRotations.GetEnumerator(); handIt = handPositions.GetEnumerator(); stackIt = recordedStacks.GetEnumerator(); MelonLogger.Msg("Uploaded"); MelonLogger.Msg($"Rotations count: {allRotations.Count}"); MelonLogger.Msg($"Hand Positions count: {handPositions.Count}"); MelonLogger.Msg($"Stacks count: {recordedStacks.Count}"); isRecorded = true; } } public class CloneData { public List<float[][]> Rotations { get; set; } public List<float[]> HandPositions { get; set; } public List<string> RecordedStacks { get; set; } } }