Decompiled source of ReachForTheStars v1.2.1

ReachForTheStars.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 GameNetcodeStuff;
using HarmonyLib;
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("ReachForTheStars")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ReachForTheStars")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("46921f63-41fd-4eb6-8cc5-e5ca0e310d5d")]
[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 ReachForTheStars
{
	[BepInPlugin("Juggernaut.ReachForTheStars", "ReachForTheStars", "1.1.0.0")]
	public class ReachBase : BaseUnityPlugin
	{
		private const string modGUID = "Juggernaut.ReachForTheStars";

		private const string modName = "ReachForTheStars";

		private const string modVersion = "1.1.0.0";

		private readonly Harmony harmony = new Harmony("Juggernaut.ReachForTheStars");

		internal ManualLogSource mls;

		public static ReachBase Instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Juggernaut.ReachForTheStars");
			mls.LogInfo((object)"Reach enabled :3");
			harmony.PatchAll(Assembly.GetExecutingAssembly());
		}
	}
}
namespace ReachForTheStars.Patches2
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class InfiniteReachForDeezPatch5
	{
		private const float INFINITE_DISTANCE = float.PositiveInfinity;

		[HarmonyPatch(typeof(PlayerControllerB))]
		[HarmonyPatch("SetHoverTipAndCurrentInteractTrigger")]
		[HarmonyPostfix]
		private static void ReachAndInteractionPatch(PlayerControllerB __instance, ref int ___interactableObjectsMask)
		{
			___interactableObjectsMask = LayerMask.GetMask(new string[2] { "Props", "InteractableObject" });
			__instance.grabDistance = float.PositiveInfinity;
			ReachBase.Instance.mls.LogInfo((object)"ReachAndInteractionPatch executed.");
		}
	}
}