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 StressLevelZero.Props.Weapons; 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.6.0", "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__19 : 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__19(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__18 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AgonyLogic <>4__this; private float 5__1; private bool 5__2; private float 5__3; private bool 5__4; private float 5__5; private float 5__6; private List.Enumerator <>s__7; private Rigidbody 5__8; private List.Enumerator <>s__9; private Rigidbody 5__10; private Vector3 5__11; private Vector3 5__12; private Vector3 5__13; private Vector3 5__14; private int 5__15; private int 5__16; private Rigidbody 5__17; private Rigidbody 5__18; private Rigidbody 5__19; private Rigidbody 5__20; private Vector3 5__21; private Vector3 5__22; private Vector3 5__23; private Vector3 5__24; private Vector3 5__25; private List.Enumerator <>s__26; private Rigidbody 5__27; private Vector3 5__28; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__7 = default(List.Enumerator); 5__8 = null; <>s__9 = default(List.Enumerator); 5__10 = null; 5__17 = null; 5__18 = null; 5__19 = null; 5__20 = null; <>s__26 = default(List.Enumerator); 5__27 = null; <>1__state = -2; } private bool MoveNext() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: 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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0238: 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_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0385: 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_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_0911: Expected O, but got Unknown //IL_08ef: Unknown result type (might be due to invalid IL or missing references) //IL_08fa: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07e9: 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_07f3: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Unknown result type (might be due to invalid IL or missing references) //IL_082d: Unknown result type (might be due to invalid IL or missing references) //IL_083d: 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_0847: Unknown result type (might be due to invalid IL or missing references) //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0854: Unknown result type (might be due to invalid IL or missing references) //IL_0859: Unknown result type (might be due to invalid IL or missing references) //IL_086a: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: 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_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Unknown result type (might be due to invalid IL or missing references) //IL_0614: 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_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_06a7: Unknown result type (might be due to invalid IL or missing references) //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Unknown result type (might be due to invalid IL or missing references) //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06df: 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_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_0740: 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(); 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__1 = 0f; 5__2 = Random.value > 0.85f; 5__3 = 0f; 5__4 = true; goto IL_0922; case 2: <>1__state = -1; goto IL_0922; case 3: { <>1__state = -1; <>4__this._isSuffering = false; return false; } IL_0922: if (<>4__this._isSuffering && 5__1 < Main.struggleTime) { 5__1 += Time.fixedDeltaTime; 5__5 = 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__5 * 1.2f), (ForceMode)0); } <>s__7 = <>4__this._limbs.GetEnumerator(); try { while (<>s__7.MoveNext()) { 5__8 = <>s__7.Current; if (!((Object)(object)5__8 == (Object)null)) { if ((Object)(object)<>4__this.lastHitBone != (Object)null) { Rigidbody obj = 5__8; val = <>4__this.lastHitBone.position - 5__8.position; obj.AddForce(((Vector3)(ref val)).normalized * (5__5 * 1.5f), (ForceMode)0); } else if ((Object)(object)<>4__this._pelvis != (Object)null) { Rigidbody obj2 = 5__8; val = <>4__this._pelvis.position - 5__8.position; obj2.AddForce(((Vector3)(ref val)).normalized * 5__5, (ForceMode)0); } 5__8 = null; } } } finally { ((IDisposable)<>s__7).Dispose(); } <>s__7 = default(List.Enumerator); <>s__9 = <>4__this._knees.GetEnumerator(); try { while (<>s__9.MoveNext()) { 5__10 = <>s__9.Current; if (!((Object)(object)5__10 == (Object)null) && !((Object)(object)<>4__this._pelvis == (Object)null)) { 5__11 = ((Component)<>4__this._pelvis).transform.InverseTransformPoint(5__10.position); if (Mathf.Abs(5__11.x) > 0.05f) { 5__12 = new Vector3(0f, 5__11.y, 5__11.z); 5__13 = ((Component)<>4__this._pelvis).transform.TransformPoint(5__12); val = 5__13 - 5__10.position; 5__14 = ((Vector3)(ref val)).normalized; 5__10.AddForce(5__14 * (5__5 * 0.6f), (ForceMode)0); } 5__10 = null; } } } finally { ((IDisposable)<>s__9).Dispose(); } <>s__9 = default(List.Enumerator); if (5__2) { 5__3 -= Time.fixedDeltaTime; if (5__3 <= 0f) { 5__3 = Random.Range(0.15f, 0.3f); 5__4 = !5__4; 5__15 = ((!5__4) ? 1 : 0); 5__16 = (5__4 ? 1 : 0); 5__17 = ((<>4__this._knees.Count > 5__15) ? <>4__this._knees[5__15] : null); 5__18 = ((<>4__this._feet.Count > 5__15) ? <>4__this._feet[5__15] : null); 5__19 = ((<>4__this._knees.Count > 5__16) ? <>4__this._knees[5__16] : null); 5__20 = ((<>4__this._feet.Count > 5__16) ? <>4__this._feet[5__16] : null); if ((Object)(object)5__17 != (Object)null && (Object)(object)<>4__this._pelvis != (Object)null) { 5__21 = ((Component)<>4__this._pelvis).transform.InverseTransformPoint(5__17.position); 5__21.x = 0f; val = ((Component)<>4__this._pelvis).transform.TransformPoint(5__21) - <>4__this._pelvis.position; 5__22 = ((Vector3)(ref val)).normalized; 5__23 = Vector3.up * 0.4f + 5__22; 5__17.AddForce(((Vector3)(ref 5__23)).normalized * (5__5 * 0.8f), (ForceMode)1); if ((Object)(object)5__18 != (Object)null) { 5__18.AddForce(((Vector3)(ref 5__23)).normalized * (5__5 * 0.3f), (ForceMode)1); } } if ((Object)(object)5__19 != (Object)null && (Object)(object)<>4__this._pelvis != (Object)null) { val = <>4__this._pelvis.position - 5__19.position; 5__24 = ((Vector3)(ref val)).normalized; val = 5__24 + Vector3.up * 0.2f; 5__25 = ((Vector3)(ref val)).normalized; 5__19.AddForce(5__25 * (5__5 * 0.6f), (ForceMode)1); if ((Object)(object)5__20 != (Object)null) { 5__20.AddForce(5__25 * (5__5 * 0.2f), (ForceMode)1); } } 5__17 = null; 5__18 = null; 5__19 = null; 5__20 = null; } } else { <>s__26 = <>4__this._legs.GetEnumerator(); try { while (<>s__26.MoveNext()) { 5__27 = <>s__26.Current; if (!((Object)(object)5__27 == (Object)null) && !((Object)(object)<>4__this._pelvis == (Object)null)) { Rigidbody obj3 = 5__27; val = <>4__this._pelvis.position - 5__27.position; obj3.AddForce(((Vector3)(ref val)).normalized * (5__5 * 0.8f), (ForceMode)0); if (Random.value > 0.98f) { val = 5__27.position - <>4__this._pelvis.position; 5__28 = ((Vector3)(ref val)).normalized + Random.onUnitSphere; 5__27.AddForce(((Vector3)(ref 5__28)).normalized * (5__5 * 0.4f), (ForceMode)1); } 5__27 = null; } } } finally { ((IDisposable)<>s__26).Dispose(); } <>s__26 = default(List.Enumerator); } 5__6 = 25f; if ((Object)(object)<>4__this._pelvis != (Object)null) { <>4__this._pelvis.AddForce(Vector3.down * 5__6, (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 List _knees = new List(); private List _feet = new List(); public Rigidbody lastHitBone; private bool _isSuffering = false; private bool _isSmallEnemy = 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[3] { "chest", "spine", "neck" }; private string[] pelvisKeywords = new string[3] { "pelvis", "hip", "root" }; 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(); _knees.Clear(); _feet.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) { string[] array4 = armKeywords; foreach (string value4 in array4) { if (text2.Contains(value4)) { _limbs.Add(item.rigidbody); break; } } } if (text2.Contains("calf") || text2.Contains("knee") || text2.Contains("lowerleg")) { _knees.Add(item.rigidbody); } if (text2.Contains("foot") || text2.Contains("toe")) { _feet.Add(item.rigidbody); } } } [IteratorStateMachine(typeof(d__18))] private IEnumerator Struggle() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__19))] private IEnumerator ResetSequence() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(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 IS ACTIVE - Now with Raycast Precision!"); 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(Gun), "OnFire", new Type[] { })] public class GunFirePatch { [HarmonyPostfix] public static void Postfix(Gun __instance) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!Main.modEnabled || (Object)(object)__instance.firePointTransform == (Object)null) { return; } Ray val = default(Ray); ((Ray)(ref val))..ctor(__instance.firePointTransform.position, __instance.firePointTransform.forward); RaycastHit val2 = default(RaycastHit); if (!Physics.Raycast(val, ref val2, 500f)) { return; } AIBrain componentInParent = ((Component)((RaycastHit)(ref val2)).collider).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { AgonyLogic component = ((Component)componentInParent).GetComponent(); if ((Object)(object)component != (Object)null) { component.lastHitBone = ((Component)((RaycastHit)(ref val2)).collider).GetComponent(); } } } } [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(); } } } }