Decompiled source of Tele Herse v1.0.0

Tele-Herse/Tele-Herse.dll

Decompiled 8 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 GameNetcodeStuff;
using HarmonyLib;
using Tele_Herse.Patches;
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("Tele-Herse")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Tele-Herse")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e96e1d8d-b411-45f6-bdb1-a0ad58e81aa8")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Tele_Herse
{
	[BepInPlugin("Dug.TeleHerseMod", "TeleHerse", "1.0.0")]
	public class TeleHerse : BaseUnityPlugin
	{
		private const string modVersion = "1.0.0";

		private const string modGUID = "Dug.TeleHerseMod";

		private const string modName = "TeleHerse";

		private readonly Harmony harmony = new Harmony("Dug.TeleHerseMod");

		private static TeleHerse Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Dug.TeleHerseMod");
			mls.LogInfo((object)"TeleHerse is Starting...");
			harmony.PatchAll(typeof(TeleHerse));
			harmony.PatchAll(typeof(ShipTeleporterPatch));
		}
	}
}
namespace Tele_Herse.Patches
{
	[HarmonyPatch(typeof(ShipTeleporter), "beamUpPlayer")]
	public class ShipTeleporterPatch
	{
		private static bool Prefix(ref bool ___isInverseTeleporter)
		{
			PlayerControllerB targetedPlayer = StartOfRound.Instance.mapScreen.targetedPlayer;
			if (!targetedPlayer.isPlayerDead && !___isInverseTeleporter)
			{
				return false;
			}
			return true;
		}
	}
}