Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of MorgenBodyslamEnable v1.0.1
MorgenBodyslamEnable.dll
Decompiled 3 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Financier-MorgenBodyslamFix")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Financier-MorgenBodyslamFix")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("cee93163-7fd6-4cf0-abe1-e5a680b5e20b")] [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 MorgenBodySlamEnable; [BepInPlugin("financierhdn.MorgenBodyslamEnable", "MorgenBodyslamEnable", "1.0.1")] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("financierhdn.MorgenBodyslamEnable"); private void Awake() { harmony.PatchAll(typeof(Plugin).Assembly); } } [HarmonyPatch(typeof(Attack))] internal static class Attack_Start_Patch { private static readonly FieldRef<ZSyncAnimation, Animator> ZSyncAnimatorRef = AccessTools.FieldRefAccess<ZSyncAnimation, Animator>("m_animator"); [HarmonyPatch("Start")] [HarmonyPrefix] private static void ForceSlamAnimation(Attack __instance, ZSyncAnimation zanim) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (__instance.m_attackAnimation != "attack_slam" || !Object.op_Implicit((Object)(object)zanim)) { return; } Animator val = ZSyncAnimatorRef.Invoke(zanim); if (!Object.op_Implicit((Object)(object)val) || ((Object)val.runtimeAnimatorController).name != "morgen_animator") { return; } int num = Animator.StringToHash("attack_bodyslam"); if (val.HasState(0, num)) { AnimatorStateInfo currentAnimatorStateInfo = val.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).shortNameHash != num) { val.CrossFade(num, 0.25f); } } } }