using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using UnityEngine; using WesleysEnemies.AI; using WesleysEnemiesFix.Custom; using WesleysEnemiesFix.Utilities; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("SkillFern")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SkillFern")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("2317c45d-9d42-4c50-aeed-5f05c5bf5865")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace WesleysEnemiesFix { [BepInPlugin("com.dajadeninja.repo.wesleysenemiesfix", "Wesleys Enemies Fix", "1.0.0")] public class Plugin : BaseUnityPlugin { public static Plugin instance; private Harmony harmony; private void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown instance = this; harmony = new Harmony("com.dajadeninja.repo.wesleysenemiesfix"); ((BaseUnityPlugin)instance).Logger.LogInfo((object)"Setting up configuration. . ."); ConfigHelper.Initialize(((BaseUnityPlugin)this).Config); LogInfo("Loaded successfully! Loading patches. . ."); harmony.PatchAll(); LogInfo("Patches loaded"); } public static void LogInfo(string msg) { if (ConfigHelper.EnableDebug()) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)msg); } } public static void LogError(string msg) { if (ConfigHelper.EnableDebug()) { ((BaseUnityPlugin)instance).Logger.LogError((object)msg); } } } } namespace WesleysEnemiesFix.Utilities { public class ConfigHelper { private static ConfigEntry enableDebug; public static bool EnableDebug() { return enableDebug.Value; } public static void Initialize(ConfigFile config) { enableDebug = config.Bind("Debug", "EnableDebug", false, "Whether to spam the log with my debug info"); } } } namespace WesleysEnemiesFix.Patches { [HarmonyPatch(typeof(Voodoo))] public class VoodooAnimationPatch { private static readonly string[] TO_PATCH = new string[3] { "VoodooLookUnderAttack", "VoodooAttackRight", "VoodooAttackLeft" }; private const float EVENT_TIME = 1.6666666f; [HarmonyPatch("Awake")] [HarmonyPostfix] public static void Postfix(Voodoo __instance) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown VoodooAnimationFix voodooAnimationFix = ((Component)__instance.VoodooAnim).gameObject.AddComponent(typeof(VoodooAnimationFix)) as VoodooAnimationFix; voodooAnimationFix.Controller = __instance; RuntimeAnimatorController runtimeAnimatorController = __instance.VoodooAnim.animator.runtimeAnimatorController; AnimationClip[] animationClips = runtimeAnimatorController.animationClips; foreach (AnimationClip val in animationClips) { string[] tO_PATCH = TO_PATCH; foreach (string text in tO_PATCH) { if (((Object)val).name == text) { val.events = (AnimationEvent[])(object)new AnimationEvent[0]; val.AddEvent(new AnimationEvent { time = 1.6666666f, functionName = "EliminateEnemyForReal" }); } } } } } } namespace WesleysEnemiesFix.Custom { public class VoodooAnimationFix : MonoBehaviour { public Voodoo Controller; public void EliminateEnemyForReal() { if (((Object)Controller._playerTarget).name == ((Object)PlayerAvatar.instance).name) { Controller._playerTarget.playerHealth.Hurt(700, false, -1, false); } } } }