Decompiled source of ScannablePlayers v2.0.0

plugins/ScannablePlayersModv1.dll

Decompiled 11 months ago
using System.Collections.Generic;
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("ScannablePlayersModv1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ScannablePlayersModv1")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("6965a26d-1c21-438e-936b-c7d11bb0522f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ScannablePlayersMod
{
	[BepInPlugin("Obsidian.Lithium.ScannablePlayers", "Lithium", "1.0.0")]
	public class ModBase : BaseUnityPlugin
	{
		private const string modGUID = "Obsidian.Lithium.ScannablePlayers";

		private const string modName = "Lithium";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Obsidian.Lithium.ScannablePlayers");

		private static ModBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			harmony.PatchAll(Assembly.GetExecutingAssembly());
		}
	}
}
namespace LethalCompanyMods.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void ScannablePlayers()
		{
			List<int> list = new List<int>();
			GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
			foreach (GameObject val in array)
			{
				if (!Object.op_Implicit((Object)(object)val.GetComponent<ScanNodeProperties>()))
				{
					val.AddComponent<ScanNodeProperties>();
					Object.Instantiate<GameObject>(GameObject.Find("ScanNode")).transform.parent = val.transform;
					val.GetComponent<ScanNodeProperties>().headerText = ((Object)val).name;
					val.GetComponent<ScanNodeProperties>().scrapValue = 0;
					val.GetComponent<ScanNodeProperties>().requiresLineOfSight = false;
					val.GetComponent<ScanNodeProperties>().subText = ((Object)val).name;
					val.GetComponent<ScanNodeProperties>().maxRange = 999;
					val.GetComponent<ScanNodeProperties>().minRange = 0;
					list.Add(((Object)val).GetInstanceID());
				}
			}
		}
	}
}