Decompiled source of LuggageRespawn v1.0.1

LuggageRespawn.dll

Decompiled 3 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Photon.Pun;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("More Respawns PEAK")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("More Respawns PEAK")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("28c280d2-c435-4a5c-8abc-9d07a461fd1c")]
[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 More_Respawns_PEAK
{
	[BepInPlugin("nugbert.Respawn_On_Big_Luggages", "RespawnOnBigLuggages", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "nugbert.Respawn_On_Big_Luggages";

		private const string modName = "RespawnOnBigLuggages";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("nugbert.Respawn_On_Big_Luggages");

		private static Plugin Instance;

		internal ManualLogSource logger;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			logger = Logger.CreateLogSource("nugbert.Respawn_On_Big_Luggages");
			logger.LogInfo((object)"Luggage Respawner Loaded!");
			harmony.PatchAll();
		}
	}
}
namespace More_Respawns_PEAK.Patches
{
	[HarmonyPatch(typeof(Luggage), "Interact_CastFinished")]
	internal class OnLuggageOpenedPatch
	{
		[HarmonyPostfix]
		public static void RespawnOnLuggage(Luggage __instance, Character interactor)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)interactor != (Object)null) || !(__instance.GetName() == "BIG LUGGAGE"))
			{
				return;
			}
			PhotonView component = ((Component)interactor).GetComponent<PhotonView>();
			Debug.Log((object)$"BIG LUGGAGE avattu: {((Object)interactor).name}, ActorNumber: {((component != null) ? new int?(component.OwnerActorNr) : null)}");
			Vector3 val = ((Component)__instance).transform.position + ((Component)__instance).transform.up * 0.2f;
			foreach (Character allCharacter in Character.AllCharacters)
			{
				if (allCharacter.data.dead || allCharacter.data.fullyPassedOut)
				{
					((MonoBehaviourPun)allCharacter).photonView.RPC("RPCA_ReviveAtPosition", (RpcTarget)0, new object[2] { val, true });
				}
			}
		}
	}
}