Decompiled source of EnhancedRespawn v1.0.0

EnhancedRespawn.dll

Decompiled 4 hours ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
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("HTF")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HTF")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5208ed49-769e-472d-8164-a43d8313e78b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HTF_EnhancedRespawn;

[BepInPlugin("HTF.kr.EnhancedRespawn", "EnhancedRespawn", "1.0.0")]
public class ModBehaviour : BaseUnityPlugin
{
	[HarmonyPatch(typeof(PlayerDying))]
	public class PlayerDying_path
	{
		[HarmonyTranspiler]
		[HarmonyPatch("Update")]
		private static IEnumerable<CodeInstruction> Update_Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Expected O, but got Unknown
			List<CodeInstruction> list = instructions.ToList();
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Call && list[i].operand is MethodInfo)
				{
					MethodInfo methodInfo = list[i].operand as MethodInfo;
					if (methodInfo.DeclaringType == typeof(BossManager) && methodInfo.Name == "get_Boss")
					{
						int num = i + 2;
						list.Insert(num, new CodeInstruction(OpCodes.Ldc_I4_0, (object)null));
						list.Insert(num + 1, new CodeInstruction(OpCodes.And, (object)null));
						break;
					}
				}
			}
			return list;
		}
	}

	[HarmonyPatch(typeof(DeathUI))]
	public class DeathUI_path
	{
		[HarmonyPrefix]
		[HarmonyPatch("ToggleBossUI")]
		private static void ToggleBossUI_Prefix(ref bool to)
		{
			to = false;
		}
	}

	private Harmony harmony;

	private static ManualLogSource Log;

	private void Awake()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		harmony = new Harmony("HTF.kr.EnhancedRespawn");
		harmony.PatchAll();
		Log = ((BaseUnityPlugin)this).Logger;
		Log.LogInfo((object)"EnhancedRespawn enble");
	}
}