Decompiled source of LethalInternship v0.24.2

plugins/Szumi57-LethalInternship/LethalInternship.dll

Decompiled 3 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CSync.Extensions;
using CSync.Lib;
using HarmonyLib;
using LethalCompanyInputUtils.Api;
using LethalInternship.Configs;
using LethalInternship.Core.Managers;
using LethalInternship.Core.UI.Outlines;
using LethalInternship.Inputs;
using LethalInternship.Managers;
using LethalInternship.NetcodePatcher;
using LethalInternship.SharedAbstractions.Configs;
using LethalInternship.SharedAbstractions.Constants;
using LethalInternship.SharedAbstractions.Enums;
using LethalInternship.SharedAbstractions.Events;
using LethalInternship.SharedAbstractions.Hooks.PluginLoggerHooks;
using LethalInternship.SharedAbstractions.Inputs;
using LethalInternship.SharedAbstractions.ManagerProviders;
using LethalInternship.SharedAbstractions.Managers;
using LethalInternship.SharedAbstractions.NetworkSerializers;
using LethalInternship.SharedAbstractions.PluginRuntimeProvider;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalInternship")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.24.2.0")]
[assembly: AssemblyInformationalVersion("0.24.2")]
[assembly: AssemblyProduct("LethalInternship")]
[assembly: AssemblyTitle("LethalInternship")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.24.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LethalInternship
{
	[BepInPlugin("Szumi57.LethalInternship", "LethalInternship", "0.24.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static PluginLogDebugDelegate <0>__LogDebug;

			public static PluginLogInfoDelegate <1>__LogInfo;

			public static PluginLogWarningDelegate <2>__LogWarning;

			public static PluginLogErrorDelegate <3>__LogError;
		}

		public const string ModGUID = "Szumi57.LethalInternship";

		public static AssetBundle ModAssets = null;

		public static EnemyType InternNPCPrefab = null;

		internal static bool UIAssetsLoaded = false;

		public static GameObject CommandsAll = null;

		public static GameObject CommandsOne = null;

		public static GameObject TooltipBar = null;

		public static GameObject WorldIconPrefab = null;

		public static GameObject InputIconPrefab = null;

		public static AudioClip[] DefaultVoiceClips = null;

		internal static string DirectoryName = null;

		internal static ManualLogSource Logger = null;

		internal static Config Config = null;

		internal static ILethalInternshipInputs InputActionsInstance = null;

		internal static int PluginIrlPlayersCount = 4;

		internal static bool IsModTooManyEmotesLoaded = false;

		internal static bool IsModModelReplacementAPILoaded = false;

		internal static bool IsModCustomItemBehaviourLibraryLoaded = false;

		internal static bool IsModMoreCompanyLoaded = false;

		internal static bool IsModReviveCompanyLoaded = false;

		internal static bool IsModBunkbedReviveLoaded = false;

		internal static bool IsModLethalMinLoaded = false;

		internal static bool IsModMipaLoaded = false;

		internal static bool IsModMonoProfilerLoaderLoaded = false;

		private readonly Harmony _harmony = new Harmony("Szumi57.LethalInternship");

		private void Awake()
		{
			string text = "internnpcmodassets";
			DirectoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
			Logger = ((BaseUnityPlugin)this).Logger;
			Config = new Config(((BaseUnityPlugin)this).Config);
			InputActionsInstance = (ILethalInternshipInputs)(object)new LethalInternshipInputs();
			InitializeNetworkBehaviours();
			ModAssets = AssetBundle.LoadFromFile(Path.Combine(DirectoryName, text));
			if ((Object)(object)ModAssets == (Object)null)
			{
				Logger.LogError((object)"Failed to load custom assets.");
			}
			else if (LoadInternPrefab(text))
			{
				UIAssetsLoaded = LoadUIPrefabs();
				LoadAudioClips();
				InitSharedValues();
				InitPluginManager();
				PatchBaseGame();
				PatchOtherMods();
				Logger.LogInfo((object)"Plugin LethalInternship is loaded!");
			}
		}

		private static void InitializeNetworkBehaviours()
		{
			Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
			foreach (Assembly assembly in assemblies)
			{
				if (assembly.GetName().Name != "LethalInternship.Core")
				{
					continue;
				}
				Type[] types = assembly.GetTypes();
				Type[] array = types;
				foreach (Type type in array)
				{
					MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
					MethodInfo[] array2 = methods;
					foreach (MethodInfo methodInfo in array2)
					{
						try
						{
							object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
							if (customAttributes.Length != 0)
							{
								methodInfo.Invoke(null, null);
							}
						}
						catch
						{
						}
					}
				}
			}
		}

		private bool LoadInternPrefab(string bundleName)
		{
			InternNPCPrefab = ModAssets.LoadAsset<EnemyType>("InternNPC");
			if ((Object)(object)InternNPCPrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load InternNPC prefab.");
				return false;
			}
			if ((Object)(object)InternNPCPrefab.enemyPrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load InternNPCPrefab.enemyPrefab.");
				return false;
			}
			foreach (Transform item in (from x in InternNPCPrefab.enemyPrefab.GetComponentsInChildren<Transform>()
				where (Object)(object)x.parent != (Object)null && ((Object)x.parent).name == "InternNPCObj" && ((Object)x).name != "Collision" && ((Object)x).name != "TurnCompass" && ((Object)x).name != "CreatureSFX" && ((Object)x).name != "CreatureVoice"
				select x).ToList())
			{
				Object.DestroyImmediate((Object)(object)((Component)item).gameObject);
			}
			byte[] value = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(Assembly.GetCallingAssembly().GetName().Name + ((Object)((Component)this).gameObject).name + bundleName));
			uint num = BitConverter.ToUInt32(value, 0);
			Type typeFromHandle = typeof(NetworkObject);
			FieldInfo field = typeFromHandle.GetField("GlobalObjectIdHash", BindingFlags.Instance | BindingFlags.NonPublic);
			NetworkObject component = InternNPCPrefab.enemyPrefab.GetComponent<NetworkObject>();
			field.SetValue(component, num);
			NetworkPrefabs.RegisterNetworkPrefab(InternNPCPrefab.enemyPrefab);
			return true;
		}

		private static void InitPluginManager()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			GameObject val = new GameObject("PluginManager");
			val.AddComponent<PluginManager>();
			PluginManager.Instance.InitManagers();
		}

		private bool LoadUIPrefabs()
		{
			CommandsAll = ModAssets.LoadAsset<GameObject>("CommandsAll");
			if ((Object)(object)CommandsAll == (Object)null)
			{
				Logger.LogError((object)"Failed to load CommandsAll prefab.");
				return false;
			}
			CommandsOne = ModAssets.LoadAsset<GameObject>("CommandsOne");
			if ((Object)(object)CommandsOne == (Object)null)
			{
				Logger.LogError((object)"Failed to load CommandsOne prefab.");
				return false;
			}
			TooltipBar = ModAssets.LoadAsset<GameObject>("Tooltip");
			if ((Object)(object)TooltipBar == (Object)null)
			{
				Logger.LogError((object)"Failed to load TooltipBar prefab.");
				return false;
			}
			WorldIconPrefab = ModAssets.LoadAsset<GameObject>("WorldIcon");
			if ((Object)(object)WorldIconPrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load WorldIcon UI prefab.");
				return false;
			}
			InputIconPrefab = ModAssets.LoadAsset<GameObject>("InputIcon");
			if ((Object)(object)InputIconPrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load InputIcon UI prefab.");
				return false;
			}
			OutlineResources.Init(ModAssets.LoadAsset<Material>("FakeOutlineMat"));
			return true;
		}

		private void LoadAudioClips()
		{
			DefaultVoiceClips = ModAssets.LoadAllAssets<AudioClip>();
		}

		private void PatchBaseGame()
		{
			Assembly assembly = null;
			Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
			foreach (Assembly assembly2 in assemblies)
			{
				if (assembly2.GetName().Name == "LethalInternship.Patches")
				{
					assembly = assembly2;
					break;
				}
			}
			if (assembly == null)
			{
				LogError("LethalInternship.Patches not found ! Cannot apply patches !");
				return;
			}
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.GameEnginePatches.DebugPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.GameEnginePatches.GameNetworkManagerPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.GameEnginePatches.HUDManagerPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.GameEnginePatches.NetworkSceneManagerPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.GameEnginePatches.NetworkObjectPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.GameEnginePatches.RoundManagerPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.GameEnginePatches.SoundManagerPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.GameEnginePatches.StartOfRoundPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.NpcPatches.EnemyAICollisionDetectPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.NpcPatches.EnemyAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch"));
			assembly.GetType("LethalInternship.Patches.NpcPatches.PlayerControllerBUtils")?.GetMethod("Init")?.Invoke(null, null);
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.BaboonBirdAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.BlobAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.BushWolfEnemyPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.ButlerBeesEnemyAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.ButlerEnemyAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.CaveDwellerAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.CentipedeAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.CrawlerAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.FlowermanAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.FlowerSnakeEnemyPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.ForestGiantAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.GiantKiwiAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.JesterAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.MaskedPlayerEnemyPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.MouthDogAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.PumaAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.RadMechAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.RadMechMissilePatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.RedLocustBeesPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.SandSpiderAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.SandWormAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.SpringManAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.MapHazardsPatches.LandminePatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.MapHazardsPatches.QuicksandTriggerPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.MapHazardsPatches.SpikeRoofTrapPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.MapHazardsPatches.TurretPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.MapPatches.DoorLockPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.MapPatches.InteractTriggerPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.MapPatches.ItemDropShipPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.MapPatches.ManualCameraRendererPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.MapPatches.ShipTeleporterPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.MapPatches.VehicleCollisionTriggerPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.MapPatches.VehicleControllerPatch"));
			assembly.GetType("LethalInternship.Patches.MapPatches.ShipTeleporterUtils")?.GetMethod("Init")?.Invoke(null, null);
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ObjectsPatches.DeadBodyInfoPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ObjectsPatches.GrabbableObjectPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ObjectsPatches.KnifeItemPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ObjectsPatches.RagdollGrabbableObjectPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ObjectsPatches.ShotgunItemPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ObjectsPatches.ShovelPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ObjectsPatches.StunGrenadeItemPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.TerminalPatches.TerminalPatch"));
			assembly.GetType("LethalInternship.Patches.TerminalPatches.TerminalUtils")?.GetMethod("Init")?.Invoke(null, null);
		}

		private void PatchOtherMods()
		{
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Expected O, but got Unknown
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Expected O, but got Unknown
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Expected O, but got Unknown
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0338: Expected O, but got Unknown
			//IL_057d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0589: Expected O, but got Unknown
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d0: Expected O, but got Unknown
			//IL_0629: Unknown result type (might be due to invalid IL or missing references)
			//IL_0635: Expected O, but got Unknown
			//IL_06e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f5: Expected O, but got Unknown
			//IL_072e: Unknown result type (might be due to invalid IL or missing references)
			//IL_073c: Expected O, but got Unknown
			//IL_076b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0779: Expected O, but got Unknown
			//IL_07b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c3: Expected O, but got Unknown
			//IL_07f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0800: Expected O, but got Unknown
			//IL_082f: Unknown result type (might be due to invalid IL or missing references)
			//IL_083d: Expected O, but got Unknown
			//IL_086c: Unknown result type (might be due to invalid IL or missing references)
			//IL_087a: Expected O, but got Unknown
			//IL_08a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b7: Expected O, but got Unknown
			//IL_08f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fe: Expected O, but got Unknown
			//IL_0939: Unknown result type (might be due to invalid IL or missing references)
			//IL_0945: Expected O, but got Unknown
			//IL_097e: Unknown result type (might be due to invalid IL or missing references)
			//IL_098c: Expected O, but got Unknown
			//IL_0a58: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a66: Expected O, but got Unknown
			IsModTooManyEmotesLoaded = IsModLoaded("FlipMods.TooManyEmotes");
			IsModModelReplacementAPILoaded = IsModLoaded("meow.ModelReplacementAPI");
			IsModCustomItemBehaviourLibraryLoaded = IsModLoaded("com.github.WhiteSpike.CustomItemBehaviourLibrary");
			IsModMoreCompanyLoaded = IsModLoaded("me.swipez.melonloader.morecompany");
			IsModReviveCompanyLoaded = IsModLoaded("OpJosMod.ReviveCompany");
			IsModBunkbedReviveLoaded = IsModLoaded("viviko.BunkbedRevive");
			IsModLethalMinLoaded = IsModLoaded("NoteBoxz.LethalMin");
			IsModMipaLoaded = IsModLoaded("Mipa");
			bool flag = IsModLoaded("MoreEmotes");
			bool flag2 = IsModLoaded("BetterEmotes");
			bool flag3 = IsModLoaded("LethalPhones");
			bool flag4 = IsModLoaded("FlipMods.FasterItemDropship");
			bool flag5 = IsModLoaded("Piggy.ShowCapacity");
			bool flag6 = IsModLoaded("FlipMods.ReservedItemSlotCore");
			bool flag7 = IsModLoaded("Stoneman.LethalProgression");
			bool flag8 = IsModLoaded("QuickBuyMenu");
			bool flag9 = IsModLoaded("suskitech.LCAlwaysHearActiveWalkie");
			bool flag10 = IsModLoaded("Zaprillator");
			bool flag11 = IsModLoaded("butterystancakes.lethalcompany.butteryfixes");
			bool flag12 = IsModLoaded("x753.Peepers");
			bool flag13 = IsModLoaded("hotdogModel");
			bool flag14 = IsModLoaded("Emil.UsualScrap");
			bool flag15 = IsModLoaded("com.example.Advancedfeatures");
			List<string> list = new List<string>();
			string[] files = Directory.GetFiles(Path.GetFullPath(Paths.PatcherPluginPath), "*.dll", SearchOption.AllDirectories);
			foreach (string path in files)
			{
				list.Add(Path.GetFileName(path));
			}
			bool flag16 = IsPreLoaderLoaded("AdditionalNetworking_Preloader.dll", list);
			IsModMonoProfilerLoaderLoaded = IsPreLoaderLoaded("MonoProfilerLoader.dll", list);
			Assembly assembly = null;
			Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
			foreach (Assembly assembly2 in assemblies)
			{
				if (assembly2.GetName().Name == "LethalInternship.Patches")
				{
					assembly = assembly2;
					break;
				}
			}
			if (assembly == null)
			{
				LogError("LethalInternship.Patches not found ! Cannot apply mod patches !");
				return;
			}
			if (flag)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.MoreEmotes.MoreEmotesPatch"));
			}
			if (flag2)
			{
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("BetterEmote.Patches.EmotePatch"), "StartPostfix", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.BetterEmotes.BetterEmotesPatch"), "StartPostfix_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("BetterEmote.Patches.EmotePatch"), "UpdatePrefix", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.BetterEmotes.BetterEmotesPatch"), "UpdatePrefix_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("BetterEmote.Patches.EmotePatch"), "UpdatePostfix", (Type[])null, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.BetterEmotes.BetterEmotesPatch"), "UpdatePostfix_Transpiler", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null);
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("BetterEmote.Patches.EmotePatch"), "PerformEmotePrefix", (Type[])null, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.BetterEmotes.BetterEmotesPatch"), "PerformEmotePrefix_Transpiler", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null);
			}
			if (IsModTooManyEmotesLoaded)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.TooManyEmotes.EmoteControllerPlayerPatch"));
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.TooManyEmotes.ThirdPersonEmoteControllerPatch"));
				assembly.GetType("LethalInternship.Patches.ModPatches.TooManyEmotes.TooManyEmotesUtils")?.GetMethod("Init")?.Invoke(null, null);
			}
			if (IsModMoreCompanyLoaded)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.MoreCompany.LookForPlayersForestGiantPatchPatch"));
				assembly.GetType("LethalInternship.Patches.ModPatches.MoreCompany.MoreCompanyUtils")?.GetMethod("Init")?.Invoke(null, null);
			}
			if (IsModModelReplacementAPILoaded)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.ModelRplcmntAPI.AvatarUpdaterPatch"));
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.ModelRplcmntAPI.BodyReplacementBasePatch"));
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.ModelRplcmntAPI.ManagerBasePatch"));
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.ModelRplcmntAPI.ModelReplacementPlayerControllerBPatchPatch"));
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.ModelRplcmntAPI.ModelReplacementAPIPatch"));
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.ModelRplcmntAPI.ViewModelUpdaterPatch"));
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.ModelRplcmntAPI.ViewStateManagerPatch"));
				assembly.GetType("LethalInternship.Patches.ModPatches.ModelRplcmntAPI.ModelReplacementAPIUtils")?.GetMethod("Init")?.Invoke(null, null);
			}
			if (flag3)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.LethalPhones.PlayerPhonePatchPatch"));
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.LethalPhones.PhoneBehaviorPatch"));
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.LethalPhones.PlayerPhonePatchLI"));
			}
			if (flag4)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.FasterItemDropship.FasterItemDropshipPatch"));
			}
			if (flag16)
			{
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("AdditionalNetworking.Patches.Inventory.PlayerControllerBPatch"), "OnStart", (Type[])null, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.AdditionalNetworking.AdditionalNetworkingPatch"), "Start_Transpiler", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null);
			}
			if (flag5)
			{
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("ShowCapacity.Patches.PlayerControllerBPatch"), "Update_PreFix", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.ShowCapacity.ShowCapacityPatch"), "Update_PreFix_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
			if (IsModReviveCompanyLoaded)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.ReviveCompany.ReviveCompanyGeneralUtilPatch"));
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("OPJosMod.ReviveCompany.Patches.PlayerControllerBPatch"), "setHoverTipAndCurrentInteractTriggerPatch", (Type[])null, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.ReviveCompany.ReviveCompanyPlayerControllerBPatchPatch"), "SetHoverTipAndCurrentInteractTriggerPatch_Transpiler", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null);
				assembly.GetType("LethalInternship.Patches.ModPatches.ReviveCompany.ReviveCompanyUtils")?.GetMethod("Init")?.Invoke(null, null);
			}
			if (IsModBunkbedReviveLoaded)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.BunkbedRevive.BunkbedControllerPatch"));
				assembly.GetType("LethalInternship.Patches.ModPatches.BunkbedRevive.BunkbedReviveUtils")?.GetMethod("Init")?.Invoke(null, null);
			}
			if (flag10)
			{
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("Zaprillator.Behaviors.RevivablePlayer"), "IShockableWithGun.StopShockingWithGun", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.Zaprillator.RevivablePlayerPatch"), "StopShockingWithGun_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
			if (flag6)
			{
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("ReservedItemSlotCore.Patches.PlayerPatcher"), "InitializePlayerControllerLate", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.ReservedItemSlotCore.PlayerPatcherPatch"), "InitializePlayerControllerLate_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("ReservedItemSlotCore.Patches.PlayerPatcher"), "CheckForChangedInventorySize", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.ReservedItemSlotCore.PlayerPatcherPatch"), "CheckForChangedInventorySize_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
			if (flag7)
			{
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("LethalProgression.Skills.HPRegen"), "HPRegenUpdate", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.LethalProgression.HPRegenPatch"), "HPRegenUpdate_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("LethalProgression.Skills.Oxygen"), "EnteredWater", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.LethalProgression.OxygenPatch"), "EnteredWater_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("LethalProgression.Skills.Oxygen"), "LeftWater", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.LethalProgression.OxygenPatch"), "LeftWater_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("LethalProgression.Skills.Oxygen"), "ShouldDrown", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.LethalProgression.OxygenPatch"), "ShouldDrown_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("LethalProgression.Skills.Oxygen"), "OxygenUpdate", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.LethalProgression.OxygenPatch"), "OxygenUpdate_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
			if (flag8)
			{
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("QuickBuyMenu.Plugin"), "RunQuickBuy", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.QuickBuy.QuickBuyMenuPatch"), "RunQuickBuy_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
			if (flag9)
			{
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("LCAlwaysHearWalkieMod.Patches.PlayerControllerBPatch"), "alwaysHearWalkieTalkiesPatch", (Type[])null, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.LCAlwaysHearActiveWalkie.LCAlwaysHearActiveWalkiePatch"), "alwaysHearWalkieTalkiesPatch_Transpiler", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null);
			}
			if (flag11)
			{
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("ButteryFixes.Patches.Player.BodyPatches"), "DeadBodyInfoPostStart", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.ButteryFixes.BodyPatchesPatch"), "DeadBodyInfoPostStart_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
			if (flag12)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.Peepers.PeeperAttachHitboxPatch"));
			}
			if (flag13)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.HotdogScout.JawMovementPatch"));
			}
			if (IsModMipaLoaded)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.Mipa.SkinApplyPatch"));
				assembly.GetType("LethalInternship.Patches.ModPatches.Mipa.MipaUtils")?.GetMethod("Init")?.Invoke(null, null);
			}
			if (flag14)
			{
				_harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("UsualScrap.Behaviors.DefibrillatorScript"), "RevivePlayer", (Type[])null, (Type[])null), new HarmonyMethod(assembly.GetType("LethalInternship.Patches.ModPatches.UsualScrap.DefibrillatorScriptPatch"), "RevivePlayer_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
			if (IsModLethalMinLoaded)
			{
				assembly.GetType("LethalInternship.Patches.ModPatches.LethalMin.LethalMinUtils")?.GetMethod("Init")?.Invoke(null, null);
			}
			if (IsModCustomItemBehaviourLibraryLoaded)
			{
				assembly.GetType("LethalInternship.Patches.ModPatches.CustomItemBehaviourLibrary.CustomItemBehaviourLibraryUtils")?.GetMethod("Init")?.Invoke(null, null);
			}
			if (IsModMonoProfilerLoaderLoaded)
			{
				assembly.GetType("LethalInternship.Patches.ModPatches.MonoProfiler.MonoProfilerUtils")?.GetMethod("Init")?.Invoke(null, null);
			}
			if (flag15)
			{
				_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ModPatches.AdvancedFeatures.EndscreenPatch"));
			}
		}

		private bool IsModLoaded(string modGUID)
		{
			bool flag = Chainloader.PluginInfos.ContainsKey(modGUID);
			if (flag)
			{
				LogInfo("Mod compatibility loaded for mod : GUID " + modGUID);
			}
			return flag;
		}

		private bool IsPreLoaderLoaded(string dllFileName, List<string> fileNames)
		{
			bool flag = fileNames.Contains(dllFileName);
			if (flag)
			{
				LogInfo("Mod compatibility loaded for preloader : " + dllFileName);
			}
			return flag;
		}

		internal void InitHooks()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			object obj = <>O.<0>__LogDebug;
			if (obj == null)
			{
				PluginLogDebugDelegate val = LogDebug;
				<>O.<0>__LogDebug = val;
				obj = (object)val;
			}
			PluginLoggerHook.LogDebug = (PluginLogDebugDelegate)obj;
			object obj2 = <>O.<1>__LogInfo;
			if (obj2 == null)
			{
				PluginLogInfoDelegate val2 = LogInfo;
				<>O.<1>__LogInfo = val2;
				obj2 = (object)val2;
			}
			PluginLoggerHook.LogInfo = (PluginLogInfoDelegate)obj2;
			object obj3 = <>O.<2>__LogWarning;
			if (obj3 == null)
			{
				PluginLogWarningDelegate val3 = LogWarning;
				<>O.<2>__LogWarning = val3;
				obj3 = (object)val3;
			}
			PluginLoggerHook.LogWarning = (PluginLogWarningDelegate)obj3;
			object obj4 = <>O.<3>__LogError;
			if (obj4 == null)
			{
				PluginLogErrorDelegate val4 = LogError;
				<>O.<3>__LogError = val4;
				obj4 = (object)val4;
			}
			PluginLoggerHook.LogError = (PluginLogErrorDelegate)obj4;
		}

		internal static void LogDebug(string debugLog)
		{
			if (Config.EnableDebugLog)
			{
				Logger.LogDebug((object)debugLog);
			}
		}

		internal static void LogInfo(string infoLog)
		{
			Logger.LogInfo((object)infoLog);
		}

		internal static void LogWarning(string warningLog)
		{
			Logger.LogWarning((object)warningLog);
		}

		internal static void LogError(string errorLog)
		{
			Logger.LogError((object)errorLog);
		}

		internal void InitSharedValues()
		{
			InitHooks();
			PluginEventsProvider.Events = (IPluginRuntimeEvents)(object)new PluginEventSource(Config);
			PluginRuntimeProvider.Context = (IPluginRuntimeContext)(object)new PluginRuntimeContext();
		}
	}
	public class PluginEventSource : IPluginRuntimeEvents
	{
		public event EventHandler? InitialSyncCompleted;

		public PluginEventSource(Config config)
		{
			((SyncedConfig2<Config>)(object)config).InitialSyncCompleted += Config_InitialSyncCompleted;
		}

		private void Config_InitialSyncCompleted(object sender, EventArgs e)
		{
			this.InitialSyncCompleted?.Invoke(sender, e);
		}
	}
	public class PluginRuntimeContext : IPluginRuntimeContext
	{
		public string Plugin_Guid => "LethalInternship";

		public string Plugin_Version => "0.24.2";

		public string Plugin_Name => "LethalInternship";

		public string ConfigPath => Paths.ConfigPath;

		public string VoicesPath => Utility.CombinePaths(new string[3]
		{
			Paths.ConfigPath,
			"LethalInternship",
			VoicesConst.VOICES_PATH
		});

		public EnemyType InternNPCPrefab => Plugin.InternNPCPrefab;

		public int PreparedIrlPlayersCount { get; set; }

		public int PreparedInternCount { get; set; }

		public int PluginIrlPlayersCount
		{
			get
			{
				return Plugin.PluginIrlPlayersCount;
			}
			set
			{
				Plugin.PluginIrlPlayersCount = value;
			}
		}

		public int AllEntitiesCount { get; set; }

		public GameObject[] InternObjects { get; set; } = null;

		public uint NextInternNetworkObjectHash { get; set; } = 100001u;

		public uint[][] InternNetworkObjectHashes { get; set; } = Array.Empty<uint[]>();

		public bool UIAssetsLoaded => Plugin.UIAssetsLoaded;

		public AudioClip[] DefaultVoicesClips => Plugin.DefaultVoiceClips;

		public GameObject CommandsAll => Plugin.CommandsAll;

		public GameObject CommandsOne => Plugin.CommandsOne;

		public GameObject TooltipBar => Plugin.TooltipBar;

		public GameObject WorldIconPrefab => Plugin.WorldIconPrefab;

		public GameObject InputIconPrefab => Plugin.InputIconPrefab;

		public string DirectoryName => Plugin.DirectoryName;

		public ILethalInternshipInputs InputActionsInstance => Plugin.InputActionsInstance;

		public IConfig Config => (IConfig)(object)Plugin.Config;

		public bool IsModTooManyEmotesLoaded => Plugin.IsModTooManyEmotesLoaded;

		public bool IsModModelReplacementAPILoaded => Plugin.IsModModelReplacementAPILoaded;

		public bool IsModCustomItemBehaviourLibraryLoaded => Plugin.IsModCustomItemBehaviourLibraryLoaded;

		public bool IsModMoreCompanyLoaded => Plugin.IsModMoreCompanyLoaded;

		public bool IsModReviveCompanyLoaded => Plugin.IsModReviveCompanyLoaded;

		public bool IsModBunkbedReviveLoaded => Plugin.IsModBunkbedReviveLoaded;

		public bool IsModLethalMinLoaded => Plugin.IsModLethalMinLoaded;

		public bool IsModMipaLoaded => Plugin.IsModMipaLoaded;

		public bool IsModMonoProfilerLoaderLoaded => Plugin.IsModMonoProfilerLoaderLoaded;
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LethalInternship";

		public const string PLUGIN_NAME = "LethalInternship";

		public const string PLUGIN_VERSION = "0.24.2";
	}
}
namespace LethalInternship.Managers
{
	internal class PluginManager : MonoBehaviour, IPluginManager
	{
		private static PluginManager _instance;

		private GameObject saveManagerPrefab = null;

		private GameObject internManagerPrefab = null;

		private GameObject terminalManagerPrefab = null;

		public static PluginManager Instance
		{
			get
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Expected O, but got Unknown
				if ((Object)(object)_instance == (Object)null)
				{
					GameObject val = new GameObject("PluginManager");
					_instance = val.AddComponent<PluginManager>();
					Object.DontDestroyOnLoad((Object)(object)val);
				}
				return _instance;
			}
		}

		public GameObject SaveManagerPrefab => saveManagerPrefab;

		public GameObject InternManagerPrefab => internManagerPrefab;

		public GameObject TerminalManagerPrefab => terminalManagerPrefab;

		private void Awake()
		{
			if ((Object)(object)_instance != (Object)null && (Object)(object)_instance != (Object)(object)this)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			_instance = this;
			PluginManagerProvider.Register((IPluginManager)(object)this);
		}

		public void InitManagers()
		{
			internManagerPrefab = NetworkPrefabs.CreateNetworkPrefab("InternManager");
			internManagerPrefab.AddComponent<InternManager>();
			saveManagerPrefab = NetworkPrefabs.CreateNetworkPrefab("SaveManager");
			saveManagerPrefab.AddComponent<SaveManager>();
			terminalManagerPrefab = NetworkPrefabs.CreateNetworkPrefab("TerminalManager");
			terminalManagerPrefab.AddComponent<TerminalManager>();
		}
	}
}
namespace LethalInternship.Inputs
{
	public class LethalInternshipInputs : LcInputActions, ILethalInternshipInputs
	{
		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction ManageIntern { get; set; }

		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction GiveItemToIntern { get; set; }

		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction GrabIntern { get; set; }

		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction ReleaseInterns { get; set; }

		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction OpenCommandsOneIntern { get; set; }

		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction OpenAllCommandsIntern { get; set; }

		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction MakeInternLookAtPosition { get; set; }
	}
}
namespace LethalInternship.Configs
{
	public class Config : SyncedConfig2<Config>, IConfig
	{
		[SyncedEntryField]
		private SyncedEntry<int> maxInternsAvailable;

		[SyncedEntryField]
		private SyncedEntry<int> internPrice;

		[SyncedEntryField]
		private SyncedEntry<int> internMaxHealth;

		[SyncedEntryField]
		private SyncedEntry<float> internSizeScale;

		[SyncedEntryField]
		private SyncedEntry<float> internSpeed;

		[SyncedEntryField]
		private SyncedEntry<string> titleInHelpMenu;

		[SyncedEntryField]
		private SyncedEntry<string> subTitleInHelpMenu;

		[SyncedEntryField]
		private SyncedEntry<bool> canSpectateInterns;

		[SyncedEntryField]
		private SyncedEntry<bool> radarEnabled;

		[SyncedEntryField]
		private SyncedEntry<bool> spawnIdentitiesRandomly;

		[SyncedEntryField]
		private SyncedEntry<int> outsideRangeCommands;

		[SyncedEntryField]
		private SyncedEntry<int> insideRangeCommands;

		[SyncedEntryField]
		private SyncedEntry<bool> followCrouchWithPlayer;

		[SyncedEntryField]
		private SyncedEntry<bool> changeSuitAutoBehaviour;

		[SyncedEntryField]
		private SyncedEntry<int> nbMaxCanCarry;

		[SyncedEntryField]
		private SyncedEntry<bool> grabItemsNearEntrances;

		[SyncedEntryField]
		private SyncedEntry<bool> grabBeesNest;

		[SyncedEntryField]
		private SyncedEntry<bool> grabDeadBodies;

		[SyncedEntryField]
		private SyncedEntry<bool> grabManeaterBaby;

		[SyncedEntryField]
		private SyncedEntry<bool> grabWheelbarrow;

		[SyncedEntryField]
		private SyncedEntry<bool> grabShoppingCart;

		[SyncedEntryField]
		private SyncedEntry<bool> grabKiwiBabyItem;

		[SyncedEntryField]
		private SyncedEntry<bool> grabApparatus;

		[SyncedEntryField]
		private SyncedEntry<bool> teleportedInternDropItems;

		private ConfigEntry<string> volumeVoicesMultiplierInterns;

		private ConfigEntry<int> talkativeness;

		private ConfigEntry<bool> allowSwearing;

		private ConfigEntry<string> volumeFootstepMultiplierInterns;

		private ConfigEntry<int> maxDefaultModelAnimatedInterns;

		private ConfigEntry<int> maxModelReplacementModelAnimatedInterns;

		private ConfigEntry<int> maxFootStepAudioInterns;

		private ConfigEntry<bool> enableDebugLog;

		private ConfigIdentities configIdentities;

		public int MaxInternsAvailable => maxInternsAvailable.Value;

		public int InternPrice => internPrice.Value;

		public int InternMaxHealth => internMaxHealth.Value;

		public float InternSizeScale => internSizeScale.Value;

		public float InternSpeed => internSpeed.Value;

		public string TitleInHelpMenu => titleInHelpMenu.Value;

		public string SubTitleInHelpMenu => subTitleInHelpMenu.Value;

		public bool CanSpectateInterns => canSpectateInterns.Value;

		public bool RadarEnabled => radarEnabled.Value;

		public bool SpawnIdentitiesRandomly => spawnIdentitiesRandomly.Value;

		public int OutsideRangeCommands => outsideRangeCommands.Value;

		public int InsideRangeCommands => insideRangeCommands.Value;

		public bool FollowCrouchWithPlayer => followCrouchWithPlayer.Value;

		public bool ChangeSuitAutoBehaviour => changeSuitAutoBehaviour.Value;

		public int NbMaxCanCarry => nbMaxCanCarry.Value;

		public bool GrabItemsNearEntrances => grabItemsNearEntrances.Value;

		public bool GrabBeesNest => grabBeesNest.Value;

		public bool GrabDeadBodies => grabDeadBodies.Value;

		public bool GrabManeaterBaby => grabManeaterBaby.Value;

		public bool GrabWheelbarrow => grabWheelbarrow.Value;

		public bool GrabShoppingCart => grabShoppingCart.Value;

		public bool GrabKiwiBabyItem => grabKiwiBabyItem.Value;

		public bool GrabApparatus => grabApparatus.Value;

		public bool TeleportedInternDropItems => teleportedInternDropItems.Value;

		public string VolumeVoicesMultiplierInterns => volumeVoicesMultiplierInterns.Value;

		public int Talkativeness => talkativeness.Value;

		public bool AllowSwearing => allowSwearing.Value;

		public string VolumeFootstepMultiplierInterns => volumeFootstepMultiplierInterns.Value;

		public int MaxDefaultModelAnimatedInterns => maxDefaultModelAnimatedInterns.Value;

		public int MaxModelReplacementModelAnimatedInterns => maxModelReplacementModelAnimatedInterns.Value;

		public int MaxFootStepAudioInterns => maxFootStepAudioInterns.Value;

		public bool EnableDebugLog => enableDebugLog.Value;

		public ConfigIdentities ConfigIdentities => configIdentities;

		public Config(ConfigFile cfg)
			: base("LethalInternship")
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Expected O, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Expected O, but got Unknown
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Expected O, but got Unknown
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Expected O, but got Unknown
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Expected O, but got Unknown
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Expected O, but got Unknown
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0414: Unknown result type (might be due to invalid IL or missing references)
			//IL_041e: Expected O, but got Unknown
			//IL_041e: Expected I4, but got Unknown
			//IL_048a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Expected O, but got Unknown
			//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c9: Expected O, but got Unknown
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fe: Expected O, but got Unknown
			cfg.SaveOnConfigSet = false;
			maxInternsAvailable = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, ConfigConst.ConfigSectionMain, "Max amount of interns purchasable", ConfigConst.DEFAULT_MAX_INTERNS_AVAILABLE, new ConfigDescription("Be aware of possible performance problems when more than ~16 interns spawned", (AcceptableValueBase)(object)new AcceptableValueRange<int>(ConfigConst.MIN_INTERNS_AVAILABLE, ConfigConst.MAX_INTERNS_AVAILABLE), Array.Empty<object>()));
			internPrice = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, ConfigConst.ConfigSectionMain, "Price", ConfigConst.DEFAULT_PRICE_INTERN, new ConfigDescription("Price for one intern", (AcceptableValueBase)(object)new AcceptableValueRange<int>(ConfigConst.MIN_PRICE_INTERN, ConfigConst.MAX_PRICE_INTERN), Array.Empty<object>()));
			internMaxHealth = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, ConfigConst.ConfigSectionMain, "Max health", ConfigConst.DEFAULT_INTERN_MAX_HEALTH, new ConfigDescription("Max health of intern", (AcceptableValueBase)(object)new AcceptableValueRange<int>(ConfigConst.MIN_INTERN_MAX_HEALTH, ConfigConst.MAX_INTERN_MAX_HEALTH), Array.Empty<object>()));
			internSizeScale = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, ConfigConst.ConfigSectionMain, "Size multiplier of intern", ConfigConst.DEFAULT_SIZE_SCALE_INTERN, new ConfigDescription("Shrink (less than 1) or equals to default (=1) size of interns", (AcceptableValueBase)(object)new AcceptableValueRange<float>(ConfigConst.MIN_SIZE_SCALE_INTERN, ConfigConst.MAX_SIZE_SCALE_INTERN), Array.Empty<object>()));
			internSpeed = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, ConfigConst.ConfigSectionMain, "Speed of intern, relative to speed of player", ConfigConst.DEFAULT_SPEED_INTERN, new ConfigDescription("Slower (< 1) or faster (> 1) than players", (AcceptableValueBase)(object)new AcceptableValueRange<float>(ConfigConst.MIN_SPEED_INTERN, ConfigConst.MAX_SPEED_INTERN), Array.Empty<object>()));
			canSpectateInterns = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionMain, "Spectate interns", false, "Can a dead player spectate interns ?");
			radarEnabled = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionMain, "Radar monitoring enabled for interns", false, "Can you monitor the intern on the ship radar computer screen ?");
			titleInHelpMenu = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, ConfigConst.ConfigSectionMain, "Title visible in help menu in the terminal", ConfigConst.DEFAULT_STRING_INTERNSHIP_PROGRAM_TITLE, "Careful ! This title will become your command to type in to enter the intership program");
			subTitleInHelpMenu = SyncedBindingExtensions.BindSyncedEntry<string>(cfg, ConfigConst.ConfigSectionMain, "Subtitle visible in help menu under the title of intership program", ConfigConst.DEFAULT_STRING_INTERNSHIP_PROGRAM_SUBTITLE, "");
			spawnIdentitiesRandomly = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionIdentities, "Randomness of identities", true, "Spawn the interns with random identities ?");
			outsideRangeCommands = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, ConfigConst.ConfigSectionBehaviour, "Maximum command range while outside", ConfigConst.DEFAULT_DISTANCE_COMMAND_OUTSIDE, new ConfigDescription("Distance at which interns stop hearing your commands while outside", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000), Array.Empty<object>()));
			insideRangeCommands = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, ConfigConst.ConfigSectionBehaviour, "Maximum command range while inside", ConfigConst.DEFAULT_DISTANCE_COMMAND_INSIDE, new ConfigDescription("Distance at which interns stop hearing your commands while inside", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000), Array.Empty<object>()));
			followCrouchWithPlayer = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionBehaviour, "Crouch with player", true, "Should the intern crouch like the player is crouching ?");
			changeSuitAutoBehaviour = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionBehaviour, "Options for automaticaly switch suit", false, "Should the intern automatically switch to the same suit as the player when assigned to him ? (overrides identity config options)");
			nbMaxCanCarry = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, ConfigConst.ConfigSectionBehaviour, "Item carry limit", ConfigConst.DEFAULT_MAX_NB_CARRY, new ConfigDescription("Number max of items interns can carry, but can still only carry 1 big (two hand) item.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(ConfigConst.MIN_NB_CARRY, ConfigConst.MAX_NB_CARRY), Array.Empty<object>()));
			grabItemsNearEntrances = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionBehaviour, "Grab items near entrances", true, "Should the intern grab the items near main entrance and fire exits ?");
			grabBeesNest = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionBehaviour, "Grab bees nests", false, "Should the intern try to grab bees nests ?");
			grabDeadBodies = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionBehaviour, "Grab dead bodies", false, "Should the intern try to grab dead bodies ?");
			grabManeaterBaby = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionBehaviour, "Grab the baby maneater", false, "Should the intern try to grab the baby maneater ?");
			grabWheelbarrow = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionBehaviour, "Grab the wheelbarrow", false, "Should the intern try to grab the wheelbarrow (mod) ?");
			grabShoppingCart = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionBehaviour, "Grab the shopping cart", false, "Should the intern try to grab the shopping cart (mod) ?");
			grabKiwiBabyItem = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionBehaviour, "Grab the kiwi/sapsucker egg", false, "Should the intern try to grab kiwi/sapsucker egg ?");
			grabApparatus = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionBehaviour, "Grab the apparatus", false, "Should the intern try to grab the apparatus ? (useful if the mod FacilityMeltdown is active)");
			teleportedInternDropItems = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionTeleporters, "Teleported intern drop item (not if the intern is grabbed by player) (no use at the moment)", true, "(no use at the moment, in later update) Should the intern his held item before teleporting ?");
			volumeVoicesMultiplierInterns = cfg.Bind<string>(ConfigConst.ConfigSectionVoices, "Voices volume multiplier", VoicesConst.DEFAULT_VOICES_VOLUME_MULTIPLIER.ToString(), "(Client only) Volume multiplier of voices of interns (min 0, max 1)");
			talkativeness = cfg.Bind<int>(ConfigConst.ConfigSectionVoices, "Talkativeness", (int)VoicesConst.DEFAULT_CONFIG_ENUM_TALKATIVENESS, new ConfigDescription("(Client only) 0: No talking | 1: Shy | 2: Normal | 3: Talkative | 4: Can't stop talking", (AcceptableValueBase)(object)new AcceptableValueRange<int>(Enum.GetValues(typeof(EnumTalkativeness)).Cast<int>().Min(), Enum.GetValues(typeof(EnumTalkativeness)).Cast<int>().Max()), Array.Empty<object>()));
			allowSwearing = cfg.Bind<bool>(ConfigConst.ConfigSectionVoices, "Swear words", false, "(Client only) Allow the use of swear words in interns voice lines ?");
			volumeFootstepMultiplierInterns = cfg.Bind<string>(ConfigConst.ConfigSectionVoices, "Footsteps volume multiplier", VoicesConst.DEFAULT_FOOTSTEP_VOLUME_MULTIPLIER.ToString(), "(Client only) Volume multiplier of intern footsteps (min 0, max 1)");
			maxDefaultModelAnimatedInterns = cfg.Bind<int>(ConfigConst.ConfigSectionPerformance, "Max animated intern with default model at the same time", ConfigConst.MAX_INTERNS_AVAILABLE, new ConfigDescription("(Client only) Set the maximum of interns with default model that can be animated at the same time (if heavy lag occurs when looking at a lot of interns)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, ConfigConst.MAX_INTERNS_AVAILABLE), Array.Empty<object>()));
			maxModelReplacementModelAnimatedInterns = cfg.Bind<int>(ConfigConst.ConfigSectionPerformance, "Max animated intern with a replacement model at the same time", ConfigConst.DEFAULT_MAX_ANIMATIONS_MODELREPLACEMENT, new ConfigDescription("(Client only) Set the maximum of interns with a replacement model (heavy on performance) that can be animated at the same time (if heavy lag occurs when looking at a lot of interns)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, ConfigConst.MAX_INTERNS_AVAILABLE), Array.Empty<object>()));
			maxFootStepAudioInterns = cfg.Bind<int>(ConfigConst.ConfigSectionPerformance, "Max number of intern making footstep sound at the same time", ConfigConst.DEFAULT_MAX_FOOTSTEP_SOUND, new ConfigDescription("(Client only) Set the maximum number of intern making footstep sound at the same time", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, ConfigConst.MAX_INTERNS_AVAILABLE), Array.Empty<object>()));
			enableDebugLog = cfg.Bind<bool>(ConfigConst.ConfigSectionDebug, "EnableDebugLog", false, "(Client only) Enable the debug logs used for this mod.");
			ClearUnusedEntries(cfg);
			cfg.SaveOnConfigSet = true;
			CopyDefaultConfigIdentitiesJson();
			ReadAndLoadConfigIdentitiesFromUser();
			ConfigManager.Register<Config>((SyncedConfig2<Config>)(object)this);
		}

		private void LogDebugInConfig(string debugLog)
		{
			if (enableDebugLog.Value)
			{
				Plugin.Logger.LogDebug((object)debugLog);
			}
		}

		public string GetTitleInternshipProgram()
		{
			return string.Format(TerminalConst.STRING_INTERNSHIP_PROGRAM_HELP, titleInHelpMenu.Value.ToUpper(), subTitleInHelpMenu.Value);
		}

		public float GetVolumeVoicesMultiplierInterns()
		{
			if (float.TryParse(volumeVoicesMultiplierInterns.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out var result))
			{
				return Mathf.Clamp(result, 0f, 1f);
			}
			return VoicesConst.DEFAULT_VOICES_VOLUME_MULTIPLIER;
		}

		public float GetVolumeFootstepMultiplierInterns()
		{
			if (float.TryParse(volumeFootstepMultiplierInterns.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out var result))
			{
				return Mathf.Clamp(result, 0f, 1f);
			}
			return VoicesConst.DEFAULT_FOOTSTEP_VOLUME_MULTIPLIER;
		}

		private void ClearUnusedEntries(ConfigFile cfg)
		{
			PropertyInfo property = ((object)cfg).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic);
			Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(cfg, null);
			dictionary.Clear();
			cfg.Save();
		}

		private void CopyDefaultConfigIdentitiesJson()
		{
			try
			{
				string text = Utility.CombinePaths(new string[2]
				{
					Paths.ConfigPath,
					"LethalInternship"
				});
				Directory.CreateDirectory(text);
				string value = ReadJsonResource("LethalInternship.Configs.ConfigIdentities.json");
				using StreamWriter streamWriter = new StreamWriter(Utility.CombinePaths(new string[2]
				{
					text,
					ConfigConst.FILE_NAME_CONFIG_IDENTITIES_DEFAULT
				}));
				streamWriter.WriteLine(value);
			}
			catch (Exception arg)
			{
				Plugin.Logger.LogError((object)$"Error while CopyDefaultConfigIdentitiesJson ! {arg}");
			}
		}

		private string ReadJsonResource(string resourceName)
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			using Stream stream = executingAssembly.GetManifestResourceStream(resourceName);
			using StreamReader streamReader = new StreamReader(stream);
			return streamReader.ReadToEnd();
		}

		private unsafe void ReadAndLoadConfigIdentitiesFromUser()
		{
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			string text = "No path yet";
			string text2;
			try
			{
				text = Utility.CombinePaths(new string[3]
				{
					Paths.ConfigPath,
					"LethalInternship",
					ConfigConst.FILE_NAME_CONFIG_IDENTITIES_USER
				});
				if (File.Exists(text))
				{
					Plugin.Logger.LogInfo((object)"User identities file found ! Reading...");
					using (StreamReader streamReader = new StreamReader(text))
					{
						text2 = streamReader.ReadToEnd();
					}
					configIdentities = JsonUtility.FromJson<ConfigIdentities>(text2);
					if (configIdentities.configIdentities == null)
					{
						Plugin.Logger.LogWarning((object)("Failed to read identities from file at " + text));
					}
				}
				else
				{
					Plugin.Logger.LogInfo((object)"No user identities file found. Reading default identities...");
					text = "LethalInternship.Configs.ConfigIdentities.json";
					text2 = ReadJsonResource(text);
					configIdentities = JsonUtility.FromJson<ConfigIdentities>(text2);
				}
			}
			catch (Exception arg)
			{
				Plugin.Logger.LogError((object)$"Error while ReadAndLoadConfigIdentitiesFromUser ! {arg}");
				text2 = "No json, see exception above.";
			}
			if (ConfigIdentities.configIdentities == null)
			{
				Plugin.Logger.LogWarning((object)("A problem occured while retrieving identities from config file ! continuing with no identities... json used : \n" + text2));
				configIdentities = new ConfigIdentities
				{
					configIdentities = (ConfigIdentity[])(object)new ConfigIdentity[0]
				};
				return;
			}
			Plugin.Logger.LogInfo((object)$"Loaded {ConfigIdentities.configIdentities.Length} identities from file : {text}");
			ConfigIdentity[] array = ConfigIdentities.configIdentities;
			for (int i = 0; i < array.Length; i++)
			{
				ConfigIdentity val = array[i];
				LogDebugInConfig(((object)(*(ConfigIdentity*)(&val))/*cast due to .constrained prefix*/).ToString() ?? "");
			}
		}
	}
}
namespace __GEN
{
	internal class NetworkVariableSerializationHelper
	{
		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeSerialization()
		{
		}
	}
}
namespace LethalInternship.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}

plugins/Szumi57-LethalInternship/LethalInternship.Core.dll

Decompiled 3 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using GameNetcodeStuff;
using LethalInternship.Core.BehaviorTree;
using LethalInternship.Core.BehaviorTree.Nodes;
using LethalInternship.Core.CommandsSystem;
using LethalInternship.Core.CommandsSystem.Abilities;
using LethalInternship.Core.CommandsSystem.Orders;
using LethalInternship.Core.Interns;
using LethalInternship.Core.Interns.AI;
using LethalInternship.Core.Interns.AI.BT;
using LethalInternship.Core.Interns.AI.BT.ActionNodes;
using LethalInternship.Core.Interns.AI.BT.ConditionNodes;
using LethalInternship.Core.Interns.AI.Batches;
using LethalInternship.Core.Interns.AI.Batches.Instructions;
using LethalInternship.Core.Interns.AI.CoroutineControllers;
using LethalInternship.Core.Interns.AI.Dijkstra;
using LethalInternship.Core.Interns.AI.Dijkstra.DJKPoints;
using LethalInternship.Core.Interns.AI.Items;
using LethalInternship.Core.Interns.AI.PointsOfInterest;
using LethalInternship.Core.Interns.AI.PointsOfInterest.InterestPoints;
using LethalInternship.Core.Interns.AI.TimedTasks;
using LethalInternship.Core.Managers;
using LethalInternship.Core.NetcodePatcher;
using LethalInternship.Core.SaveAdapter;
using LethalInternship.Core.TerminalAdapter;
using LethalInternship.Core.TerminalAdapter.TerminalStates;
using LethalInternship.Core.UI.CommandsControllers;
using LethalInternship.Core.UI.CommandsControllers.DualSwitch;
using LethalInternship.Core.UI.CommandsControllers.GatheringPoint;
using LethalInternship.Core.UI.CommandsControllers.Suits;
using LethalInternship.Core.UI.Icons;
using LethalInternship.Core.UI.Icons.InputIcons;
using LethalInternship.Core.UI.Icons.Pools;
using LethalInternship.Core.UI.Icons.WorldIcons;
using LethalInternship.Core.UI.InternBlocks;
using LethalInternship.Core.UI.ItemBlocks;
using LethalInternship.Core.UI.Others;
using LethalInternship.Core.UI.Outlines;
using LethalInternship.Core.UI.Renderers;
using LethalInternship.Core.UI.Renderers.InterestPointsRenderer;
using LethalInternship.Core.UI.TooltipBar;
using LethalInternship.Core.Utils;
using LethalInternship.Core.VoiceAdapter;
using LethalInternship.SharedAbstractions.Adapters;
using LethalInternship.SharedAbstractions.CommandsSystem;
using LethalInternship.SharedAbstractions.Constants;
using LethalInternship.SharedAbstractions.Enums;
using LethalInternship.SharedAbstractions.Events;
using LethalInternship.SharedAbstractions.Hooks.BunkbedReviveHooks;
using LethalInternship.SharedAbstractions.Hooks.CustomItemBehaviourLibraryHooks;
using LethalInternship.SharedAbstractions.Hooks.LethalMinHooks;
using LethalInternship.SharedAbstractions.Hooks.MipaHooks;
using LethalInternship.SharedAbstractions.Hooks.ModelReplacementAPIHooks;
using LethalInternship.SharedAbstractions.Hooks.MonoProfilerHooks;
using LethalInternship.SharedAbstractions.Hooks.MoreCompanyHooks;
using LethalInternship.SharedAbstractions.Hooks.PlayerControllerBHooks;
using LethalInternship.SharedAbstractions.Hooks.PluginLoggerHooks;
using LethalInternship.SharedAbstractions.Hooks.ReviveCompanyHooks;
using LethalInternship.SharedAbstractions.Hooks.ShipTeleporterHooks;
using LethalInternship.SharedAbstractions.Hooks.TerminalHooks;
using LethalInternship.SharedAbstractions.Hooks.TooManyEmotesHooks;
using LethalInternship.SharedAbstractions.Interns;
using LethalInternship.SharedAbstractions.ManagerProviders;
using LethalInternship.SharedAbstractions.Managers;
using LethalInternship.SharedAbstractions.NetworkSerializers;
using LethalInternship.SharedAbstractions.Parameters;
using LethalInternship.SharedAbstractions.PluginRuntimeProvider;
using LethalInternship.SharedAbstractions.Pools;
using LethalInternship.SharedAbstractions.UI;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Animations.Rigging;
using UnityEngine.Audio;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Utilities;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalInternship.Core")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LethalInternship.Core")]
[assembly: AssemblyTitle("LethalInternship.Core")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace LethalInternship.Core.VoiceAdapter
{
	public class VoiceSource
	{
		public string Name { get; }

		public string? FilePath { get; }

		public AudioClip? Clip { get; set; }

		public VoiceSource(string name, string filePath)
		{
			Name = name;
			FilePath = filePath;
		}

		public VoiceSource(string name, AudioClip clip)
		{
			Name = name;
			Clip = clip;
		}
	}
}
namespace LethalInternship.Core.Utils
{
	public static class BTUtil
	{
		public static void PrintTree(IBehaviourTreeNode tree)
		{
			if (tree is IPrintableNode)
			{
				PrintNode((IPrintableNode)tree);
			}
		}

		private static void PrintNode(IPrintableNode node, int depth = 0)
		{
			string text = string.Empty;
			for (int i = 1; i <= depth - 1; i++)
			{
				text += "│   ";
			}
			if (depth > 0)
			{
				text += "├─ ";
			}
			PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
			if (logDebug != null)
			{
				logDebug.Invoke(text + node.NodeTypeSign + " " + node.NodeType + " " + node.Name);
			}
			foreach (IPrintableNode printableChild in node.PrintableChildren)
			{
				PrintNode(printableChild, depth + 1);
			}
		}

		public static string Export1TreeJson(IBehaviourTreeNode tree)
		{
			if (tree is IPrintableNode)
			{
				return JsonConvert.SerializeObject((object)Export1Tree((IPrintableNode)tree));
			}
			return "No printable tree.";
		}

		public static Export1Tree Export1Tree(IPrintableNode tree)
		{
			Guid guid = Guid.NewGuid();
			Export1Tree export1Tree = new Export1Tree
			{
				version = "0.3.0",
				scope = "tree",
				id = Guid.NewGuid(),
				title = "My tree",
				description = "Description",
				root = guid,
				properties = new Dictionary<string, string>(),
				nodes = new Dictionary<Guid, Export1Node>(),
				display = new Dictionary<string, float>
				{
					["camera_x"] = 810f,
					["camera_y"] = 390.5f,
					["camera_z"] = 0.75f,
					["x"] = -588f,
					["y"] = -144f
				},
				custom_nodes = new List<Export1CustomNode>()
			};
			Export1Node(tree, guid, export1Tree.nodes, export1Tree.custom_nodes);
			return export1Tree;
		}

		private static void Export1Node(IPrintableNode node, Guid guid, Dictionary<Guid, Export1Node> export1Nodes, List<Export1CustomNode> export1CustomNodes)
		{
			string nodeType = node.NodeType;
			string name = node.Name;
			Export1Node export1Node = new Export1Node
			{
				id = guid,
				name = ((nodeType == "action") ? name : nodeType),
				title = name,
				description = string.Empty,
				properties = new Dictionary<string, string>(),
				display = new Dictionary<string, int>
				{
					["x"] = 0,
					["y"] = 0
				}
			};
			if (nodeType == "action")
			{
				export1CustomNodes.Add(new Export1CustomNode
				{
					version = "0.3.0",
					scope = "node",
					name = name,
					category = "action",
					title = null,
					description = null,
					properties = new Dictionary<string, string>()
				});
			}
			export1Nodes.Add(guid, export1Node);
			foreach (IPrintableNode printableChild in node.PrintableChildren)
			{
				if (export1Node.children == null)
				{
					export1Node.children = new List<Guid>();
				}
				Guid guid2 = Guid.NewGuid();
				export1Node.children.Add(guid2);
				Export1Node(printableChild, guid2, export1Nodes, export1CustomNodes);
			}
		}
	}
	public class Export1Tree
	{
		public string version { get; set; }

		public string scope { get; set; }

		public Guid id { get; set; }

		public string title { get; set; }

		public string description { get; set; }

		public Guid root { get; set; }

		public Dictionary<string, string> properties { get; set; }

		public Dictionary<Guid, Export1Node> nodes { get; set; }

		public Dictionary<string, float> display { get; set; }

		public List<Export1CustomNode> custom_nodes { get; set; }
	}
	public class Export1Node
	{
		public Guid id { get; set; }

		public string name { get; set; }

		public string title { get; set; }

		public string description { get; set; }

		public Dictionary<string, string> properties { get; set; }

		public Dictionary<string, int> display { get; set; }

		public List<Guid> children { get; set; }
	}
	public class Export1CustomNode
	{
		public string version { get; set; }

		public string scope { get; set; }

		public string name { get; set; }

		public string category { get; set; }

		public string title { get; set; }

		public string description { get; set; }

		public Dictionary<string, string> properties { get; set; }
	}
	public static class ComponentUtil
	{
		public static void ListAllComponents(GameObject gameObject)
		{
			if ((Object)(object)gameObject == (Object)null)
			{
				return;
			}
			PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
			if (logDebug != null)
			{
				logDebug.Invoke(" ");
			}
			PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
			if (logDebug2 != null)
			{
				logDebug2.Invoke(" List of components :");
			}
			Component[] componentsInChildren = gameObject.GetComponentsInChildren(typeof(Component));
			Component[] array = componentsInChildren;
			foreach (Component val in array)
			{
				if (!((Object)(object)val == (Object)null))
				{
					PluginLogDebugDelegate logDebug3 = PluginLoggerHook.LogDebug;
					if (logDebug3 != null)
					{
						logDebug3.Invoke(((object)val).ToString());
					}
				}
			}
		}

		public static void SetFieldValue(object obj, string fieldName, object value)
		{
			Type type = obj.GetType();
			FieldInfo field = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			field.SetValue(obj, value);
		}

		public static void SetPropertyValue(object obj, string propertyName, object value)
		{
			Type type = obj.GetType();
			PropertyInfo property = type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			property.SetValue(obj, value);
		}

		public static T GetCopyOf<T>(this Component comp, T other) where T : Component
		{
			Type type = ((object)comp).GetType();
			if (type != ((object)other).GetType())
			{
				return default(T);
			}
			BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
			PropertyInfo[] properties = type.GetProperties(bindingAttr);
			PropertyInfo[] array = properties;
			foreach (PropertyInfo propertyInfo in array)
			{
				if (propertyInfo.CanWrite && propertyInfo.CanRead && !(propertyInfo.Name == "name"))
				{
					try
					{
						propertyInfo.SetValue(comp, propertyInfo.GetValue(other, null), null);
					}
					catch
					{
					}
				}
			}
			FieldInfo[] allFields = PropertiesAndFieldsUtils.GetAllFields(type);
			FieldInfo[] array2 = allFields;
			foreach (FieldInfo fieldInfo in array2)
			{
				if (!fieldInfo.IsStatic)
				{
					fieldInfo.SetValue(comp, fieldInfo.GetValue(other));
				}
			}
			return (T)(object)((comp is T) ? comp : null);
		}

		public static T AddCopyOfComponent<T>(this GameObject go, T toAdd) where T : Component
		{
			return ((Component)(object)go.AddComponent<T>()).GetCopyOf(toAdd);
		}

		public static T CopyComponent<T>(T original, GameObject destination) where T : Component
		{
			Type type = ((object)original).GetType();
			Component component = destination.GetComponent(type);
			T val = (T)(object)((component is T) ? component : null);
			if (!Object.op_Implicit((Object)(object)val))
			{
				Component obj = destination.AddComponent(type);
				val = (T)(object)((obj is T) ? obj : null);
			}
			FieldInfo[] allFields = PropertiesAndFieldsUtils.GetAllFields(type);
			FieldInfo[] array = allFields;
			foreach (FieldInfo fieldInfo in array)
			{
				if (!fieldInfo.IsStatic)
				{
					fieldInfo.SetValue(val, fieldInfo.GetValue(original));
				}
			}
			PropertyInfo[] properties = type.GetProperties();
			PropertyInfo[] array2 = properties;
			foreach (PropertyInfo propertyInfo in array2)
			{
				if (propertyInfo.CanWrite && propertyInfo.CanWrite && !(propertyInfo.Name == "name"))
				{
					propertyInfo.SetValue(val, propertyInfo.GetValue(original, null), null);
				}
			}
			return val;
		}
	}
	public static class DrawUtil
	{
		public static void DrawWhiteLine(LineRenderer? lr, Ray ray, float length)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			DrawLine(lr, ray, length, Color.white);
		}

		public static void DrawLine(LineRenderer? lr, Ray ray, float length, Color color)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			Vector3 origin = ((Ray)(ref ray)).origin;
			Vector3 origin2 = ((Ray)(ref ray)).origin;
			Vector3 direction = ((Ray)(ref ray)).direction;
			DrawLine(lr, origin, origin2 + ((Vector3)(ref direction)).normalized * length, color);
		}

		public static void DrawLine(LineRenderer? lr, Vector3 start, Vector3 end, Color color)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)lr == (Object)null))
			{
				((Renderer)lr).material = new Material(Shader.Find("Legacy Shaders/Particles/Alpha Blended Premultiply"));
				lr.startColor = color;
				lr.endColor = color;
				lr.startWidth = 0.1f;
				lr.endWidth = 0.1f;
				lr.SetPosition(0, start);
				lr.SetPosition(1, end);
			}
		}

		public static void DrawPath(LineRendererUtil lineRendererUtil, NavMeshPath path)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Invalid comparison between Unknown and I4
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Invalid comparison between Unknown and I4
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			if (!DebugConst.DRAW_LINES)
			{
				return;
			}
			if ((int)path.status == 1)
			{
				for (int i = 0; i < path.corners.Length - 1; i++)
				{
					DrawLine(lineRendererUtil.GetLineRenderer(), path.corners[i], path.corners[i + 1], Color.red);
					DrawLine(lineRendererUtil.GetLineRenderer(), path.corners[i], path.corners[i] + new Vector3(0f, 1f, 0f), Color.red);
				}
			}
			else if ((int)path.status == 0)
			{
				for (int j = 0; j < path.corners.Length - 1; j++)
				{
					DrawLine(lineRendererUtil.GetLineRenderer(), path.corners[j], path.corners[j + 1], Color.white);
					DrawLine(lineRendererUtil.GetLineRenderer(), path.corners[j], path.corners[j] + new Vector3(0f, 1f, 0f), Color.white);
				}
			}
		}
	}
	public static class LayerUtil
	{
		public static void LogAllLayersName()
		{
			LogLayerName(StartOfRound.Instance.collidersRoomMaskDefaultAndPlayers, "collidersRoomMaskDefaultAndPlayers");
			LogLayerName(64, "PlayerControllerB.grabbableObjectsMask 64");
			LogLayerName(1073742656, "PlayerControllerB.interactableObjectsMask 1073742656");
			LogLayerName(StartOfRound.Instance.walkableSurfacesMask, "walkableSurfacesMask");
			LogLayerName(1342179585, "walkableSurfacesNoPlayersMask = 1342179585");
			LogLayerName(StartOfRound.Instance.collidersAndRoomMaskAndDefault, "collidersAndRoomMaskAndDefault");
			LogLayerName(StartOfRound.Instance.collidersAndRoomMask, "collidersAndRoomMask");
			LogLayerName(StartOfRound.Instance.collidersAndRoomMaskAndPlayers, "collidersAndRoomMaskAndPlayers");
			LogLayerName(StartOfRound.Instance.collidersRoomDefaultAndFoliage, "collidersRoomDefaultAndFoliage");
			LogLayerName(StartOfRound.Instance.allPlayersCollideWithMask, "allPlayersCollideWithMask");
		}

		public static void LogLayerName(int layer, string name)
		{
			PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
			if (logDebug != null)
			{
				logDebug.Invoke("----------- " + name + " -----------");
			}
			for (int i = 0; i < 32; i++)
			{
				if ((layer & (1 << i)) != 0)
				{
					PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
					if (logDebug2 != null)
					{
						logDebug2.Invoke($"Layer {i}: {LayerMask.LayerToName(i)}");
					}
				}
			}
		}
	}
	public class LineRendererUtil
	{
		private LineRenderer[] _listLineRenderers;

		private Transform _transformToParent;

		private int _index;

		public LineRendererUtil(int nbMaxLineRenderer, Transform transformToParent)
		{
			_listLineRenderers = (LineRenderer[])(object)new LineRenderer[nbMaxLineRenderer];
			_transformToParent = transformToParent;
		}

		public LineRenderer? GetLineRenderer()
		{
			if (!DebugConst.DRAW_LINES)
			{
				return null;
			}
			for (int i = 0; i < _listLineRenderers.Length; i++)
			{
				if ((Object)(object)_listLineRenderers[i] == (Object)null)
				{
					_listLineRenderers[i] = CreateLineRenderer();
					return _listLineRenderers[i];
				}
			}
			if (_index >= _listLineRenderers.Length)
			{
				_index = 0;
			}
			return _listLineRenderers[_index++];
		}

		private LineRenderer CreateLineRenderer()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			LineRenderer lineRenderer = new GameObject().AddComponent<LineRenderer>();
			return InitLineRenderer(ref lineRenderer);
		}

		private LineRenderer InitLineRenderer(ref LineRenderer lineRenderer)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			((Component)lineRenderer).gameObject.transform.SetParent(((Component)_transformToParent).transform, false);
			((Component)lineRenderer).gameObject.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity);
			return lineRenderer;
		}
	}
	public static class PropertiesAndFieldsUtils
	{
		public static void ListNamesOfObjectsArray<T>(T[] array)
		{
			Type typeFromHandle = typeof(T);
			PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
			if (logDebug != null)
			{
				logDebug.Invoke(" ");
			}
			if (array == null)
			{
				PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
				if (logDebug2 != null)
				{
					logDebug2.Invoke($"Array of type {typeFromHandle} is null");
				}
				return;
			}
			if (array.Length == 0)
			{
				PluginLogDebugDelegate logDebug3 = PluginLoggerHook.LogDebug;
				if (logDebug3 != null)
				{
					logDebug3.Invoke($"Array of type {typeFromHandle} is empty");
				}
				return;
			}
			PropertyInfo[] readablePropertiesOf = GetReadablePropertiesOf(typeFromHandle);
			PluginLogDebugDelegate logDebug4 = PluginLoggerHook.LogDebug;
			if (logDebug4 != null)
			{
				logDebug4.Invoke($"- List of type : {typeFromHandle}");
			}
			for (int i = 0; i < array.Length; i++)
			{
				T val = array[i];
				if (val != null)
				{
					PluginLogDebugDelegate logDebug5 = PluginLoggerHook.LogDebug;
					if (logDebug5 != null)
					{
						logDebug5.Invoke($" Object {i}: \"{NameOfObject(val, readablePropertiesOf)}\"");
					}
				}
			}
		}

		public static void ListPropertiesAndFieldsOfArray<T>(T[] array, bool hasToListProperties = true, bool hasToListFields = true)
		{
			Type typeFromHandle = typeof(T);
			if (array == null)
			{
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke($"Array of type {typeFromHandle} is null");
				}
				return;
			}
			if (array.Length == 0)
			{
				PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
				if (logDebug2 != null)
				{
					logDebug2.Invoke($"Array of type {typeFromHandle} is empty");
				}
				return;
			}
			PropertyInfo[] readablePropertiesOf = GetReadablePropertiesOf(typeFromHandle);
			FieldInfo[] allFields = GetAllFields(typeFromHandle);
			for (int i = 0; i < array.Length; i++)
			{
				if (hasToListProperties)
				{
					LogProperties(array[i], typeFromHandle, readablePropertiesOf);
				}
				PluginLogDebugDelegate logDebug3 = PluginLoggerHook.LogDebug;
				if (logDebug3 != null)
				{
					logDebug3.Invoke(" ");
				}
				PluginLogDebugDelegate logDebug4 = PluginLoggerHook.LogDebug;
				if (logDebug4 != null)
				{
					logDebug4.Invoke($"- Fields of \"{NameOfObject(array[i], readablePropertiesOf)}\" of type \"{typeFromHandle}\" :");
				}
				if (hasToListFields)
				{
					LogFields(array[i], typeFromHandle, allFields);
				}
			}
		}

		public static void ListPropertiesAndFields<T>(T obj, bool hasToListProperties = true, bool hasToListFields = true)
		{
			Type typeFromHandle = typeof(T);
			PropertyInfo[] readablePropertiesOf = GetReadablePropertiesOf(typeFromHandle);
			if (hasToListProperties)
			{
				LogProperties(obj, typeFromHandle, readablePropertiesOf);
			}
			PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
			if (logDebug != null)
			{
				logDebug.Invoke(" ");
			}
			PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
			if (logDebug2 != null)
			{
				logDebug2.Invoke($"- Fields of \"{NameOfObject(obj, readablePropertiesOf)}\" of type \"{typeFromHandle}\" :");
			}
			FieldInfo[] allFields = GetAllFields(typeFromHandle);
			if (hasToListFields)
			{
				LogFields(obj, typeFromHandle, allFields);
			}
		}

		public static NetworkObject? GetNetworkObjectByHash(uint hashID)
		{
			FieldInfo field = typeof(NetworkObject).GetField("GlobalObjectIdHash", BindingFlags.Instance | BindingFlags.NonPublic);
			if (field == null)
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("GlobalObjectIdHash field is null.");
				}
				return null;
			}
			NetworkObject[] array = Resources.FindObjectsOfTypeAll<NetworkObject>();
			foreach (NetworkObject val in array)
			{
				uint num = (uint)field.GetValue(val);
				if (num == hashID)
				{
					return val;
				}
			}
			return null;
		}

		private static void LogProperties<T>(T obj, Type typeObj, PropertyInfo[] arrObjProperties)
		{
			if (obj == null)
			{
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke($"Object of type {typeObj} is null");
				}
				return;
			}
			PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
			if (logDebug2 != null)
			{
				logDebug2.Invoke(" ");
			}
			PluginLogDebugDelegate logDebug3 = PluginLoggerHook.LogDebug;
			if (logDebug3 != null)
			{
				logDebug3.Invoke($"- Properties of \"{NameOfObject(obj, arrObjProperties)}\" of type \"{typeObj}\" :");
			}
			foreach (PropertyInfo propertyInfo in arrObjProperties)
			{
				PluginLogDebugDelegate logDebug4 = PluginLoggerHook.LogDebug;
				if (logDebug4 != null)
				{
					logDebug4.Invoke($" {propertyInfo.Name} = {GetValueOfProperty(obj, propertyInfo)}");
				}
			}
		}

		private static string NameOfObject<T>(T obj, PropertyInfo[] propertyInfos)
		{
			object valueOfProperty = GetValueOfProperty(obj, propertyInfos.FirstOrDefault((PropertyInfo x) => x.Name == "name"));
			return (valueOfProperty == null) ? "name null" : valueOfProperty.ToString();
		}

		private static void LogFields<T>(T obj, Type typeObj, FieldInfo[] arrObjFields)
		{
			if (obj == null)
			{
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke($"Object of type {typeObj} is null");
				}
				return;
			}
			PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
			if (logDebug2 != null)
			{
				logDebug2.Invoke(" ");
			}
			foreach (FieldInfo fieldInfo in arrObjFields)
			{
				PluginLogDebugDelegate logDebug3 = PluginLoggerHook.LogDebug;
				if (logDebug3 != null)
				{
					logDebug3.Invoke($" {fieldInfo.Name} = {GetValueOfField(obj, fieldInfo)}");
				}
			}
		}

		public static FieldInfo[] GetAllFields(Type t)
		{
			if (t == null)
			{
				return new FieldInfo[0];
			}
			BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
			return t.GetFields(bindingAttr).Concat(GetAllFields(t.BaseType)).ToArray();
		}

		private static PropertyInfo[] GetReadablePropertiesOf(Type type)
		{
			return (from x in type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)
				where x.CanRead
				select x).ToArray();
		}

		private static object? GetValueOfProperty<T>(T obj, PropertyInfo propertyInfo)
		{
			if (propertyInfo == null)
			{
				return null;
			}
			return propertyInfo.GetAccessors(nonPublic: true)[0].IsStatic ? propertyInfo.GetValue(null) : propertyInfo.GetValue(obj, null);
		}

		private static object? GetValueOfField<T>(T obj, FieldInfo fieldInfo)
		{
			if (fieldInfo == null)
			{
				return null;
			}
			return fieldInfo.IsStatic ? fieldInfo.GetValue(null) : fieldInfo.GetValue(obj);
		}
	}
	public class RayUtil
	{
		public static void RayCastAndDrawFromPointWithColor(LineRenderer? lr, Vector3 origin, Vector3 endPoint, Color color)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			Ray ray = default(Ray);
			((Ray)(ref ray))..ctor(origin, endPoint - origin);
			float length = Vector3.Distance(endPoint, origin);
			DrawUtil.DrawLine(lr, ray, length, color);
		}

		public static bool RayCastAndDraw(LineRenderer? lr, Vector3 origin, Vector3 directionOrigin, float angle, float length)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = Vector3.Cross(directionOrigin, Vector3.up);
			if (val == Vector3.zero)
			{
				val = Vector3.right;
			}
			Ray val2 = default(Ray);
			((Ray)(ref val2))..ctor(origin, Quaternion.AngleAxis(angle, val) * directionOrigin);
			if (Physics.Raycast(val2, length, StartOfRound.Instance.walkableSurfacesMask, (QueryTriggerInteraction)1))
			{
				DrawUtil.DrawLine(lr, val2, length, Color.red);
				return true;
			}
			DrawUtil.DrawWhiteLine(lr, val2, length);
			return false;
		}

		public static bool RayCastForwardAndDraw(LineRenderer? lr, Vector3 origin, Vector3 directionForward, float length)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(origin, directionForward);
			if (Physics.Raycast(val, length, StartOfRound.Instance.walkableSurfacesMask, (QueryTriggerInteraction)1))
			{
				DrawUtil.DrawLine(lr, val, length, Color.red);
				return true;
			}
			DrawUtil.DrawWhiteLine(lr, val, length);
			return false;
		}

		public static bool RayCastDownAndDraw(LineRenderer? lr, Vector3 origin, float length)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(origin, Vector3.down);
			if (Physics.Raycast(val, length, StartOfRound.Instance.walkableSurfacesMask, (QueryTriggerInteraction)1))
			{
				DrawUtil.DrawLine(lr, val, length, Color.red);
				return true;
			}
			DrawUtil.DrawWhiteLine(lr, val, length);
			return false;
		}
	}
	internal static class TreesUtils
	{
		public static void PrintTransformTree(Transform[] tree, string? parent = null)
		{
			if (tree == null)
			{
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke("Tree of transform is null");
				}
				return;
			}
			if (tree.Length == 0)
			{
				PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
				if (logDebug2 != null)
				{
					logDebug2.Invoke("Tree of transform is empty");
				}
				return;
			}
			if (string.IsNullOrWhiteSpace(parent))
			{
				Transform? obj = tree.FirstOrDefault();
				object obj2;
				if (obj == null)
				{
					obj2 = null;
				}
				else
				{
					Transform parent2 = obj.parent;
					if (parent2 == null)
					{
						obj2 = null;
					}
					else
					{
						Transform root = parent2.root;
						obj2 = ((root != null) ? ((Object)root).name : null);
					}
				}
				parent = (string?)obj2;
			}
			TransformTreeTraversal(tree, parent, 0);
		}

		private static void TransformTreeTraversal(Transform[] tree, string? parent, int depth)
		{
			StringBuilder stringBuilder = new StringBuilder();
			foreach (Transform val in tree)
			{
				if ((string.IsNullOrWhiteSpace(parent) && ((Object)(object)val.parent == (Object)null || string.IsNullOrWhiteSpace(((Object)val.parent).name))) || ((Object)(object)val.parent != (Object)null && ((Object)val.parent).name == parent))
				{
					for (int j = 1; j <= depth - 1; j++)
					{
						stringBuilder.Append("│   ");
					}
					if (depth > 0)
					{
						stringBuilder.Append("├──");
					}
					PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
					if (logDebug != null)
					{
						logDebug.Invoke(stringBuilder.ToString() + ((Object)val).name);
					}
					stringBuilder.Clear();
					TransformTreeTraversal(tree, ((Object)val).name, depth + 1);
				}
			}
		}

		public static void PrintComponentsTreeOfGameObject(GameObject gameObject)
		{
			if ((Object)(object)gameObject == (Object)null)
			{
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke("GameObject is null");
				}
				return;
			}
			Component[] array = (from x in gameObject.GetComponentsInChildren(typeof(Component))
				where (Object)(object)x != (Object)null
				select x).ToArray();
			if (array.Length == 0)
			{
				PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
				if (logDebug2 != null)
				{
					logDebug2.Invoke("GameObject has no components");
				}
			}
			else
			{
				ComponentTreeTraversal(array);
			}
		}

		private static int ComponentTreeTraversal(Component[] tree, string? parent = null, int index = 0, int depth = 0, string lastTransformName = "")
		{
			StringBuilder stringBuilder = new StringBuilder();
			for (int i = index; i < tree.Length; i++)
			{
				Component val = tree[i];
				Transform val2 = (Transform)(object)((val is Transform) ? val : null);
				bool flag = (Object)(object)val2 != (Object)null;
				if ((Object)(object)val2 == (Object)null)
				{
					val2 = val.transform;
				}
				if (string.IsNullOrWhiteSpace(parent))
				{
					Transform parent2 = val2.parent;
					if (string.IsNullOrWhiteSpace((parent2 != null) ? ((Object)parent2).name : null))
					{
						PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
						if (logDebug != null)
						{
							logDebug.Invoke((flag ? ((Object)val2).name : ((object)val).ToString()) ?? "");
						}
					}
				}
				if (string.IsNullOrWhiteSpace(parent))
				{
					Transform parent3 = val2.parent;
					if (!string.IsNullOrWhiteSpace((parent3 != null) ? ((Object)parent3).name : null))
					{
						parent = ((Object)val2.parent).name;
					}
				}
				if (parent == ((Object)val2).name)
				{
					for (int j = 1; j <= depth - 1; j++)
					{
						stringBuilder.Append("│   ");
					}
					if (depth > 0)
					{
						stringBuilder.Append("├──");
					}
					PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
					if (logDebug2 != null)
					{
						logDebug2.Invoke($"{stringBuilder}{(flag ? ((Object)val2).name : ((object)val).ToString())}");
					}
					stringBuilder.Clear();
					continue;
				}
				Transform parent4 = val2.parent;
				if (!(((parent4 != null) ? ((Object)parent4).name : null) == parent && flag))
				{
					continue;
				}
				for (int k = 1; k <= depth - 1; k++)
				{
					stringBuilder.Append("│   ");
				}
				if (depth > 0)
				{
					stringBuilder.Append("├──");
				}
				if (!(((Object)val2).name == lastTransformName))
				{
					lastTransformName = ((Object)val2).name;
					PluginLogDebugDelegate logDebug3 = PluginLoggerHook.LogDebug;
					if (logDebug3 != null)
					{
						logDebug3.Invoke($"{stringBuilder}{((Object)val2).name}");
					}
					stringBuilder.Clear();
					i = ComponentTreeTraversal(tree, ((Object)val2).name, i + 1, depth + 1, lastTransformName);
					index = i;
				}
			}
			return index;
		}
	}
	public static class UIUtil
	{
		public static string GetGameObjectPath(GameObject? obj)
		{
			if ((Object)(object)obj == (Object)null)
			{
				return "[null]";
			}
			string text = "/" + ((Object)obj).name;
			while ((Object)(object)obj.transform.parent != (Object)null)
			{
				obj = ((Component)obj.transform.parent).gameObject;
				text = "/" + ((Object)obj).name + text;
			}
			return text;
		}
	}
}
namespace LethalInternship.Core.UI.TooltipBar
{
	public class TooltipBarUI : MonoBehaviour
	{
		public CanvasGroup CanvasGroup = null;

		public TMP_Text Text = null;

		public Image icon = null;

		public Image holdFill = null;

		public RectTransform root = null;

		private Canvas canvas = null;

		private RectTransform content = null;

		private Vector2 offset = new Vector2(4f, 14f);

		private float showDelay = 0.7f;

		private Coroutine showRoutine = null;

		private Coroutine holdRoutine = null;

		private void Awake()
		{
			HideImmediate();
			Text.font = UIManager.Instance.FontToUse;
			canvas = ((Component)((Component)this).transform.parent).GetComponent<Canvas>();
			content = ((Component)Text.transform.parent).GetComponent<RectTransform>();
		}

		private void Update()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			if (UIManager.Instance.IsAnyMenuOpen)
			{
				Vector2 tooltipScreenPosition = GetTooltipScreenPosition();
				Transform transform = ((Component)canvas).transform;
				RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null);
				if (!((Object)(object)val == (Object)null))
				{
					Vector2 val2 = default(Vector2);
					RectTransformUtility.ScreenPointToLocalPointInRectangle(val, tooltipScreenPosition, ((int)canvas.renderMode == 0) ? null : canvas.worldCamera, ref val2);
					Vector2 val3 = val2 + offset;
					Rect rect = val.rect;
					Vector2 size = ((Rect)(ref rect)).size;
					rect = content.rect;
					Vector2 size2 = ((Rect)(ref rect)).size;
					float num = size.x / 2f - size2.x;
					val3.x = Mathf.Min(val3.x, num);
					float num2 = size.y / 2f - size2.y;
					val3.y = Mathf.Min(val3.y, num2);
					float num3 = (0f - size.x) / 2f;
					float num4 = (0f - size.y) / 2f;
					val3.x = Mathf.Max(val3.x, num3);
					val3.y = Mathf.Max(val3.y, num4);
					root.anchoredPosition = val3;
				}
			}
		}

		private Vector2 GetTooltipScreenPosition()
		{
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			if (InputManager.Instance.IsUsingController)
			{
				GameObject currentSelectedGameObject = EventSystem.current.currentSelectedGameObject;
				if ((Object)(object)currentSelectedGameObject != (Object)null)
				{
					Transform transform = currentSelectedGameObject.transform;
					RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null);
					if ((Object)(object)val != (Object)null)
					{
						Vector3[] array = (Vector3[])(object)new Vector3[4];
						val.GetWorldCorners(array);
						Vector3 val2 = (array[0] + array[2]) * 0.5f;
						return RectTransformUtility.WorldToScreenPoint(((int)canvas.renderMode == 0) ? null : canvas.worldCamera, val2);
					}
				}
			}
			return ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue();
		}

		public void ShowImmediate(string message, Sprite iconSprite = null)
		{
			Text.text = message;
			Show(iconSprite);
		}

		public void RequestShow(string message, Sprite iconSprite = null)
		{
			CancelAll();
			showRoutine = ((MonoBehaviour)this).StartCoroutine(ShowAfterDelay(message, iconSprite));
		}

		public void Hide()
		{
			CancelAll();
			HideImmediate();
		}

		private void Show(Sprite iconSprite = null)
		{
			if ((Object)(object)icon != (Object)null)
			{
				((Behaviour)icon).enabled = (Object)(object)iconSprite != (Object)null;
				icon.sprite = iconSprite;
			}
			CanvasGroup.alpha = 1f;
			CanvasGroup.blocksRaycasts = false;
		}

		private IEnumerator ShowAfterDelay(string message, Sprite iconSprite)
		{
			Text.text = message;
			if (CanvasGroup.alpha > 0f)
			{
				yield return null;
				Show(iconSprite);
			}
			else
			{
				yield return (object)new WaitForSeconds(showDelay);
				Show(iconSprite);
			}
		}

		public void StartHold(float duration, Action onComplete)
		{
			holdRoutine = ((MonoBehaviour)this).StartCoroutine(HoldRoutine(duration, onComplete));
		}

		public void StopHold()
		{
			if (holdRoutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(holdRoutine);
			}
			holdFill.fillAmount = 0f;
			((Component)((Component)holdFill).transform.parent).gameObject.SetActive(false);
		}

		private IEnumerator HoldRoutine(float duration, Action onComplete)
		{
			CanvasGroup.alpha = 1f;
			CanvasGroup.blocksRaycasts = false;
			((Component)((Component)holdFill).transform.parent).gameObject.SetActive(true);
			float t = 0f;
			while (t < duration)
			{
				t += Time.deltaTime;
				holdFill.fillAmount = t / duration;
				yield return null;
			}
			holdFill.fillAmount = 1f;
			onComplete?.Invoke();
		}

		private void HideImmediate()
		{
			CanvasGroup.alpha = 0f;
			holdFill.fillAmount = 0f;
			((Component)((Component)holdFill).transform.parent).gameObject.SetActive(false);
		}

		private void CancelAll()
		{
			if (showRoutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(showRoutine);
			}
			if (holdRoutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(holdRoutine);
			}
		}
	}
}
namespace LethalInternship.Core.UI.Renderers
{
	public class InterestPointRendererRegistery
	{
		private readonly Dictionary<Type, IInterestPointRendererWrapper> wrappers = new Dictionary<Type, IInterestPointRendererWrapper>();

		public void Register<T>(IInterestPointRenderer<T> renderer) where T : IInterestPoint
		{
			wrappers[typeof(T)] = (IInterestPointRendererWrapper)(object)new InterestPointRendererWrapper<T>(renderer);
		}

		public EnumIconImagesTypes GetIconImagesTypes(IInterestPoint interestPoint)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			if (wrappers.TryGetValue(((object)interestPoint).GetType(), out IInterestPointRendererWrapper value))
			{
				return value.GetIconImagesTypes(interestPoint);
			}
			return (EnumIconImagesTypes)0;
		}

		public Vector3 GetUIPosOffset(IInterestPoint interestPoint)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			if (wrappers.TryGetValue(((object)interestPoint).GetType(), out IInterestPointRendererWrapper value))
			{
				return value.GetUIPos(interestPoint);
			}
			return Vector3.zero;
		}
	}
	public class InterestPointRendererWrapper<T> : IInterestPointRendererWrapper where T : IInterestPoint
	{
		private readonly IInterestPointRenderer<T> renderer;

		public InterestPointRendererWrapper(IInterestPointRenderer<T> renderer)
		{
			this.renderer = renderer;
		}

		public EnumIconImagesTypes GetIconImagesTypes(IInterestPoint interestPoint)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			return renderer.GetIconImagesTypes((T)(object)interestPoint);
		}

		public Vector3 GetUIPos(IInterestPoint interestPoint)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			return renderer.GetUIPos((T)(object)interestPoint);
		}
	}
	public class PointOfInterestRendererService
	{
		private readonly InterestPointRendererRegistery registery;

		private readonly Dictionary<int, IIconUIInfos> dictIconInfos;

		private readonly List<Type> priorityOrder = new List<Type>
		{
			typeof(PositionInterestPoint),
			typeof(VehicleInterestPoint),
			typeof(ShipInterestPoint),
			typeof(GatheringInterestPoint)
		};

		public PointOfInterestRendererService(InterestPointRendererRegistery registery)
		{
			this.registery = registery;
			dictIconInfos = new Dictionary<int, IIconUIInfos>();
		}

		public IIconUIInfos GetIconUIInfos(IPointOfInterest pointOfInterest)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected I4, but got Unknown
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected I4, but got Unknown
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected I4, but got Unknown
			EnumIconImagesTypes val = (EnumIconImagesTypes)0;
			Dictionary<Type, IInterestPoint> dictTypeInterestPoints = pointOfInterest.GetDictTypeInterestPoints();
			foreach (Type item in priorityOrder)
			{
				if (dictTypeInterestPoints.TryGetValue(item, out var value))
				{
					val |= registery.GetIconImagesTypes(value);
				}
			}
			if (dictIconInfos.TryGetValue((int)val, out IIconUIInfos value2))
			{
				return value2;
			}
			dictIconInfos[(int)val] = (IIconUIInfos)(object)new IconUIInfos(val);
			return dictIconInfos[(int)val];
		}

		public Vector3 GetUIIcon(IPointOfInterest pointOfInterest)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<Type, IInterestPoint> dictTypeInterestPoints = pointOfInterest.GetDictTypeInterestPoints();
			foreach (Type item in priorityOrder)
			{
				if (dictTypeInterestPoints.TryGetValue(item, out var value))
				{
					return registery.GetUIPosOffset(value);
				}
			}
			using (Dictionary<Type, IInterestPoint>.ValueCollection.Enumerator enumerator2 = dictTypeInterestPoints.Values.GetEnumerator())
			{
				if (enumerator2.MoveNext())
				{
					IInterestPoint current2 = enumerator2.Current;
					return registery.GetUIPosOffset(current2);
				}
			}
			return Vector3.zero;
		}
	}
}
namespace LethalInternship.Core.UI.Renderers.InterestPointsRenderer
{
	public class GatheringPointRenderer : IInterestPointRenderer<GatheringInterestPoint>
	{
		public EnumIconImagesTypes GetIconImagesTypes(GatheringInterestPoint interestPoint)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (EnumIconImagesTypes)4;
		}

		public Vector3 GetUIPos(GatheringInterestPoint interestPoint)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			return interestPoint.Point;
		}
	}
	public class PositionInterestPointRenderer : IInterestPointRenderer<PositionInterestPoint>
	{
		public EnumIconImagesTypes GetIconImagesTypes(PositionInterestPoint interestPoint)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (EnumIconImagesTypes)8;
		}

		public Vector3 GetUIPos(PositionInterestPoint interestPoint)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			return interestPoint.Point;
		}
	}
	public class ShipInterestPointRenderer : IInterestPointRenderer<ShipInterestPoint>
	{
		public EnumIconImagesTypes GetIconImagesTypes(ShipInterestPoint interestPoint)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return (EnumIconImagesTypes)16;
		}

		public Vector3 GetUIPos(ShipInterestPoint interestPoint)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)interestPoint.HangarShipTransform).transform.position + interestPoint.HangarShipTransform.rotation * new Vector3(0f, 6f, -7f);
		}
	}
	public class VehicleInterestPointRenderer : IInterestPointRenderer<VehicleInterestPoint>
	{
		public EnumIconImagesTypes GetIconImagesTypes(VehicleInterestPoint interestPoint)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return (EnumIconImagesTypes)32;
		}

		public Vector3 GetUIPos(VehicleInterestPoint interestPoint)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			if (interestPoint.IsInvalid)
			{
				return default(Vector3);
			}
			return ((Component)interestPoint.VehicleController).transform.position + new Vector3(0f, 3f, 0f);
		}
	}
}
namespace LethalInternship.Core.UI.Outlines
{
	public static class InternOutlineController
	{
		private class OutlineState
		{
			public bool enabled;

			public float intensity;

			public float rimPower;

			public Color color;
		}

		private const float RIM_EPSILON = 0.02f;

		private static readonly Dictionary<ulong, OutlineState> internStates = new Dictionary<ulong, OutlineState>();

		private static readonly Dictionary<EnemyAI, OutlineState> enemiesStates = new Dictionary<EnemyAI, OutlineState>();

		private static readonly Dictionary<GrabbableObject, OutlineState> itemStates = new Dictionary<GrabbableObject, OutlineState>();

		public static void UpdateInternsOutlines(IEnumerable<IInternIdentity> identities, ulong? pointedInternClientId, bool allowMultiple, bool forceNoOutlines = false)
		{
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)StartOfRound.Instance.localPlayerController == (Object)null)
			{
				return;
			}
			PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
			foreach (IInternIdentity identity in identities)
			{
				IInternAI internAI = identity.InternAI;
				if (internAI != null)
				{
					bool flag = !forceNoOutlines && !internAI.Npc.isPlayerDead && !internAI.IsSpawningAnimationRunning() && (internAI.Npc.playerClientId == pointedInternClientId || allowMultiple) && ((internAI.OwnerClientId == ((NetworkBehaviour)localPlayerController).OwnerClientId && internAI.NpcController.GetSqrDistanceWithLocalPlayer() < (float)InternManager.Instance.GetMaxDistanceCommand()) || internAI.NpcController.GetSqrDistanceWithLocalPlayer() < localPlayerController.grabDistance * localPlayerController.grabDistance);
					float rimPower = UIConst.OUTLINE_RIM_DEFAULT;
					if (flag)
					{
						float sqrDistanceWithLocalPlayer = internAI.NpcController.GetSqrDistanceWithLocalPlayer();
						float num = Mathf.InverseLerp(1f, UIConst.DISTANCE_SOLID_OUTLINE * UIConst.DISTANCE_SOLID_OUTLINE, sqrDistanceWithLocalPlayer);
						rimPower = Mathf.Lerp(UIConst.OUTLINE_RIM_DEFAULT, UIConst.OUTLINE_RIM_SOLID, num);
					}
					bool flag2 = (Object)(object)StartOfRound.Instance != (Object)null && (Object)(object)StartOfRound.Instance.localPlayerController != (Object)null && StartOfRound.Instance.localPlayerController.actualClientId == internAI.OwnerClientId;
					if (!internStates.TryGetValue(internAI.Npc.playerClientId, out OutlineState value))
					{
						value = new OutlineState();
						internStates[internAI.Npc.playerClientId] = value;
					}
					ApplyState(((Component)internAI.Npc).gameObject, value, flag, onlySkinned: true, UIConst.OUTLINE_INTENSITY_DEFAULT, rimPower, flag2 ? UIConst.UI_COLOR_ORANGE : UIConst.UI_COLOR_DEFAULT);
				}
			}
		}

		public static void UpdateEnemiesOutlines(IEnumerable<EnemyAI> enemies, EnemyAI? pointedEnemy, bool allowMultiple, bool forceNoOutlines = false)
		{
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)StartOfRound.Instance.localPlayerController == (Object)null)
			{
				return;
			}
			PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
			foreach (EnemyAI enemy in enemies)
			{
				if (!((Object)(object)enemy == (Object)null))
				{
					bool flag = !forceNoOutlines && ((Object)(object)enemy == (Object)(object)pointedEnemy || allowMultiple);
					float rimPower = UIConst.OUTLINE_RIM_DEFAULT;
					if (flag)
					{
						Vector3 val = ((Component)enemy).transform.position - ((Component)localPlayerController.gameplayCamera).transform.position;
						float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude;
						float num = Mathf.InverseLerp(1f, UIConst.DISTANCE_SOLID_OUTLINE * UIConst.DISTANCE_SOLID_OUTLINE, sqrMagnitude);
						rimPower = Mathf.Lerp(UIConst.OUTLINE_RIM_DEFAULT, UIConst.OUTLINE_RIM_SOLID, num);
					}
					if (!enemiesStates.TryGetValue(enemy, out OutlineState value))
					{
						value = new OutlineState();
						enemiesStates[enemy] = value;
					}
					ApplyState(((Component)enemy).gameObject, value, flag, onlySkinned: true, UIConst.OUTLINE_INTENSITY_DEFAULT, rimPower, UIConst.UI_COLOR_ORANGE);
				}
			}
		}

		public static void UpdateItemsOutlines(IEnumerable<GameObject> items, GrabbableObject? pointedItem, bool allowMultiple, bool forceNoOutlines = false)
		{
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)StartOfRound.Instance.localPlayerController == (Object)null)
			{
				return;
			}
			foreach (GameObject item in items)
			{
				if ((Object)(object)item == (Object)null)
				{
					continue;
				}
				GrabbableObject component = item.GetComponent<GrabbableObject>();
				if (!((Object)(object)component == (Object)null))
				{
					bool shouldEnable = !forceNoOutlines && InternManager.Instance.IsGrabbableObjectGrabbable(component, forcePickUp: true) && ((Object)(object)component == (Object)(object)pointedItem || allowMultiple);
					if (!itemStates.TryGetValue(component, out OutlineState value))
					{
						value = new OutlineState();
						itemStates[component] = value;
					}
					ApplyState(item.gameObject, value, shouldEnable, onlySkinned: false, UIConst.OUTLINE_INTENSITY_DEFAULT, UIConst.OUTLINE_RIM_SOLID, UIConst.UI_COLOR_ORANGE);
				}
			}
		}

		private static void ApplyState(GameObject target, OutlineState state, bool shouldEnable, bool onlySkinned, float intensity, float rimPower, Color color)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			if (shouldEnable != state.enabled)
			{
				if (shouldEnable)
				{
					SimpleOutline.Add(target, color, onlySkinned, rimPower, intensity);
				}
				else
				{
					SimpleOutline.Remove(target);
				}
				state.enabled = shouldEnable;
			}
			if (shouldEnable)
			{
				bool flag = Mathf.Abs(state.rimPower - rimPower) > 0.02f;
				bool flag2 = state.intensity != intensity;
				bool flag3 = state.color != color;
				if (flag || flag2 || flag3)
				{
					SimpleOutline.UpdateParams(target, intensity, rimPower, color);
					state.intensity = intensity;
					state.rimPower = Mathf.Lerp(state.rimPower, rimPower, Time.deltaTime * 10f);
					state.color = color;
				}
			}
		}
	}
	public static class OutlineResources
	{
		public static Material SilhouetteMaterial;

		public static Material RimOutlineMaterial;

		public static void Init(Material silhouetteMaterial)
		{
			SilhouetteMaterial = silhouetteMaterial;
			RimOutlineMaterial = null;
		}

		public static void Init(Material silhouetteMaterial, Material rimOutlineMaterial)
		{
			SilhouetteMaterial = silhouetteMaterial;
			RimOutlineMaterial = rimOutlineMaterial;
		}
	}
	public static class SimpleOutline
	{
		private class OutlineInstance
		{
			public GameObject go = null;

			public Renderer renderer = null;

			public MaterialPropertyBlock mpb = null;
		}

		private static readonly Dictionary<GameObject, Renderer[]> _rendererCache = new Dictionary<GameObject, Renderer[]>();

		private static readonly Dictionary<Renderer, OutlineInstance> active = new Dictionary<Renderer, OutlineInstance>();

		public static void Add(GameObject target, Color color, bool onlySkinned, float rimPower = 2.5f, float intensity = 2.5f)
		{
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)target) || !Object.op_Implicit((Object)(object)OutlineResources.SilhouetteMaterial))
			{
				return;
			}
			Renderer[] renderersCached = GetRenderersCached(target);
			foreach (Renderer val in renderersCached)
			{
				if ((Object)(object)val == (Object)null || !val.enabled || active.ContainsKey(val))
				{
					continue;
				}
				SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(object)((val is SkinnedMeshRenderer) ? val : null);
				if (val2 != null)
				{
					AddSkinned(val2, color, rimPower, intensity);
				}
				else if (!onlySkinned)
				{
					MeshRenderer val3 = (MeshRenderer)(object)((val is MeshRenderer) ? val : null);
					if (val3 != null)
					{
						AddStatic(val3, color, rimPower, intensity);
					}
				}
			}
		}

		public static void Remove(GameObject target)
		{
			if (!Object.op_Implicit((Object)(object)target))
			{
				return;
			}
			Renderer[] renderersCached = GetRenderersCached(target);
			foreach (Renderer val in renderersCached)
			{
				if (!((Object)(object)val == (Object)null) && active.TryGetValue(val, out OutlineInstance value))
				{
					Object.Destroy((Object)(object)value.go);
					active.Remove(val);
				}
			}
		}

		public static void UpdateParams(GameObject target, float intensity, float rimPower, Color color)
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			Renderer[] renderersCached = GetRenderersCached(target);
			foreach (Renderer val in renderersCached)
			{
				if (!((Object)(object)val == (Object)null) && active.TryGetValue(val, out OutlineInstance value))
				{
					value.mpb.SetFloat("_Intensity", intensity);
					value.mpb.SetFloat("_RimPower", rimPower);
					value.mpb.SetColor("_Color", color);
					value.renderer.SetPropertyBlock(value.mpb);
				}
			}
		}

		private static void AddSkinned(SkinnedMeshRenderer smr, Color color, float rimPower, float intensity)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)smr.sharedMesh))
			{
				GameObject val = new GameObject(((Object)smr).name + "_Outline");
				val.transform.SetParent(((Component)smr).transform, false);
				SkinnedMeshRenderer val2 = val.AddComponent<SkinnedMeshRenderer>();
				val2.sharedMesh = smr.sharedMesh;
				val2.bones = smr.bones;
				val2.rootBone = smr.rootBone;
				val2.updateWhenOffscreen = true;
				((Renderer)val2).sharedMaterial = OutlineResources.SilhouetteMaterial;
				MaterialPropertyBlock val3 = CreateMPB(color, rimPower, intensity);
				((Renderer)val2).SetPropertyBlock(val3);
				active[(Renderer)(object)smr] = new OutlineInstance
				{
					go = val,
					renderer = (Renderer)(object)val2,
					mpb = val3
				};
			}
		}

		private static void AddStatic(MeshRenderer mr, Color color, float rimPower, float intensity)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Expected O, but got Unknown
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)mr).name.Contains("ScanNode"))
			{
				MeshFilter component = ((Component)mr).GetComponent<MeshFilter>();
				if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.sharedMesh))
				{
					GameObject val = new GameObject(((Object)mr).name + "_Outline");
					val.transform.SetParent(((Component)mr).transform, false);
					MeshFilter val2 = val.AddComponent<MeshFilter>();
					val2.sharedMesh = component.sharedMesh;
					MeshRenderer val3 = val.AddComponent<MeshRenderer>();
					((Renderer)val3).sharedMaterial = OutlineResources.SilhouetteMaterial;
					MaterialPropertyBlock val4 = CreateMPB(color, rimPower, intensity);
					((Renderer)val3).SetPropertyBlock(val4);
					active[(Renderer)(object)mr] = new OutlineInstance
					{
						go = val,
						renderer = (Renderer)(object)val3,
						mpb = val4
					};
				}
			}
		}

		private static MaterialPropertyBlock CreateMPB(Color color, float rimPower, float intensity)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			MaterialPropertyBlock val = new MaterialPropertyBlock();
			val.SetColor("_Color", color);
			val.SetFloat("_RimPower", rimPower);
			val.SetFloat("_Intensity", intensity);
			return val;
		}

		private static Renderer[] GetRenderersCached(GameObject target)
		{
			if (!_rendererCache.TryGetValue(target, out Renderer[] value))
			{
				value = target.GetComponentsInChildren<Renderer>(true);
				_rendererCache[target] = value;
			}
			return value;
		}
	}
}
namespace LethalInternship.Core.UI.Others
{
	public class BlocksUIPool<T> where T : Component
	{
		private T prefab;

		private Transform parent;

		private Queue<T> pool = new Queue<T>();

		public BlocksUIPool(T prefab, Transform parent, int startSize)
		{
			this.prefab = prefab;
			this.parent = parent;
			for (int i = 0; i < startSize; i++)
			{
				T val = Object.Instantiate<T>(prefab, parent);
				((Component)val).gameObject.SetActive(false);
				pool.Enqueue(val);
			}
		}

		public T Get()
		{
			if (pool.Count == 0)
			{
				Expand();
			}
			T val = pool.Dequeue();
			((Component)val).gameObject.SetActive(true);
			return val;
		}

		public void Release(T obj)
		{
			((Component)obj).gameObject.SetActive(false);
			pool.Enqueue(obj);
		}

		private void Expand()
		{
			T val = Object.Instantiate<T>(prefab, parent);
			((Component)val).gameObject.SetActive(false);
			pool.Enqueue(val);
		}
	}
	public class CameraFocusUI
	{
		private struct CameraState
		{
			public float fov;

			public void Capture(Camera cam)
			{
				fov = cam.fieldOfView;
			}

			public void Apply(Camera cam)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				((Component)cam).transform.localRotation = Quaternion.identity;
				cam.fieldOfView = fov;
			}
		}

		private static CameraFocusUI _instance;

		private Camera cam = null;

		private float focusSpeed = 4f;

		private CameraState initialState;

		private Coroutine currentRoutine = null;

		public static CameraFocusUI Instance
		{
			get
			{
				if (_instance == null)
				{
					_instance = new CameraFocusUI();
				}
				return _instance;
			}
		}

		private CameraFocusUI()
		{
		}

		private bool UpdateCam()
		{
			if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)StartOfRound.Instance.localPlayerController == (Object)null)
			{
				PluginLogWarningDelegate logWarning = PluginLoggerHook.LogWarning;
				if (logWarning != null)
				{
					logWarning.Invoke("CameraFocusUI : no local Player available !");
				}
				return false;
			}
			cam = StartOfRound.Instance.localPlayerController.gameplayCamera;
			if ((Object)(object)cam == (Object)null)
			{
				PluginLogWarningDelegate logWarning2 = PluginLoggerHook.LogWarning;
				if (logWarning2 != null)
				{
					logWarning2.Invoke("CameraFocusUI : no local Player gameplayCamera available !");
				}
				return false;
			}
			return true;
		}

		public void FocusOnIntern(Transform target)
		{
			if (UpdateCam())
			{
				if (currentRoutine != null)
				{
					((MonoBehaviour)UIManager.Instance).StopCoroutine(currentRoutine);
				}
				initialState.Capture(cam);
				currentRoutine = ((MonoBehaviour)UIManager.Instance).StartCoroutine(FocusRotationOnly(target));
			}
		}

		public void ReturnToInitial()
		{
			if (UpdateCam())
			{
				if (currentRoutine != null)
				{
					((MonoBehaviour)UIManager.Instance).StopCoroutine(currentRoutine);
					currentRoutine = null;
				}
				initialState.Apply(cam);
			}
		}

		private IEnumerator FocusRotationOnly(Transform target)
		{
			if (UpdateCam())
			{
				Vector3 targetPos = target.position + new Vector3(0f, 1.5f, 0f);
				Vector3 camWorldPos = ((Component)cam).transform.position;
				Quaternion targetWorldRot = Quaternion.LookRotation(targetPos - camWorldPos);
				Quaternion targetLocalRot = Quaternion.Inverse(((Component)cam).transform.parent.rotation) * targetWorldRot;
				Quaternion startLocalRot = ((Component)cam).transform.localRotation;
				float startFov = cam.fieldOfView;
				float targetFov = Mathf.Clamp(startFov - 15f, 25f, 60f);
				float t = 0f;
				while (t < 1f)
				{
					t += Time.deltaTime * focusSpeed;
					((Component)cam).transform.localRotation = Quaternion.Slerp(startLocalRot, targetLocalRot, t);
					cam.fieldOfView = Mathf.Lerp(startFov, targetFov, t);
					yield return null;
				}
			}
		}
	}
	public class CategoryBlockUI : MonoBehaviour
	{
		public TextMeshProUGUI CategoryTitle = null;

		private EnumCategoryTypeUI categoryTypeUI = (EnumCategoryTypeUI)0;

		private void OnEnable()
		{
			((TMP_Text)CategoryTitle).font = UIManager.Instance.FontToUse;
		}

		public void SetCategory(EnumCategoryTypeUI categoryTypeUI)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			this.categoryTypeUI = categoryTypeUI;
		}

		public void UpdateTitleText(string text)
		{
			((TMP_Text)CategoryTitle).text = text;
		}
	}
	public enum EnumUIGroups
	{
		None,
		InternsList,
		ItemsList,
		SuitMenu,
		FollowMeButton,
		StopButton,
		PointerButton,
		AutoDefenseButton,
		CarryItemBehaviourButton,
		ShipGroupButtons,
		GatheringPointGroupButtons,
		VehicleGroupButtons,
		NavigationGroupButtons,
		Other,
		Close
	}
	public interface IGroupUI
	{
		EnumUIGroups GroupUI { get; }
	}
	public interface IHoldHandler : IEventSystemHandler
	{
		void OnHoldStart();

		void OnHoldEnd();
	}
	public interface IRefreshableUI
	{
		void Refresh();
	}
	public interface IVisibilityUI : IGroupUI
	{
		GameObject Go { get; }

		void SetInteractable(bool interactable, string tooltipMessageNotInteractable = null);
	}
	public class OverlayClose : MonoBehaviour
	{
		public void MouseClick()
		{
			UIManager.Instance.HideAll();
			CommandContextService.Instance.ExitCommandMode();
		}
	}
	public class ScrollWheelForwarder : MonoBehaviour, IScrollHandler, IEventSystemHandler
	{
		public void OnScroll(PointerEventData eventData)
		{
			ExecuteEvents.ExecuteHierarchy<IScrollHandler>(((Component)((Component)this).transform.parent).gameObject, (BaseEventData)(object)eventData, ExecuteEvents.scrollHandler);
		}
	}
}
namespace LethalInternship.Core.UI.ItemBlocks
{
	public class ItemBlockUI : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
	{
		public static Action<GrabbableObject> OnSelected;

		public Transform Content = null;

		public Image FrameImage = null;

		public ItemButtonController[] ItemButtons = null;

		private GameObject itemHologram = null;

		private Quaternion restingRotation = Quaternion.identity;

		private GrabbableObject itemGrabbableObject = null;

		private RectTransform viewport = null;

		private RectTransform itemFrameRect = null;

		private Renderer[] hologramRenderers = null;

		public bool IsBlockCurrentWeapon;

		private bool isNotInteractable;

		private string tooltipMessageNotInteractable = string.Empty;

		private float duration = 1.5f;

		private float rotationSpeed = 180f;

		private Coroutine rotationRoutine = null;

		private float tiltYAngle = -30f;

		private float tiltZAngle = 30f;

		private bool? previousController = null;

		public string ItemName => itemGrabbableObject.itemProperties.itemName;

		public int ItemValue => itemGrabbableObject.scrapValue;

		private string tooltipMessage => isNotInteractable ? tooltipMessageNotInteractable : UIConst.TOOLTIPBAR_ITEM;

		private void Awake()
		{
			viewport = ((Component)((Component)this).transform.parent.parent).GetComponent<RectTransform>();
			((UnityEvent<Vector2>)(object)((Component)((Component)this).transform.parent.parent.parent).GetComponent<ScrollRect>().onValueChanged).AddListener((UnityAction<Vector2>)OnScroll);
		}

		private void OnEnable()
		{
			StopHover();
			if (!((Object)(object)itemHologram == (Object)null))
			{
				PlayAnimationRotation();
				((MonoBehaviour)this).StartCoroutine(FitNextFrame());
				((MonoBehaviour)this).StartCoroutine(CheckVisibilityNextFrame());
				previousController = null;
			}
		}

		private void Update()
		{
			if (InputManager.Instance.IsUsingController != previousController)
			{
				previousController = InputManager.Instance.IsUsingController;
				UpdateActive();
			}
		}

		public void SetInteractable(bool interactable, string tooltipMessageNotInteractable = null)
		{
			this.tooltipMessageNotInteractable = tooltipMessageNotInteractable;
			isNotInteractable = !interactable;
		}

		public void Setup(GrabbableObject grabbableObject)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			itemGrabbableObject = grabbableObject;
			itemHologram = Object.Instantiate<GameObject>(grabbableObject.itemProperties.spawnPrefab, Content);
			itemFrameRect = (RectTransform)Content;
			float num = 0.5f - itemFrameRect.pivot.y;
			Rect rect = itemFrameRect.rect;
			float num2 = num * ((Rect)(ref rect)).height;
			itemHologram.transform.localPosition = new Vector3(0f, num2, 0f);
			restingRotation = Quaternion.Euler(grabbableObject.itemProperties.restingRotation);
			itemHologram.transform.rotation = restingRotation;
			Renderer[] componentsInChildren = itemHologram.GetComponentsInChildren<Renderer>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				if (((Component)componentsInChildren[i]).gameObject.layer != 22)
				{
					Material[] sharedMaterials = componentsInChildren[i].sharedMaterials;
					componentsInChildren[i].rendererPriority = 70;
					for (int j = 0; j < sharedMaterials.Length; j++)
					{
						sharedMaterials[j] = HUDManager.Instance.hologramMaterial;
					}
					componentsInChildren[i].sharedMaterials = sharedMaterials;
					((Component)componentsInChildren[i]).gameObject.layer = 5;
				}
			}
			hologramRenderers = componentsInChildren;
			Object.Destroy((Object)(object)itemHologram.GetComponent<NetworkObject>());
			Object.Destroy((Object)(object)itemHologram.GetComponent<GrabbableObject>());
			Object.Destroy((Object)(object)itemHologram.GetComponent<Collider>());
			Transform? obj = (from x in itemHologram.GetComponentsInChildren<Transform>()
				where ((Object)x).name == "ScanNode"
				select x).FirstOrDefault();
			GameObject val = ((obj != null) ? ((Component)obj).gameObject : null);
			if ((Object)(object)val != (Object)null)
			{
				Object.Destroy((Object)(object)val);
			}
			if (UIManager.Instance.IsCommandsOneOpen)
			{
				PlayAnimationRotation();
				((MonoBehaviour)this).StartCoroutine(FitNextFrame());
				((MonoBehaviour)this).StartCoroutine(CheckVisibilityNextFrame());
			}
			ItemButtonController[] itemButtons = ItemButtons;
			foreach (ItemButtonController itemButtonController in itemButtons)
			{
				itemButtonController.Init(itemGrabbableObject);
			}
			StopHover();
		}

		private void StartHover()
		{
			FrameImage.pixelsPerUnitMultiplier = 4f;
			SetAlpha(FrameImage, 1f);
			ItemButtonController[] itemButtons = ItemButtons;
			foreach (ItemButtonController itemButtonController in itemButtons)
			{
				((Component)itemButtonController).gameObject.SetActive(itemButtonController.StayActive(IsBlockCurrentWeapon));
			}
		}

		private void StopHover()
		{
			FrameImage.pixelsPerUnitMultiplier = 6f;
			SetAlpha(FrameImage, 0.39f);
			UpdateActive();
		}

		private void UpdateActive()
		{
			if (InputManager.Instance.IsUsingController)
			{
				ItemButtonController[] itemButtons = ItemButtons;
				foreach (ItemButtonController itemButtonController in itemButtons)
				{
					((Component)itemButtonController).gameObject.SetActive(itemButtonController.StayActive(IsBlockCurrentWeapon));
				}
			}
			else
			{
				ItemButtonController[] itemButtons2 = ItemButtons;
				foreach (ItemButtonController itemButtonController2 in itemButtons2)
				{
					((Component)itemButtonController2).gameObject.SetActive(false);
				}
			}
		}

		private void SetAlpha(Image image, float transparency)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)image != (Object)null && ((Graphic)image).color.a != transparency)
			{
				Color color = ((Graphic)image).color;
				color.a = transparency;
				((Graphic)image).color = color;
			}
		}

		public void PlayAnimationRotation()
		{
			if (rotationRoutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(rotationRoutine);
			}
			rotationRoutine = ((MonoBehaviour)this).StartCoroutine(RotateRoutine());
		}

		private IEnumerator RotateRoutine()
		{
			float elapsed = 0f;
			Quaternion startRotation = restingRotation;
			Quaternion tiltRotation = Quaternion.Euler(0f, tiltYAngle, tiltZAngle);
			while (elapsed < duration)
			{
				elapsed += Time.deltaTime;
				float main = rotationSpeed * elapsed;
				Quaternion mainRotation = Quaternion.Euler(main, 0f, 0f);
				itemHologram.transform.localRotation = startRotation * mainRotation * tiltRotation;
				yield return null;
			}
			rotationRoutine = null;
		}

		public float GetScaleFittingToFrame(Transform root, float targetSize, float margin = 0.9f)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			Renderer[] componentsInChildren = ((Component)root).GetComponentsInChildren<Renderer>();
			if (componentsInChildren.Length == 0)
			{
				return 1f;
			}
			Bounds bounds = componentsInChildren[0].bounds;
			for (int i = 1; i < componentsInChildren.Length; i++)
			{
				if (!(componentsInChildren[i] is ParticleSystemRenderer))
				{
					((Bounds)(ref bounds)).Encapsulate(componentsInChildren[i].bounds);
				}
			}
			Vector3 size = ((Bounds)(ref bounds)).size;
			float num = Mathf.Max(new float[3] { size.x, size.y, size.z });
			if (num <= 0f)
			{
				return 1f;
			}
			return targetSize / num * margin;
		}

		private IEnumerator FitNextFrame()
		{
			yield return null;
			Transform transform = itemHologram.transform;
			transform.localScale *= GetScaleFittingToFrame(itemHologram.transform, 0.38f, 0.8f);
		}

		private void UpdateVisibility()
		{
			if ((Object)(object)viewport == (Object)null || (Object)(object)itemFrameRect == (Object)null || hologramRenderers == null)
			{
				return;
			}
			bool enabled = IsVisible(itemFrameRect, viewport);
			Renderer[] array = hologramRenderers;
			foreach (Renderer val in array)
			{
				if ((Object)(object)val != (Object)null)
				{
					val.enabled = enabled;
				}
			}
		}

		private bool IsVisible(RectTransform itemFrame, RectTransform viewport)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			Vector3[] array = (Vector3[])(object)new Vector3[4];
			Vector3[] array2 = (Vector3[])(object)new Vector3[4];
			itemFrame.GetWorldCorners(array);
			viewport.GetWorldCorners(array2);
			Rect a = RectFromCorners(array);
			Rect val = RectFromCorners(array2);
			if (!((Rect)(ref a)).Overlaps(val))
			{
				return false;
			}
			float num = IntersectionArea(a, val);
			float num2 = ((Rect)(ref a)).width * ((Rect)(ref a)).height;
			if (num2 <= 0f)
			{
				return false;
			}
			float num3 = num / num2;
			return num3 >= 2f / 3f;
		}

		private IEnumerator CheckVisibilityNextFrame()
		{
			yield return null;
			UpdateVisibility();
		}

		private Rect RectFromCorners(Vector3[] corners)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = corners[0];
			Vector3 val2 = corners[2];
			return new Rect(Vector2.op_Implicit(val), Vector2.op_Implicit(val2 - val));
		}

		private float IntersectionArea(Rect a, Rect b)
		{
			float num = Mathf.Max(((Rect)(ref a)).xMin, ((Rect)(ref b)).xMin);
			float num2 = Mathf.Min(((Rect)(ref a)).xMax, ((Rect)(ref b)).xMax);
			float num3 = Mathf.Max(((Rect)(ref a)).yMin, ((Rect)(ref b)).yMin);
			float num4 = Mathf.Min(((Rect)(ref a)).yMax, ((Rect)(ref b)).yMax);
			if (num2 <= num || num4 <= num3)
			{
				return 0f;
			}
			return (num2 - num) * (num4 - num3);
		}

		private void OnScroll(Vector2 v)
		{
			UpdateVisibility();
		}

		public void OnPointerEnter(PointerEventData eventData)
		{
			UIManager.Instance.ToolTipBarUI.ShowImmediate(string.Format(tooltipMessage, ItemName, ItemValue));
			if (!isNotInteractable)
			{
				StartHover();
			}
		}

		public void OnPointerExit(PointerEventData eventData)
		{
			UIManager.Instance.ToolTipBarUI.Hide();
			StopHover();
		}
	}
	public class ItemButtonController : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler, ISelectHandler, IDeselectHandler, IHoldHandler
	{
		public static Action<GrabbableObject, EnumInputAction> OnSelected;

		public Image BGImage = null;

		public Image ButtonImage = null;

		public EnumInputAction TypeInputAction;

		private GrabbableObject itemGrabbableObject = null;

		private bool isHovered;

		private bool isPointerOver;

		private bool isSelected;

		private float holdTime = 0.3f;

		private void OnEnable()
		{
			isPointerOver = false;
			isSelected = false;
			isHovered = false;
			StopHover();
		}

		public void Init(GrabbableObject itemGrabbableObject)
		{
			this.itemGrabbableObject = itemGrabbableObject;
		}

		private void StartHover()
		{
			SetAlpha(BGImage, 1f);
			SetAlpha(ButtonImage, 1f);
		}

		private void StopHover()
		{
			SetAlpha(BGImage, 0.39f);
			SetAlpha(ButtonImage, 0.39f);
		}

		private void SetAlpha(Image image, float transparency)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)image != (Object)null && ((Graphic)image).color.a != transparency)
			{
				Color color = ((Graphic)image).color;
				color.a = transparency;
				((Graphic)image).color = color;
			}
		}

		public bool StayActive(bool isCurrentWeapon)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Invalid comparison between Unknown and I4
			EnumInputAction typeInputAction = TypeInputAction;
			EnumInputAction val = typeInputAction;
			if ((int)val != 6)
			{
				if ((int)val != 30)
				{
					if ((int)val == 31)
					{
						return InternManager.Instance.IsItemUsableItem(itemGrabbableObject);
					}
					return true;
				}
				return !isCurrentWeapon && InternManager.Instance.IsItemUsableWeapon(itemGrabbableObject);
			}
			return true;
		}

		private void UpdateHighlight()
		{
			bool flag = isPointerOver || isSelected;
			if (flag != isHovered)
			{
				isHovered = flag;
				if (isHovered)
				{
					StartHover();
				}
				else
				{
					StopHover();
				}
			}
		}

		public void OnHoldStart()
		{
			UIManager.Instance.ToolTipBarUI.StartHold(holdTime, ActionValidated);
		}

		public void OnHoldEnd()
		{
			UIManager.Instance.ToolTipBarUI.StopHold();
		}

		private void ActionValidated()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			UIManager.Instance.ToolTipBarUI.Hide();
			OnSelected?.Invoke(itemGrabbableObject, TypeInputAction);
		}

		public void OnPointerEnter(PointerEventData eventData)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			if (!InputManager.Instance.IsUsingController)
			{
				UIManager.Instance.UpdateLastSelectedUI(((Component)this).gameObject);
				isPointerOver = true;
				isSelected = false;
				UIManager.Instance.ToolTipBarUI.ShowImmediate(UIConst.COMMANDS_BUTTON_STRING[TypeInputAction] ?? "");
				UpdateHighlight();
			}
		}

		public void OnPointerExit(PointerEventData eventData)
		{
			isPointerOver = false;
			isSelected = false;
			UIManager.Instance.ToolTipBarUI.Hide();
			UpdateHighlight();
		}

		public void OnPointerDown(PointerEventData eventData)
		{
			OnHoldStart();
		}

		public void OnPointerUp(PointerEventData eventData)
		{
			OnHoldEnd();
		}

		public void OnSelect(BaseEventData eventData)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			UIManager.Instance.UpdateLastSelectedUI(((Component)this).gameObject);
			isPointerOver = false;
			isSelected = true;
			UIManager.Instance.ToolTipBarUI.ShowImmediate(UIConst.COMMANDS_BUTTON_STRING[TypeInputAction] ?? "");
			UpdateHighlight();
		}

		public void OnDeselect(BaseEventData eventData)
		{
			isPointerOver = false;
			isSelected = false;
			UIManager.Instance.ToolTipBarUI.Hide();
			UpdateHighlight();
		}
	}
	public class ItemListUIController : MonoBehaviour, IRefreshableUI, IVisibilityUI, IGroupUI
	{
		public EnumUIGroups GroupUI = EnumUIGroups.InternsList;

		public Transform Content = null;

		public ItemBlockUI PrefabItemBlockUI = null;

		public CategoryBlockUI PrefabCategoryBlockUI = null;

		private BlocksUIPool<CategoryBlockUI> categoryPool = null;

		private Dictionary<GrabbableObject, ItemBlockUI> blocksByGrabbableObject = new Dictionary<GrabbableObject, ItemBlockUI>();

		private Dictionary<EnumCategoryTypeUI, CategoryBlockUI> categoryMap = new Dictionary<EnumCategoryTypeUI, CategoryBlockUI>();

		private int weaponScrapValue = 0;

		private int itemsScrapValue = 0;

		private IInternAI currentInternAI = null;

		public GameObject Go { get; private set; } = null;

		EnumUIGroups IGroupUI.GroupUI => GroupUI;

		private void Awake()
		{
			Go = null;
		}

		private void OnEnable()
		{
			Refresh();
		}

		public void Refresh()
		{
			InitUIPools();
			if (!((Object)(object)GameNetworkManager.Instance == (Object)null) && !((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null))
			{
				IInternIdentity current = IdentitySelectionService.Instance.GetCurrent();
				if (current != null && current.Alive && current.InternAI != null)
				{
					currentInternAI = current.InternAI;
					SyncList(currentInternAI.GetHeldGrabbableObjects());
					IInternAI obj = currentInternAI;
					obj.OnHeldItemsChanged = (Action<IInternAI>)Delegate.Remove(obj.OnHeldItemsChanged, new Action<IInternAI>(UpdateItems));
					IInternAI obj2 = currentInternAI;
					obj2.OnHeldItemsChanged = (Action<IInternAI>)Delegate.Combine(obj2.OnHeldItemsChanged, new Action<IInternAI>(UpdateItems));
				}
			}
		}

		public void SetInteractable(bool interactable, string tooltipMessageNotInteractable = null)
		{
			foreach (var (val2, itemBlockUI2) in blocksByGrabbableObject)
			{
				itemBlockUI2.SetInteractable(interactable, tooltipMessageNotInteractable);
			}
		}

		private void InitUIPools()
		{
			if (categoryPool == null)
			{
				categoryPool = new BlocksUIPool<CategoryBlockUI>(PrefabCategoryBlockUI, Content, Enum.GetNames(typeof(EnumCategoryTypeUI)).Length);
			}
		}

		private void UpdateItems(IInternAI intern)
		{
			int num = -1;
			bool isUsingController = InputManager.Instance.IsUsingController;
			if (isUsingController)
			{
				GameObject currentSelectedGameObject = EventSystem.current.currentSelectedGameObject;
				if ((Object)(object)currentSelectedGameObject != (Object)null)
				{
					int num2 = 0;
					foreach (KeyValuePair<GrabbableObject, ItemBlockUI> item in blocksByGrabbableObject)
					{
						if (currentSelectedGameObject.transform.IsChildOf(((Component)item.Value).transform))
						{
							num = num2;
							break;
						}
						num2++;
					}
				}
			}
			SyncList(intern.GetHeldGrabbableObjects());
			if (!isUsingController || num < 0)
			{
				return;
			}
			int num3 = 0;
			ItemBlockUI itemBlockUI = null;
			foreach (KeyValuePair<GrabbableObject, ItemBlockUI> item2 in blocksByGrabbableObject)
			{
				if (((Behaviour)item2.Value).isActiveAndEnabled)
				{
					itemBlockUI = item2.Value;
					if (num3++ == num)
					{
						EventSystem current3 = EventSystem.current;
						ItemButtonController? itemButtonControllerDropFromBlockUI = GetItemButtonControllerDropFromBlockUI(item2.Value);
						current3.SetSelectedGameObject((itemButtonControllerDropFromBlockUI != null) ? ((Component)itemButtonControllerDropFromBlockUI).gameObject : null);
						return;
					}
				}
			}
			if ((Object)(object)itemBlockUI == (Object)null)
			{
				EventSystem.current.SetSelectedGameObject((GameObject)null);
				return;
			}
			EventSystem current4 = EventSystem.current;
			ItemButtonController? itemButtonControllerDropFromBlockUI2 = GetItemButtonControllerDropFromBlockUI(itemBlockUI);
			current4.SetSelectedGameObject((itemButtonControllerDropFromBlockUI2 != null) ? ((Component)itemButtonControllerDropFromBlockUI2).gameObject : null);
		}

		private ItemButtonController? GetItemButtonControllerDropFromBlockUI(ItemBlockUI block)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			for (int i = 0; i < block.ItemButtons.Length; i++)
			{
				if ((int)block.ItemButtons[i].TypeInputAction == 6)
				{
					return block.ItemButtons[i];
				}
			}
			return null;
		}

		public void SyncList(IEnumerable<GrabbableObject> items)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			weaponScrapValue = 0;
			itemsScrapValue = 0;
			Dictionary<EnumCategoryTypeUI, List<GrabbableObject>> dictionary = new Dictionary<EnumCategoryTypeUI, List<GrabbableObject>>
			{
				{
					(EnumCategoryTypeUI)5,
					new List<GrabbableObject>()
				},
				{
					(EnumCategoryTypeUI)6,
					new List<GrabbableObject>()
				}
			};
			foreach (GrabbableObject item in items)
			{
				dictionary[GetCategory(item)].Add(item);
			}
			DisableMissingItems(items);
			int startIndex = 0;
			startIndex = SyncCategory((EnumCategoryTypeUI)5, dictionary[(EnumCategoryTypeUI)5], weaponScrapValue, startIndex);
			startIndex = SyncCategory((EnumCategoryTypeUI)6, dictionary[(EnumCategoryTypeUI)6], itemsScrapValue, startIndex);
		}

		private EnumCategoryTypeUI GetCategory(GrabbableObject item)
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)currentInternAI.GetHeldWeapon() == (Object)(object)item)
			{
				weaponScrapValue += item.scrapValue;
				return (EnumCategoryTypeUI)5;
			}
			itemsScrapValue += item.scrapValue;
			return (EnumCategoryTypeUI)6;
		}

		private int SyncCategory(EnumCategoryTypeUI type, List<GrabbableObject> itemsGrabbableObjects, int totalValue, int startIndex)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Invalid comparison between Unknown and I4
			CategoryBlockUI orCreateCategory = GetOrCreateCategory(type, itemsGrabbableObjects.Count, totalValue);
			((Component)orCreateCategory).transform.SetSiblingIndex(startIndex++);
			foreach (GrabbableObject itemsGrabbableObject in itemsGrabbableObjects)
			{
				if (!blocksByGrabbableObject.TryGetValue(itemsGrabbableObject, out ItemBlockUI value))
				{
					value = Object.Instantiate<ItemBlockUI>(PrefabItemBlockUI, Content);
					value.Setup(itemsGrabbableObject);
					blocksByGrabbableObject[itemsGrabbableObject] = value;
				}
				value.IsBlockCurrentWeapon = (int)type == 5;
				((Component)value).gameObject.SetActive(true);
				((Component)value).transform.SetSiblingIndex(startIndex++);
			}
			return startIndex;
		}

		private void DisableMissingItems(IEnumerable<GrabbableObject> newItems)
		{
			HashSet<GrabbableObject> hashSet = new HashSet<GrabbableObject>(newItems);
			List<GrabbableObject> list = new List<GrabbableObject>();
			foreach (GrabbableObject key in blocksByGrabbableObject.Keys)
			{
				if (!h

plugins/Szumi57-LethalInternship/LethalInternship.Patches.dll

Decompiled 3 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using AdvancedFeatures;
using BetterEmote.AssetScripts;
using BunkbedRevive;
using CustomItemBehaviourLibrary.AbstractItems;
using FasterItemDropship;
using GameNetcodeStuff;
using HarmonyLib;
using LCPeeper;
using LethalInternship.Patches.GameEnginePatches;
using LethalInternship.Patches.Utils;
using LethalInternship.SharedAbstractions.Adapters;
using LethalInternship.SharedAbstractions.Constants;
using LethalInternship.SharedAbstractions.Enums;
using LethalInternship.SharedAbstractions.Hooks.BunkbedReviveHooks;
using LethalInternship.SharedAbstractions.Hooks.CustomItemBehaviourLibraryHooks;
using LethalInternship.SharedAbstractions.Hooks.LethalMinHooks;
using LethalInternship.SharedAbstractions.Hooks.MipaHooks;
using LethalInternship.SharedAbstractions.Hooks.ModelReplacementAPIHooks;
using LethalInternship.SharedAbstractions.Hooks.MonoProfilerHooks;
using LethalInternship.SharedAbstractions.Hooks.MoreCompanyHooks;
using LethalInternship.SharedAbstractions.Hooks.PlayerControllerBHooks;
using LethalInternship.SharedAbstractions.Hooks.PluginLoggerHooks;
using LethalInternship.SharedAbstractions.Hooks.ReviveCompanyHooks;
using LethalInternship.SharedAbstractions.Hooks.ShipTeleporterHooks;
using LethalInternship.SharedAbstractions.Hooks.TerminalHooks;
using LethalInternship.SharedAbstractions.Hooks.TooManyEmotesHooks;
using LethalInternship.SharedAbstractions.Interns;
using LethalInternship.SharedAbstractions.ManagerProviders;
using LethalInternship.SharedAbstractions.Managers;
using LethalInternship.SharedAbstractions.NetworkSerializers;
using LethalInternship.SharedAbstractions.Parameters;
using LethalInternship.SharedAbstractions.PluginRuntimeProvider;
using LethalMin;
using Microsoft.CodeAnalysis;
using Mipa;
using ModelReplacement;
using ModelReplacement.AvatarBodyUpdater;
using ModelReplacement.Monobehaviors;
using ModelReplacement.Patches;
using ModelReplacement.Scripts.Player;
using MonoProfiler;
using MoreCompany;
using MoreCompany.Cosmetics;
using MoreEmotes.Patch;
using MoreEmotes.Scripts;
using OPJosMod.ReviveCompany;
using Scoops.misc;
using Scoops.patch;
using TMPro;
using TooManyEmotes;
using TooManyEmotes.Patches;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalInternship.Patches")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LethalInternship.Patches")]
[assembly: AssemblyTitle("LethalInternship.Patches")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace LethalInternship.Patches.Utils
{
	public static class PatchesUtil
	{
		public static readonly FieldInfo FieldInfoWasUnderwaterLastFrame = AccessTools.Field(typeof(PlayerControllerB), "wasUnderwaterLastFrame");

		public static readonly FieldInfo FieldInfoPlayerClientId = AccessTools.Field(typeof(PlayerControllerB), "playerClientId");

		public static readonly FieldInfo FieldInfoPreviousAnimationStateHash = AccessTools.Field(typeof(PlayerControllerB), "previousAnimationStateHash");

		public static readonly FieldInfo FieldInfoCurrentAnimationStateHash = AccessTools.Field(typeof(PlayerControllerB), "currentAnimationStateHash");

		public static readonly FieldInfo FieldInfoTargetPlayer = AccessTools.Field(typeof(BushWolfEnemy), "targetPlayer");

		public static readonly FieldInfo FieldInfoDraggingPlayer = AccessTools.Field(typeof(BushWolfEnemy), "draggingPlayer");

		public static readonly MethodInfo AllEntitiesCountMethod = SymbolExtensions.GetMethodInfo((Expression<Action>)(() => AllEntitiesCount()));

		public static readonly MethodInfo AreInternsScheduledToLandMethod = SymbolExtensions.GetMethodInfo((Expression<Action>)(() => AreInternsScheduledToLand()));

		public static readonly MethodInfo IsPlayerLocalOrInternOwnerLocalMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), Expression.New(typeof(PlayerControllerB))), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo IsColliderFromLocalOrInternOwnerLocalMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), Expression.New(typeof(Collider))), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo IndexBeginOfInternsMethod = SymbolExtensions.GetMethodInfo((Expression<Action>)(() => IndexBeginOfInterns()));

		public static readonly MethodInfo IsPlayerInternMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), Expression.New(typeof(PlayerControllerB))), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo IsIdPlayerInternMethod = SymbolExtensions.GetMethodInfo((Expression<Action>)(() => IsIdPlayerIntern(0)));

		public static readonly MethodInfo IsRagdollPlayerIdInternMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), Expression.New(typeof(RagdollGrabbableObject))), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo IsPlayerInternOwnerLocalMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), Expression.New(typeof(PlayerControllerB))), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo IsAnInternAiOwnerOfObjectMethod = SymbolExtensions.GetMethodInfo((Expression<Action>)(() => IsAnInternAiOwnerOfObject((GrabbableObject)new object())));

		public static readonly MethodInfo DisableOriginalGameDebugLogsMethod = SymbolExtensions.GetMethodInfo((Expression<Action>)(() => DisableOriginalGameDebugLogs()));

		public static readonly MethodInfo IsPlayerInternControlledAndOwnerMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), Expression.New(typeof(PlayerControllerB))), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo GetDamageFromSlimeIfInternMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), Expression.New(typeof(PlayerControllerB))), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo SyncWatchingThreatIfInternMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), new Expression[2]
		{
			Expression.New(typeof(GiantKiwiAI)),
			Expression.New(typeof(PlayerControllerB))
		}), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo SyncAttackingThreatIfInternMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), new Expression[2]
		{
			Expression.New(typeof(GiantKiwiAI)),
			Expression.New(typeof(PlayerControllerB))
		}), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo SyncSetTargetToThreatIfInternMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), new Expression[3]
		{
			Expression.New(typeof(RadMechAI)),
			Expression.New(typeof(PlayerControllerB)),
			Expression.New(typeof(Vector3))
		}), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo ShouldIgnoreHitShovelIfInternMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), Expression.New(typeof(Shovel))), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo ShouldIgnoreHitKnifeIfInternMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), Expression.New(typeof(KnifeItem))), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo ShouldIgnoreInternsEndScreenMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), Expression.New(typeof(PlayerControllerB))), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo IsAnyMenuOpenedMethod = SymbolExtensions.GetMethodInfo((Expression<Action>)(() => IsAnyMenuOpened()));

		public static readonly MethodInfo DropAllItemsIfInternMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), Expression.New(typeof(PlayerControllerB))), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo BushWolfEnemyCheckIfHitInternMethod = SymbolExtensions.GetMethodInfo(Expression.Lambda<Action>(Expression.Call(null, (MethodInfo)MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), new Expression[2]
		{
			Expression.New(typeof(BushWolfEnemy)),
			Expression.New(typeof(PlayerControllerB))
		}), Array.Empty<ParameterExpression>()));

		public static readonly MethodInfo GetGameobjectMethod = AccessTools.PropertyGetter(typeof(Component), "gameObject");

		public static readonly MethodInfo SyncJumpMethod = SymbolExtensions.GetMethodInfo((Expression<Action>)(() => SyncJump(0uL)));

		public static readonly MethodInfo SyncLandFromJumpMethod = SymbolExtensions.GetMethodInfo((Expression<Action>)(() => SyncLandFromJump(0uL, fallHard: false)));

		public static List<CodeInstruction> InsertIsPlayerInternInstructions(List<CodeInstruction> codes, ILGenerator generator, int startIndex, int indexToJumpTo)
		{
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Expected O, but got Unknown
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Expected O, but got Unknown
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			List<Label> labels = codes[startIndex].labels;
			List<Label> labels2 = codes[startIndex + indexToJumpTo].labels;
			Label label = generator.DefineLabel();
			labels2.Add(label);
			if (labels.Count > 0)
			{
				codes.Insert(startIndex + 1, new CodeInstruction(codes[startIndex].opcode, codes[startIndex].operand));
				codes[startIndex].opcode = OpCodes.Nop;
				codes[startIndex].operand = null;
				startIndex++;
			}
			List<CodeInstruction> collection = new List<CodeInstruction>
			{
				new CodeInstruction(OpCodes.Ldarg_0, (object)null),
				new CodeInstruction(OpCodes.Call, (object)IsPlayerInternMethod),
				new CodeInstruction(OpCodes.Brtrue_S, (object)label)
			};
			codes.InsertRange(startIndex, collection);
			return codes;
		}

		public static List<CodeInstruction> InsertIsBypass(List<CodeInstruction> codes, ILGenerator generator, int startIndex, int indexToJumpTo)
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Expected O, but got Unknown
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			List<Label> labels = codes[startIndex].labels;
			List<Label> labels2 = codes[startIndex + indexToJumpTo].labels;
			Label label = generator.DefineLabel();
			labels2.Add(label);
			if (labels.Count > 0)
			{
				codes.Insert(startIndex + 1, new CodeInstruction(codes[startIndex].opcode, codes[startIndex].operand));
				codes[startIndex].opcode = OpCodes.Nop;
				codes[startIndex].operand = null;
				startIndex++;
			}
			List<CodeInstruction> collection = new List<CodeInstruction>
			{
				new CodeInstruction(OpCodes.Call, (object)DisableOriginalGameDebugLogsMethod),
				new CodeInstruction(OpCodes.Brtrue_S, (object)label)
			};
			codes.InsertRange(startIndex, collection);
			return codes;
		}

		public static bool IsGrabbableObjectEqualsToNull(GrabbableObject grabbableObject)
		{
			return (Object)(object)grabbableObject == (Object)null;
		}

		private static bool DisableOriginalGameDebugLogs()
		{
			return Const.DISABLE_ORIGINAL_GAME_DEBUG_LOGS;
		}

		private static bool AreInternsScheduledToLand()
		{
			return InternManagerProvider.Instance.AreInternsScheduledToLand();
		}

		private static bool IsPlayerLocalOrInternOwnerLocal(PlayerControllerB player)
		{
			return InternManagerProvider.Instance.IsPlayerLocalOrInternOwnerLocal(player);
		}

		private static int IndexBeginOfInterns()
		{
			return InternManagerProvider.Instance.IndexBeginOfInterns;
		}

		private static int AllEntitiesCount()
		{
			return InternManagerProvider.Instance.AllEntitiesCount;
		}

		private static bool IsColliderFromLocalOrInternOwnerLocal(Collider collider)
		{
			return InternManagerProvider.Instance.IsColliderFromLocalOrInternOwnerLocal(collider);
		}

		private static bool IsPlayerIntern(PlayerControllerB player)
		{
			return InternManagerProvider.Instance.IsPlayerIntern(player);
		}

		private static bool IsIdPlayerIntern(int id)
		{
			return InternManagerProvider.Instance.IsIdPlayerIntern(id);
		}

		private static bool IsRagdollPlayerIdIntern(RagdollGrabbableObject ragdollGrabbableObject)
		{
			return InternManagerProvider.Instance.IsIdPlayerIntern((int)ragdollGrabbableObject.ragdoll.playerScript.playerClientId);
		}

		private static bool IsPlayerInternOwnerLocal(PlayerControllerB player)
		{
			return InternManagerProvider.Instance.IsPlayerInternOwnerLocal(player);
		}

		private static bool IsPlayerInternControlledAndOwner(PlayerControllerB player)
		{
			return InternManagerProvider.Instance.IsPlayerInternControlledAndOwner(player);
		}

		private static int GetDamageFromSlimeIfIntern(PlayerControllerB player)
		{
			return InternManagerProvider.Instance.GetDamageFromSlimeIfIntern(player);
		}

		private static bool SyncWatchingThreatIfIntern(GiantKiwiAI giantKiwiAI, IVisibleThreat threat)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB component = ((Component)threat.GetThreatTransform()).gameObject.GetComponent<PlayerControllerB>();
			if ((Object)(object)component == (Object)null)
			{
				return false;
			}
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)component.playerClientId);
			if (internAI == null)
			{
				return false;
			}
			internAI.SyncWatchingThreatGiantKiwiServerRpc(NetworkObjectReference.op_Implicit(((Component)giantKiwiAI).GetComponent<NetworkObject>()));
			return true;
		}

		private static bool SyncAttackingThreatIfIntern(GiantKiwiAI giantKiwiAI, IVisibleThreat threat)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB component = ((Component)threat.GetThreatTransform()).gameObject.GetComponent<PlayerControllerB>();
			if ((Object)(object)component == (Object)null)
			{
				return false;
			}
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)component.playerClientId);
			if (internAI == null)
			{
				return false;
			}
			internAI.SyncAttackingThreatGiantKiwiServerRpc(NetworkObjectReference.op_Implicit(((Component)giantKiwiAI).GetComponent<NetworkObject>()));
			return true;
		}

		private static bool SyncSetTargetToThreatIfIntern(RadMechAI radMechAI, IVisibleThreat threat, Vector3 lastSeenPos)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB component = ((Component)threat.GetThreatTransform()).gameObject.GetComponent<PlayerControllerB>();
			if ((Object)(object)component == (Object)null)
			{
				return false;
			}
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)component.playerClientId);
			if (internAI == null)
			{
				return false;
			}
			internAI.SyncSetTargetToThreatServerRpc(NetworkObjectReference.op_Implicit(((Component)radMechAI).GetComponent<NetworkObject>()), lastSeenPos);
			return true;
		}

		private static bool IsAnInternAiOwnerOfObject(GrabbableObject grabbableObject)
		{
			return InternManagerProvider.Instance.IsAnInternAiOwnerOfObject(grabbableObject);
		}

		private static void SyncJump(ulong playerClientId)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)playerClientId);
			if (internAI != null)
			{
				internAI.SyncJump();
			}
		}

		private static void SyncLandFromJump(ulong playerClientId, bool fallHard)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)playerClientId);
			if (internAI != null)
			{
				internAI.SyncLandFromJump(fallHard);
			}
		}

		private static bool ShouldIgnoreIfIntern(Shovel shovel)
		{
			return InternManagerProvider.Instance.GetInternAI((int)((GrabbableObject)shovel).playerHeldBy.playerClientId) != null;
		}

		private static bool ShouldIgnoreIfIntern(KnifeItem knife)
		{
			return InternManagerProvider.Instance.GetInternAI((int)((GrabbableObject)knife).playerHeldBy.playerClientId) != null;
		}

		private static bool ShouldIgnoreInternsEndScreen(PlayerControllerB player)
		{
			return InternManagerProvider.Instance.ShouldIgnoreInternsEndScreen(player);
		}

		private static bool IsAnyMenuOpened()
		{
			return UIManagerProvider.Instance.IsAnyCommandsMenuOpenOrWasOpen;
		}

		private static void DropAllItemsIfIntern(PlayerControllerB player)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)player.playerClientId);
			if (internAI != null)
			{
				internAI.DropAllItems((EnumOptionsGetItems)0, false);
			}
		}

		private static bool BushWolfEnemyCheckIfHitIntern(BushWolfEnemy bushWolfEnemy, PlayerControllerB player)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)player.playerClientId);
			if (internAI == null)
			{
				return false;
			}
			if (!Physics.Linecast(bushWolfEnemy.tongueStartPoint.position, ((Component)player.gameplayCamera).transform.position - Vector3.up * 0.3f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1) && Vector3.Distance(((Component)bushWolfEnemy).transform.position, ((Component)player).transform.position) < bushWolfEnemy.attackDistance)
			{
				bushWolfEnemy.HitByEnemyServerRpc();
			}
			else
			{
				bushWolfEnemy.DodgedEnemyHitServerRpc();
			}
			return true;
		}

		public static void SetFieldValue(object obj, string fieldName, object value)
		{
			Type type = obj.GetType();
			FieldInfo field = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			field.SetValue(obj, value);
		}

		public static void SetPropertyValue(object obj, string propertyName, object value)
		{
			Type type = obj.GetType();
			PropertyInfo property = type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			property.SetValue(obj, value);
		}
	}
}
namespace LethalInternship.Patches.TerminalPatches
{
	[HarmonyPatch(typeof(Terminal))]
	public class TerminalPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void Start_Postfix(TerminalNodesList ___terminalNodes)
		{
			TerminalManagerProvider.Instance.AddTextToHelpTerminalNode(___terminalNodes);
		}

		[HarmonyPatch("ParsePlayerSentence")]
		[HarmonyPostfix]
		private static void ParsePlayerSentence_Postfix(ref Terminal __instance, ref TerminalNode __result)
		{
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Invalid comparison between Unknown and I4
			string text = __instance.screenText.text.Substring(__instance.screenText.text.Length - __instance.textAdded);
			TerminalNode val = TerminalManagerProvider.Instance.ParseLethalInternshipCommands(text, ref __instance);
			if ((Object)(object)__result == (Object)null || (Object)(object)__result == (Object)(object)__instance.terminalNodes.specialNodes[10] || (Object)(object)__result == (Object)(object)__instance.terminalNodes.specialNodes[11] || (Object)(object)__result == (Object)(object)__instance.terminalNodes.specialNodes[12] || text == PluginRuntimeProvider.Context.Config.GetTitleInternshipProgram())
			{
				if ((Object)(object)val != (Object)null)
				{
					__result = val;
				}
			}
			else if ((int)TerminalManagerProvider.Instance.GetTerminalPage() != 1 && (Object)(object)val != (Object)null)
			{
				__result = val;
			}
			else
			{
				TerminalManagerProvider.Instance.ResetTerminalParser();
			}
		}

		[HarmonyPatch("ParseWord")]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		public static TerminalKeyword ParseWord_ReversePatch(object instance, string playerWord, int specificityRequired)
		{
			throw new NotImplementedException("Stub LethalInternship.Patches.TerminalPatches.ParseWord_ReversePatch");
		}

		[HarmonyPatch("ParseWordOverrideOptions")]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		public static TerminalNode ParseWordOverrideOptions_ReversePatch(object instance, string playerWord, CompatibleNoun[] options)
		{
			throw new NotImplementedException("Stub LethalInternship.Patches.TerminalPatches.ParseWordOverrideOptions_ReversePatch");
		}

		[HarmonyPatch("RemovePunctuation")]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		public static string RemovePunctuation_ReversePatch(object instance, string s)
		{
			throw new NotImplementedException("Stub LethalInternship.Patches.TerminalPatches.RemovePunctuation_ReversePatch");
		}
	}
	public class TerminalUtils
	{
		public static void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			TerminalHook.RemovePunctuation_ReversePatch = new RemovePunctuation_ReversePatchDelegate(TerminalPatch.RemovePunctuation_ReversePatch);
		}
	}
}
namespace LethalInternship.Patches.ObjectsPatches
{
	[HarmonyPatch(typeof(DeadBodyInfo))]
	public class DeadBodyInfoPatch
	{
		[HarmonyPatch("DetectIfSeenByLocalPlayer")]
		[HarmonyPrefix]
		private static bool DetectIfSeenByLocalPlayer_PreFix(DeadBodyInfo __instance)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI(__instance.playerObjectId);
			if (internAI != null && internAI.RagdollInternBody != null && (Object)(object)internAI.RagdollInternBody.GetDeadBodyInfo() == (Object)(object)__instance)
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch("Start")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> Start_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Expected O, but got Unknown
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Expected O, but got Unknown
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			int num = -1;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count - 8; i++)
			{
				if (((object)list[i]).ToString().StartsWith("ldarg.0 NULL") && ((object)list[i + 3]).ToString().StartsWith("ldarg.0 NULL") && ((object)list[i + 8]).ToString() == "ldstr \"PlayerRagdoll\"")
				{
					num = i;
					break;
				}
			}
			if (num > -1)
			{
				List<Label> labels = list[num + 3].labels;
				Label label = generator.DefineLabel();
				labels.Add(label);
				List<CodeInstruction> list2 = new List<CodeInstruction>();
				list2.Add(new CodeInstruction(OpCodes.Ldarg_0, (object)null));
				list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)AccessTools.Field(typeof(DeadBodyInfo), "playerObjectId")));
				list2.Add(new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsIdPlayerInternMethod));
				list2.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label));
				List<CodeInstruction> collection = list2;
				list.InsertRange(num, collection);
				num = -1;
			}
			else
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.ObjectsPatches.DeadBodyInfoPatch.Start_Transpiler remplace with correct tag if intern.");
				}
			}
			return list.AsEnumerable();
		}
	}
	[HarmonyPatch(typeof(GrabbableObject))]
	public class GrabbableObjectPatch
	{
		[HarmonyPatch("SetControlTipsForItem")]
		[HarmonyPrefix]
		public static bool SetControlTipsForItem_PreFix(GrabbableObject __instance)
		{
			return InternManagerProvider.Instance.IsAnInternAiOwnerOfObject(__instance);
		}

		[HarmonyPatch("DiscardItem")]
		[HarmonyPrefix]
		public static bool DiscardItem_PreFix(GrabbableObject __instance)
		{
			PlayerControllerB playerHeldBy = __instance.playerHeldBy;
			if ((Object)(object)playerHeldBy == (Object)null || !InternManagerProvider.Instance.IsPlayerIntern(playerHeldBy))
			{
				return true;
			}
			__instance.playerHeldBy.IsInspectingItem = false;
			__instance.playerHeldBy.activatingItem = false;
			__instance.playerHeldBy = null;
			return false;
		}

		[HarmonyPatch("SetScrapValue")]
		[HarmonyPrefix]
		public static bool SetScrapValue_PreFix(GrabbableObject __instance, int setValueTo)
		{
			RagdollGrabbableObject val = (RagdollGrabbableObject)(object)((__instance is RagdollGrabbableObject) ? __instance : null);
			if ((Object)(object)val == (Object)null)
			{
				return true;
			}
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI(val.bodyID);
			if (internAI == null)
			{
				if ((Object)(object)((Component)val).gameObject.GetComponentInChildren<ScanNodeProperties>() == (Object)null)
				{
					__instance.scrapValue = setValueTo;
					return false;
				}
				return true;
			}
			if (internAI.NpcController.Npc.isPlayerDead && (Object)(object)((Component)val).gameObject.GetComponentInChildren<ScanNodeProperties>() == (Object)null)
			{
				if ((Object)(object)((Component)val).gameObject.GetComponentInChildren<ScanNodeProperties>() == (Object)null)
				{
					__instance.scrapValue = setValueTo;
					return false;
				}
				return true;
			}
			return false;
		}

		[HarmonyPatch("UseItemOnClient")]
		[HarmonyPrefix]
		public static bool UseItemOnClient_PreFix(GrabbableObject __instance)
		{
			return InputManagerProvider.Instance.PreviousTargetedAbility == null;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPatch("Update")]
		public static void GrabbableObject_Update_ReversePatch(RagdollGrabbableObject instance)
		{
			throw new NotImplementedException("Stub LethalInternship.Patches.NpcPatches.GrabbableObjectPatch.GrabbableObject_Update_ReversePatch");
		}

		[HarmonyPatch("EquipItem")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> EquipItem_Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Expected O, but got Unknown
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Expected O, but got Unknown
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Expected O, but got Unknown
			int num = -1;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count - 3; i++)
			{
				if (((object)list[i]).ToString() == "call static HUDManager HUDManager::get_Instance()" && ((object)list[i + 1]).ToString() == "callvirt void HUDManager::ClearControlTips()" && ((object)list[i + 3]).ToString() == "callvirt virtual void GrabbableObject::SetControlTipsForItem()")
				{
					num = i;
					break;
				}
			}
			if (num > -1)
			{
				List<CodeInstruction> collection = new List<CodeInstruction>
				{
					new CodeInstruction(OpCodes.Ldarg_0, (object)null),
					new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsAnInternAiOwnerOfObjectMethod),
					new CodeInstruction(OpCodes.Brtrue_S, (object)list[num + 4].labels[0])
				};
				list.InsertRange(num, collection);
				num = -1;
			}
			else
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.ObjectsPatches.EquipItem_Transpiler could not remove check if holding player is intern");
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch("LateUpdate")]
		[HarmonyPostfix]
		public static void LateUpdate_PostFix(GrabbableObject __instance)
		{
			if (!((Object)(object)__instance.playerHeldBy == (Object)null))
			{
				IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerHeldBy.playerClientId);
				if (internAI != null)
				{
					internAI.UpdateItemRotation(__instance);
				}
			}
		}
	}
	[HarmonyPatch(typeof(KnifeItem))]
	public class KnifeItemPatch
	{
		[HarmonyPatch("HitKnife")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> HitKnife_Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			int num = -1;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count - 28; i++)
			{
				if (((object)list[i]).ToString().StartsWith("ldarg.0") && ((object)list[i + 28]).ToString().StartsWith("call static UnityEngine.RaycastHit[] UnityEngine.Physics::SphereCastAll"))
				{
					num = i;
					break;
				}
			}
			if (num > -1)
			{
				List<CodeInstruction> obj = new List<CodeInstruction>
				{
					new CodeInstruction(list[num]),
					new CodeInstruction(OpCodes.Call, (object)PatchesUtil.ShouldIgnoreHitKnifeIfInternMethod)
				};
				obj.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)list[list.Count - 1].labels[0]));
				List<CodeInstruction> collection = obj;
				list.InsertRange(num, collection);
				num = -1;
			}
			else
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.ObjectsPatches.KnifeItemPatch.HitKnife_Transpiler could not ignore knife hit if holder is intern");
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch("HitKnife")]
		[HarmonyPostfix]
		public static void HitKnife_PostFix(KnifeItem __instance, bool cancel)
		{
			if (!cancel)
			{
				IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)((GrabbableObject)__instance).playerHeldBy.playerClientId);
				if (internAI != null)
				{
					internAI.HitTargetWithKnife(__instance);
				}
			}
		}
	}
	[HarmonyPatch(typeof(RagdollGrabbableObject))]
	public class RagdollGrabbableObjectPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPrefix]
		private static bool Update_PreFix(RagdollGrabbableObject __instance, ref bool ___foundRagdollObject)
		{
			int bodyID = __instance.bodyID;
			if (bodyID == Const.INIT_RAGDOLL_ID)
			{
				if ((Object)(object)__instance.ragdoll == (Object)null)
				{
					return false;
				}
				___foundRagdollObject = true;
				((GrabbableObject)__instance).grabbableToEnemies = false;
				return true;
			}
			if (___foundRagdollObject && (Object)(object)StartOfRound.Instance.allPlayerScripts[bodyID].deadBody != (Object)null && (Object)(object)__instance.ragdoll != (Object)null && bodyID != (int)__instance.ragdoll.playerScript.playerClientId)
			{
				___foundRagdollObject = false;
			}
			return true;
		}

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Update_PostFix(RagdollGrabbableObject __instance)
		{
			if (__instance.bodyID == Const.INIT_RAGDOLL_ID)
			{
				((GrabbableObject)__instance).grabbableToEnemies = false;
			}
		}
	}
	[HarmonyPatch(typeof(ShotgunItem))]
	public class ShotgunItemPatch
	{
		[HarmonyPatch("ShootGun")]
		[HarmonyPostfix]
		private static void ShootGun_PostFix(ShotgunItem __instance, Vector3 shotgunPosition, Vector3 shotgunForward)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			for (int i = InternManagerProvider.Instance.IndexBeginOfInterns; i < InternManagerProvider.Instance.AllEntitiesCount; i++)
			{
				PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i];
				if (val.isPlayerDead || !val.isPlayerControlled)
				{
					continue;
				}
				IInternAI internAIIfLocalIsOwner = InternManagerProvider.Instance.GetInternAIIfLocalIsOwner((int)val.playerClientId);
				if (internAIIfLocalIsOwner == null)
				{
					continue;
				}
				int num = 0;
				Vector3 val2 = ((Component)val).transform.position + new Vector3(0f, 1f, 0f);
				float num2 = Vector3.Distance(val2, ((Component)__instance.shotgunRayPoint).transform.position);
				Vector3 val3 = val2;
				if (Vector3.Angle(shotgunForward, val3 - shotgunPosition) < 30f && !Physics.Linecast(shotgunPosition, val3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
				{
					if (num2 < 5f)
					{
						num = 100;
					}
					if (num2 < 15f)
					{
						num = 100;
					}
					else if (num2 < 23f)
					{
						num = 40;
					}
					else if (num2 < 30f)
					{
						num = 20;
					}
					val.DamagePlayer(num, false, false, (CauseOfDeath)7, 0, false, __instance.shotgunRayPoint.forward * 30f);
				}
			}
		}
	}
	[HarmonyPatch(typeof(Shovel))]
	public class ShovelPatch
	{
		[HarmonyPatch("HitShovel")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> HitShovel_Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			int num = -1;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count - 28; i++)
			{
				if (((object)list[i]).ToString().StartsWith("ldarg.0") && ((object)list[i + 28]).ToString().StartsWith("call static UnityEngine.RaycastHit[] UnityEngine.Physics::SphereCastAll"))
				{
					num = i;
					break;
				}
			}
			if (num > -1)
			{
				List<CodeInstruction> obj = new List<CodeInstruction>
				{
					new CodeInstruction(list[num]),
					new CodeInstruction(OpCodes.Call, (object)PatchesUtil.ShouldIgnoreHitShovelIfInternMethod)
				};
				obj.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)list[list.Count - 1].labels[0]));
				List<CodeInstruction> collection = obj;
				list.InsertRange(num, collection);
				num = -1;
			}
			else
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.ObjectsPatches.ShovelPatch.HitShovel_Transpiler could not ignore shovel hit if holder is intern");
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch("HitShovel")]
		[HarmonyPostfix]
		public static void HitShovel_PostFix(Shovel __instance, bool cancel)
		{
			if (!cancel)
			{
				IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)((GrabbableObject)__instance).playerHeldBy.playerClientId);
				if (internAI != null)
				{
					internAI.HitTargetWithShovel(__instance);
				}
			}
		}
	}
	[HarmonyPatch(typeof(StunGrenadeItem))]
	public class StunGrenadeItemPatch
	{
		[HarmonyPatch("SetControlTipForGrenade")]
		[HarmonyPrefix]
		private static bool SetControlTipForGrenade_PreFix(StunGrenadeItem __instance)
		{
			if (InternManagerProvider.Instance.IsAnInternAiOwnerOfObject((GrabbableObject)(object)__instance))
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch("StunExplosion")]
		[HarmonyPostfix]
		private static void StunExplosion_PostFix(Vector3 explosionPosition, bool isHeldItem, PlayerControllerB playerHeldBy)
		{
		}
	}
}
namespace LethalInternship.Patches.NpcPatches
{
	[HarmonyPatch(typeof(EnemyAICollisionDetect))]
	public class EnemyAICollisionDetectPatch
	{
		[HarmonyPatch("OnTriggerStay")]
		[HarmonyPrefix]
		private static void Prefix(EnemyAICollisionDetect __instance, Collider other)
		{
			if (((object)__instance.mainScript).GetType() == typeof(IInternAI))
			{
				PlayerControllerB componentInParent = ((Component)other).gameObject.GetComponentInParent<PlayerControllerB>();
				if ((Object)(object)componentInParent != (Object)null && InternManagerProvider.Instance.IsPlayerIntern(componentInParent))
				{
					Physics.IgnoreCollision(((Component)__instance).GetComponent<Collider>(), other);
				}
			}
		}
	}
	[HarmonyPatch(typeof(EnemyAI))]
	public class EnemyAIPatch
	{
		[HarmonyPatch("ChangeOwnershipOfEnemy")]
		[HarmonyPrefix]
		private static bool ChangeOwnershipOfEnemy_PreFix(ref ulong newOwnerClientId)
		{
			PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
			if (logDebug != null)
			{
				logDebug.Invoke($"Try ChangeOwnershipOfEnemy newOwnerClientId : {(int)newOwnerClientId}");
			}
			if (newOwnerClientId > Const.INTERN_ACTUAL_ID_OFFSET)
			{
				IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)(newOwnerClientId - Const.INTERN_ACTUAL_ID_OFFSET));
				if (internAI == null)
				{
					PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
					if (logDebug2 != null)
					{
						logDebug2.Invoke($"Could not find intern with id : {(int)(newOwnerClientId - Const.INTERN_ACTUAL_ID_OFFSET)}, aborting ChangeOwnershipOfEnemy.");
					}
					return false;
				}
				PluginLogDebugDelegate logDebug3 = PluginLoggerHook.LogDebug;
				if (logDebug3 != null)
				{
					logDebug3.Invoke($"ChangeOwnershipOfEnemy not on intern but on intern owner : {internAI.OwnerClientId}");
				}
				newOwnerClientId = internAI.OwnerClientId;
			}
			return true;
		}

		[HarmonyPatch("HitEnemyOnLocalClient")]
		[HarmonyPrefix]
		private static bool HitEnemyOnLocalClient(EnemyAI __instance)
		{
			if (((object)__instance).GetType() == typeof(IInternAI))
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch("MeetsStandardPlayerCollisionConditions")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> MeetsStandardPlayerCollisionConditions_Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Expected O, but got Unknown
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Expected O, but got Unknown
			int num = -1;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count - 8; i++)
			{
				if (list[i].opcode == OpCodes.Brtrue && list[i + 1].opcode == OpCodes.Ldloc_0 && list[i + 2].opcode == OpCodes.Call && list[i + 3].opcode == OpCodes.Ldfld && list[i + 4].opcode == OpCodes.Call && list[i + 8].opcode == OpCodes.Ldarg_0)
				{
					num = i;
					break;
				}
			}
			if (num > -1)
			{
				List<CodeInstruction> collection = new List<CodeInstruction>
				{
					new CodeInstruction(OpCodes.Ldarg_1, (object)null),
					new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsColliderFromLocalOrInternOwnerLocalMethod),
					new CodeInstruction(OpCodes.Brtrue_S, (object)list[num + 8].labels.First())
				};
				list.InsertRange(num + 1, collection);
			}
			else
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.NpcPatches.EnemyAIPatch.MeetsStandardPlayerCollisionConditions_Transpiler could not insert instruction if is intern for \"component != GameNetworkManager.Instance.localPlayerController\".");
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch("CheckLineOfSightForPlayer")]
		[HarmonyPostfix]
		private static void CheckLineOfSightForPlayer_PostFix(EnemyAI __instance, ref PlayerControllerB __result, float width, ref int range, int proximityAwareness)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Invalid comparison between Unknown and I4
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB val = null;
			if (__instance.isOutside && !__instance.enemyType.canSeeThroughFog && (int)TimeOfDay.Instance.currentLevelWeather == 3)
			{
				range = Mathf.Clamp(range, 0, 30);
			}
			for (int i = InternManagerProvider.Instance.IndexBeginOfInterns; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[i];
				if (__instance.PlayerIsTargetable(val2, false, false, true))
				{
					Vector3 position = ((Component)val2.gameplayCamera).transform.position;
					Vector3 val3 = position - __instance.eye.position;
					if (((Vector3)(ref val3)).sqrMagnitude < (float)range * (float)range && !Physics.Linecast(__instance.eye.position, position, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && (Vector3.Angle(__instance.eye.forward, val3) < width || (proximityAwareness != -1 && Vector3.Distance(__instance.eye.position, position) < (float)proximityAwareness)))
					{
						val = val2;
					}
				}
			}
			if ((Object)(object)__result == (Object)null && (Object)(object)val == (Object)null)
			{
				return;
			}
			if ((Object)(object)__result == (Object)null && (Object)(object)val != (Object)null)
			{
				__result = val;
			}
			else if ((!((Object)(object)__result != (Object)null) || !((Object)(object)val == (Object)null)) && !((Object)(object)__result == (Object)null) && !((Object)(object)val == (Object)null))
			{
				Vector3 position2 = ((Component)__result.gameplayCamera).transform.position;
				Vector3 position3 = ((Component)val.gameplayCamera).transform.position;
				Vector3 val4 = (((Object)(object)__instance.eye == (Object)null) ? ((Component)__instance).transform.position : __instance.eye.position);
				Vector3 val5 = position3 - val4;
				float sqrMagnitude = ((Vector3)(ref val5)).sqrMagnitude;
				val5 = position2 - val4;
				if (sqrMagnitude < ((Vector3)(ref val5)).sqrMagnitude)
				{
					__result = val;
				}
			}
		}

		[HarmonyPatch("GetClosestPlayer")]
		[HarmonyPostfix]
		private static void GetClosestPlayer_PostFix(EnemyAI __instance, ref PlayerControllerB __result, bool requireLineOfSight, bool cannotBeInShip, bool cannotBeNearShip)
		{
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB val = null;
			for (int i = InternManagerProvider.Instance.IndexBeginOfInterns; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[i];
				if (!__instance.PlayerIsTargetable(val2, cannotBeInShip, false, true))
				{
					continue;
				}
				if (cannotBeNearShip)
				{
					if (val2.isInElevator)
					{
						continue;
					}
					bool flag = false;
					for (int j = 0; j < RoundManager.Instance.spawnDenialPoints.Length; j++)
					{
						if (Vector3.Distance(RoundManager.Instance.spawnDenialPoints[j].transform.position, ((Component)val2).transform.position) < 10f)
						{
							flag = true;
							break;
						}
					}
					if (flag)
					{
						continue;
					}
				}
				if (!requireLineOfSight || !Physics.Linecast(((Component)__instance).transform.position, ((Component)val2).transform.position, 256))
				{
					__instance.tempDist = Vector3.Distance(((Component)__instance).transform.position, ((Component)val2).transform.position);
					if (__instance.tempDist < __instance.mostOptimalDistance)
					{
						__instance.mostOptimalDistance = __instance.tempDist;
						val = val2;
					}
				}
			}
			if ((Object)(object)__result == (Object)null && (Object)(object)val == (Object)null)
			{
				return;
			}
			if ((Object)(object)__result == (Object)null && (Object)(object)val != (Object)null)
			{
				__result = val;
			}
			else if ((!((Object)(object)__result != (Object)null) || !((Object)(object)val == (Object)null)) && !((Object)(object)__result == (Object)null) && !((Object)(object)val == (Object)null))
			{
				Vector3 position = ((Component)__result.gameplayCamera).transform.position;
				Vector3 position2 = ((Component)val.gameplayCamera).transform.position;
				Vector3 val3 = (((Object)(object)__instance.eye == (Object)null) ? ((Component)__instance).transform.position : __instance.eye.position);
				Vector3 val4 = position2 - val3;
				float sqrMagnitude = ((Vector3)(ref val4)).sqrMagnitude;
				val4 = position - val3;
				if (sqrMagnitude < ((Vector3)(ref val4)).sqrMagnitude)
				{
					__result = val;
				}
			}
		}

		[HarmonyPatch("TargetClosestPlayer")]
		[HarmonyPostfix]
		private static void TargetClosestPlayer_PostFix(EnemyAI __instance, ref bool __result, float bufferDistance, bool requireLineOfSight, float viewWidth)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB targetPlayer = __instance.targetPlayer;
			for (int i = InternManagerProvider.Instance.IndexBeginOfInterns; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i];
				if (__instance.PlayerIsTargetable(val, false, false, true) && !__instance.PathIsIntersectedByLineOfSight(((Component)val).transform.position, false, false, false) && (!requireLineOfSight || __instance.CheckLineOfSightForPosition(((Component)val.gameplayCamera).transform.position, viewWidth, 40, -1f, (Transform)null)))
				{
					__instance.tempDist = Vector3.Distance(((Component)__instance).transform.position, ((Component)val).transform.position);
					if (__instance.tempDist < __instance.mostOptimalDistance)
					{
						__instance.mostOptimalDistance = __instance.tempDist;
						__instance.targetPlayer = val;
					}
				}
			}
			if ((Object)(object)__instance.targetPlayer != (Object)null && bufferDistance > 0f && (Object)(object)targetPlayer != (Object)null && Mathf.Abs(__instance.mostOptimalDistance - Vector3.Distance(((Component)__instance).transform.position, ((Component)targetPlayer).transform.position)) < bufferDistance)
			{
				__instance.targetPlayer = targetPlayer;
			}
			__result = (Object)(object)__instance.targetPlayer != (Object)null;
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	public class PlayerControllerBPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyAfter(new string[] { "MoreEmotes" })]
		[HarmonyPrefix]
		private static bool Update_PreFix(PlayerControllerB __instance, ref bool ___isCameraDisabled, bool ___isJumping, bool ___isFallingFromJump, ref float ___crouchMeter, ref bool ___isWalking, ref float ___playerSlidingTimer, ref bool ___disabledJetpackControlsThisFrame, ref bool ___startedJetpackControls, ref float ___timeSinceTakingGravityDamage, ref bool ___teleportingThisFrame, ref float ___previousFrameDeltaTime, ref float ___cameraUp, ref float ___updatePlayerLookInterval)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI == null)
			{
				if ((int)__instance.playerClientId >= InternManagerProvider.Instance.IndexBeginOfInterns)
				{
					return false;
				}
				return true;
			}
			if (internAI.NpcController == null)
			{
				return false;
			}
			internAI.NpcController.IsCameraDisabled = ___isCameraDisabled;
			internAI.NpcController.IsJumping = ___isJumping;
			internAI.NpcController.IsFallingFromJump = ___isFallingFromJump;
			internAI.NpcController.CrouchMeter = ___crouchMeter;
			internAI.NpcController.IsWalking = ___isWalking;
			internAI.NpcController.PlayerSlidingTimer = ___playerSlidingTimer;
			internAI.NpcController.DisabledJetpackControlsThisFrame = ___disabledJetpackControlsThisFrame;
			internAI.NpcController.StartedJetpackControls = ___startedJetpackControls;
			internAI.NpcController.TimeSinceTakingGravityDamage = ___timeSinceTakingGravityDamage;
			internAI.NpcController.TeleportingThisFrame = ___teleportingThisFrame;
			internAI.NpcController.PreviousFrameDeltaTime = ___previousFrameDeltaTime;
			internAI.NpcController.CameraUp = ___cameraUp;
			internAI.NpcController.UpdatePlayerLookInterval = ___updatePlayerLookInterval;
			internAI.UpdateController();
			___isCameraDisabled = internAI.NpcController.IsCameraDisabled;
			___crouchMeter = internAI.NpcController.CrouchMeter;
			___isWalking = internAI.NpcController.IsWalking;
			___playerSlidingTimer = internAI.NpcController.PlayerSlidingTimer;
			___startedJetpackControls = internAI.NpcController.StartedJetpackControls;
			___timeSinceTakingGravityDamage = internAI.NpcController.TimeSinceTakingGravityDamage;
			___teleportingThisFrame = internAI.NpcController.TeleportingThisFrame;
			___previousFrameDeltaTime = internAI.NpcController.PreviousFrameDeltaTime;
			___cameraUp = internAI.NpcController.CameraUp;
			___updatePlayerLookInterval = internAI.NpcController.UpdatePlayerLookInterval;
			return false;
		}

		[HarmonyPatch("LateUpdate")]
		[HarmonyPrefix]
		private static bool LateUpdate_PreFix(PlayerControllerB __instance, ref bool ___isWalking, ref bool ___updatePositionForNewlyJoinedClient, ref float ___updatePlayerLookInterval, int ___playerMask)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				if (internAI.NpcController == null)
				{
					return false;
				}
				internAI.NpcController.IsWalking = ___isWalking;
				internAI.NpcController.UpdatePositionForNewlyJoinedClient = ___updatePositionForNewlyJoinedClient;
				internAI.NpcController.UpdatePlayerLookInterval = ___updatePlayerLookInterval;
				internAI.NpcController.PlayerMask = ___playerMask;
				internAI.NpcController.LateUpdate();
				___isWalking = internAI.NpcController.IsWalking;
				___updatePositionForNewlyJoinedClient = internAI.NpcController.UpdatePositionForNewlyJoinedClient;
				___updatePlayerLookInterval = internAI.NpcController.UpdatePlayerLookInterval;
				return false;
			}
			return true;
		}

		[HarmonyPatch("Awake")]
		[HarmonyPrefix]
		private static bool Awake_PreFix(PlayerControllerB __instance)
		{
			NetworkManager singleton = NetworkManager.Singleton;
			if (!InternManagerProvider.IsReady && (singleton.IsHost || singleton.IsServer))
			{
				PluginLogInfoDelegate logInfo = PluginLoggerHook.LogInfo;
				if (logInfo != null)
				{
					logInfo.Invoke("Spawning InternManager networkBehaviour in PlayerControllerBPatch Awake_PreFix");
				}
				GameObject val = Object.Instantiate<GameObject>(PluginManagerProvider.Instance.InternManagerPrefab);
				val.GetComponent<NetworkObject>().Spawn(false);
			}
			if (!SaveManagerProvider.IsReady && (singleton.IsHost || singleton.IsServer))
			{
				PluginLogInfoDelegate logInfo2 = PluginLoggerHook.LogInfo;
				if (logInfo2 != null)
				{
					logInfo2.Invoke("Spawning SaveManager networkBehaviour in PlayerControllerBPatch Awake_PreFix");
				}
				GameObject val2 = Object.Instantiate<GameObject>(PluginManagerProvider.Instance.SaveManagerPrefab);
				val2.GetComponent<NetworkObject>().Spawn(false);
			}
			if (!TerminalManagerProvider.IsReady && (singleton.IsHost || singleton.IsServer))
			{
				PluginLogInfoDelegate logInfo3 = PluginLoggerHook.LogInfo;
				if (logInfo3 != null)
				{
					logInfo3.Invoke("Spawning TerminalManager networkBehaviour in PlayerControllerBPatch Awake_PreFix");
				}
				GameObject val3 = Object.Instantiate<GameObject>(PluginManagerProvider.Instance.TerminalManagerPrefab);
				val3.GetComponent<NetworkObject>().Spawn(false);
			}
			return true;
		}

		[HarmonyPatch("DamagePlayer")]
		[HarmonyPrefix]
		private static bool DamagePlayer_PreFix(PlayerControllerB __instance, int damageNumber, CauseOfDeath causeOfDeath, int deathAnimation, bool fallDamage, Vector3 force)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke($"SyncDamageIntern called from game code on LOCAL client, intern object: Intern #{internAI.NpcController.Npc.playerClientId}");
				}
				internAI.SyncDamageIntern(damageNumber, causeOfDeath, deathAnimation, fallDamage, force);
				return false;
			}
			if (DebugConst.NO_DAMAGE)
			{
				PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
				if (logDebug2 != null)
				{
					logDebug2.Invoke("Bootleg invulnerability (return false)");
				}
				return false;
			}
			return true;
		}

		[HarmonyPatch("DamagePlayerFromOtherClientServerRpc")]
		[HarmonyPrefix]
		private static bool DamagePlayerFromOtherClientServerRpc_PreFix(PlayerControllerB __instance, int damageAmount, Vector3 hitDirection, int playerWhoHit)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke($"SyncDamageInternFromOtherClient called from game code on LOCAL client, intern object: Intern #{internAI.NpcController.Npc.playerClientId}");
				}
				internAI.DamageInternFromOtherClientServerRpc(damageAmount, hitDirection, playerWhoHit);
				return false;
			}
			return true;
		}

		[HarmonyPatch("KillPlayer")]
		[HarmonyPrefix]
		private static bool KillPlayer_PreFix(PlayerControllerB __instance, Vector3 bodyVelocity, bool spawnBody, CauseOfDeath causeOfDeath, int deathAnimation, Vector3 positionOffset)
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Expected I4, but got Unknown
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke($"SyncKillIntern called from game code on LOCAL client, intern object: Intern #{internAI.NpcController.Npc.playerClientId}");
				}
				internAI.SyncKillIntern(bodyVelocity, spawnBody, causeOfDeath, deathAnimation, positionOffset);
				return false;
			}
			if (DebugConst.NO_DEATH)
			{
				PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
				if (logDebug2 != null)
				{
					logDebug2.Invoke("Bootleg invincibility");
				}
				return false;
			}
			IInternAI[] internsAiHoldByPlayer = InternManagerProvider.Instance.GetInternsAiHoldByPlayer((int)__instance.playerClientId);
			if (internsAiHoldByPlayer.Length != 0)
			{
				foreach (IInternAI val in internsAiHoldByPlayer)
				{
					switch (causeOfDeath - 2)
					{
					case 0:
					case 1:
					case 3:
					case 7:
					case 8:
					{
						PluginLogDebugDelegate logDebug3 = PluginLoggerHook.LogDebug;
						if (logDebug3 != null)
						{
							logDebug3.Invoke($"SyncKillIntern on held intern by {__instance.playerUsername} {__instance.playerClientId} on LOCAL client, Intern #{val.NpcController.Npc.playerClientId}");
						}
						val.SyncKillIntern(bodyVelocity, spawnBody, causeOfDeath, deathAnimation, positionOffset);
						break;
					}
					}
				}
			}
			return true;
		}

		[HarmonyPatch("UpdateSpecialAnimationValue")]
		[HarmonyPrefix]
		private static bool UpdateSpecialAnimationValue_PreFix(PlayerControllerB __instance, bool specialAnimation, float timed, bool climbingLadder)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				internAI.UpdateInternSpecialAnimationValue(specialAnimation, timed, climbingLadder);
				return false;
			}
			return true;
		}

		[HarmonyPatch("BeginGrabObject")]
		[HarmonyPrefix]
		private static bool BeginGrabObject_PreFix(PlayerControllerB __instance, ref Ray ___interactRay, ref RaycastHit ___hit, ref int ___interactableObjectsMask)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			___interactRay = new Ray(((Component)__instance.gameplayCamera).transform.position, ((Component)__instance.gameplayCamera).transform.forward);
			if (Physics.Raycast(___interactRay, ref ___hit, __instance.grabDistance, ___interactableObjectsMask) && ((Component)((RaycastHit)(ref ___hit)).collider).gameObject.layer != 8 && ((Component)((RaycastHit)(ref ___hit)).collider).tag == "PhysicsProp")
			{
				GrabbableObject component = ((Component)((Component)((RaycastHit)(ref ___hit)).collider).transform).gameObject.GetComponent<GrabbableObject>();
				if ((Object)(object)component == (Object)null)
				{
					return true;
				}
				if (!component.isHeld)
				{
					return true;
				}
				IInternAI internAiOwnerOfObject = InternManagerProvider.Instance.GetInternAiOwnerOfObject(component);
				if (internAiOwnerOfObject == null)
				{
					PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
					if (logDebug != null)
					{
						logDebug.Invoke("BeginGrabObject_PreFix: no intern found who hold item " + ((Object)component).name);
					}
					return true;
				}
				PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
				if (logDebug2 != null)
				{
					logDebug2.Invoke("intern " + internAiOwnerOfObject.NpcController.Npc.playerUsername + " drop item " + ((Object)component).name + " before grab by player");
				}
				component.isHeld = false;
				internAiOwnerOfObject.DropItem(component);
			}
			return true;
		}

		[HarmonyPatch("SyncBodyPositionClientRpc")]
		[HarmonyPrefix]
		private static bool SyncBodyPositionClientRpc_PreFix(PlayerControllerB __instance, Vector3 newBodyPosition)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke($"NetworkManager {((NetworkBehaviour)__instance).NetworkManager}, newBodyPosition {newBodyPosition}, this.deadBody {__instance.deadBody}");
				}
				internAI.SyncDeadBodyPositionServerRpc(newBodyPosition);
				return false;
			}
			return true;
		}

		[HarmonyPatch("PlayerHitGroundEffects")]
		[HarmonyPrefix]
		private static bool PlayerHitGroundEffects_PreFix(PlayerControllerB __instance)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				PlayerHitGroundEffects_ReversePatch(__instance);
				return false;
			}
			return true;
		}

		[HarmonyPatch("IncreaseFearLevelOverTime")]
		[HarmonyPrefix]
		private static bool IncreaseFearLevelOverTime_PreFix(PlayerControllerB __instance)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch("JumpToFearLevel")]
		[HarmonyPrefix]
		private static bool JumpToFearLevel_PreFix(PlayerControllerB __instance)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch("PerformEmote")]
		[HarmonyPrefix]
		private static bool PerformEmote_PreFix(PlayerControllerB __instance, int emoteID)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI == null)
			{
				return true;
			}
			if (!CheckConditionsForEmote_ReversePatch(__instance))
			{
				return false;
			}
			__instance.performingEmote = true;
			__instance.playerBodyAnimator.SetInteger("emoteNumber", emoteID);
			internAI.StartPerformingEmoteInternServerRpc(emoteID);
			return false;
		}

		[HarmonyPatch("StartPerformingEmoteServerRpc")]
		[HarmonyPrefix]
		private static bool StartPerformingEmoteServerRpc_PreFix(PlayerControllerB __instance)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI == null)
			{
				return true;
			}
			internAI.StartPerformingEmoteInternServerRpc(__instance.playerBodyAnimator.GetInteger("emoteNumber"));
			return false;
		}

		[HarmonyPatch("ConnectClientToPlayerObject")]
		[HarmonyPrefix]
		private static bool ConnectClientToPlayerObject_PreFix(PlayerControllerB __instance)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch("TeleportPlayer")]
		[HarmonyPrefix]
		private static bool TeleportPlayer_PreFix(PlayerControllerB __instance, Vector3 pos)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			if (!InternManagerProvider.IsReady)
			{
				return true;
			}
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				internAI.TeleportIntern(pos, (bool?)null, false);
				return false;
			}
			return true;
		}

		[HarmonyPatch("PlayFootstepServer")]
		[HarmonyPrefix]
		private static bool PlayFootstepServer_PreFix(PlayerControllerB __instance)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				internAI.NpcController.PlayFootstep(true);
				return false;
			}
			return true;
		}

		[HarmonyPatch("PlayFootstepLocal")]
		[HarmonyPrefix]
		private static bool PlayFootstepLocal_PreFix(PlayerControllerB __instance)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				internAI.NpcController.PlayFootstep(false);
				return false;
			}
			return true;
		}

		[HarmonyPatch("PlayJumpAudio")]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		public static void PlayJumpAudio_ReversePatch(object instance)
		{
			throw new NotImplementedException("Stub LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.PlayJumpAudio_ReversePatch");
		}

		[HarmonyPatch("PlayerHitGroundEffects")]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		public static void PlayerHitGroundEffects_ReversePatch(object instance)
		{
			Transpiler(null);
			static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
			{
				//IL_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0125: Expected O, but got Unknown
				int num = -1;
				List<CodeInstruction> list = new List<CodeInstruction>(instructions);
				for (int i = 0; i < list.Count - 9; i++)
				{
					if (((object)list[i]).ToString().StartsWith("ldarg.0 NULL") && ((object)list[i + 9]).ToString().StartsWith("call void GameNetcodeStuff.PlayerControllerB::LandFromJumpRpc("))
					{
						num = i;
						break;
					}
				}
				if (num > -1)
				{
					list[num + 5].opcode = OpCodes.Nop;
					list[num + 5].operand = null;
					list[num + 6].opcode = OpCodes.Nop;
					list[num + 6].operand = null;
					list[num + 7].opcode = OpCodes.Nop;
					list[num + 7].operand = null;
					list[num + 8].opcode = OpCodes.Nop;
					list[num + 8].operand = null;
					list[num + 9].operand = PatchesUtil.SyncLandFromJumpMethod;
					list.Insert(num + 1, new CodeInstruction(OpCodes.Ldfld, (object)PatchesUtil.FieldInfoPlayerClientId));
					num = -1;
				}
				else
				{
					PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
					if (logError != null)
					{
						logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.PlayerHitGroundEffects_ReversePatch could not use jump from land method for intern");
					}
				}
				return list.AsEnumerable();
			}
		}

		[HarmonyPatch("CheckConditionsForEmote")]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		public static bool CheckConditionsForEmote_ReversePatch(object instance)
		{
			throw new NotImplementedException("Stub LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.PlayerControllerBPatchCheckConditionsForEmote_ReversePatch");
		}

		[HarmonyPatch("OnDisable")]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		public static void OnDisable_ReversePatch(object instance)
		{
			throw new NotImplementedException("Stub LethalInternship.Patches.NpcPatches.OnDisable_ReversePatch");
		}

		[HarmonyPatch("InteractTriggerUseConditionsMet")]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		public static bool InteractTriggerUseConditionsMet_ReversePatch(object instance)
		{
			throw new NotImplementedException("Stub LethalInternship.Patches.NpcPatches.InteractTriggerUseConditionsMet_ReversePatch");
		}

		[HarmonyPatch("IsInSpecialAnimationClientRpc")]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		public static void IsInSpecialAnimationClientRpc_ReversePatch(object instance, bool specialAnimation, float timed, bool climbingLadder)
		{
			Transpiler(null);
			static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
			{
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0096: Expected O, but got Unknown
				int num = -1;
				List<CodeInstruction> list = new List<CodeInstruction>(instructions);
				for (int i = 0; i < list.Count - 3; i++)
				{
					if (((object)list[i]).ToString().StartsWith("call bool Unity.Netcode.NetworkBehaviour::get_IsOwner()") && ((object)list[i + 3]).ToString().StartsWith("ldstr \"Setting animation on client\""))
					{
						num = i;
						break;
					}
				}
				if (num > -1)
				{
					list.Insert(0, new CodeInstruction(OpCodes.Br, (object)list[num + 3].labels[0]));
					num = -1;
				}
				else
				{
					PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
					if (logError != null)
					{
						logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.IsInSpecialAnimationClientRpc_ReversePatch could not bypass rpc stuff");
					}
				}
				return list.AsEnumerable();
			}
		}

		[HarmonyPatch("SyncBodyPositionClientRpc")]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		public static void SyncBodyPositionClientRpc_ReversePatch(object instance, Vector3 newBodyPosition)
		{
			Transpiler(null);
			static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
			{
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: Expected O, but got Unknown
				int num = -1;
				List<CodeInstruction> list = new List<CodeInstruction>(instructions);
				for (int i = 0; i < list.Count - 6; i++)
				{
					if (((object)list[i]).ToString().StartsWith("nop NULL") && ((object)list[i + 9]).ToString().StartsWith("call static float UnityEngine.Vector3::Distance(UnityEngine.Vector3 a, UnityEngine.Vector3 b)"))
					{
						num = i;
						break;
					}
				}
				if (num > -1)
				{
					list.Insert(0, new CodeInstruction(OpCodes.Br, (object)list[num].labels[0]));
					num = -1;
				}
				else
				{
					PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
					if (logError != null)
					{
						logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.SyncBodyPositionClientRpc_ReversePatch could not bypass rpc stuff");
					}
				}
				return list.AsEnumerable();
			}
		}

		[HarmonyPatch("SetSpecialGrabAnimationBool")]
		[HarmonyReversePatch(/*Could not decode attribute arguments.*/)]
		public static void SetSpecialGrabAnimationBool_ReversePatch(object instance, bool setTrue, GrabbableObject currentItem)
		{
			throw new NotImplementedException("Stub LethalInternship.Patches.NpcPatches.SetSpecialGrabAnimationBool_ReversePatch");
		}

		[HarmonyPatch("SpectateNextPlayer")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> SpectateNextPlayer_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			int num = -1;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			if (!PluginRuntimeProvider.Context.Config.CanSpectateInterns)
			{
				for (int i = 0; i < list.Count - 2; i++)
				{
					if (((object)list[i]).ToString() == "call static StartOfRound StartOfRound::get_Instance()" && ((object)list[i + 1]).ToString() == "ldfld GameNetcodeStuff.PlayerControllerB[] StartOfRound::allPlayerScripts" && ((object)list[i + 2]).ToString() == "ldlen NULL")
					{
						num = i;
						break;
					}
				}
				if (num > -1)
				{
					list[num].opcode = OpCodes.Nop;
					list[num].operand = null;
					list[num + 1].opcode = OpCodes.Nop;
					list[num + 1].operand = null;
					list[num + 2].opcode = OpCodes.Call;
					list[num + 2].operand = PatchesUtil.IndexBeginOfInternsMethod;
					num = -1;
				}
				else
				{
					PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
					if (logError != null)
					{
						logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.SpectateNextPlayer_Transpiler could not use irl number of player for iteration.");
					}
				}
				for (int j = 0; j < list.Count - 2; j++)
				{
					if (((object)list[j]).ToString() == "call static StartOfRound StartOfRound::get_Instance()" && ((object)list[j + 1]).ToString() == "ldfld GameNetcodeStuff.PlayerControllerB[] StartOfRound::allPlayerScripts" && ((object)list[j + 2]).ToString() == "ldlen NULL")
					{
						num = j;
						break;
					}
				}
				if (num > -1)
				{
					list[num].opcode = OpCodes.Nop;
					list[num].operand = null;
					list[num + 1].opcode = OpCodes.Nop;
					list[num + 1].operand = null;
					list[num + 2].opcode = OpCodes.Call;
					list[num + 2].operand = PatchesUtil.IndexBeginOfInternsMethod;
					num = -1;
				}
				else
				{
					PluginLogErrorDelegate logError2 = PluginLoggerHook.LogError;
					if (logError2 != null)
					{
						logError2.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.SpectateNextPlayer_Transpiler could not use irl number of player.");
					}
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch("ConnectClientToPlayerObject")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> ConnectClientToPlayerObject_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			int num = -1;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count - 3; i++)
			{
				if (((object)list[i]).ToString().StartsWith("ldarg.0 NULL") && ((object)list[i + 1]).ToString() == "ldfld StartOfRound GameNetcodeStuff.PlayerControllerB::playersManager" && ((object)list[i + 2]).ToString() == "ldfld UnityEngine.GameObject[] StartOfRound::allPlayerObjects" && ((object)list[i + 3]).ToString() == "ldlen NULL")
				{
					num = i;
					break;
				}
			}
			if (num > -1)
			{
				list[num].opcode = OpCodes.Nop;
				list[num].operand = null;
				list[num + 1].opcode = OpCodes.Nop;
				list[num + 1].operand = null;
				list[num + 2].opcode = OpCodes.Nop;
				list[num + 2].operand = null;
				list[num + 3].opcode = OpCodes.Call;
				list[num + 3].operand = PatchesUtil.IndexBeginOfInternsMethod;
				num = -1;
			}
			else
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.ConnectClientToPlayerObject_Transpiler could not limit teleport to only not interns.");
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch("Interact_performed")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> Interact_performed_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Expected O, but got Unknown
			int num = -1;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count - 28; i++)
			{
				if (((object)list[i]).ToString().StartsWith("ldarg.0 NULL") && ((object)list[i + 1]).ToString() == "call bool Unity.Netcode.NetworkBehaviour::get_IsOwner()" && ((object)list[i + 28]).ToString().StartsWith("ret NULL"))
				{
					num = i;
					break;
				}
			}
			if (num > -1)
			{
				List<CodeInstruction> collection = new List<CodeInstruction>
				{
					new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsAnyMenuOpenedMethod),
					new CodeInstruction(OpCodes.Brtrue_S, (object)list[num + 28].labels[0])
				};
				list.InsertRange(num, collection);
				num = -1;
			}
			else
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.Interact_performed_Transpiler could not ignore intract input when commands opened");
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch("ItemSecondaryUse_performed")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> ItemSecondaryUse_performed_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			int num = 0;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			int num2 = -1;
			for (int i = 0; i < list.Count; i++)
			{
				if (((object)list[i]).ToString().StartsWith("ret NULL") && list[i].labels.Count > 0)
				{
					num2 = i;
					break;
				}
			}
			if (num2 < 0)
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.ItemSecondaryUse_performed could not ignore ItemSecondaryUse_performed input when commands opened");
				}
				return list.AsEnumerable();
			}
			List<CodeInstruction> collection = new List<CodeInstruction>
			{
				new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsAnyMenuOpenedMethod),
				new CodeInstruction(OpCodes.Brtrue_S, (object)list[num + num2].labels[0])
			};
			list.InsertRange(num, collection);
			return list.AsEnumerable();
		}

		[HarmonyPatch("ItemTertiaryUse_performed")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> ItemTertiaryUse_performed_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			int num = 0;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			int num2 = -1;
			for (int i = 0; i < list.Count; i++)
			{
				if (((object)list[i]).ToString().StartsWith("ret NULL") && list[i].labels.Count > 0)
				{
					num2 = i;
					break;
				}
			}
			if (num2 < 0)
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.ItemTertiaryUse_performed could not ignore ItemTertiaryUse_performed input when commands opened");
				}
				return list.AsEnumerable();
			}
			List<CodeInstruction> collection = new List<CodeInstruction>
			{
				new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsAnyMenuOpenedMethod),
				new CodeInstruction(OpCodes.Brtrue_S, (object)list[num + num2].labels[0])
			};
			list.InsertRange(num, collection);
			return list.AsEnumerable();
		}

		[HarmonyPatch("QEItemInteract_performed")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> QEItemInteract_performed_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			int num = 0;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			int num2 = -1;
			for (int i = 0; i < list.Count; i++)
			{
				if (((object)list[i]).ToString().StartsWith("ret NULL") && list[i].labels.Count > 0)
				{
					num2 = i;
					break;
				}
			}
			if (num2 < 0)
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.QEItemInteract_performed could not ignore QEItemInteract_performed input when commands opened");
				}
				return list.AsEnumerable();
			}
			List<CodeInstruction> collection = new List<CodeInstruction>
			{
				new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsAnyMenuOpenedMethod),
				new CodeInstruction(OpCodes.Brtrue_S, (object)list[num + num2].labels[0])
			};
			list.InsertRange(num, collection);
			return list.AsEnumerable();
		}

		[HarmonyPatch("InspectItem_performed")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> InspectItem_performed_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			int num = 0;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			int num2 = -1;
			for (int i = 0; i < list.Count; i++)
			{
				if (((object)list[i]).ToString().StartsWith("ret NULL") && list[i].labels.Count > 0)
				{
					num2 = i;
					break;
				}
			}
			if (num2 < 0)
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.InspectItem_performed could not ignore InspectItem_performed input when commands opened");
				}
				return list.AsEnumerable();
			}
			List<CodeInstruction> collection = new List<CodeInstruction>
			{
				new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsAnyMenuOpenedMethod),
				new CodeInstruction(OpCodes.Brtrue_S, (object)list[num + num2].labels[0])
			};
			list.InsertRange(num, collection);
			return list.AsEnumerable();
		}

		[HarmonyPatch("ScrollMouse_performed")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> ScrollMouse_performed_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			int num = 0;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			int num2 = -1;
			for (int i = 0; i < list.Count; i++)
			{
				if (((object)list[i]).ToString().StartsWith("ret NULL") && list[i].labels.Count > 0)
				{
					num2 = i;
					break;
				}
			}
			if (num2 < 0)
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.ScrollMouse_performed could not ignore ScrollMouse_performed input when commands opened");
				}
				return list.AsEnumerable();
			}
			List<CodeInstruction> collection = new List<CodeInstruction>
			{
				new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsAnyMenuOpenedMethod),
				new CodeInstruction(OpCodes.Brtrue_S, (object)list[num + num2].labels[0])
			};
			list.InsertRange(num, collection);
			return list.AsEnumerable();
		}

		[HarmonyPatch("OpenMenu_performed")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> OpenMenu_performed_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			int num = 0;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			int num2 = -1;
			for (int i = 0; i < list.Count; i++)
			{
				if (((object)list[i]).ToString().StartsWith("ret NULL") && list[i].labels.Count > 0)
				{
					num2 = i;
					break;
				}
			}
			if (num2 < 0)
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.NpcPatches.PlayerControllerBPatch.OpenMenu_performed could not ignore OpenMenu_performed input when commands opened");
				}
				return list.AsEnumerable();
			}
			List<CodeInstruction> collection = new List<CodeInstruction>
			{
				new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsAnyMenuOpenedMethod),
				new CodeInstruction(OpCodes.Brtrue_S, (object)list[num + num2].labels[0])
			};
			list.InsertRange(num, collection);
			return list.AsEnumerable();
		}

		[HarmonyPatch("Start")]
		[HarmonyAfter(new string[] { "MoreEmotes" })]
		[HarmonyPostfix]
		private static void Start_PostFix(PlayerControllerB __instance, ref Collider[] ___nearByPlayers)
		{
			___nearByPlayers = (Collider[])(object)new Collider[InternManagerProvider.Instance.AllEntitiesCount];
		}

		[HarmonyPatch("PerformEmote")]
		[HarmonyPostfix]
		private static void PerformEmote_PostFix(PlayerControllerB __instance)
		{
			//IL_006a: 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_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			if (DebugConst.SPAWN_INTERN_WITH_EMOTE && !(__instance.playerUsername != "Player #0"))
			{
				int num = -1;
				int[] identitiesToDrop = IdentityManagerProvider.Instance.GetIdentitiesToDrop();
				if (identitiesToDrop.Length != 0)
				{
					num = identitiesToDrop[0];
				}
				if (num < 0)
				{
					num = IdentityManagerProvider.Instance.GetNewIdentityToSpawn();
				}
				InternManagerProvider.Instance.SpawnThisInternServerRpc(num, new SpawnInternsParamsNetworkSerializable
				{
					enumSpawnAnimation = 0,
					SpawnPosition = ((Component)__instance).transform.position,
					YRot = ((Component)__instance).transform.eulerAngles.y,
					IsOutside = !__instance.isInsideFactory
				});
			}
		}

		[HarmonyPatch("SetHoverTipAndCurrentInteractTrigger")]
		[HarmonyPostfix]
		private static void SetHoverTipAndCurrentInteractTrigger_PostFix(ref PlayerControllerB __instance, ref Ray ___interactRay, int ___playerMask, int ___interactableObjectsMask, ref RaycastHit ___hit)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			___interactRay = new Ray(((Component)__instance.gameplayCamera).transform.position, ((Component)__instance.gameplayCamera).transform.forward);
			if (Physics.Raycast(___interactRay, ref ___hit, __instance.grabDistance, ___interactableObjectsMask) && ((Component)((RaycastHit)(ref ___hit)).collider).gameObject.layer != 8 && ((Component)((RaycastHit)(ref ___hit)).collider).gameObject.layer != 30 && ((Component)((RaycastHit)(ref ___hit)).collider).tag == "PhysicsProp")
			{
				RagdollGrabbableObject component = ((Component)((RaycastHit)(ref ___hit)).collider).gameObject.GetComponent<RagdollGrabbableObject>();
				if (!((Object)(object)component == (Object)null) && component.bodyID == Const.INIT_RAGDOLL_ID)
				{
					((TMP_Text)__instance.cursorTip).text = string.Empty;
					((Behaviour)__instance.cursorIcon).enabled = false;
				}
			}
		}
	}
	public class PlayerControllerBUtils
	{
		public static void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			PlayerControllerBHook.PlayerHitGroundEffects_ReversePatch = new PlayerHitGroundEffects_ReversePatchDelegate(PlayerControllerBPatch.PlayerHitGroundEffects_ReversePatch);
			PlayerControllerBHook.PlayJumpAudio_ReversePatch = new PlayJumpAudio_ReversePatchDelegate(PlayerControllerBPatch.PlayJumpAudio_ReversePatch);
			PlayerControllerBHook.SyncBodyPositionClientRpc_ReversePatch = new SyncBodyPositionClientRpc_ReversePatchDelegate(PlayerControllerBPatch.SyncBodyPositionClientRpc_ReversePatch);
			PlayerControllerBHook.SetSpecialGrabAnimationBool_ReversePatch = new SetSpecialGrabAnimationBool_ReversePatchDelegate(PlayerControllerBPatch.SetSpecialGrabAnimationBool_ReversePatch);
			PlayerControllerBHook.IsInSpecialAnimationClientRpc_ReversePatch = new IsInSpecialAnimationClientRpc_ReversePatchDelegate(PlayerControllerBPatch.IsInSpecialAnimationClientRpc_ReversePatch);
			PlayerControllerBHook.OnDisable_ReversePatch = new OnDisable_ReversePatchDelegate(PlayerControllerBPatch.OnDisable_ReversePatch);
			PlayerControllerBHook.InteractTriggerUseConditionsMet_ReversePatch = new InteractTriggerUseConditionsMet_ReversePatchDelegate(PlayerControllerBPatch.InteractTriggerUseConditionsMet_ReversePatch);
		}
	}
}
namespace LethalInternship.Patches.ModPatches.Zaprillator
{
	public class RevivablePlayerPatch
	{
		public static bool StopShockingWithGun_Prefix(RagdollGrabbableObject ____ragdoll, ref bool ____bodyShocked, ref GrabbableObject ____shockedBy, float ____batteryLevel)
		{
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)____ragdoll == (Object)null)
			{
				return true;
			}
			if (!____bodyShocked)
			{
				return false;
			}
			if ((Object)(object)____shockedBy == (Object)null || !((NetworkBehaviour)____shockedBy).IsOwner)
			{
				return false;
			}
			string headerText = ((Component)____ragdoll.ragdoll).gameObject.GetComponentInChildren<ScanNodeProperties>().headerText;
			IInternIdentity val = IdentityManagerProvider.Instance.FindIdentityFromBodyName(headerText);
			if (val == null)
			{
				return true;
			}
			if (val.Alive)
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("Zaprillator with LethalInternship: error when trying to revive intern \"" + val.Name + "\", intern is already alive! do nothing more");
				}
				return false;
			}
			____bodyShocked = false;
			RoundManager.Instance.FlickerLights(false, false);
			int hp = InternManagerProvider.Instance.MaxHealthPercent(Mathf.RoundToInt(____batteryLevel * 100f), val.HpMax);
			____shockedBy.UseUpBatteries();
			____shockedBy.SyncBatteryServerRpc(0);
			____shockedBy = null;
			InternManagerProvider.Instance.SpawnThisInternServerRpc(val.IdIdentity, new SpawnInternsParamsNetworkSerializable
			{
				ShouldDestroyDeadBody = true,
				Hp = hp,
				enumSpawnAnimation = 1,
				SpawnPosition = ((Component)____ragdoll.ragdoll).transform.position,
				YRot = 0f,
				IsOutside = !GameNetworkManager.Instance.localPlayerController.isInsideFactory
			});
			return false;
		}
	}
}
namespace LethalInternship.Patches.ModPatches.UsualScrap
{
	public class DefibrillatorScriptPatch
	{
		public static readonly FieldInfo FieldUsesLimited = AccessTools.Field(AccessTools.TypeByName("UsualScrap.Behaviors.DefibrillatorScript"), "UsesLimited");

		public static readonly FieldInfo FieldUseLimit = AccessTools.Field(AccessTools.TypeByName("UsualScrap.Behaviors.DefibrillatorScript"), "UseLimit");

		public static readonly FieldInfo FieldDisplayRenderers = AccessTools.Field(AccessTools.TypeByName("UsualScrap.Behaviors.DefibrillatorScript"), "displayRenderers");

		public static bool RevivePlayer_Prefix(GrabbableObject __instance, int PlayerID, Vector3 SpawnPosition)
		{
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
			if (logDebug != null)
			{
				logDebug.Invoke($"attempt to revive id {PlayerID}");
			}
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI(PlayerID);
			if (internAI == null)
			{
				return true;
			}
			if (!InternManagerProvider.Instance.IsServer)
			{
				return false;
			}
			IInternIdentity internIdentity = internAI.InternIdentity;
			if (internIdentity == null || internIdentity.Alive)
			{
				return false;
			}
			PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
			if (logDebug2 != null)
			{
				logDebug2.Invoke("Reviving intern " + internIdentity.Name);
			}
			InternManagerProvider.Instance.SpawnThisInternServerRpc(internIdentity.IdIdentity, new SpawnInternsParamsNetworkSerializable
			{
				ShouldDestroyDeadBody = true,
				enumSpawnAnimation = 1,
				SpawnPosition = SpawnPosition,
				YRot = ((Component)internAI.NpcContro

plugins/Szumi57-LethalInternship/LethalInternship.SharedAbstractions.dll

Decompiled 3 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using GameNetcodeStuff;
using LethalInternship.SharedAbstractions.Adapters;
using LethalInternship.SharedAbstractions.CommandsSystem;
using LethalInternship.SharedAbstractions.Configs;
using LethalInternship.SharedAbstractions.Enums;
using LethalInternship.SharedAbstractions.Hooks.PluginLoggerHooks;
using LethalInternship.SharedAbstractions.Inputs;
using LethalInternship.SharedAbstractions.Interns;
using LethalInternship.SharedAbstractions.Managers;
using LethalInternship.SharedAbstractions.NetworkSerializers;
using LethalInternship.SharedAbstractions.Parameters;
using LethalInternship.SharedAbstractions.Pools;
using Microsoft.CodeAnalysis;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalInternship.SharedAbstractions")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LethalInternship.SharedAbstractions")]
[assembly: AssemblyTitle("LethalInternship.SharedAbstractions")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace LethalInternship.SharedAbstractions.UI
{
	public interface IIconUI
	{
		int Key { get; }

		void SetIconActive(bool active);
	}
	public interface IIconUIInfos
	{
		EnumIconImagesTypes IconImagesTypes { get; }

		int GetUIKey();
	}
}
namespace LethalInternship.SharedAbstractions.Pools
{
	public interface IObjectPool
	{
		int Created { get; }

		int Available { get; }

		Type ObjectType { get; }
	}
	public interface IPoolManager
	{
		T Get<T>() where T : class, new();

		void Return<T>(T obj) where T : class, new();

		void LogStats();
	}
}
namespace LethalInternship.SharedAbstractions.PluginRuntimeProvider
{
	public interface IPluginRuntimeContext
	{
		string Plugin_Guid { get; }

		string Plugin_Version { get; }

		string Plugin_Name { get; }

		string ConfigPath { get; }

		string VoicesPath { get; }

		EnemyType InternNPCPrefab { get; }

		int PreparedIrlPlayersCount { get; set; }

		int PreparedInternCount { get; set; }

		int PluginIrlPlayersCount { get; set; }

		int AllEntitiesCount { get; set; }

		GameObject[] InternObjects { get; set; }

		uint NextInternNetworkObjectHash { get; set; }

		uint[][] InternNetworkObjectHashes { get; set; }

		bool UIAssetsLoaded { get; }

		AudioClip[] DefaultVoicesClips { get; }

		GameObject CommandsAll { get; }

		GameObject CommandsOne { get; }

		GameObject TooltipBar { get; }

		GameObject WorldIconPrefab { get; }

		GameObject InputIconPrefab { get; }

		string DirectoryName { get; }

		IConfig Config { get; }

		ILethalInternshipInputs InputActionsInstance { get; }

		bool IsModTooManyEmotesLoaded { get; }

		bool IsModModelReplacementAPILoaded { get; }

		bool IsModCustomItemBehaviourLibraryLoaded { get; }

		bool IsModMoreCompanyLoaded { get; }

		bool IsModReviveCompanyLoaded { get; }

		bool IsModBunkbedReviveLoaded { get; }

		bool IsModLethalMinLoaded { get; }

		bool IsModMipaLoaded { get; }

		bool IsModMonoProfilerLoaderLoaded { get; }
	}
	public static class PluginRuntimeProvider
	{
		private static IPluginRuntimeContext context;

		public static IPluginRuntimeContext Context
		{
			get
			{
				if (context == null)
				{
					PluginLoggerHook.LogError?.Invoke("PluginRuntimeContext not initialized !");
					return null;
				}
				return context;
			}
			set
			{
				context = value;
			}
		}
	}
}
namespace LethalInternship.SharedAbstractions.Parameters
{
	public readonly struct InstructionParameters
	{
		public readonly int groupId;

		public readonly Vector3 start;

		public readonly Vector3 target;

		public readonly IDJKPoint startDJKPoint;

		public readonly IDJKPoint targetDJKPoint;

		public readonly NeighborResult resultCallback;

		public InstructionParameters(int groupId, Vector3 start, Vector3 target, IDJKPoint startDJKPoint, IDJKPoint targetDJKPoint, NeighborResult resultCallback)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			this.groupId = groupId;
			this.start = start;
			this.target = target;
			this.startDJKPoint = startDJKPoint;
			this.targetDJKPoint = targetDJKPoint;
			this.resultCallback = resultCallback;
		}
	}
	public struct PlayVoiceParameters
	{
		public bool CanTalkIfOtherInternTalk { get; set; }

		public bool WaitForCooldown { get; set; }

		public bool CutCurrentVoiceStateToTalk { get; set; }

		public bool CanRepeatVoiceState { get; set; }

		public EnumVoicesState VoiceState { get; set; }

		public bool ShouldSync { get; set; }

		public bool IsInternInside { get; set; }

		public bool AllowSwearing { get; set; }
	}
}
namespace LethalInternship.SharedAbstractions.NetworkSerializers
{
	[Serializable]
	public struct ConfigIdentity : INetworkSerializable
	{
		public string name;

		public int suitID;

		public int suitConfigOption;

		public string voiceFolder;

		public float volume;

		public float voicePitch;

		public bool autoDefenseMode;

		public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			serializer.SerializeValue(ref name, false);
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref suitID, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref suitConfigOption, default(ForPrimitives));
			serializer.SerializeValue(ref voiceFolder, false);
			((BufferSerializer<float>*)(&serializer))->SerializeValue<float>(ref volume, default(ForPrimitives));
			((BufferSerializer<float>*)(&serializer))->SerializeValue<float>(ref voicePitch, default(ForPrimitives));
			((BufferSerializer<bool>*)(&serializer))->SerializeValue<bool>(ref autoDefenseMode, default(ForPrimitives));
		}

		public override string ToString()
		{
			return $"name: {name}, suitID {suitID}, suitConfigOption {suitConfigOption} {(EnumOptionSuitConfig)suitConfigOption}, voiceFolder {voiceFolder}, volume {volume}, voicePitch {voicePitch}, autoDefense {autoDefenseMode}";
		}
	}
	[Serializable]
	public struct ConfigIdentities
	{
		public ConfigIdentity[] configIdentities;
	}
	public struct ConfigIdentitiesNetworkSerializable : INetworkSerializable
	{
		public ConfigIdentity[] ConfigIdentities;

		public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			((BufferSerializer<ConfigIdentity>*)(&serializer))->SerializeValue<ConfigIdentity>(ref ConfigIdentities, default(ForNetworkSerializable));
		}
	}
	public struct DropItemNetworkSerializable : INetworkSerializable
	{
		public NetworkObjectReference GrabbedObject;

		public bool DroppedInElevator;

		public bool DroppedInShipRoom;

		public Vector3 TargetFloorPosition;

		public int FloorYRot;

		public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			((BufferSerializer<NetworkObjectReference>*)(&serializer))->SerializeValue<NetworkObjectReference>(ref GrabbedObject, default(ForNetworkSerializable));
			((BufferSerializer<bool>*)(&serializer))->SerializeValue<bool>(ref DroppedInElevator, default(ForPrimitives));
			((BufferSerializer<bool>*)(&serializer))->SerializeValue<bool>(ref DroppedInShipRoom, default(ForPrimitives));
			serializer.SerializeValue(ref TargetFloorPosition);
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref FloorYRot, default(ForPrimitives));
		}
	}
	public struct PlaceItemNetworkSerializable : INetworkSerializable
	{
		public NetworkObjectReference GrabbedObject;

		public NetworkObjectReference ParentObject;

		public Vector3 PlacePositionOffset;

		public bool MatchRotationOfParent;

		public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			((BufferSerializer<NetworkObjectReference>*)(&serializer))->SerializeValue<NetworkObjectReference>(ref GrabbedObject, default(ForNetworkSerializable));
			((BufferSerializer<NetworkObjectReference>*)(&serializer))->SerializeValue<NetworkObjectReference>(ref ParentObject, default(ForNetworkSerializable));
			serializer.SerializeValue(ref PlacePositionOffset);
			((BufferSerializer<bool>*)(&serializer))->SerializeValue<bool>(ref MatchRotationOfParent, default(ForPrimitives));
		}
	}
	public struct SaveNetworkSerializable : INetworkSerializable
	{
		public bool LandingAllowed;

		public IdentitySaveFileNetworkSerializable[] Identities;

		public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			((BufferSerializer<bool>*)(&serializer))->SerializeValue<bool>(ref LandingAllowed, default(ForPrimitives));
			((BufferSerializer<IdentitySaveFileNetworkSerializable>*)(&serializer))->SerializeValue<IdentitySaveFileNetworkSerializable>(ref Identities, default(ForNetworkSerializable));
		}
	}
	public struct IdentitySaveFileNetworkSerializable : INetworkSerializable
	{
		public int IdIdentity;

		public int SuitID;

		public int Hp;

		public int Status;

		public int[] ItemIDs;

		public bool AutoDefense;

		public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref IdIdentity, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref SuitID, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref Hp, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref Status, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref ItemIDs, default(ForPrimitives));
			((BufferSerializer<bool>*)(&serializer))->SerializeValue<bool>(ref AutoDefense, default(ForPrimitives));
		}
	}
	public struct SpawnInternsParamsNetworkSerializable : INetworkSerializable
	{
		public int IndexNextIntern;

		public int IndexNextPlayerObject;

		public int InternIdentityID;

		public int Hp;

		public int SuitID;

		public int enumSpawnAnimation;

		public Vector3 SpawnPosition;

		public float YRot;

		public bool IsOutside;

		public bool ShouldDestroyDeadBody;

		public unsafe void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref IndexNextIntern, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref IndexNextPlayerObject, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref InternIdentityID, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref Hp, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref SuitID, default(ForPrimitives));
			((BufferSerializer<int>*)(&serializer))->SerializeValue<int>(ref enumSpawnAnimation, default(ForPrimitives));
			serializer.SerializeValue(ref SpawnPosition);
			((BufferSerializer<float>*)(&serializer))->SerializeValue<float>(ref YRot, default(ForPrimitives));
			((BufferSerializer<bool>*)(&serializer))->SerializeValue<bool>(ref IsOutside, default(ForPrimitives));
			((BufferSerializer<bool>*)(&serializer))->SerializeValue<bool>(ref ShouldDestroyDeadBody, default(ForPrimitives));
		}
	}
}
namespace LethalInternship.SharedAbstractions.Managers
{
	public interface IIdentityManager
	{
		int GetNewIdentityToSpawn();

		int[] GetIdentitiesIDsSpawned();

		List<IInternIdentity> GetIdentitiesSpawned();

		int[] GetIdentitiesToDrop();

		IInternIdentity? FindIdentityFromBodyName(string bodyName);

		bool IsIdentityValidToCommand(IInternIdentity identity);

		bool IsIdentityCloseEnoughToCommand(IInternIdentity identity);
	}
	public interface IInputManager
	{
		TargetedAbility? CurrentTargetedAbility { get; }

		TargetedAbility? PreviousTargetedAbility { get; }

		bool IsUsingController { get; }

		bool IsManualEmoteToIgnore { get; }

		string GetKeyAction(InputAction inputAction);
	}
	public interface IInternManager
	{
		GameObject ManagerGameObject { get; }

		int IndexBeginOfInterns { get; }

		int AllEntitiesCount { get; }

		Vector3 ItemDropShipPos { get; set; }

		List<int> HeldInternsLocalPlayer { get; set; }

		bool IsServer { get; }

		Dictionary<EnemyAI, INoiseListener> DictEnemyAINoiseListeners { get; }

		List<IBodyReplacementBase> ListBodyReplacementOnDeadBodies { get; set; }

		Transform? ShipTransform { get; }

		VehicleController? VehicleController { get; }

		void Init();

		void DestroyMonoManagers();

		IInternAI? GetInternAI(int playerClientId);

		IInternAI? GetInternAIByInternId(int internId);

		void ManagePoolOfInterns();

		void SyncEndOfRoundInterns();

		bool IsPlayerIntern(PlayerControllerB player);

		bool IsIdPlayerIntern(int id);

		bool IsIdPlayerInternOwnerLocal(int idPlayer);

		bool AreInternsScheduledToLand();

		bool IsPlayerLocalOrInternOwnerLocal(PlayerControllerB player);

		bool IsColliderFromLocalOrInternOwnerLocal(Collider collider);

		bool IsPlayerInternOwnerLocal(PlayerControllerB player);

		bool IsPlayerInternControlledAndOwner(PlayerControllerB player);

		bool IsAnInternAiOwnerOfObject(GrabbableObject grabbableObject);

		int GetDamageFromSlimeIfIntern(PlayerControllerB player);

		IInternAI? GetInternAIIfLocalIsOwner(int index);

		void GetAliveAndSpawnInternsAI(List<IInternAI> result);

		IInternAI[] GetInternsAIOwnedByLocal();

		void GetAliveAndSpawnInternsAIOwnedByLocal(List<IInternAI> result);

		IInternAI? GetInternAiOwnerOfObject(GrabbableObject grabbableObject);

		IInternAI[] GetInternsAiHoldByPlayer(int idPlayerHolder);

		void ExecuteOrder(Order order);

		int GetMaxDistanceCommand();

		void GlobalCommandServerRpc(EnumInputAction enumInputAction);

		void SyncLoadedJsonIdentitiesServerRpc(ulong clientId);

		void SetInternsInElevatorLateUpdate(float deltaTime);

		void UpdateAllInternsVoiceEffects();

		void ResetIdentities();

		void SpawnInternsFromDropShip(Transform[] spawnPositions);

		void TeleportOutInterns(ShipTeleporter teleporter, Random shipTeleporterSeed);

		void VehicleHasLanded();

		void SpawnThisInternServerRpc(int identityID, SpawnInternsParamsNetworkSerializable spawnInternsParamsNetworkSerializable);

		void SyncGroupCreditsForNotOwnerTerminalServerRpc(int newGroupCredits, int numItemsInShip);

		void UpdateReviveCountServerRpc(int id);

		IInternCullingBodyInfo? GetInternCullingBodyInfo(GameObject gameObject);

		void HideShowRagdollModel(PlayerControllerB internController, bool show);

		void UpdateReviveCompanyRemainingRevivesServerRpc(string identityName);

		int MaxHealthPercent(int percentage, int maxHealth);

		bool DidAnInternJustTalkedClose(int idInternTryingToTalk);

		void PlayAudibleNoiseForIntern(int internID, Vector3 noisePosition, float noiseRange = 10f, float noiseLoudness = 0.5f, int noiseID = 0);

		void HideShowInternControllerModel(GameObject internObject, bool show);

		bool ShouldShovelIgnoreIntern(Shovel shovel, Transform transform);

		List<GrabbableObject> LookingForItemsToGrabInMap(List<GrabbableObject> items, bool forcePickUp = false);

		bool IsGrabbableObjectGrabbable(GrabbableObject grabbableObject, bool forcePickUp = false);

		bool IsGrabbableObjectBlackListed(GameObject gameObjectToEvaluate);

		bool IsItemUsableWeapon(GrabbableObject grabbableObject);

		bool IsItemUsableItem(GrabbableObject grabbableObject);

		List<EnemyAI> GetEnemiesList();

		bool IsEnemyKillable(EnemyAI enemy);

		bool ShouldIgnoreInternsEndScreen(PlayerControllerB player);

		void GetListOfAvailableSuitIDs(List<int> indexesSpawnedSuits);

		bool IsCurrentMoonCompanyMoon();
	}
	public interface IPluginManager
	{
		GameObject SaveManagerPrefab { get; }

		GameObject InternManagerPrefab { get; }

		GameObject TerminalManagerPrefab { get; }
	}
	public interface ISaveManager
	{
		GameObject ManagerGameObject { get; }

		void SavePluginInfos();

		void SyncCurrentValuesServerRpc(ulong clientId);
	}
	public interface ITerminalManager
	{
		GameObject ManagerGameObject { get; }

		Terminal GetTerminal();

		void AddTextToHelpTerminalNode(TerminalNodesList terminalNodesList);

		TerminalNode? ParseLethalInternshipCommands(string command, ref Terminal terminal);

		EnumTerminalStates GetTerminalPage();

		void ResetTerminalParser();

		EnumErrorTypeTerminalPage BroadcastRecallInterns();
	}
	public interface IUIManager
	{
		bool IsCommandsAllOpen { get; }

		bool IsCommandsOneOpen { get; }

		bool IsAnyMenuOpen { get; }

		bool IsAnyCommandsMenuOpenOrWasOpen { get; }

		GameObject? LastSelectedUI { get; }

		TMP_FontAsset FontToUse { get; }

		void ShowCommandsAll();

		void HideCommandsAll(bool resetCameraFocus = true);

		void HideAll();

		void InitUI(Transform HUDContainerParent);

		void UpdateLastSelectedUI(GameObject? gameObject);
	}
}
namespace LethalInternship.SharedAbstractions.ManagerProviders
{
	public static class IdentityManagerProvider
	{
		private static IIdentityManager? instance;

		public static bool IsReady => instance != null;

		public static IIdentityManager Instance
		{
			get
			{
				if (instance == null)
				{
					throw new InvalidOperationException("IdentityManager not available yet");
				}
				return instance;
			}
		}

		public static void Register(IIdentityManager manager)
		{
			instance = manager;
		}

		public static void Unregister(IIdentityManager manager)
		{
			if (instance == manager)
			{
				instance = null;
			}
		}
	}
	public class InputManagerProvider
	{
		private static IInputManager? instance;

		public static bool IsReady => instance != null;

		public static IInputManager Instance
		{
			get
			{
				if (instance == null)
				{
					throw new InvalidOperationException("InputManager not available yet");
				}
				return instance;
			}
		}

		public static void Register(IInputManager manager)
		{
			instance = manager;
		}

		public static void Unregister(IInputManager manager)
		{
			if (instance == manager)
			{
				instance = null;
			}
		}
	}
	public static class InternManagerProvider
	{
		private static IInternManager? instance;

		public static bool IsReady => instance != null;

		public static IInternManager Instance
		{
			get
			{
				if (instance == null)
				{
					throw new InvalidOperationException("InternManager not available yet");
				}
				return instance;
			}
		}

		public static void Register(IInternManager manager)
		{
			instance = manager;
		}

		public static void Unregister(IInternManager manager)
		{
			if (instance == manager)
			{
				instance = null;
			}
		}

		public static void ForceClear()
		{
			instance = null;
		}
	}
	public class PluginManagerProvider
	{
		private static IPluginManager? instance;

		public static bool IsReady => instance != null;

		public static IPluginManager Instance
		{
			get
			{
				if (instance == null)
				{
					throw new InvalidOperationException("PluginManager not available yet");
				}
				return instance;
			}
		}

		public static void Register(IPluginManager manager)
		{
			instance = manager;
		}

		public static void Unregister(IPluginManager manager)
		{
			if (instance == manager)
			{
				instance = null;
			}
		}
	}
	public class SaveManagerProvider
	{
		private static ISaveManager? instance;

		public static bool IsReady => instance != null;

		public static ISaveManager Instance
		{
			get
			{
				if (instance == null)
				{
					throw new InvalidOperationException("SaveManager not available yet");
				}
				return instance;
			}
		}

		public static void Register(ISaveManager manager)
		{
			instance = manager;
		}

		public static void Unregister(ISaveManager manager)
		{
			if (instance == manager)
			{
				instance = null;
			}
		}

		public static void ForceClear()
		{
			instance = null;
		}
	}
	public class TerminalManagerProvider
	{
		private static ITerminalManager? instance;

		public static bool IsReady => instance != null;

		public static ITerminalManager Instance
		{
			get
			{
				if (instance == null)
				{
					throw new InvalidOperationException("TerminalManager not available yet");
				}
				return instance;
			}
		}

		public static void Register(ITerminalManager manager)
		{
			instance = manager;
		}

		public static void Unregister(ITerminalManager manager)
		{
			if (instance == manager)
			{
				instance = null;
			}
		}

		public static void ForceClear()
		{
			instance = null;
		}
	}
	public class UIManagerProvider
	{
		private static IUIManager? instance;

		public static bool IsReady => instance != null;

		public static IUIManager Instance
		{
			get
			{
				if (instance == null)
				{
					throw new InvalidOperationException("UIManager not available yet");
				}
				return instance;
			}
		}

		public static void Register(IUIManager manager)
		{
			instance = manager;
		}

		public static void Unregister(IUIManager manager)
		{
			if (instance == manager)
			{
				instance = null;
			}
		}
	}
}
namespace LethalInternship.SharedAbstractions.Interns
{
	public struct DJKNeighbor
	{
		public int ToId;

		public Vector3 Pos;

		public float Cost;

		public DJKNeighbor(int toId, Vector3 pos, float cost)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			ToId = toId;
			Pos = pos;
			Cost = cost;
		}
	}
	public interface IDJKNodeSource
	{
		int NodeCount { get; }

		IEnumerable<DJKNeighbor> GetNeighbors(int nodeId);
	}
	public interface IDJKPoint
	{
		int Id { get; set; }

		IEnumerable<Vector3> GetAllPoints();

		Vector3 GetClosestPointTo(Vector3 point);

		IEnumerable<Vector3> GetNearbyPoints(Vector3 point);

		IInstruction GenerateInstruction(int idBatch, InstructionParameters instructionToProcess);

		new string ToString();

		IDJKPoint Clone(IPoolManager pool);

		void ReturnToPool(IPoolManager pool);
	}
	public delegate void NeighborResult(int fromId, int toId, Vector3 start, Vector3 target, float distance);
	public interface IInstruction
	{
		int IdBatch { get; }

		int GroupId { get; }

		void Initialize(int idBatch, int groupId, Vector3 start, Vector3 target, IDJKPoint startDJKPoint, IDJKPoint targetDJKPoint, float samplePosDist, int fromId, int toId, NeighborResult resultCallback);

		void Execute();

		void ReleaseInPool();
	}
	public interface IInterestPoint
	{
		Vector3 Point { get; }

		EnumCommandTypes? CommandType { get; }

		bool IsInvalid { get; }

		bool IsCompatibleWith(IInterestPoint other);
	}
	public interface IInterestPointRenderer<in T> where T : IInterestPoint
	{
		EnumIconImagesTypes GetIconImagesTypes(T interestPoint);

		Vector3 GetUIPos(T interestPoint);
	}
	public interface IInterestPointRendererWrapper
	{
		EnumIconImagesTypes GetIconImagesTypes(IInterestPoint interestPoint);

		Vector3 GetUIPos(IInterestPoint interestPoint);
	}
	public interface IInternAI
	{
		INpcController NpcController { get; }

		PlayerControllerB Npc { get; }

		IInternIdentity InternIdentity { get; set; }

		IRagdollInternBody RagdollInternBody { get; set; }

		bool AnimationCoroutineRagdollingRunning { get; }

		List<IBodyReplacementBase> ListModelReplacement { get; }

		GameObject GameObject { get; }

		ulong OwnerClientId { get; }

		bool IsOwner { get; }

		NetworkObject NetworkObject { get; }

		Transform Transform { get; }

		bool IsSpawned { get; }

		bool IsEnemyDead { get; }

		EnumCommandTypes PendingCommand { get; }

		EnumCommandTypes CurrentCommand { get; }

		EnumTempCommandFeedback TempCommandFeedback { get; }

		Action<IInternAI>? OnInternDead { get; set; }

		Action<IInternAI>? OnOwnerChanged { get; set; }

		Action<IInternAI>? OnHeldItemsChanged { get; set; }

		IPointOfInterest? GetPointOfInterest();

		void AssignOrder(Order order);

		void SetCommandToFollowPlayer(bool playVoice = true);

		void SetCommandToScavengingToShip();

		void SetCommandToScavengingToCruiser();

		void SetCommandToScavengingToGatheringPoint();

		void SetCommandToFetchItem(GrabbableObject itemToFetch);

		void SetCommandTo(IPointOfInterest pointOfInterest, bool playVoice = true);

		void SetCommandToAttackEnemy(EnemyAI enemy);

		void SetCommandToDropToShip();

		void SetCommandToDropToGatheringPoint();

		void SetCommandToDropToCruiser();

		void SetCommandToUnloadFromCruiser();

		void SetCommandToUnloadFromGatheringPoint();

		void SetCommandToWaitForCommand(bool wait);

		void SetCommandFeedback(EnumTempCommandFeedback commandFeedback);

		void OnCollisionWithCruiser();

		void AdaptController(PlayerControllerB playerControllerB);

		void UpdateController();

		void SyncJump();

		void SyncLandFromJump(bool fallHard);

		void DropItem(GrabbableObject itemToDrop);

		GrabbableObject? ChooseFirstPickedUpItem(EnumOptionsGetItems options);

		GrabbableObject? ChooseLastPickedUpItem(EnumOptionsGetItems options);

		void DropTwoHandItem();

		void DropAllItems(EnumOptionsGetItems dropOptions, bool waitBetweenItems = true);

		void StopSinkingState();

		void SyncDamageIntern(int damageNumber, CauseOfDeath causeOfDeath = (CauseOfDeath)0, int deathAnimation = 0, bool fallDamage = false, Vector3 force = default(Vector3));

		void DamageInternFromOtherClientServerRpc(int damageAmount, Vector3 hitDirection, int playerWhoHit);

		void SyncKillIntern(Vector3 bodyVelocity, bool spawnBody = true, CauseOfDeath causeOfDeath = (CauseOfDeath)0, int deathAnimation = 0, Vector3 positionOffset = default(Vector3));

		void UpdateInternSpecialAnimationValue(bool specialAnimation, float timed, bool climbingLadder);

		void SyncDeadBodyPositionServerRpc(Vector3 newBodyPosition);

		void StartPerformingEmoteInternServerRpc(int emoteID);

		void TeleportIntern(Vector3 pos, bool? setOutside = null, bool isUsingEntrance = false);

		bool IsSpawningAnimationRunning();

		bool AreHandsFree();

		bool AreFreeSlotsAvailable();

		bool CanHoldItem(GrabbableObject grabbableObject);

		bool IsHoldingItem(GrabbableObject grabbableObject);

		void UpdateItemOffsetsWhileHeld();

		bool IsHoldingTwoHandedItem();

		void UpdateItemRotation(GrabbableObject grabbableObject);

		void BeginSwapWeaponWith(GrabbableObject newWeapon);

		void UseItem(GrabbableObject item);

		bool IsClientOwnerOfIntern();

		void SyncStopPerformingEmote();

		void SyncChangeSinkingState(bool startSinking, float sinkingSpeed = 0f, int audioClipIndex = 0);

		void SyncDisableJetpackMode();

		void UpdateInternAnimationServerRpc(int animationState, float animationSpeed);

		void SyncUpdateInternRotationAndLook(string stateIndicator, Vector3 direction, int intEnumObjectsLookingAt, Vector3 playerEyeToLookAt, Vector3 positionToLookAt);

		void SyncUpdateInternPosition(Vector3 newPos, bool inElevator, bool inShipRoom, bool exhausted, bool isPlayerGrounded);

		void SyncSetFaceUnderwaterServerRpc(bool isUnderwater);

		string GetSizedBillboardStateIndicator();

		void HealthRegen();

		void PerformTooManyEmoteInternServerRpc(int tooManyEmoteID);

		void StopPerformTooManyEmoteInternServerRpc();

		void HideShowLevelStickerBetaBadge(bool show);

		void ChangeSuitInternServerRpc(ulong idInternController, int suitID);

		void SyncReleaseIntern(PlayerControllerB playerGrabberController);

		void SyncAssignTargetAndSetMovingTo(PlayerControllerB newTarget);

		void GrabInternServerRpc(ulong idPlayerGrabberController);

		List<GrabbableObject> GetHeldGrabbableObjects();

		GrabbableObject? GetHeldWeapon();

		GrabbableObject? GetCurrentlyHeldItem();

		int GetNbHeldItems();

		void GrabItemServerRpc(NetworkObjectReference networkObjectReference);

		void GrabItem(GrabbableObject grabbableObject);

		void GiveItemToInternServerRpc(ulong playerClientIdGiver, NetworkObjectReference networkObjectReference);

		void PlayAudioServerRpc(string clipName, int enumTalkativeness);

		void HitTargetWithShovel(Shovel shovel);

		void HitTargetWithKnife(KnifeItem knife);

		void SetAutoDefenseModeServerRpc(bool autoDefense);

		Vector3 GetBillBoardPosition(GameObject bodyModel);

		float GetAngleFOVWithLocalPlayer(Transform localPlayerCameraTransform, Vector3 internBodyPos);

		float GetClosestPlayerDistance();

		void SyncWatchingThreatGiantKiwiServerRpc(NetworkObjectReference giantKiwiNOR);

		void SyncAttackingThreatGiantKiwiServerRpc(NetworkObjectReference giantKiwiNOR);

		void SyncSetTargetToThreatServerRpc(NetworkObjectReference radMechNOR, Vector3 lastSeenPos);
	}
	public interface IInternCullingBodyInfo
	{
		Component InternBody { get; set; }

		EnumBodyTypeCulling EnumBodyTypeCulling { get; set; }

		bool BodyInFOV { get; set; }

		bool HasModelReplacement { get; set; }

		int? RankDistanceAnyModel { get; set; }

		int? RankDistanceNoModelReplacement { get; set; }

		int? RankDistanceWithModelReplacement { get; set; }

		int? RankDistanceAnyModelInFOV { get; set; }

		int? RankDistanceNoModelReplacementInFOV { get; set; }

		int? RankDistanceWithModelReplacementInFOV { get; set; }

		float TimerRagdollUpdateModelReplacement { get; set; }

		void Init(bool hasModelReplacement);

		void ResetBodyInfos();

		bool IsRankDistanceAnyModelInFOVValid(int rankDistanceMax);

		float GetSqrDistanceWithLocalPlayer();

		bool CheckIsInFOV();
	}
	public interface IInternIdentity
	{
		IInternAI? InternAI { get; set; }

		int IdIdentity { get; }

		string Name { get; }

		int Hp { get; set; }

		int HpMax { get; set; }

		int? SuitID { get; set; }

		DeadBodyInfo? DeadBody { get; set; }

		EnumStatusIdentity Status { get; set; }

		IInternVoice Voice { get; }

		object? BodyReplacementBase { get; set; }

		bool Alive { get; }

		int[] ItemsInInventory { get; }

		Action<IInternIdentity>? OnAutoDefenseChanged { get; set; }

		Action<IInternIdentity>? OnCommandChanged { get; set; }

		bool AutoDefense { get; }

		int GetPreviousSuitID();

		int GetNextSuitID();

		int GetRandomSuitID();

		void UpdateIdentity(int Hp, int? suitID, EnumStatusIdentity enumStatusIdentity, int[]? itemsInInventory, bool autoDefense);

		void UpdateItemsInInventory(int[] itemsID);

		void SetAutoDefense(bool autoDefense);
	}
	public interface IInternVoice
	{
		int InternID { get; set; }

		AudioSource CurrentAudioSource { get; set; }

		void TryPlayVoiceAudio(PlayVoiceParameters parameters);

		void CountTime(float time);

		bool CanPlayAudioAfterCooldown();

		bool IsTalking();

		float GetAmplitude();

		void TryStopAudioFadeOut();

		void SetNewRandomCooldownAudio();

		void PlayAudioClip(AudioClip audioClip);

		void ResetAboutToTalk();

		void StopAudioFadeOut();
	}
	public interface INpcController
	{
		PlayerControllerB Npc { get; }

		IInternCullingBodyInfo InternCullingBodyInfo { get; set; }

		bool IsCameraDisabled { get; set; }

		bool IsJumping { get; set; }

		bool IsFallingFromJump { get; set; }

		float CrouchMeter { get; set; }

		bool IsWalking { get; set; }

		float PlayerSlidingTimer { get; set; }

		bool DisabledJetpackControlsThisFrame { get; set; }

		bool StartedJetpackControls { get; set; }

		float TimeSinceTakingGravityDamage { get; set; }

		bool TeleportingThisFrame { get; set; }

		float PreviousFrameDeltaTime { get; set; }

		float CameraUp { get; set; }

		float UpdatePlayerLookInterval { get; set; }

		bool UpdatePositionForNewlyJoinedClient { get; set; }

		int PlayerMask { get; set; }

		bool IsTouchingGround { get; set; }

		EnemyAI? EnemyInAnimationWith { get; set; }

		bool IsControllerInCruiser { get; set; }

		bool HasToMove { get; }

		Vector3 MoveVector { get; }

		Vector3 NearEntitiesPushVector { get; set; }

		List<PlayerPhysicsRegion> CurrentInternPhysicsRegions { get; }

		bool GrabbedObjectValidated { get; set; }

		OccludeAudio OccludeAudioComponent { get; set; }

		AudioLowPassFilter AudioLowPassFilterComponent { get; set; }

		AudioHighPassFilter AudioHighPassFilterComponent { get; set; }

		void Awake();

		void Update();

		void LateUpdate();

		void OrderToMove();

		void OrderToStopMoving();

		void OrderToSprint();

		void OrderToStopSprint();

		void OrderToToggleCrouch();

		void OrderToLookForward();

		void OrderToLookAtPosition(Vector3 positionToLookAt);

		void OrderToLookAtPlayer(Vector3 positionPlayerEyeToLookAt);

		void OrderToLookAtMovingTarget(Transform movingTargetToLookAt);

		bool CheckConditionsForSinkingInQuicksandIntern();

		void PlayFootstep(bool isServer);

		void ShowFullNameBillboard();

		void MimicEmotes(PlayerControllerB playerToMimic);

		void PerformDefaultEmote(int emoteNumberToMimic);

		void PerformTooManyEmote(int tooManyEmoteID);

		void StopPerformingTooManyEmote();

		Vector3 GetBillBoardPosition(GameObject bodyModel, Vector3 lastPosition);

		void SetTurnBodyTowardsDirectionWithPosition(Vector3 positionDirection);

		void SetTurnBodyTowardsDirection(Vector3 direction);

		void ApplyUpdateInternAnimationsNotOwner(int animationState, float animationSpeed);

		void RefreshBillBoardPosition();

		void ReParentNotSpawnedTransform(Transform newParent);

		void SetAnimationBoolForItem(string animationString, bool value);

		void PlayAudibleNoiseIntern(Vector3 noisePosition, float noiseRange = 10f, float noiseLoudness = 0.5f, int timesPlayedInSameSpot = 0, bool noiseIsInsideClosedShip = false, int noiseID = 0);

		void UpdateNowTurnBodyTowardsDirection(Vector3 direction);

		void StopAnimations();

		float GetSqrDistanceWithLocalPlayer();

		Bounds GetBoundsModel(GameObject model);
	}
	public interface IPointOfInterest
	{
		bool IsInvalid { get; }

		IInterestPoint? GetInterestPoint();

		Vector3 GetPoint();

		bool TryAddInterestPoint<T>(T interestPointToAdd) where T : IInterestPoint;

		bool TryRemoveInterestPointType(Type interestPointTypeToRemove);

		IEnumerable<IInterestPoint> GetListInterestPoints();

		Dictionary<Type, IInterestPoint> GetDictTypeInterestPoints();

		EnumCommandTypes? GetCommand();
	}
	public interface IRagdollInternBody
	{
		void SetGrabbedBy(PlayerControllerB playerGrabberController, DeadBodyInfo deadBodyInfo, int idPlayerHolder);

		void Hide();

		void SetFreeRagdoll(DeadBodyInfo deadBodyInfo);

		float GetWeight();

		DeadBodyInfo? GetDeadBodyInfo();

		bool IsRagdollBodyHeld();

		bool IsRagdollBodyHeldByPlayer(int idPlayer);

		PlayerControllerB GetPlayerHolder();

		bool IsRagdollEnabled();
	}
}
namespace LethalInternship.SharedAbstractions.Inputs
{
	public interface ILethalInternshipInputs
	{
		InputAction ManageIntern { get; set; }

		InputAction GiveItemToIntern { get; set; }

		InputAction GrabIntern { get; set; }

		InputAction ReleaseInterns { get; set; }

		InputAction OpenCommandsOneIntern { get; set; }

		InputAction OpenAllCommandsIntern { get; set; }

		InputAction MakeInternLookAtPosition { get; set; }
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.TooManyEmotesHooks
{
	public delegate void CheckAndPerformTooManyEmoteDelegate(IInternAI internAI, PlayerControllerB playerToMimic);
	public delegate void PerformTooManyEmoteDelegate(INpcController npcController, int tooManyEmoteID);
	public delegate void StopPerformingTooManyEmoteDelegate(INpcController npcController);
	public class TooManyEmotesHook
	{
		public static CheckAndPerformTooManyEmoteDelegate? CheckAndPerformTooManyEmote;

		public static PerformTooManyEmoteDelegate? PerformTooManyEmote;

		public static StopPerformingTooManyEmoteDelegate? StopPerformingTooManyEmote;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.TerminalHooks
{
	public delegate string RemovePunctuation_ReversePatchDelegate(object instance, string s);
	public class TerminalHook
	{
		public static RemovePunctuation_ReversePatchDelegate? RemovePunctuation_ReversePatch;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.ShipTeleporterHooks
{
	public delegate void SetPlayerTeleporterId_ReversePatchDelegate(object instance, PlayerControllerB playerScript, int teleporterId);
	public class ShipTeleporterHook
	{
		public static SetPlayerTeleporterId_ReversePatchDelegate? SetPlayerTeleporterId_ReversePatch;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.ReviveCompanyHooks
{
	public delegate void ReviveCompanySetPlayerDiedAtDelegate(int playerClientId);
	public delegate void UpdateReviveCompanyRemainingRevivesDelegate(string identityName);
	public class ReviveCompanyHook
	{
		public static ReviveCompanySetPlayerDiedAtDelegate? ReviveCompanySetPlayerDiedAt;

		public static UpdateReviveCompanyRemainingRevivesDelegate? UpdateReviveCompanyRemainingRevives;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.PluginLoggerHooks
{
	public delegate void PluginLogDebugDelegate(string message);
	public delegate void PluginLogInfoDelegate(string message);
	public delegate void PluginLogWarningDelegate(string message);
	public delegate void PluginLogErrorDelegate(string message);
	public class PluginLoggerHook
	{
		public static PluginLogDebugDelegate? LogDebug;

		public static PluginLogInfoDelegate? LogInfo;

		public static PluginLogWarningDelegate? LogWarning;

		public static PluginLogErrorDelegate? LogError;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.PlayerControllerBHooks
{
	public delegate void PlayerHitGroundEffects_ReversePatchDelegate(object instance);
	public delegate void PlayJumpAudio_ReversePatchDelegate(object instance);
	public delegate void IsInSpecialAnimationClientRpc_ReversePatchDelegate(object instance, bool specialAnimation, float timed, bool climbingLadder);
	public delegate void SyncBodyPositionClientRpc_ReversePatchDelegate(object instance, Vector3 newBodyPosition);
	public delegate void SetSpecialGrabAnimationBool_ReversePatchDelegate(object instance, bool setTrue, GrabbableObject currentItem);
	public delegate void OnDisable_ReversePatchDelegate(object instance);
	public delegate bool InteractTriggerUseConditionsMet_ReversePatchDelegate(object instance);
	public class PlayerControllerBHook
	{
		public static PlayerHitGroundEffects_ReversePatchDelegate? PlayerHitGroundEffects_ReversePatch;

		public static PlayJumpAudio_ReversePatchDelegate? PlayJumpAudio_ReversePatch;

		public static IsInSpecialAnimationClientRpc_ReversePatchDelegate? IsInSpecialAnimationClientRpc_ReversePatch;

		public static SyncBodyPositionClientRpc_ReversePatchDelegate? SyncBodyPositionClientRpc_ReversePatch;

		public static SetSpecialGrabAnimationBool_ReversePatchDelegate? SetSpecialGrabAnimationBool_ReversePatch;

		public static OnDisable_ReversePatchDelegate? OnDisable_ReversePatch;

		public static InteractTriggerUseConditionsMet_ReversePatchDelegate? InteractTriggerUseConditionsMet_ReversePatch;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.MoreCompanyHooks
{
	public delegate void RemoveCosmeticsDelegate(PlayerControllerB internController);
	public class MoreCompanyHook
	{
		public static RemoveCosmeticsDelegate? RemoveCosmetics;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.MonoProfilerHooks
{
	public delegate void DumpMonoProfilerFileDelegate();
	public class MonoProfilerHook
	{
		public static DumpMonoProfilerFileDelegate? DumpMonoProfilerFile;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.ModelReplacementAPIHooks
{
	public delegate void RemoveInternModelReplacementDelegate(IInternAI internAI, bool forceRemove);
	public delegate Vector3? GetBillBoardPositionModelReplacementAPIDelegate(IInternAI internAI);
	public delegate void HideShowModelReplacementDelegate(PlayerControllerB body, bool show);
	public delegate void HideShowReplacementModelOnlyBodyDelegate(PlayerControllerB body, IInternAI internAI, bool show);
	public delegate void RemovePlayerModelReplacementDelegate(object bodyReplacementBase);
	public delegate void RemovePlayerModelReplacementFromControllerDelegate(PlayerControllerB internController);
	public delegate void HideShowRagdollWithModelReplacementDelegate(GameObject internObject, bool show);
	public delegate bool HasComponentModelReplacementAPIDelegate(GameObject gameObject);
	public delegate void CleanListBodyReplacementOnDeadBodiesDelegate();
	public static class ModelReplacementAPIHook
	{
		public static RemoveInternModelReplacementDelegate? RemoveInternModelReplacement;

		public static GetBillBoardPositionModelReplacementAPIDelegate? GetBillBoardPositionModelReplacementAPI;

		public static HideShowModelReplacementDelegate? HideShowModelReplacement;

		public static HideShowReplacementModelOnlyBodyDelegate? HideShowReplacementModelOnlyBody;

		public static RemovePlayerModelReplacementDelegate? RemovePlayerModelReplacement;

		public static RemovePlayerModelReplacementFromControllerDelegate? RemovePlayerModelReplacementFromController;

		public static HideShowRagdollWithModelReplacementDelegate? HideShowRagdollWithModelReplacement;

		public static HasComponentModelReplacementAPIDelegate? HasComponentModelReplacementAPI;

		public static CleanListBodyReplacementOnDeadBodiesDelegate? CleanListBodyReplacementOnDeadBodies;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.MipaHooks
{
	public delegate AudioClip? GetMipaFootstepAudioClipDelegate(PlayerControllerB npcController);
	public delegate float? GetMipaFootstepVolumeScaleDelegate(PlayerControllerB npcController, int animationHashLayers0);
	public static class MipaHook
	{
		public static GetMipaFootstepAudioClipDelegate? GetMipaFootstepAudioClip;

		public static GetMipaFootstepVolumeScaleDelegate? GetMipaFootstepVolumeScale;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.LethalMinHooks
{
	public delegate bool IsGrabbableObjectHeldByPikminModDelegate(GrabbableObject grabbableObject);
	public class LethalMinHook
	{
		public static IsGrabbableObjectHeldByPikminModDelegate? IsGrabbableObjectHeldByPikminMod;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.CustomItemBehaviourLibraryHooks
{
	public delegate bool IsGrabbableObjectInContainerModDelegate(GrabbableObject grabbableObject);
	public class CustomItemBehaviourLibraryHook
	{
		public static IsGrabbableObjectInContainerModDelegate? IsGrabbableObjectInContainerMod;
	}
}
namespace LethalInternship.SharedAbstractions.Hooks.BunkbedReviveHooks
{
	public delegate void UpdateReviveCountDelegate(int id);
	public class BunkbedReviveHook
	{
		public static UpdateReviveCountDelegate? UpdateReviveCount;
	}
}
namespace LethalInternship.SharedAbstractions.Events
{
	public interface IPluginRuntimeEvents
	{
		event EventHandler? InitialSyncCompleted;
	}
	public static class PluginEventsProvider
	{
		public static IPluginRuntimeEvents? Events { get; set; }
	}
}
namespace LethalInternship.SharedAbstractions.Enums
{
	public enum EnumBodyTypeCulling
	{
		InternBody,
		Ragdoll
	}
	public enum EnumCategoryTypeUI
	{
		None,
		InternClose,
		InternTooFar,
		InternNotOwned,
		InternDead,
		HeldWeapon,
		HeldItem
	}
	public enum EnumClickSide
	{
		Left,
		Right
	}
	public enum EnumCommandTypes
	{
		None,
		FollowPlayer,
		GoToVehicle,
		GoToPosition,
		WaitForCommand,
		ScavengingToShip,
		ScavengingToCruiser,
		ScavengingToGatheringPoint,
		GoFetchItem,
		Kill,
		DropAllItemsToShip,
		DropAllItemsOnGatheringPoint,
		DropAllItemsInCruiser,
		UnloadCruiser,
		UnloadGatheringPoint
	}
	public enum EnumErrorTypeTerminalPage
	{
		NoError,
		Default,
		NotEnoughCredits,
		NoMoreInterns,
		ShipLeavingMoon,
		InternDead,
		InternAlreadySelected,
		NoSignalTranslator
	}
	public enum GameAction
	{
		Unknown,
		Look,
		Move,
		Jump,
		Sprint,
		Interact,
		Crouch,
		Use,
		ActivateItem,
		Discard,
		SwitchItem,
		QEItemInteract,
		InspectItem,
		PingScan,
		ItemSecondaryUse,
		ItemTertiaryUse
	}
	[Flags]
	public enum EnumIconImagesTypes
	{
		None = 0,
		Attack = 1,
		Default = 2,
		GatheringPoint = 4,
		Position = 8,
		Ship = 0x10,
		Vehicle = 0x20,
		FetchItem = 0x40,
		CantAttack = 0x80
	}
	public enum EnumInputAction
	{
		None,
		FollowMe,
		StayHere,
		PointToAction,
		SetToAutoFlee,
		SetToAutoDefense,
		DropItem,
		DropAllItems,
		GoToShip,
		SetGatheringPoint,
		GoToGatheringPoint,
		RemoveGatheringPoint,
		GoToVehicle,
		ScavengeToShip,
		ScavengeToGatheringPoint,
		ScavengeToCruiser,
		PreviousSuit,
		NextSuit,
		SameSuit,
		RandomSuit,
		SelectSuit,
		Close,
		ReturnToAll,
		PreviousIntern,
		NextIntern,
		UnloadCruiser,
		UnloadGatheringPoint,
		DropAllItemsInShip,
		DropAllItemsOnGatheringPoint,
		DropAllItemsInCruiser,
		SwapWeapon,
		ActivateItem
	}
	public enum EnumItemTypes
	{
		Default,
		WeaponMelee,
		WeaponRanged,
		CaveDweller
	}
	public enum EnumObjectsLookingAt
	{
		Forward,
		Player,
		Position,
		MovingTarget
	}
	public enum EnumOptionsGetItems
	{
		All,
		IgnoreWeapon,
		ChooseWeaponLast
	}
	public enum EnumOptionSuitChange
	{
		Manual,
		AutomaticSameAsPlayer
	}
	public enum EnumOptionSuitConfig
	{
		Fixed,
		Random
	}
	public enum EnumSpawnAnimation
	{
		None,
		OnlyPlayerSpawnAnimation,
		RagdollFromDropShipAndPlayerSpawnAnimation
	}
	public enum EnumStateControllerMovement
	{
		FollowAgent,
		Free,
		Fixed
	}
	public enum EnumStatusIdentity
	{
		Available,
		ToDrop,
		Spawned
	}
	public enum EnumTalkativeness
	{
		NoTalking,
		Shy,
		Normal,
		Talkative,
		CantStopTalking
	}
	public enum EnumTempCommandFeedback
	{
		None,
		ExecutingCommand,
		NoFreeSlotsAvailable,
		CantHoldItem,
		TargetItemNotGrabbable,
		NoItemsLeftToGrab,
		Thinking,
		NotHoldingWeapon,
		CantKillEnemy,
		Fleeing,
		CombatTooLong,
		EnemyNotHere,
		EnemyTooFar
	}
	public enum EnumTerminalStates
	{
		Error,
		WaitForMainCommand,
		Info,
		ConfirmCancelPurchase,
		AbortLanding,
		ConfirmCancelAbortLanding,
		Status
	}
	public enum EnumVoicesState
	{
		None,
		AttackingWithGun,
		AttackingWithMelee,
		CantDoCommand,
		Chilling,
		EnteringCruiser,
		FollowingPlayer,
		FoundLoot,
		HasLoot,
		HearsPlayer,
		Hit,
		LosingPlayer,
		Lost,
		LostAndFound,
		NoLoot,
		NowScavenging,
		OrderedToFollow,
		OrderedToGoThere,
		OrderedToStay,
		RunningFromMonster,
		Sinking,
		SteppedOnTrap,
		Thinking,
		Waiting
	}
}
namespace LethalInternship.SharedAbstractions.Constants
{
	public class ConfigConst
	{
		public static readonly string ConfigSectionMain = "1. Internship program";

		public static readonly string ConfigSectionIdentities = "2. Intern identities";

		public static readonly string ConfigSectionBehaviour = "3. Behaviour";

		public static readonly string ConfigSectionTeleporters = "4. Teleporters";

		public static readonly string ConfigSectionVoices = "5. Voices";

		public static readonly string ConfigSectionPerformance = "6. Performance";

		public static readonly string ConfigSectionDebug = "7. Debug";

		public static readonly int DEFAULT_MAX_INTERNS_AVAILABLE = 16;

		public static readonly int MIN_INTERNS_AVAILABLE = 1;

		public static readonly int MAX_INTERNS_AVAILABLE = 32;

		public static readonly int DEFAULT_PRICE_INTERN = 19;

		public static readonly int MIN_PRICE_INTERN = 0;

		public static readonly int MAX_PRICE_INTERN = 200;

		public static readonly int DEFAULT_INTERN_MAX_HEALTH = 51;

		public static readonly int MIN_INTERN_MAX_HEALTH = 1;

		public static readonly int MAX_INTERN_MAX_HEALTH = 200;

		public static readonly float DEFAULT_SIZE_SCALE_INTERN = 0.85f;

		public static readonly float MIN_SIZE_SCALE_INTERN = 0.3f;

		public static readonly float MAX_SIZE_SCALE_INTERN = 1f;

		public static int DEFAULT_DISTANCE_COMMAND_OUTSIDE = 45;

		public static int DEFAULT_DISTANCE_COMMAND_INSIDE = 15;

		public static readonly float DEFAULT_SPEED_INTERN = 0.85f;

		public static readonly float MIN_SPEED_INTERN = 0.05f;

		public static readonly float MAX_SPEED_INTERN = 5f;

		public static readonly int DEFAULT_MAX_NB_CARRY = 1;

		public static readonly int MIN_NB_CARRY = 1;

		public static readonly int MAX_NB_CARRY = 10;

		public static readonly string DEFAULT_STRING_INTERNSHIP_PROGRAM_TITLE = "INTERNSHIP PROGRAM";

		public static readonly string DEFAULT_STRING_INTERNSHIP_PROGRAM_SUBTITLE = "Need some help ? Try our new workforce, ready to assist you and gain experience";

		public static readonly string DEFAULT_INTERN_NAME = "Intern #{0}";

		public static EnumOptionSuitChange DEFAULT_CONFIG_ENUM_INTERN_SUIT_CHANGE = EnumOptionSuitChange.Manual;

		public static readonly int DEFAULT_MAX_IDENTITIES = 22;

		public static readonly int MIN_IDENTITIES = 10;

		public static readonly int MAX_IDENTITIES = 200;

		public static readonly string FILE_NAME_CONFIG_IDENTITIES_DEFAULT = "ConfigIdentitiesDefault.json";

		public static readonly string FILE_NAME_CONFIG_IDENTITIES_USER = "ConfigIdentitiesUser.json";

		public static readonly ConfigIdentity DEFAULT_CONFIG_IDENTITY = new ConfigIdentity
		{
			name = DEFAULT_INTERN_NAME,
			suitConfigOption = 1,
			suitID = 0,
			voiceFolder = "Mathew_kelly",
			volume = 0.5f
		};

		public static readonly int DEFAULT_MAX_ANIMATIONS_MODELREPLACEMENT = 6;

		public static readonly int DEFAULT_MAX_FOOTSTEP_SOUND = 7;
	}
	public class Const
	{
		public const string CSYNC_GUID = "com.sigurd.csync";

		public const string MORECOMPANY_GUID = "me.swipez.melonloader.morecompany";

		public const string LETHALCOMPANYINPUTUTILS_GUID = "com.rune580.LethalCompanyInputUtils";

		public const string BETTER_EXP_GUID = "Swaggies.BetterEXP";

		public const string MOREEMOTES_GUID = "MoreEmotes";

		public const string BETTEREMOTES_GUID = "BetterEmotes";

		public const string MODELREPLACEMENT_GUID = "meow.ModelReplacementAPI";

		public const string LETHALPHONES_GUID = "LethalPhones";

		public const string FASTERITEMDROPSHIP_GUID = "FlipMods.FasterItemDropship";

		public const string SHOWCAPACITY_GUID = "Piggy.ShowCapacity";

		public const string REVIVECOMPANY_GUID = "OpJosMod.ReviveCompany";

		public const string BUNKBEDREVIVE_GUID = "viviko.BunkbedRevive";

		public const string ZAPRILLATOR_GUID = "Zaprillator";

		public const string TOOMANYEMOTES_GUID = "FlipMods.TooManyEmotes";

		public const string RESERVEDITEMSLOTCORE_GUID = "FlipMods.ReservedItemSlotCore";

		public const string LETHALPROGRESSION_GUID = "Stoneman.LethalProgression";

		public const string QUICKBUYMENU_GUID = "QuickBuyMenu";

		public const string CUSTOMITEMBEHAVIOURLIBRARY_GUID = "com.github.WhiteSpike.CustomItemBehaviourLibrary";

		public const string LCALWAYSHEARWALKIEMOD_GUID = "suskitech.LCAlwaysHearActiveWalkie";

		public const string BUTTERYFIXES_GUID = "butterystancakes.lethalcompany.butteryfixes";

		public const string PEEPERS_GUID = "x753.Peepers";

		public const string LETHALMIN_GUID = "NoteBoxz.LethalMin";

		public const string HOTDOGMODEL_GUID = "hotdogModel";

		public const string MIPA_GUID = "Mipa";

		public const string USUALSCRAP_GUID = "Emil.UsualScrap";

		public const string ADVANCEDFEATURES_GUID = "com.example.Advancedfeatures";

		public const string ADDITIONALNETWORKING_DLLFILENAME = "AdditionalNetworking_Preloader.dll";

		public const string MONOPROFILERLOADER_DLLFILENAME = "MonoProfilerLoader.dll";

		public static readonly float EPSILON = 0.01f;

		public static readonly bool DISABLE_ORIGINAL_GAME_DEBUG_LOGS = true;

		public static readonly ulong INTERN_ACTUAL_ID_OFFSET = 100000uL;

		public static readonly float INTERN_FOV = 90f;

		public static readonly int INTERN_ENTITIES_RANGE = 40;

		public static readonly float INTERN_OBJECT_AWARNESS = 5f;

		public static readonly float INTERN_OBJECT_RANGE = 15f;

		public static readonly float WAIT_TIME_FOR_GRAB_DROPPED_OBJECTS = 10f;

		public static readonly float CLIMB_SPEED = 8f;

		public static readonly int INIT_RAGDOLL_ID = -2;

		public static readonly float BASE_MAX_SPEED = 0.9f;

		public static readonly float BODY_TURNSPEED = 6f;

		public static readonly float CAMERA_TURNSPEED = 4f;

		public static readonly float DISTANCE_CLOSE_ENOUGH_TO_DESTINATION = 1f;

		public static readonly float DISTANCE_ITEMS_TO_ENTRANCE = 6f;

		public static readonly int COMPANY_BUILDING_MOON_ID = 3;

		public static readonly float DISTANCE_NPCBODY_FROM_DOOR = 2.5f;

		public static readonly float TIMER_CHECK_DOOR = 0.9f;

		public static readonly int PROXIMITY_AWARENESS_INSIDE = 5;

		public static readonly int PROXIMITY_AWARENESS_OUTSIDE = 10;

		public static readonly int PLAYER_MASK = 8;

		public static readonly string PLAYER_ANIMATION_WEIGHT_HOLDINGITEMSRIGHTHAND = "HoldingItemsRightHand";

		public static readonly string PLAYER_ANIMATION_WEIGHT_HOLDINGITEMSBOTHHANDS = "HoldingItemsBothHands";

		public static readonly string PLAYER_ANIMATION_WEIGHT_SPECIALANIMATIONS = "SpecialAnimations";

		public static readonly string PLAYER_ANIMATION_WEIGHT_EMOTESNOARMS = "EmotesNoArms";

		public static readonly string PLAYER_ANIMATION_BOOL_GRAB = "Grab";

		public static readonly string PLAYER_ANIMATION_BOOL_GRABVALIDATED = "GrabValidated";

		public static readonly string PLAYER_ANIMATION_BOOL_GRABINVALIDATED = "GrabInvalidated";

		public static readonly string PLAYER_ANIMATION_BOOL_CANCELHOLDING = "cancelHolding";

		public static readonly string PLAYER_ANIMATION_BOOL_WALKING = "Walking";

		public static readonly string PLAYER_ANIMATION_BOOL_SPRINTING = "Sprinting";

		public static readonly string PLAYER_ANIMATION_BOOL_SIDEWAYS = "Sideways";

		public static readonly string PLAYER_ANIMATION_BOOL_ANIMATIONSPEED = "animationSpeed";

		public static readonly string PLAYER_ANIMATION_BOOL_HINDEREDMOVEMENT = "hinderedMovement";

		public static readonly string PLAYER_ANIMATION_BOOL_CROUCHING = "crouching";

		public static readonly string PLAYER_ANIMATION_BOOL_FALLNOJUMP = "FallNoJump";

		public static readonly string PLAYER_ANIMATION_BOOL_SHORTFALLLANDING = "ShortFallLanding";

		public static readonly string PLAYER_ANIMATION_BOOL_LIMP = "Limp";

		public static readonly string PLAYER_ANIMATION_TRIGGER_THROW = "Throw";

		public static readonly string PLAYER_ANIMATION_TRIGGER_DAMAGE = "Damage";

		public static readonly string PLAYER_ANIMATION_TRIGGER_SHORTFALLLANDING = "ShortFallLanding";

		public static readonly string PLAYER_ANIMATION_FLOAT_ANIMATIONSPEED = "animationSpeed";

		public static readonly string PLAYER_ANIMATION_FLOAT_TIREDAMOUNT = "tiredAmount";

		public static readonly string MAPDOT_ANIMATION_BOOL_DEAD = "dead";

		public static readonly int IDLE_STATE_HASH = -1437577361;

		public static readonly int WALKING_STATE_HASH = 81563449;

		public static readonly int SPRINTING_STATE_HASH = -350224702;

		public static readonly int CROUCHING_IDLE_STATE_HASH = 1917280335;

		public static readonly int CROUCHING_WALKING_STATE_HASH = -483816927;

		public static readonly float MIN_TIME_SPRINT_SEARCH_WANDER = 1f;

		public static readonly float MAX_TIME_SPRINT_SEARCH_WANDER = 3f;

		public static readonly float DISTANCE_START_RUNNING = 2f;

		public static readonly float DISTANCE_STOP_RUNNING = 7f;

		public static readonly float DISTANCE_CLOSE_ENOUGH_HOR = 4f;

		public static readonly float DISTANCE_CLOSE_ENOUGH_VER = 2f;

		public static readonly float DISTANCE_TO_ENTRANCE = 1f;

		public static readonly float OUTSIDE_INSIDE_DISTANCE_LIMIT = 100f;

		public static readonly float DISTANCE_AWARENESS_HOR = 50f;

		public static readonly float DISTANCE_AWARENESS_VER = 50f;

		public static readonly float TIMER_LOOKING_AROUND = 6f;

		public static readonly float MIN_TIME_FREEZE_LOOKING_AROUND = 0.5f;

		public static readonly float MAX_TIME_FREEZE_LOOKING_AROUND = 2f;

		public static readonly float DISTANCE_TO_CRUISER = 10f;

		public static readonly Vector3 LEFT_FRONT_POS_CRUISER = new Vector3(-0.75f, -1f, 5.5f);

		public static readonly Vector3 RIGHT_FRONT_POS_CRUISER = new Vector3(1.2f, -1f, 5.5f);

		public static readonly Vector3 LEFT_CENTER_POS_CRUISER = new Vector3(-2f, -1f, 0f);

		public static readonly Vector3 RIGHT_CENTER_POS_CRUISER = new Vector3(2.5f, -1f, 0f);

		public static readonly Vector3 LEFT_BACK_POS_CRUISER = new Vector3(-0.75f, -1f, -5.5f);

		public static readonly Vector3 RIGHT_BACK_POS_CRUISER = new Vector3(1.2f, -1f, -5.5f);

		public static readonly Vector3 FIRST_CORNER_INSIDE_CRUISER = new Vector3(-0.5f, -0.5f, -0.4f);

		public static readonly Vector3 SECOND_CORNER_INSIDE_CRUISER = new Vector3(0.9f, -0.5f, -2.5f);

		public static readonly float DISTANCE_FLEEING_NO_LOS = 5f;

		public static readonly float DISTANCE_SAME_ENTRANCE = 1f;

		public static readonly float PENALTY_ENTRANCE = 100f;

		public static readonly float GATHERING_POINT_RANGE = 5f;

		public static readonly int GRAPH_CAPACITY = 256;
	}
	public class DebugConst
	{
		public static readonly bool DRAW_LINES;

		public static readonly bool SHOW_LOG_DEBUG_ONTRANSFORMPARENTCHANGED;

		public static readonly bool SPAWN_INTERN_WITH_EMOTE;

		public static readonly bool NO_DAMAGE;

		public static readonly bool NO_DEATH;

		public static readonly bool SPAWN_BUSH_WOLVES_FOR_DEBUG;

		public static readonly bool SPAWN_MINESHAFT_FOR_DEBUG;

		public static readonly bool TEST_MORE_THAN_X_PLAYER_BYPASS;

		public static readonly bool ALLOW_COMMANDS_ALWAYS;
	}
	public class TerminalConst
	{
		public static readonly int INDEX_HELP_TERMINALNODE = 13;

		public static readonly string STRING_OTHER_HELP = ">OTHER";

		public static readonly int INDEX_AUDIO_BOUGHT_ITEM = 0;

		public static readonly int INDEX_AUDIO_ERROR = 1;

		public static readonly string STRING_LAND_COMMAND = "land";

		public static readonly string STRING_EVACUATION_COMMAND = "evacuation";

		public static readonly string STRING_BUY_COMMAND = "buy";

		public static readonly string STRING_CONFIRM_COMMAND = "confirm";

		public static readonly string STRING_CANCEL_COMMAND = "deny";

		public static readonly string STRING_BACK_COMMAND = "back";

		public static readonly string STRING_LANDING_STATUS_ALLOWED = "+ Allowed +";

		public static readonly string STRING_LANDING_STATUS_ABORTED = "--Aborted--";

		public static readonly string STRING_LANDING_STATUS_ABORTED_COMPANY_MOON = " (aborted on company building moon)";

		public static readonly string STRING_INTERNSHIP_PROGRAM_HELP = ">{0}\n{1}\n\n";

		public static readonly string TEXT_INFO_PAGE_IN_SPACE = "Remaining interns : {0}\r\nUnit price : ${1}\r\n\r\n----------------------------------------\r\n--> Interns scheduled on next moon : {2}\r\n----------------------------------------\r\n\r\nInterns landing on moon : {3}\r\n\r\n\r\nCommands :\r\n- '{4}' : allow/cancel\r\n- '{5}' : broadcast call to ship\r\n- '{6}' : order new intern";

		public static readonly string TEXT_INFO_PAGE_INTERN_TO_DROPSHIP = "Interns waiting to land : {0}";

		public static readonly string TEXT_INFO_PAGE_ON_MOON = "Remaining interns : {0}\r\nUnit price : ${1}\r\n\r\n{2}\r\n------------------------------\r\n--> Interns on this moon : {3}\r\n------------------------------\r\n\r\nInterns landing status : {4}\r\n\r\n\r\nCommands :\r\n- '{5}' : allow/cancel\r\n- '{6}' : broadcast call to ship\r\n- '{7}' : order new intern";

		public static readonly string TEXT_CONFIRM_CANCEL_PURCHASE_MAXIMUM = "(max)";

		public static readonly string TEXT_CONFIRM_CANCEL_PURCHASE = "You have requested to order interns. Amount {0}{1}\r\n\r\nTotal cost of items: ${2}\r\n\r\n\r\nPlease CONFIRM or DENY.";

		public static readonly string TEXT_CONFIRM_CANCEL_REVIVE_INTERN = " (will be reanimated)";

		public static readonly string TEXT_CONFIRM_CANCEL_SPECIFIC_PURCHASE = "You have select {0} for the next drop.{1}\r\n\r\nTotal cost : ${2}\r\n\r\n\r\nPlease CONFIRM or DENY.";

		public static readonly string TEXT_ERROR_NOERROR = "Executed successfully.";

		public static readonly string TEXT_ERROR_DEFAULT = "An error occured in the internship program.";

		public static readonly string TEXT_ERROR_NOT_ENOUGH_CREDITS = "You do not have enough credits to order an intern.";

		public static readonly string TEXT_NO_MORE_INTERNS_PURCHASABLE = "Sorry too much interns at once. Try again later.";

		public static readonly string TEXT_ERROR_SHIP_LEAVING = "You can not buy when the ship is leaving the moon.";

		public static readonly string TEXT_ERROR_INTERN_DEAD = "Sorry, this intern is dead, you can revive an intern only in orbit, try with another one.";

		public static readonly string TEXT_ERROR_INTERN_ALREADY_SELECTED = "Sorry, this intern is already selected for the next moon, try with another one.";

		public static readonly string TEXT_ERROR_SIGNAL = "Could not send signal. No signal translator detected on the ship.";

		public static readonly string TEXT_BROADCAST_RECALL = "RETREAT";

		public static readonly string TEXT_STATUS = "Interns status : \r\n\r\n";
	}
	public class UIConst
	{
		public static Color UI_COLOR_DEFAULT = new Color(1f, 0.20392157f, 0.003921569f);

		public static Color UI_COLOR_ORANGE = new Color(1f, 37f / 85f, 0.003921569f);

		public static Color UI_COLOR_BLACK = new Color(0f, 0f, 0f);

		public static string UI_INPUT_MESSAGE_KEYBOARD = "[Mouse click] confirm";

		public static string UI_INPUT_MESSAGE_CONTROLLER = "[{0}] confirm | [{1}] [{2}] change| [{3}] close";

		public static string UI_CHOOSE_LOCATION = "Choose this location";

		public static string UI_TITLE_COMMANDS_ALL = "Commands :";

		public static string UI_TITLE_LIST_INTERNS = "Interns close :";

		public static string UI_TITLE_LIST_SINGLE_INTERN = "Managing intern :";

		public static readonly string TOOLTIP_GIVE_ITEM = "Give item : [{0}]";

		public static readonly string TOOLTIP_MANAGE = "Manage : [{0}]";

		public static readonly string TOOLTIP_GRAB_INTERNS = "Grab intern: [{0}]";

		public static readonly string TOOLTIP_RELEASE_INTERNS = "Release grabbed interns : [{0}]";

		public static readonly string TOOLTIP_COMMANDS_ALL = "Commands for all interns : [{0}]";

		public static readonly string TOOLTIP_COMMANDS_ONE = "Commands : [{0}]";

		public static readonly string TOOLTIP_MAKE_INTERN_LOOK = "Make interns look : [{0}]";

		public static readonly string TOOLTIP_TARGETING_ENEMY = "-> Attack !";

		public static readonly string TOOLTIP_TARGETING_UNKILLABLE_ENEMY = "Can't attack this enemy !";

		public static readonly string TOOLTIP_TARGETING_ITEM = "-> Go get this item";

		public static readonly string TOOLTIP_TARGETING_POSITION = "-> Go there";

		public static readonly string TOOLTIP_NOT_OWNED = "Unmanaged";

		public static readonly string[] TOOLTIP_COMMAND_FEEDBACK = new string[13]
		{
			"[...]", "[...]", "[Hands full]", "[Cannot hold this item]", "[Cannot take this item]", "[No more items to grab]", "[Thinking]", "[Not holding any weapon]", "[This monster is unkillable]", "[Fleeing !]",
			"[Combat too long, aborting...]", "[The monster is not here]", "[The monster is too far]"
		};

		public static readonly string[] TOOLTIP_EXECUTING_COMMAND = new string[15]
		{
			"[...]", "[Following]", "[Going to the cruiser]", "[Going to the position]", "[Waiting for command]", "[Scavenge -> Ship]", "[Scavenge -> Cruiser]", "[Scavenge -> Gathering point]", "[Grabbing the item]", "[Kill]",
			"[Drop all items -> Ship]", "[Drop all items -> Gathering point]", "[Drop all items -> Cruiser]", "[Unloading cruiser]", "[Unloading gathering point]"
		};

		public static string[] COMMANDS_BUTTON_STRING = new string[32]
		{
			string.Empty,
			"Follow me",
			"Stay here",
			"Point to action",
			"Flee when an enemy is near ",
			"Try to attack when an enemy is near",
			"Drop item",
			"Drop all items",
			"Go to the ship",
			"Set new gathering point",
			"Go to the gathering point",
			"Delete the gathering point",
			"Go to the cruiser",
			"Scavenge and return to ship",
			"Scavenge and return to the gathering point",
			"Scavenge and return to the cruiser",
			"Previous suit",
			"Next suit",
			"Same suit as player",
			"Random suit",
			"Choose suit",
			"Close",
			"See all interns",
			"Previous intern",
			"Next intern",
			"Unload items in cruiser",
			"Unload items near the gathering point",
			"Drop all items in the ship",
			"Drop all items on the gathering point",
			"Drop all items in the cruiser",
			"Swap weapon",
			"Use"
		};

		public static string[] CATEGORIES_STRING = new string[7] { "- None ({0})", "- In proximity ({0})", "- Too far ({0})", "- Not managed ({0})", "- Dead ({0})", "- Weapon ({0})", "- {0} Items ${1}" };

		public static string TOOLTIP_AUTODEFENSE_BEHAVIOUR = "[Attack enemy if holding weapon]";

		public static string TOOLTIP_FLEE_BEHAVIOUR = "[Flee if enemy]";

		public static float OUTLINE_RIM_DEFAULT = 5f;

		public static float OUTLINE_RIM_SOLID = 0.1f;

		public static float DISTANCE_SOLID_OUTLINE = 15f;

		public static float OUTLINE_INTENSITY_DEFAULT = 0.7f;

		public static string TOOLTIPBAR_ITEM = "{0} ${1}";

		public static string TOOLTIPBAR_NO_CRUISER = "No cruiser spawned !";

		public static string TOOLTIPBAR_NO_GATHERINGPOINT = "No gathering point set !";

		public static string TOOLTIPBAR_NO_INTERNS_TO_MANAGE = "Not managing any interns !";

		public static string TOOLTIPBAR_NOT_IN_SPACE = "Not available in space.";
	}
	public class VoicesConst
	{
		public static readonly string VOICES_PATH = "Audio\\Voices\\";

		public static readonly string DEFAULT_VOICES_FOLDER = "Mathew_kelly";

		public static readonly float DEFAULT_VOICES_VOLUME_MULTIPLIER = 1f;

		public static EnumTalkativeness DEFAULT_CONFIG_ENUM_TALKATIVENESS = EnumTalkativeness.Normal;

		public static readonly float DEFAULT_FOOTSTEP_VOLUME_MULTIPLIER = 1f;

		public static readonly float DISTANCE_TO_PLAYER_MIN_TO_TALK = 30f;

		public static readonly float DISTANCE_HEAR_OTHER_INTERNS = 10f;

		public static readonly float FADE_IN_TIME = 0.1f;

		public static readonly float FADE_OUT_TIME = 0.2f;

		public static readonly string SWEAR_KEYWORD = "_cuss";

		public static readonly string INSIDE_KEYWORD = "_inside";

		public static readonly string OUTSIDE_KEYWORD = "_outside";

		public static readonly int MIN_COOLDOWN_PLAYVOICE_SHY = 10;

		public static readonly int MAX_COOLDOWN_PLAYVOICE_SHY = 40;

		public static readonly int MIN_COOLDOWN_PLAYVOICE_NORMAL = 5;

		public static readonly int MAX_COOLDOWN_PLAYVOICE_NORMAL = 20;

		public static readonly int MIN_COOLDOWN_PLAYVOICE_TALKATIVE = 2;

		public static readonly int MAX_COOLDOWN_PLAYVOICE_TALKATIVE = 10;

		public static readonly int MIN_COOLDOWN_PLAYVOICE_CANTSTOPTALKING = 0;

		public static readonly int MAX_COOLDOWN_PLAYVOICE_CANTSTOPTALKING = 0;
	}
}
namespace LethalInternship.SharedAbstractions.Configs
{
	public interface IConfig
	{
		int MaxInternsAvailable { get; }

		int InternPrice { get; }

		int InternMaxHealth { get; }

		float InternSizeScale { get; }

		float InternSpeed { get; }

		string TitleInHelpMenu { get; }

		string SubTitleInHelpMenu { get; }

		bool CanSpectateInterns { get; }

		bool RadarEnabled { get; }

		bool SpawnIdentitiesRandomly { get; }

		int OutsideRangeCommands { get; }

		int InsideRangeCommands { get; }

		bool FollowCrouchWithPlayer { get; }

		bool ChangeSuitAutoBehaviour { get; }

		int NbMaxCanCarry { get; }

		bool GrabItemsNearEntrances { get; }

		bool GrabBeesNest { get; }

		bool GrabDeadBodies { get; }

		bool GrabManeaterBaby { get; }

		bool GrabWheelbarrow { get; }

		bool GrabShoppingCart { get; }

		bool GrabKiwiBabyItem { get; }

		bool GrabApparatus { get; }

		bool TeleportedInternDropItems { get; }

		string VolumeVoicesMultiplierInterns { get; }

		int Talkativeness { get; }

		bool AllowSwearing { get; }

		string VolumeFootstepMultiplierInterns { get; }

		int MaxDefaultModelAnimatedInterns { get; }

		int MaxModelReplacementModelAnimatedInterns { get; }

		int MaxFootStepAudioInterns { get; }

		bool EnableDebugLog { get; }

		ConfigIdentities ConfigIdentities { get; }

		string GetTitleInternshipProgram();

		float GetVolumeVoicesMultiplierInterns();

		float GetVolumeFootstepMultiplierInterns();
	}
}
namespace LethalInternship.SharedAbstractions.CommandsSystem
{
	public abstract class Ability
	{
		public IReadOnlyList<IInternIdentity> IdentitiesToOrder { get; }

		public abstract bool RequiresTargeting { get; }

		protected Ability(IEnumerable<IInternIdentity> identities)
		{
			IdentitiesToOrder = identities.ToArray();
		}

		public abstract void Activate();
	}
	public class IgnoreRaycast : MonoBehaviour, IIgnoreRaycast
	{
	}
	public interface IIgnoreRaycast
	{
	}
	public abstract class Order
	{
		public IReadOnlyList<IInternIdentity> IdentitiesToOrder { get; }

		protected Order(IReadOnlyList<IInternIdentity> identities)
		{
			IdentitiesToOrder = identities;
		}

		public abstract void ApplyTo(IInternAI intern);
	}
	public struct TargetData
	{
		public GameObject Root;

		public RaycastHit RaycastHit;

		public IInternAI? Intern;

		public GrabbableObject? Item;

		public EnemyAI? Enemy;

		public IPointOfInterest? PointedPointOfInterest;

		public float Distance => ((RaycastHit)(ref RaycastHit)).distance;

		public bool IsTargetNotPosition()
		{
			return Intern != null || (Object)(object)Enemy != (Object)null || (Object)(object)Item != (Object)null;
		}

		public override string ToString()
		{
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			string empty = string.Empty;
			if (Intern != null)
			{
				return string.Format("Intern ({0}) dist {1}, Root {2}", Intern.Npc.playerUsername, Distance.ToString("00.00"), Root);
			}
			if ((Object)(object)Enemy != (Object)null)
			{
				return string.Format("Enemy ({0}) dist {1}, Root {2}", Enemy.enemyType.enemyName, Distance.ToString("00.00"), Root);
			}
			if ((Object)(object)Item != (Object)null)
			{
				return string.Format("Item({0}) dist {1}, Root {2}", Item.itemProperties.itemName, Distance.ToString("00.00"), Root);
			}
			if (PointedPointOfInterest != null)
			{
				return string.Format("Point of interest ({0}) dist {1}, Root {2}", ((object)PointedPointOfInterest.GetPoint()/*cast due to .constrained prefix*/).ToString(), Distance.ToString("00.00"), Root);
			}
			return string.Format("Target RaycastHit ({0}) dist {1}, Root {2}", ((object)Unsafe.As<RaycastHit, RaycastHit>(ref RaycastHit)/*cast due to .constrained prefix*/).ToString(), Distance.ToString("00.00"), Root);
		}
	}
	public abstract class TargetedAbility : Ability
	{
		public abstract HashSet<GameAction> NotInterruptingActions { get; }

		public abstract HashSet<GameAction> SubmitActions { get; }

		public override bool RequiresTargeting => true;

		protected TargetedAbility(IEnumerable<IInternIdentity> identities)
			: base(identities)
		{
		}

		public override void Activate()
		{
			BeginTargeting();
		}

		protected abstract void BeginTargeting();

		public abstract Order? ResolveTarget(TargetData target);
	}
}
namespace LethalInternship.SharedAbstractions.Adapters
{
	public interface IBodyReplacementBase
	{
		Component BodyReplacementBase { get; }

		Type TypeReplacement { get; }

		bool IsActive { get; set; }

		GameObject? DeadBody { get; }

		string SuitName { get; set; }
	}
}