using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using HarmonyLib; using MelonLoader; using ModThatIsNotMod.BoneMenu; using ModThatIsNotMod.MonoBehaviours; using Procudeal_aimation; using PuppetMasta; using StressLevelZero.AI; using UnhollowerBaseLib; using UnhollowerRuntimeLib; 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(Main), "Procudeal aimation", "5.5.3", "Jeb", null)] [assembly: MelonGame("Stress Level Zero", "BONEWORKS")] [assembly: AssemblyTitle("Procudeal aimation")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Procudeal aimation")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e02c3ff9-db33-4862-8ec0-1d1790eb4fef")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace ModThatIsNotMod.MonoBehaviours { public class OriginalPuppetProperties : MonoBehaviour { public float damper; public float weight; public float animSpeed; public OriginalPuppetProperties(IntPtr ptr) : base(ptr) { } } public class AgonyLogic : MonoBehaviour { [CompilerGenerated] private sealed class d__16 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AgonyLogic <>4__this; private PuppetMaster 5__1; private OriginalPuppetProperties 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; 5__1 = <>4__this._brain.puppetMaster; 5__2 = ((Component)<>4__this).GetComponent(); if ((Object)(object)5__1 == (Object)null || (Object)(object)5__2 == (Object)null) { return false; } if ((Object)(object)5__1.targetAnimator != (Object)null) { ((Behaviour)5__1.targetAnimator).enabled = true; 5__1.targetAnimator.speed = 0f; } 5__1.muscleDamper = 5__2.damper; 5__1.muscleWeight = 5__2.weight; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AgonyLogic <>4__this; private PuppetMaster 5__1; private float 5__2; private float 5__3; private List.Enumerator <>s__4; private Rigidbody 5__5; private List.Enumerator <>s__6; private Rigidbody 5__7; private Vector3 5__8; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>s__4 = default(List.Enumerator); 5__5 = null; <>s__6 = default(List.Enumerator); 5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_011e: 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_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: 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_039a: Expected O, but got Unknown //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0274: 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_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.RefreshBodyParts(); 5__1 = <>4__this._brain.puppetMaster; if (<>4__this._isSmallEnemy) { <>4__this._isSuffering = false; return false; } <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 1; return true; case 1: <>1__state = -1; 5__2 = 0f; goto IL_03ab; case 2: <>1__state = -1; goto IL_03ab; case 3: { <>1__state = -1; <>4__this._isSuffering = false; return false; } IL_03ab: if (<>4__this._isSuffering && 5__2 < Main.struggleTime) { 5__2 += Time.fixedDeltaTime; 5__3 = Main.pullForce; Vector3 val; if ((Object)(object)<>4__this._chest != (Object)null && (Object)(object)<>4__this._pelvis != (Object)null) { Rigidbody chest = <>4__this._chest; val = <>4__this._pelvis.position - <>4__this._chest.position; chest.AddForce(((Vector3)(ref val)).normalized * (5__3 * 1.2f), (ForceMode)0); } <>s__4 = <>4__this._limbs.GetEnumerator(); try { while (<>s__4.MoveNext()) { 5__5 = <>s__4.Current; if ((Object)(object)5__5 != (Object)null && (Object)(object)<>4__this._pelvis != (Object)null) { Rigidbody obj = 5__5; val = <>4__this._pelvis.position - 5__5.position; obj.AddForce(((Vector3)(ref val)).normalized * 5__3, (ForceMode)0); } 5__5 = null; } } finally { ((IDisposable)<>s__4).Dispose(); } <>s__4 = default(List.Enumerator); <>s__6 = <>4__this._legs.GetEnumerator(); try { while (<>s__6.MoveNext()) { 5__7 = <>s__6.Current; if (!((Object)(object)5__7 == (Object)null) && !((Object)(object)<>4__this._pelvis == (Object)null)) { Rigidbody obj2 = 5__7; val = <>4__this._pelvis.position - 5__7.position; obj2.AddForce(((Vector3)(ref val)).normalized * (5__3 * 0.8f), (ForceMode)0); if (Random.value > 0.98f) { val = 5__7.position - <>4__this._pelvis.position; 5__8 = ((Vector3)(ref val)).normalized + Random.onUnitSphere; 5__7.AddForce(((Vector3)(ref 5__8)).normalized * (5__3 * 0.4f), (ForceMode)1); } 5__7 = null; } } } finally { ((IDisposable)<>s__6).Dispose(); } <>s__6 = default(List.Enumerator); if ((Object)(object)<>4__this._pelvis != (Object)null) { <>4__this._pelvis.AddForce(Vector3.down * 20f, (ForceMode)0); } <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 2; return true; } <>2__current = <>4__this.ResetSequence(); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private AIBrain _brain; private List _limbs = new List(); private List _legs = new List(); private Rigidbody _pelvis; private Rigidbody _chest; private bool _isSuffering = false; private string[] legKeywords = new string[6] { "foot", "calf", "thigh", "knee", "toe", "leg" }; private string[] armKeywords = new string[5] { "hand", "arm", "shoulder", "wrist", "elbow" }; private string[] coreKeywords = new string[4] { "chest", "spine", "neck", "head" }; private string[] pelvisKeywords = new string[3] { "pelvis", "hip", "root" }; private bool _isSmallEnemy = false; public AgonyLogic(IntPtr ptr) : base(ptr) { } private void Awake() { _brain = ((Component)this).GetComponent(); } public void ProcessHit() { if (!((Object)(object)_brain == (Object)null) && !_isSuffering) { _isSuffering = true; MelonCoroutines.Start(Struggle()); } } private void RefreshBodyParts() { _isSmallEnemy = false; _limbs.Clear(); _legs.Clear(); PuppetMaster puppetMaster = _brain.puppetMaster; if ((Object)(object)puppetMaster == (Object)null || puppetMaster.muscles == null || ((Il2CppArrayBase)(object)puppetMaster.muscles).Count == 0) { return; } string text = ((Object)((Component)_brain).gameObject).name.ToLower(); if (text.Contains("crab") || text.Contains("headcrab")) { _isSmallEnemy = true; return; } _pelvis = ((Il2CppArrayBase)(object)puppetMaster.muscles)[0].rigidbody; foreach (Muscle item in (Il2CppArrayBase)(object)puppetMaster.muscles) { if ((Object)(object)item.rigidbody == (Object)null) { continue; } string text2 = ((Object)item.rigidbody).name.ToLower(); string[] array = pelvisKeywords; foreach (string value in array) { if (text2.Contains(value)) { _pelvis = item.rigidbody; break; } } string[] array2 = coreKeywords; foreach (string value2 in array2) { if (text2.Contains(value2)) { _chest = item.rigidbody; break; } } bool flag = false; string[] array3 = legKeywords; foreach (string value3 in array3) { if (text2.Contains(value3)) { _legs.Add(item.rigidbody); flag = true; break; } } if (flag) { continue; } string[] array4 = armKeywords; foreach (string value4 in array4) { if (text2.Contains(value4)) { _limbs.Add(item.rigidbody); break; } } } } [IteratorStateMachine(typeof(d__15))] private IEnumerator Struggle() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__16))] private IEnumerator ResetSequence() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0) { <>4__this = this }; } } } namespace Procudeal_aimation { public class Main : MelonMod { [CompilerGenerated] private sealed class d__6 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Main <>4__this; private WaitForSeconds 5__1; private Il2CppArrayBase 5__2; private IEnumerator <>s__3; private AIBrain 5__4; private PuppetMaster 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>s__3 = null; 5__4 = null; 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Invalid comparison between Unknown and I4 switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = new WaitForSeconds(0.5f); break; case 1: <>1__state = -1; break; } if (modEnabled) { 5__2 = Resources.FindObjectsOfTypeAll(); <>s__3 = 5__2.GetEnumerator(); try { while (<>s__3.MoveNext()) { 5__4 = <>s__3.Current; if (!((Object)(object)5__4 == (Object)null)) { if ((Object)(object)((Component)5__4).gameObject.GetComponent() == (Object)null) { ((Component)5__4).gameObject.AddComponent(); } 5__5 = 5__4.puppetMaster; if ((Object)(object)5__5 != (Object)null && (int)5__5.state != 1 && (Object)(object)5__5.targetAnimator != (Object)null && 5__5.targetAnimator.speed == 0f) { ((Behaviour)5__5.targetAnimator).enabled = true; 5__5.targetAnimator.speed = 1f; } 5__5 = null; 5__4 = null; } } } finally { if (<>s__3 != null) { <>s__3.Dispose(); } } <>s__3 = null; 5__2 = null; } <>2__current = 5__1; <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static bool modEnabled = true; public static float pullForce = 35f; public static float struggleTime = 8f; private bool _isScannerRunning = false; public override void OnApplicationStart() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown MelonLogger.Msg(ConsoleColor.Cyan, "the proceudal ANIMAtion NOT animation becuase it got a idiot typo IS ACTIVE!!!!!! wow i cant belive it wowwwwwwwww"); ClassInjector.RegisterTypeInIl2Cpp(); ClassInjector.RegisterTypeInIl2Cpp(); Harmony val = new Harmony("com.jeb.proceduralanimation"); val.PatchAll(); SetupMenu(); } public override void OnSceneWasInitialized(int buildIndex, string sceneName) { if (!_isScannerRunning) { _isScannerRunning = true; MelonCoroutines.Start(OptimizedScanner()); } } [IteratorStateMachine(typeof(d__6))] private IEnumerator OptimizedScanner() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { <>4__this = this }; } private void SetupMenu() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) MenuCategory val = MenuManager.CreateCategory("Procudeal aimation", Color.red); val.CreateBoolElement("Mod Active", Color.white, true, (Action)delegate(bool v) { modEnabled = v; }); val.CreateFloatElement("Force", Color.red, 35f, (Action)delegate(float v) { pullForce = v; }, 5f, -2.1474836E+09f, 2.1474836E+09f, false); val.CreateFloatElement("Duration", Color.white, 8f, (Action)delegate(float v) { struggleTime = v; }, 1f, -2.1474836E+09f, 2.1474836E+09f, false); } } [HarmonyPatch(typeof(PuppetMaster), "Kill", new Type[] { })] public class PuppetMasterKillPatch { [HarmonyPrefix] public static void Prefix(PuppetMaster __instance) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) if (!Main.modEnabled) { return; } AIBrain componentInParent = ((Component)__instance).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null) { return; } OriginalPuppetProperties component = ((Component)componentInParent).GetComponent(); if ((Object)(object)component == (Object)null) { component = ((Component)componentInParent).gameObject.AddComponent(); component.damper = __instance.muscleDamper; component.weight = __instance.muscleWeight; if ((Object)(object)__instance.targetAnimator != (Object)null) { component.animSpeed = __instance.targetAnimator.speed; } } if ((Object)(object)__instance.targetAnimator != (Object)null) { ((Behaviour)__instance.targetAnimator).enabled = false; } __instance.stateSettings = new StateSettings(0f, 0f, 0f, 0f, false, false); __instance.muscleDamper = 0f; __instance.muscleWeight = 5f; AgonyLogic component2 = ((Component)componentInParent).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.ProcessHit(); } } } }