using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("No Dying")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("No Dying")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("2f55c077-7a5a-4f9f-adbc-3bb1565a9213")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.1.0.0")] namespace NoDying; [BepInPlugin("com.kyleanderror13.nodyingmod", "No Dying", "1.1")] public class Mod : BaseUnityPlugin { private void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"No Dying mod installed."); Harmony.CreateAndPatchAll(typeof(Mod), (string)null); } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerData), "TakeHealth")] private static void TakeHealthPrefix(int amount, bool hasBlueHealth, bool allowFracturedMaskBreak, out InvincibilityStates __state) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected I4, but got Unknown __state = (InvincibilityStates)(int)CheatManager.Invincibility; CheatManager.Invincibility = (InvincibilityStates)3; } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerData), "TakeHealth")] private static void TakeHealthPostfix(int amount, bool hasBlueHealth, bool allowFracturedMaskBreak, InvincibilityStates __state) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) CheatManager.Invincibility = __state; } }