using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using MelonLoader;
using PoseHitboxes;
using RUMBLE.Poses;
using RUMBLE.Tutorial.MoveLearning;
using RumbleModdingAPI;
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(ClassPH), "PoseHitboxes", "1.1.1", "Marcopolo1613", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: AssemblyTitle("PoseHitboxes")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PoseHitboxes")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("138ef4a5-245f-4c7b-a130-69645d5b6e5b")]
[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")]
namespace PoseHitboxes;
public class ClassPH : MelonMod
{
private string currentScene = "Loader";
private bool sceneChanged = false;
private bool loaded = false;
private PoseGhost poseGhost;
private Material ghosty;
private Material redy;
private Material glassy;
private string currentPoseName = "";
private int delayCycle = 0;
private GameObject LRotate;
private GameObject RRotate;
private GameObject LRotateLimit;
private GameObject RRotateLimit;
private GameObject LHandRef;
private GameObject RHandRef;
private float deg2rad = 0.01745328f;
private float LThresh = 0f;
private float RThresh = 0f;
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
{
currentScene = sceneName;
sceneChanged = true;
delayCycle = 5;
loaded = false;
}
public override void OnUpdate()
{
//IL_0e9f: Unknown result type (might be due to invalid IL or missing references)
//IL_0ec0: Unknown result type (might be due to invalid IL or missing references)
//IL_0284: Unknown result type (might be due to invalid IL or missing references)
//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
//IL_0408: Unknown result type (might be due to invalid IL or missing references)
//IL_042d: Unknown result type (might be due to invalid IL or missing references)
//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
//IL_0511: Unknown result type (might be due to invalid IL or missing references)
//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
//IL_05fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0611: Unknown result type (might be due to invalid IL or missing references)
//IL_0625: Unknown result type (might be due to invalid IL or missing references)
//IL_0643: Unknown result type (might be due to invalid IL or missing references)
//IL_0657: Unknown result type (might be due to invalid IL or missing references)
//IL_065c: 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_0691: Unknown result type (might be due to invalid IL or missing references)
//IL_0696: Unknown result type (might be due to invalid IL or missing references)
//IL_06e4: Unknown result type (might be due to invalid IL or missing references)
//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
//IL_06ed: Unknown result type (might be due to invalid IL or missing references)
//IL_0702: Unknown result type (might be due to invalid IL or missing references)
//IL_0707: Unknown result type (might be due to invalid IL or missing references)
//IL_0715: Unknown result type (might be due to invalid IL or missing references)
//IL_0816: Unknown result type (might be due to invalid IL or missing references)
//IL_0831: Unknown result type (might be due to invalid IL or missing references)
//IL_0852: Unknown result type (might be due to invalid IL or missing references)
//IL_0867: Unknown result type (might be due to invalid IL or missing references)
//IL_087c: Unknown result type (might be due to invalid IL or missing references)
//IL_0886: Unknown result type (might be due to invalid IL or missing references)
//IL_08a3: Unknown result type (might be due to invalid IL or missing references)
//IL_08b8: Unknown result type (might be due to invalid IL or missing references)
//IL_08cd: Unknown result type (might be due to invalid IL or missing references)
//IL_08d7: Unknown result type (might be due to invalid IL or missing references)
//IL_0737: Unknown result type (might be due to invalid IL or missing references)
//IL_0752: Unknown result type (might be due to invalid IL or missing references)
//IL_0773: Unknown result type (might be due to invalid IL or missing references)
//IL_0788: Unknown result type (might be due to invalid IL or missing references)
//IL_079d: Unknown result type (might be due to invalid IL or missing references)
//IL_07a7: Unknown result type (might be due to invalid IL or missing references)
//IL_07c4: Unknown result type (might be due to invalid IL or missing references)
//IL_07d9: Unknown result type (might be due to invalid IL or missing references)
//IL_07ee: Unknown result type (might be due to invalid IL or missing references)
//IL_07f8: Unknown result type (might be due to invalid IL or missing references)
//IL_09b8: Unknown result type (might be due to invalid IL or missing references)
//IL_09f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0a6d: Unknown result type (might be due to invalid IL or missing references)
//IL_0a88: Unknown result type (might be due to invalid IL or missing references)
//IL_0aa3: Unknown result type (might be due to invalid IL or missing references)
//IL_0abe: Unknown result type (might be due to invalid IL or missing references)
//IL_0adf: Unknown result type (might be due to invalid IL or missing references)
//IL_0b01: Unknown result type (might be due to invalid IL or missing references)
//IL_0b23: Unknown result type (might be due to invalid IL or missing references)
//IL_0b45: Unknown result type (might be due to invalid IL or missing references)
//IL_0c1e: Unknown result type (might be due to invalid IL or missing references)
//IL_0c32: Unknown result type (might be due to invalid IL or missing references)
//IL_0c46: Unknown result type (might be due to invalid IL or missing references)
//IL_0c5a: Unknown result type (might be due to invalid IL or missing references)
//IL_0c78: Unknown result type (might be due to invalid IL or missing references)
//IL_0c8c: Unknown result type (might be due to invalid IL or missing references)
//IL_0c91: Unknown result type (might be due to invalid IL or missing references)
//IL_0cb2: Unknown result type (might be due to invalid IL or missing references)
//IL_0cc6: Unknown result type (might be due to invalid IL or missing references)
//IL_0ccb: Unknown result type (might be due to invalid IL or missing references)
//IL_0cec: Unknown result type (might be due to invalid IL or missing references)
//IL_0d00: Unknown result type (might be due to invalid IL or missing references)
//IL_0d05: Unknown result type (might be due to invalid IL or missing references)
//IL_0d26: Unknown result type (might be due to invalid IL or missing references)
//IL_0d3a: Unknown result type (might be due to invalid IL or missing references)
//IL_0d3f: Unknown result type (might be due to invalid IL or missing references)
//IL_0d55: Unknown result type (might be due to invalid IL or missing references)
//IL_0d5a: Unknown result type (might be due to invalid IL or missing references)
//IL_0d5e: Unknown result type (might be due to invalid IL or missing references)
//IL_0d73: Unknown result type (might be due to invalid IL or missing references)
//IL_0d78: Unknown result type (might be due to invalid IL or missing references)
//IL_0d86: Unknown result type (might be due to invalid IL or missing references)
//IL_0dfd: Unknown result type (might be due to invalid IL or missing references)
//IL_0e02: Unknown result type (might be due to invalid IL or missing references)
//IL_0e07: Unknown result type (might be due to invalid IL or missing references)
//IL_0e24: Unknown result type (might be due to invalid IL or missing references)
//IL_0e29: Unknown result type (might be due to invalid IL or missing references)
//IL_0e2e: Unknown result type (might be due to invalid IL or missing references)
//IL_0dab: Unknown result type (might be due to invalid IL or missing references)
//IL_0db0: Unknown result type (might be due to invalid IL or missing references)
//IL_0db5: Unknown result type (might be due to invalid IL or missing references)
//IL_0dd2: Unknown result type (might be due to invalid IL or missing references)
//IL_0dd7: Unknown result type (might be due to invalid IL or missing references)
//IL_0ddc: Unknown result type (might be due to invalid IL or missing references)
//IL_0e4c: Unknown result type (might be due to invalid IL or missing references)
//IL_0e69: Unknown result type (might be due to invalid IL or missing references)
if (currentScene != "Gym")
{
return;
}
if (sceneChanged)
{
if (delayCycle > 1)
{
delayCycle--;
}
else
{
if (!loaded)
{
try
{
poseGhost = MoveLearning.GetGameObject().GetComponentInChildren<PoseGhost>();
ghosty = ((Component)((Component)poseGhost).transform.GetChild(0).GetChild(1)).GetComponent<Renderer>().material;
redy = ((Component)GymArena.GetGameObject().transform.GetChild(0)).GetComponent<Renderer>().material;
LHandRef = GameObject.Find("Player Controller(Clone)/Visuals/RIG/Bone_Pelvis/Bone_Spine/Bone_Chest/Bone_Shoulderblade_L/Bone_Shoulder_L/Bone_Lowerarm_L/Bone_Hand_L");
RHandRef = GameObject.Find("Player Controller(Clone)/Visuals/RIG/Bone_Pelvis/Bone_Spine/Bone_Chest/Bone_Shoulderblade_R/Bone_Shoulder_R/Bone_Lowerarm_R/Bone_Hand_R");
loaded = true;
currentPoseName = "";
}
catch
{
return;
}
}
sceneChanged = false;
}
}
if (loaded && currentPoseName != ((Object)poseGhost.showCurrentPoseData).name)
{
if (((Component)poseGhost).transform.GetChild(0).GetChild(0).childCount > 0)
{
while (((Component)poseGhost).transform.GetChild(0).GetChild(0).childCount > 0 || ((Component)poseGhost).transform.GetChild(0).GetChild(1).childCount > 0)
{
Object.DestroyImmediate((Object)(object)((Component)((Component)poseGhost).transform.GetChild(0).GetChild(0).GetChild(0)).gameObject);
Object.DestroyImmediate((Object)(object)((Component)((Component)poseGhost).transform.GetChild(0).GetChild(1).GetChild(0)).gameObject);
Object.DestroyImmediate((Object)(object)LRotate.gameObject);
Object.DestroyImmediate((Object)(object)RRotate.gameObject);
}
}
GameObject val = GameObject.CreatePrimitive((PrimitiveType)3);
GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)3);
val.transform.parent = ((Component)poseGhost).transform.GetChild(0).GetChild(0);
val2.transform.parent = ((Component)poseGhost).transform.GetChild(0).GetChild(1);
val.transform.position = poseGhost.leftHand.position;
val2.transform.position = poseGhost.rightHand.position;
val.GetComponent<Renderer>().material = ghosty;
val2.GetComponent<Renderer>().material = ghosty;
((Component)((Component)poseGhost).transform.GetChild(0).GetChild(0)).GetComponent<Renderer>().material = redy;
((Component)((Component)poseGhost).transform.GetChild(0).GetChild(1)).GetComponent<Renderer>().material = redy;
currentPoseName = ((Object)poseGhost.showCurrentPoseData).name;
LRotate = GameObject.CreatePrimitive((PrimitiveType)3);
RRotate = GameObject.CreatePrimitive((PrimitiveType)3);
GameObject val3 = GameObject.CreatePrimitive((PrimitiveType)3);
GameObject val4 = GameObject.CreatePrimitive((PrimitiveType)3);
GameObject val5 = GameObject.CreatePrimitive((PrimitiveType)3);
GameObject val6 = GameObject.CreatePrimitive((PrimitiveType)3);
LRotate.transform.parent = ((Component)poseGhost).transform.GetChild(0).GetChild(0);
RRotate.transform.parent = ((Component)poseGhost).transform.GetChild(0).GetChild(1);
LRotate.GetComponent<Renderer>().material = redy;
RRotate.GetComponent<Renderer>().material = redy;
LRotate.transform.localScale = new Vector3(0.003f, 0.003f, 0.003f);
RRotate.transform.localScale = new Vector3(0.003f, 0.003f, 0.003f);
val3.transform.parent = LRotate.transform;
val4.transform.parent = LRotate.transform;
val5.transform.parent = RRotate.transform;
val6.transform.parent = RRotate.transform;
val3.transform.localScale = new Vector3(1f, 25f, 1f);
val4.transform.localScale = new Vector3(1f, 1f, 25f);
val5.transform.localScale = new Vector3(1f, 25f, 1f);
val6.transform.localScale = new Vector3(1f, 1f, 25f);
Color val7 = default(Color);
((Color)(ref val7))..ctor(1f, 0f, 0f, 0.8f);
Color color = default(Color);
((Color)(ref color))..ctor(0f, 1f, 0f, 0.8f);
Color color2 = default(Color);
((Color)(ref color2))..ctor(0f, 0f, 1f, 0.8f);
val3.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
val4.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
val5.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
val6.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
val3.GetComponent<Renderer>().material.color = color;
val4.GetComponent<Renderer>().material.color = color2;
val5.GetComponent<Renderer>().material.color = color;
val6.GetComponent<Renderer>().material.color = color2;
LRotate.transform.position = poseGhost.leftHand.position + new Vector3(-1f, 0f, -1f);
RRotate.transform.position = poseGhost.rightHand.position + new Vector3(-1f, 0f, -1f);
LRotateLimit = GameObject.CreatePrimitive((PrimitiveType)0);
RRotateLimit = GameObject.CreatePrimitive((PrimitiveType)0);
GameObject val8 = GameObject.CreatePrimitive((PrimitiveType)2);
GameObject val9 = GameObject.CreatePrimitive((PrimitiveType)2);
GameObject val10 = GameObject.CreatePrimitive((PrimitiveType)2);
GameObject val11 = GameObject.CreatePrimitive((PrimitiveType)2);
Quaternion rotation = poseGhost.leftHand.rotation;
float x = ((Quaternion)(ref rotation)).eulerAngles.x;
Condition leftControllerCondition = poseGhost.showCurrentPoseData.leftControllerCondition;
if (x == ((Quaternion)(ref leftControllerCondition.DesiredPose.rotation)).eulerAngles.x)
{
LThresh = poseGhost.showCurrentPoseData.LeftControllerCondition.RotationTreshold;
RThresh = poseGhost.showCurrentPoseData.RightControllerCondition.RotationTreshold;
val.transform.localScale = new Vector3(poseGhost.showCurrentPoseData.leftControllerCondition.PositionTreshold, poseGhost.showCurrentPoseData.leftControllerCondition.PositionTreshold, poseGhost.showCurrentPoseData.leftControllerCondition.PositionTreshold);
val2.transform.localScale = new Vector3(poseGhost.showCurrentPoseData.RightControllerCondition.PositionTreshold, poseGhost.showCurrentPoseData.RightControllerCondition.PositionTreshold, poseGhost.showCurrentPoseData.RightControllerCondition.PositionTreshold);
}
else
{
RThresh = poseGhost.showCurrentPoseData.LeftControllerCondition.RotationTreshold;
LThresh = poseGhost.showCurrentPoseData.RightControllerCondition.RotationTreshold;
val2.transform.localScale = new Vector3(poseGhost.showCurrentPoseData.leftControllerCondition.PositionTreshold, poseGhost.showCurrentPoseData.leftControllerCondition.PositionTreshold, poseGhost.showCurrentPoseData.leftControllerCondition.PositionTreshold);
val.transform.localScale = new Vector3(poseGhost.showCurrentPoseData.RightControllerCondition.PositionTreshold, poseGhost.showCurrentPoseData.RightControllerCondition.PositionTreshold, poseGhost.showCurrentPoseData.RightControllerCondition.PositionTreshold);
}
float num = (1f - LThresh) * 3.14159f;
float num2 = (1f - RThresh) * 3.14159f;
LRotateLimit.transform.parent = ((Component)poseGhost).transform.GetChild(0).GetChild(0);
RRotateLimit.transform.parent = ((Component)poseGhost).transform.GetChild(0).GetChild(1);
LRotateLimit.GetComponent<Renderer>().material = redy;
RRotateLimit.GetComponent<Renderer>().material = redy;
LRotateLimit.transform.localScale = new Vector3(0.03f * LThresh, 0.03f * LThresh, 0.03f * LThresh);
RRotateLimit.transform.localScale = new Vector3(0.03f * RThresh, 0.03f * RThresh, 0.03f * RThresh);
val8.transform.parent = LRotateLimit.transform;
val9.transform.parent = LRotateLimit.transform;
val10.transform.parent = RRotateLimit.transform;
val11.transform.parent = RRotateLimit.transform;
val8.transform.localScale = new Vector3(num, 0.5f, num);
val9.transform.localScale = new Vector3(num, 0.5f, num);
val10.transform.localScale = new Vector3(num2, 0.5f, num2);
val11.transform.localScale = new Vector3(num2, 0.5f, num2);
val8.transform.Rotate(new Vector3(0f, 90f, 0f), (Space)1);
val9.transform.Rotate(new Vector3(90f, 0f, 0f), (Space)1);
val10.transform.Rotate(new Vector3(0f, 90f, 0f), (Space)1);
val11.transform.Rotate(new Vector3(90f, 0f, 0f), (Space)1);
val8.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
val9.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
val10.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
val11.GetComponent<Renderer>().material.shader = Shader.Find("Universal Render Pipeline/Lit");
Color val12 = default(Color);
((Color)(ref val12))..ctor(1f, 0f, 0f, 0.1f);
Color color3 = default(Color);
((Color)(ref color3))..ctor(0f, 1f, 0f, 0.1f);
Color color4 = default(Color);
((Color)(ref color4))..ctor(0f, 0f, 1f, 0.1f);
val8.GetComponent<Renderer>().material.color = color3;
val9.GetComponent<Renderer>().material.color = color4;
val10.GetComponent<Renderer>().material.color = color3;
val11.GetComponent<Renderer>().material.color = color4;
LRotateLimit.transform.position = poseGhost.leftHand.position + new Vector3(-0.3f, 0.15f, -0.3f);
RRotateLimit.transform.position = poseGhost.rightHand.position + new Vector3(-0.3f, 0.15f, -0.3f);
LRotate.transform.position = poseGhost.leftHand.position + new Vector3(-0.3f, 0.15f, -0.3f);
RRotate.transform.position = poseGhost.rightHand.position + new Vector3(-0.3f, 0.15f, -0.3f);
rotation = poseGhost.leftHand.rotation;
float x2 = ((Quaternion)(ref rotation)).eulerAngles.x;
leftControllerCondition = poseGhost.showCurrentPoseData.leftControllerCondition;
if (x2 == ((Quaternion)(ref leftControllerCondition.DesiredPose.rotation)).eulerAngles.x)
{
val.transform.localRotation = poseGhost.showCurrentPoseData.leftControllerCondition.DesiredPose.rotation;
val2.transform.localRotation = poseGhost.showCurrentPoseData.rightControllerCondition.DesiredPose.rotation;
}
else
{
val2.transform.localRotation = poseGhost.showCurrentPoseData.leftControllerCondition.DesiredPose.rotation;
val.transform.localRotation = poseGhost.showCurrentPoseData.rightControllerCondition.DesiredPose.rotation;
}
LRotateLimit.transform.rotation = val.transform.rotation;
RRotateLimit.transform.rotation = val2.transform.rotation;
}
if ((Object)(object)LRotate != (Object)null)
{
LRotate.transform.rotation = LHandRef.GetComponent<Transform>().rotation;
RRotate.transform.rotation = RHandRef.GetComponent<Transform>().rotation;
}
}
}