Decompiled source of LethalInternship v0.20.2

plugins/Szumi57-LethalInternship/LethalInternship.dll

Decompiled a week 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.Inputs;
using LethalInternship.Managers;
using LethalInternship.NetcodePatcher;
using LethalInternship.PluginPatches.GameEnginePatches;
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.20.2.0")]
[assembly: AssemblyInformationalVersion("0.20.2")]
[assembly: AssemblyProduct("LethalInternship")]
[assembly: AssemblyTitle("LethalInternship")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.20.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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]
	[Microsoft.CodeAnalysis.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]
	[Microsoft.CodeAnalysis.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.20.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.*/)]
	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;

		public static EnemyType InternNPCPrefab;

		internal static bool UIAssetsLoaded;

		public static GameObject CommandsWheelUIPrefab;

		public static GameObject WorldIconPrefab;

		public static GameObject InputIconPrefab;

		public static GameObject DefaultIconImagePrefab;

		public static GameObject PointerIconImagePrefab;

		public static GameObject PedestrianIconImagePrefab;

		public static GameObject VehicleIconImagePrefab;

		public static GameObject ShipIconImagePrefab;

		public static GameObject MeetingPointIconImagePrefab;

		public static GameObject GatheringPointIconImagePrefab;

		public static GameObject AttackIconImagePrefab;

		internal static string DirectoryName;

		internal static ManualLogSource Logger;

		internal static Config Config;

		internal static ILethalInternshipInputs InputActionsInstance;

		internal static int PluginIrlPlayersCount;

		internal static bool IsModTooManyEmotesLoaded;

		internal static bool IsModModelReplacementAPILoaded;

		internal static bool IsModCustomItemBehaviourLibraryLoaded;

		internal static bool IsModMoreCompanyLoaded;

		internal static bool IsModReviveCompanyLoaded;

		internal static bool IsModBunkbedReviveLoaded;

		internal static bool IsModLethalMinLoaded;

		internal static bool IsModMipaLoaded;

		internal static bool IsModMonoProfilerLoaderLoaded;

		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();
				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()
		{
			CommandsWheelUIPrefab = ModAssets.LoadAsset<GameObject>("CommandsWheel");
			if ((Object)(object)CommandsWheelUIPrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load CommandsWheel UI 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;
			}
			PointerIconImagePrefab = ModAssets.LoadAsset<GameObject>("PointerIconImage");
			if ((Object)(object)PointerIconImagePrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load PointerIconImage UI prefab.");
				return false;
			}
			DefaultIconImagePrefab = ModAssets.LoadAsset<GameObject>("DefaultIconImage");
			if ((Object)(object)DefaultIconImagePrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load DefaultIconImage UI prefab.");
				return false;
			}
			PedestrianIconImagePrefab = ModAssets.LoadAsset<GameObject>("PedestrianIconImage");
			if ((Object)(object)PedestrianIconImagePrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load PedestrianIconImage UI prefab.");
				return false;
			}
			VehicleIconImagePrefab = ModAssets.LoadAsset<GameObject>("VehicleIconImage");
			if ((Object)(object)VehicleIconImagePrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load VehicleIconImage UI prefab.");
				return false;
			}
			ShipIconImagePrefab = ModAssets.LoadAsset<GameObject>("ShipIconImage");
			if ((Object)(object)ShipIconImagePrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load ShipIconImage UI prefab.");
				return false;
			}
			MeetingPointIconImagePrefab = ModAssets.LoadAsset<GameObject>("MeetingPointIconImage");
			if ((Object)(object)MeetingPointIconImagePrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load MeetingPointIconImage UI prefab.");
				return false;
			}
			GatheringPointIconImagePrefab = ModAssets.LoadAsset<GameObject>("GatheringPointIconImage");
			if ((Object)(object)GatheringPointIconImagePrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load GatheringPointIconImage UI prefab.");
				return false;
			}
			AttackIconImagePrefab = ModAssets.LoadAsset<GameObject>("AttackIconImage");
			if ((Object)(object)AttackIconImagePrefab == (Object)null)
			{
				Logger.LogError((object)"Failed to load AttackIconImage UI prefab.");
				return false;
			}
			return true;
		}

		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(typeof(StartOfRoundPatch));
			_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.JesterAIPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.MaskedPlayerEnemyPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.EnemiesPatches.MouthDogAIPatch"));
			_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.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.RagdollGrabbableObjectPatch"));
			_harmony.PatchAll(assembly.GetType("LethalInternship.Patches.ObjectsPatches.ShotgunItemPatch"));
			_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_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Expected O, but got Unknown
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Expected O, but got Unknown
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Expected O, but got Unknown
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Expected O, but got Unknown
			//IL_0570: Unknown result type (might be due to invalid IL or missing references)
			//IL_057c: Expected O, but got Unknown
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c3: Expected O, but got Unknown
			//IL_061c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0628: Expected O, but got Unknown
			//IL_06da: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e8: Expected O, but got Unknown
			//IL_0721: Unknown result type (might be due to invalid IL or missing references)
			//IL_072f: Expected O, but got Unknown
			//IL_075e: Unknown result type (might be due to invalid IL or missing references)
			//IL_076c: Expected O, but got Unknown
			//IL_07a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b6: Expected O, but got Unknown
			//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f3: Expected O, but got Unknown
			//IL_0822: Unknown result type (might be due to invalid IL or missing references)
			//IL_0830: Expected O, but got Unknown
			//IL_085f: Unknown result type (might be due to invalid IL or missing references)
			//IL_086d: Expected O, but got Unknown
			//IL_089c: Unknown result type (might be due to invalid IL or missing references)
			//IL_08aa: Expected O, but got Unknown
			//IL_08e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f1: Expected O, but got Unknown
			//IL_092c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0938: Expected O, but got Unknown
			//IL_0971: Unknown result type (might be due to invalid IL or missing references)
			//IL_097f: Expected O, but got Unknown
			//IL_0a4b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a59: 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");
			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 flag15 = 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 (flag15)
			{
				_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);
			}
		}

		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.20.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 bool UIAssetsLoaded => Plugin.UIAssetsLoaded;

		public GameObject CommandsWheelUIPrefab => Plugin.CommandsWheelUIPrefab;

		public GameObject WorldIconPrefab => Plugin.WorldIconPrefab;

		public GameObject InputIconPrefab => Plugin.InputIconPrefab;

		public GameObject DefaultIconImagePrefab => Plugin.DefaultIconImagePrefab;

		public GameObject PointerIconImagePrefab => Plugin.PointerIconImagePrefab;

		public GameObject PedestrianIconImagePrefab => Plugin.PedestrianIconImagePrefab;

		public GameObject VehicleIconImagePrefab => Plugin.VehicleIconImagePrefab;

		public GameObject ShipIconImagePrefab => Plugin.ShipIconImagePrefab;

		public GameObject MeetingPointIconImagePrefab => Plugin.MeetingPointIconImagePrefab;

		public GameObject GatheringPointIconImagePrefab => Plugin.GatheringPointIconImagePrefab;

		public GameObject AttackIconImagePrefab => Plugin.AttackIconImagePrefab;

		public string DirectoryName => Plugin.DirectoryName;

		public ILethalInternshipInputs InputActionsInstance => Plugin.InputActionsInstance;

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

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

		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.20.2";
	}
}
namespace LethalInternship.PluginPatches.GameEnginePatches
{
	[HarmonyPatch(typeof(StartOfRound))]
	public class StartOfRoundPatch
	{
		[HarmonyPatch("Awake")]
		[HarmonyPrefix]
		private static void Awake_Prefix(StartOfRound __instance)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			Plugin.LogDebug("Initialize managers...");
			GameObject val = new GameObject("InputManager");
			val.AddComponent<InputManager>();
			val = new GameObject("AudioManager");
			val.AddComponent<AudioManager>();
			val = new GameObject("IdentityManager");
			val.AddComponent<IdentityManager>();
			val = new GameObject("UIManager");
			val.AddComponent<UIManager>();
			val = Object.Instantiate<GameObject>(PluginManager.Instance.TerminalManagerPrefab);
			if (((NetworkBehaviour)__instance).NetworkManager.IsHost || ((NetworkBehaviour)__instance).NetworkManager.IsServer)
			{
				val.GetComponent<NetworkObject>().Spawn(false);
			}
			val = Object.Instantiate<GameObject>(PluginManager.Instance.SaveManagerPrefab);
			if (((NetworkBehaviour)__instance).NetworkManager.IsHost || ((NetworkBehaviour)__instance).NetworkManager.IsServer)
			{
				val.GetComponent<NetworkObject>().Spawn(false);
			}
			val = Object.Instantiate<GameObject>(PluginManager.Instance.InternManagerPrefab);
			if (((NetworkBehaviour)__instance).NetworkManager.IsHost || ((NetworkBehaviour)__instance).NetworkManager.IsServer)
			{
				val.GetComponent<NetworkObject>().Spawn(false);
			}
			InternManagerProvider.Instance = (IInternManager)(object)InternManager.Instance;
			IdentityManagerProvider.Instance = (IIdentityManager)(object)IdentityManager.Instance;
			InputManagerProvider.Instance = (IInputManager)(object)InputManager.Instance;
			SaveManagerProvider.Instance = (ISaveManager)(object)SaveManager.Instance;
			TerminalManagerProvider.Instance = (ITerminalManager)(object)TerminalManager.Instance;
			UIManagerProvider.Instance = (IUIManager)(object)UIManager.Instance;
			Plugin.LogDebug("... Managers started");
		}
	}
}
namespace LethalInternship.Managers
{
	internal class PluginManager : MonoBehaviour
	{
		public GameObject SaveManagerPrefab = null;

		public GameObject InternManagerPrefab = null;

		public GameObject TerminalManagerPrefab = null;

		public static PluginManager Instance { get; private set; }

		private void Awake()
		{
			Instance = this;
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		}

		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 GiveTakeItem { 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 ChangeSuitIntern { get; set; }

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

		[InputAction(/*Could not decode attribute arguments.*/)]
		public InputAction OpenCommandsIntern { 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<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<bool> canLosePlayer;

		[SyncedEntryField]
		private SyncedEntry<bool> followCrouchWithPlayer;

		[SyncedEntryField]
		private SyncedEntry<bool> changeSuitAutoBehaviour;

		[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> 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 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 bool CanLosePlayer => canLosePlayer.Value;

		public bool FollowCrouchWithPlayer => followCrouchWithPlayer.Value;

		public bool ChangeSuitAutoBehaviour => changeSuitAutoBehaviour.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 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_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Expected O, but got Unknown
			//IL_0326: Expected I4, but got Unknown
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Expected O, but got Unknown
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Expected O, but got Unknown
			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: 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>()));
			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 ?");
			canLosePlayer = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, ConfigConst.ConfigSectionBehaviour, "Can lose the player", false, "Can the intern lose the player if he goes too far ?");
			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)");
			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 shppping cart", false, "Should the intern try to grab the shopping cart (mod) ?");
			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()
		{
			NumberFormatInfo numberFormatInfo = new NumberFormatInfo();
			numberFormatInfo.NumberDecimalSeparator = ",";
			if (float.TryParse(volumeVoicesMultiplierInterns.Value, NumberStyles.Any, numberFormatInfo, out var result))
			{
				return Mathf.Clamp(result, 0f, 1f);
			}
			return VoicesConst.DEFAULT_VOICES_VOLUME_MULTIPLIER;
		}

		public float GetVolumeFootstepMultiplierInterns()
		{
			NumberFormatInfo numberFormatInfo = new NumberFormatInfo();
			numberFormatInfo.NumberDecimalSeparator = ",";
			if (float.TryParse(volumeFootstepMultiplierInterns.Value, NumberStyles.Any, numberFormatInfo, 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 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)(ref val)).ToString() ?? "");
			}
		}
	}
}
namespace LethalInternship.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}

plugins/Szumi57-LethalInternship/LethalInternship.Core.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
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.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.CoroutineControllers;
using LethalInternship.Core.Interns.AI.PointsOfInterest;
using LethalInternship.Core.Interns.AI.PointsOfInterest.InterestPoints;
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.CommandButton;
using LethalInternship.Core.UI.CommandsUI;
using LethalInternship.Core.UI.CommandsWheel;
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.Renderers;
using LethalInternship.Core.UI.Renderers.InterestPointsRenderer;
using LethalInternship.Core.Utils;
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.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.InputSystem;
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]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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]
	[Microsoft.CodeAnalysis.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.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)
			{
				PrintNode((IPrintableNode)tree);
				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 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;
		}
	}
}
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 GameObject? GetImagePrefab(IInterestPoint interestPoint)
		{
			if (wrappers.TryGetValue(((object)interestPoint).GetType(), out IInterestPointRendererWrapper value))
			{
				return value.GetImagePrefab(interestPoint);
			}
			return null;
		}

		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 GameObject GetImagePrefab(IInterestPoint interestPoint)
		{
			return renderer.GetImagePrefab((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<string, IIconUIInfos> dictIconInfos;

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

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

		public IIconUIInfos GetIconUIInfos(IPointOfInterest pointOfInterest)
		{
			string text = string.Empty;
			List<GameObject> list = new List<GameObject>();
			foreach (IInterestPoint listInterestPoint in pointOfInterest.GetListInterestPoints())
			{
				GameObject imagePrefab = registery.GetImagePrefab(listInterestPoint);
				if ((Object)(object)imagePrefab != (Object)null)
				{
					list.Add(imagePrefab);
					text += ((Object)imagePrefab).name;
				}
			}
			if (dictIconInfos.TryGetValue(text, out IIconUIInfos value))
			{
				return value;
			}
			dictIconInfos[text] = (IIconUIInfos)(object)new IconUIInfos(text, list);
			return dictIconInfos[text];
		}

		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 DefaultInterestPointRenderer : IInterestPointRenderer<DefaultInterestPoint>
	{
		public GameObject GetImagePrefab(DefaultInterestPoint defaultInterestPoint)
		{
			return PluginRuntimeProvider.Context.PedestrianIconImagePrefab;
		}

		public Vector3 GetUIPos(DefaultInterestPoint 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 GameObject GetImagePrefab(ShipInterestPoint interestPoint)
		{
			return PluginRuntimeProvider.Context.ShipIconImagePrefab;
		}

		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 GameObject GetImagePrefab(VehicleInterestPoint interestPoint)
		{
			return PluginRuntimeProvider.Context.VehicleIconImagePrefab;
		}

		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.Icons
{
	public class IconUIInfos : IIconUIInfos
	{
		private string UIKey;

		private List<GameObject> imagesPrefabs;

		public IconUIInfos(string uIKey, List<GameObject> imagesPrefabs)
		{
			this.imagesPrefabs = imagesPrefabs;
			UIKey = uIKey;
		}

		public List<GameObject> GetImagesPrefab()
		{
			return imagesPrefabs;
		}

		public string GetUIKey()
		{
			return UIKey;
		}
	}
}
namespace LethalInternship.Core.UI.Icons.WorldIcons
{
	public class WorldIconUI : IIconUI
	{
		private string key;

		private GameObject iconGameObject;

		private RectTransform rectTransformCanvasOverlay;

		private Vector3 iconWorldPosition;

		private WorldIconUIController iconUIController;

		public string Key => key;

		public bool IsIconActive => iconGameObject.activeSelf;

		public bool IsIconInCenter => IsIconActive && iconUIController.IsIconInCenter;

		public Vector3 IconWorldPosition => iconWorldPosition;

		public WorldIconUI(GameObject iconGameObject, IIconUIInfos iconUIInfos, RectTransform rectTransformCanvasOverlay)
		{
			this.iconGameObject = iconGameObject;
			key = iconUIInfos.GetUIKey();
			this.rectTransformCanvasOverlay = rectTransformCanvasOverlay;
			iconUIController = this.iconGameObject.GetComponentInChildren<WorldIconUIController>();
			iconUIController.SetImagesOnTop(iconUIInfos.GetImagesPrefab());
			SetIconActive(toActive: false);
		}

		public void SetPositionUI(Vector3 worldPosition)
		{
			//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)
			//IL_001d: 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_002a: Unknown result type (might be due to invalid IL or missing references)
			iconWorldPosition = worldPosition;
			Vector3 screenPos = WorldSpaceToCanvas(rectTransformCanvasOverlay, StartOfRound.Instance.localPlayerController.gameplayCamera, worldPosition);
			iconUIController.PlaceOnCanvas(screenPos, rectTransformCanvasOverlay);
		}

		public void SetColorIcon(Color color)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			iconUIController.SetColor(color);
		}

		public void SetDefaultColor()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			iconUIController.SetColor(new Color(1f, 37f / 85f, 0.003921569f));
		}

		public void SetIconActive(bool toActive)
		{
			iconGameObject.SetActive(toActive);
		}

		public void TriggerPingAnimation()
		{
			iconUIController.TriggerPingAnimation();
		}

		public static Vector3 WorldSpaceToCanvas(RectTransform canvasRect, Camera camera, Vector3 worldPos)
		{
			//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)
			//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_0012: 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_002f: 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_0042: 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)
			//IL_0063: 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_00b6: 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)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = camera.WorldToViewportPoint(worldPos);
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(val.x * canvasRect.sizeDelta.x - canvasRect.sizeDelta.x * 0.5f, val.y * canvasRect.sizeDelta.y - canvasRect.sizeDelta.y * 0.5f, Mathf.Abs(val.z));
			if (val.z < 0f)
			{
				if (val2.x > 0f)
				{
					val2.x = float.NegativeInfinity;
				}
				else
				{
					val2.x = float.PositiveInfinity;
				}
				val2.y *= -1f;
			}
			return val2;
		}
	}
	[ExecuteInEditMode]
	public class WorldIconUIController : MonoBehaviour
	{
		private RectTransform rectTransformIcon = null;

		private Animator animator = null;

		private bool isIconInCenter;

		private List<GameObject> ImagesTopPrefab = null;

		private List<Image> ImagesTop = null;

		private GameObject TopRow = null;

		private Image ImageBottom = null;

		private bool pingAnimationNextUpdate = false;

		public bool IsIconInCenter => isIconInCenter;

		private void Start()
		{
			rectTransformIcon = ((Component)this).GetComponent<RectTransform>();
			animator = ((Component)this).GetComponent<Animator>();
			ImageBottom = ((IEnumerable<Image>)((Component)this).GetComponentsInChildren<Image>()).FirstOrDefault((Func<Image, bool>)((Image x) => ((Object)x).name == "PointerIconImage"));
			TopRow = ((IEnumerable<Component>)((Component)this).GetComponentsInChildren<Component>()).FirstOrDefault((Func<Component, bool>)((Component x) => ((Object)x).name == "Top")).gameObject;
			UpdateImagesOnTop();
		}

		private void Update()
		{
			if (pingAnimationNextUpdate)
			{
				TriggerPingAnimation();
				pingAnimationNextUpdate = false;
			}
		}

		public void SetImagesOnTop(List<GameObject> images)
		{
			ImagesTopPrefab = images;
		}

		private void UpdateImagesOnTop()
		{
			if (ImagesTopPrefab == null || ImagesTopPrefab.Count == 0)
			{
				if ((Object)(object)PluginRuntimeProvider.Context.DefaultIconImagePrefab != (Object)null)
				{
					ImagesTop = new List<Image> { Object.Instantiate<GameObject>(PluginRuntimeProvider.Context.DefaultIconImagePrefab).GetComponent<Image>() };
					((Component)ImagesTop.First()).transform.SetParent(TopRow.transform);
				}
				return;
			}
			Image[] componentsInChildren = TopRow.GetComponentsInChildren<Image>();
			foreach (Image val in componentsInChildren)
			{
				Object.Destroy((Object)(object)((Component)val).gameObject);
			}
			ImagesTop = new List<Image>();
			foreach (GameObject item in ImagesTopPrefab)
			{
				GameObject val2 = Object.Instantiate<GameObject>(item);
				ImagesTop.Add(val2.GetComponent<Image>());
				val2.transform.SetParent(TopRow.transform);
			}
		}

		public void PlaceOnCanvas(Vector3 screenPos, RectTransform rectTransformCanvasParent)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: 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_01d2: 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_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: 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_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: 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)
			if ((Object)(object)rectTransformIcon == (Object)null)
			{
				return;
			}
			if (screenPos.z != 0f)
			{
				float num = 1f / screenPos.z * 400f;
				if (num < 10f)
				{
					num = 10f;
				}
				if (num > 200f)
				{
					num = 200f;
				}
				if (screenPos.z < 5f)
				{
					SetTransparency(screenPos.z / 5f * 0.5f);
				}
				else
				{
					SetTransparency(1f);
				}
				rectTransformIcon.sizeDelta = new Vector2(num, num);
			}
			if (screenPos.x - rectTransformIcon.sizeDelta.x * 0.5f < rectTransformCanvasParent.sizeDelta.x * -0.5f)
			{
				screenPos.x = rectTransformCanvasParent.sizeDelta.x * -0.5f + rectTransformIcon.sizeDelta.x * 0.5f;
			}
			if (screenPos.x + rectTransformIcon.sizeDelta.x * 0.5f > rectTransformCanvasParent.sizeDelta.x * 0.5f)
			{
				screenPos.x = rectTransformCanvasParent.sizeDelta.x * 0.5f - rectTransformIcon.sizeDelta.x * 0.5f;
			}
			if (screenPos.y < rectTransformCanvasParent.sizeDelta.y * -0.5f)
			{
				screenPos.y = rectTransformCanvasParent.sizeDelta.y * -0.5f;
			}
			if (screenPos.y + rectTransformIcon.sizeDelta.y > rectTransformCanvasParent.sizeDelta.y * 0.5f)
			{
				screenPos.y = rectTransformCanvasParent.sizeDelta.y * 0.5f - rectTransformIcon.sizeDelta.y;
			}
			((Transform)rectTransformIcon).localPosition = new Vector3(screenPos.x, screenPos.y + rectTransformIcon.sizeDelta.y * 0.5f, 0f);
			float num2 = ((Transform)rectTransformIcon).localPosition.x - rectTransformIcon.sizeDelta.x / 2f;
			float num3 = ((Transform)rectTransformIcon).localPosition.x + rectTransformIcon.sizeDelta.x / 2f;
			float num4 = ((Transform)rectTransformIcon).localPosition.y + rectTransformIcon.sizeDelta.y / 2f;
			float num5 = ((Transform)rectTransformIcon).localPosition.y - rectTransformIcon.sizeDelta.y / 2f;
			isIconInCenter = num2 < 0f && num3 > 0f && num4 > 0f && num5 < 0f;
			animator.SetBool("IsHovered", isIconInCenter);
		}

		private void SetTransparency(float alpha)
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: 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_0029: 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_003f: 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)
			if (ImagesTop != null)
			{
				foreach (Image item in ImagesTop)
				{
					((Graphic)item).color = new Color(((Graphic)item).color.r, ((Graphic)item).color.g, ((Graphic)item).color.b, alpha);
				}
			}
			if ((Object)(object)ImageBottom != (Object)null)
			{
				((Graphic)ImageBottom).color = new Color(((Graphic)ImageBottom).color.r, ((Graphic)ImageBottom).color.g, ((Graphic)ImageBottom).color.b, alpha);
			}
		}

		public void SetColor(Color color)
		{
			//IL_0083: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: 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)
			//IL_0028: 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_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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 (ImagesTop != null)
			{
				foreach (Image item in ImagesTop)
				{
					((Graphic)item).color = new Color(color.r, color.g, color.b, ((Graphic)item).color.a);
				}
			}
			if ((Object)(object)ImageBottom != (Object)null)
			{
				((Graphic)ImageBottom).color = new Color(color.r, color.g, color.b, ((Graphic)ImageBottom).color.a);
			}
		}

		public void TriggerPingAnimation()
		{
			if ((Object)(object)animator == (Object)null)
			{
				pingAnimationNextUpdate = true;
				return;
			}
			animator.ResetTrigger("Ping");
			animator.SetTrigger("Ping");
		}
	}
}
namespace LethalInternship.Core.UI.Icons.Pools
{
	public abstract class IconUIPoolBase<T> where T : IIconUI
	{
		private List<T> icons;

		protected IconUIPoolBase()
		{
			icons = new List<T>();
		}

		protected abstract T NewIcon(IIconUIInfos iconInfos);

		public T GetIcon(IIconUIInfos iconInfos)
		{
			for (int num = icons.Count - 1; num >= 0; num--)
			{
				if (((IIconUI)icons[num]).Key == iconInfos.GetUIKey())
				{
					T result = icons[num];
					icons.RemoveAt(num);
					return result;
				}
			}
			PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
			if (logDebug != null)
			{
				logDebug.Invoke($"---------------------- NewIcon {typeof(T)}");
			}
			return NewIcon(iconInfos);
		}

		public void ReturnIcon(T icon)
		{
			icons.Add(icon);
		}

		public void DisableOtherIcons()
		{
			foreach (T icon in icons)
			{
				((IIconUI)icon).SetIconActive(false);
			}
		}
	}
	public class InputIconUIPool : IconUIPoolBase<InputIconUI>
	{
		private Canvas canvasOverlay;

		private RectTransform rectTransformCanvasOverlay;

		public InputIconUIPool(Canvas canvasOverlay)
		{
			this.canvasOverlay = canvasOverlay;
			rectTransformCanvasOverlay = ((Component)canvasOverlay).GetComponentInChildren<RectTransform>();
		}

		protected override InputIconUI NewIcon(IIconUIInfos iconInfos)
		{
			return new InputIconUI(Object.Instantiate<GameObject>(PluginRuntimeProvider.Context.InputIconPrefab, ((Component)canvasOverlay).transform), iconInfos, rectTransformCanvasOverlay);
		}
	}
	public class WorldIconUIPool : IconUIPoolBase<WorldIconUI>
	{
		private Canvas canvasOverlay;

		private RectTransform rectTransformCanvasOverlay;

		public WorldIconUIPool(Canvas canvasOverlay)
		{
			this.canvasOverlay = canvasOverlay;
			rectTransformCanvasOverlay = ((Component)canvasOverlay).GetComponentInChildren<RectTransform>();
		}

		protected override WorldIconUI NewIcon(IIconUIInfos iconInfos)
		{
			return new WorldIconUI(Object.Instantiate<GameObject>(PluginRuntimeProvider.Context.WorldIconPrefab, ((Component)canvasOverlay).transform), iconInfos, rectTransformCanvasOverlay);
		}
	}
}
namespace LethalInternship.Core.UI.Icons.InputIcons
{
	public class InputIconUI : IIconUI
	{
		private string key;

		private GameObject iconGameObject;

		private RectTransform rectTransformCanvasOverlay;

		private InputIconUIController iconUIController;

		public string Key => key;

		public InputIconUI(GameObject iconGameObject, IIconUIInfos iconUIInfos, RectTransform rectTransformCanvasOverlay)
		{
			this.iconGameObject = iconGameObject;
			key = iconUIInfos.GetUIKey();
			this.rectTransformCanvasOverlay = rectTransformCanvasOverlay;
			iconUIController = this.iconGameObject.GetComponentInChildren<InputIconUIController>();
			iconUIController.SetImageOnTop(iconUIInfos.GetImagesPrefab().First());
			SetIconActive(active: false);
		}

		public void SetPositionUICenter()
		{
			iconUIController.PlaceOnCenterCanvas();
			SetIconActive(active: true);
		}

		public void SetColorIconValidOrNot(bool isValidNavMeshPoint)
		{
			//IL_0022: 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)
			if (isValidNavMeshPoint)
			{
				iconUIController.SetColor(Color.green);
			}
			else
			{
				iconUIController.SetColor(Color.red);
			}
		}

		public void SetIconActive(bool active)
		{
			iconGameObject.SetActive(active);
		}
	}
	public class InputIconUIController : MonoBehaviour
	{
		private RectTransform rectTransformIcon = null;

		private bool isIconInCenter;

		private GameObject ImageTopPrefab = null;

		private Image ImageTop = null;

		private Image ImageBottom = null;

		public bool IsIconInCenter => isIconInCenter;

		private void Start()
		{
			rectTransformIcon = ((Component)this).GetComponent<RectTransform>();
			ImageBottom = ((IEnumerable<Image>)((Component)this).GetComponentsInChildren<Image>()).FirstOrDefault((Func<Image, bool>)((Image x) => ((Object)x).name == "PointerIconImage"));
			UpdateImagesOnTop();
		}

		public void SetImageOnTop(GameObject image)
		{
			ImageTopPrefab = image;
		}

		private void UpdateImagesOnTop()
		{
			if ((Object)(object)ImageTopPrefab == (Object)null)
			{
				Object.Destroy((Object)(object)((Component)((IEnumerable<Image>)((Component)this).GetComponentsInChildren<Image>()).FirstOrDefault((Func<Image, bool>)((Image x) => ((Object)x).name != "PointerIconImage"))).gameObject);
				ImageTop = Object.Instantiate<GameObject>(PluginRuntimeProvider.Context.DefaultIconImagePrefab).GetComponent<Image>();
				((Component)ImageTop).transform.SetParent(((Component)this).transform);
				return;
			}
			Object.Destroy((Object)(object)((Component)((IEnumerable<Image>)((Component)this).GetComponentsInChildren<Image>()).FirstOrDefault((Func<Image, bool>)((Image x) => ((Object)x).name != "PointerIconImage"))).gameObject);
			GameObject val = Object.Instantiate<GameObject>(ImageTopPrefab);
			ImageTop = val.GetComponent<Image>();
			val.transform.SetParent(((Component)this).transform);
			val.transform.SetAsFirstSibling();
		}

		public void PlaceOnCenterCanvas()
		{
			//IL_002f: 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)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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)
			if (!((Object)(object)rectTransformIcon == (Object)null))
			{
				Vector3 val = default(Vector3);
				((Vector3)(ref val))..ctor(0f, 0f, 10f);
				float num = 1f / val.z * 400f;
				rectTransformIcon.sizeDelta = new Vector2(num, num);
				((Transform)rectTransformIcon).localPosition = new Vector3(val.x, val.y, 0f);
			}
		}

		public void SetColor(Color color)
		{
			//IL_0018: 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_0024: 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_003a: 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_0063: 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_0075: 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)
			if ((Object)(object)ImageTop != (Object)null)
			{
				((Graphic)ImageTop).color = new Color(color.r, color.g, color.b, ((Graphic)ImageTop).color.a);
			}
			if ((Object)(object)ImageBottom != (Object)null)
			{
				((Graphic)ImageBottom).color = new Color(color.r, color.g, color.b, ((Graphic)ImageBottom).color.a);
			}
		}
	}
}
namespace LethalInternship.Core.UI.CommandsWheel
{
	public class CommandWheelController : MonoBehaviour
	{
		public CommandButtonController[] CommandButtons;

		public Sprite[] UsedSpritesInAnimation;

		public TextMeshProUGUI CommandDescription;

		public RectTransform CommandWheelRectTransform;

		private CommandButtonController closestButton;

		private RectTransform CanvasOverlayRectTransform;

		private TMP_FontAsset font;

		private void Start()
		{
			CommandButtons = ((Component)this).GetComponentsInChildren<CommandButtonController>();
			if (CommandButtons == null || CommandButtons.Length == 0)
			{
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke("No CommandButtons found !");
				}
			}
			if (UsedSpritesInAnimation == null || UsedSpritesInAnimation.Length == 0)
			{
				PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
				if (logDebug2 != null)
				{
					logDebug2.Invoke("No UsedSpritesInAnimation found !");
				}
			}
			if ((Object)(object)CommandDescription == (Object)null)
			{
				CommandDescription = ((Component)this).GetComponent<TextMeshProUGUI>();
			}
			if ((Object)(object)CommandDescription == (Object)null)
			{
				PluginLogDebugDelegate logDebug3 = PluginLoggerHook.LogDebug;
				if (logDebug3 != null)
				{
					logDebug3.Invoke("No CommandDescription found !");
				}
			}
			CanvasOverlayRectTransform = ((Component)UIManager.Instance.CanvasOverlay).GetComponentInChildren<RectTransform>();
		}

		private void Update()
		{
			//IL_0142: 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)
			if (CommandButtons == null || CommandButtons.Length == 0 || UsedSpritesInAnimation == null || UsedSpritesInAnimation.Length == 0)
			{
				return;
			}
			closestButton = GetClosestButton();
			CommandButtonController[] commandButtons = CommandButtons;
			foreach (CommandButtonController commandButtonController in commandButtons)
			{
				if ((Object)(object)commandButtonController == (Object)(object)closestButton)
				{
					commandButtonController.CommandFrameImage.sprite = UsedSpritesInAnimation[1];
					((Graphic)commandButtonController.CommandIcon).color = new Color(0f, 0f, 0f);
					if (!((Object)(object)CommandDescription == (Object)null))
					{
						if (UIConst.COMMANDS_BUTTON_STRING.Length <= commandButtonController.ID)
						{
							((TMP_Text)CommandDescription).text = string.Empty;
						}
						else
						{
							((TMP_Text)CommandDescription).text = UIConst.COMMANDS_BUTTON_STRING[commandButtonController.ID].ToString();
						}
					}
				}
				else
				{
					commandButtonController.CommandFrameImage.sprite = UsedSpritesInAnimation[0];
					((Graphic)commandButtonController.CommandIcon).color = new Color(1f, 1f, 1f);
				}
			}
		}

		private CommandButtonController GetClosestButton()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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_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_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: 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_00b7: 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)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			float num = float.MaxValue;
			CommandButtonController result = CommandButtons[0];
			CommandButtonController[] commandButtons = CommandButtons;
			Vector2 val = default(Vector2);
			Vector2 val3 = default(Vector2);
			foreach (CommandButtonController commandButtonController in commandButtons)
			{
				if (!commandButtonController.IsNotAvailable)
				{
					((Vector2)(ref val))..ctor(((Component)CommandWheelRectTransform).transform.localPosition.x, ((Component)CommandWheelRectTransform).transform.localPosition.y);
					Vector2 val2 = new Vector2(((Component)commandButtonController).transform.localPosition.x, ((Component)commandButtonController).transform.localPosition.y) + val;
					RectTransformUtility.ScreenPointToLocalPointInRectangle(CanvasOverlayRectTransform, ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(), (Camera)null, ref val3);
					Vector2 val4 = val3 - val2;
					float sqrMagnitude = ((Vector2)(ref val4)).sqrMagnitude;
					if (sqrMagnitude < num)
					{
						num = sqrMagnitude;
						result = commandButtonController;
					}
				}
			}
			return result;
		}

		public CommandButtonController? GetGoToVehicleButton()
		{
			if (CommandButtons != null)
			{
				return CommandButtons.FirstOrDefault((CommandButtonController x) => x.ID == 4);
			}
			return null;
		}

		public void CommandWheelMouseDown()
		{
			closestButton.Selected();
		}

		public void SetFont(TMP_FontAsset font)
		{
			this.font = font;
			((TMP_Text)CommandDescription).font = font;
		}
	}
	public enum SpriteForAnimation
	{
		WheelButtonFrameUnselected,
		WheelButtonFrameSelected
	}
}
namespace LethalInternship.Core.UI.CommandsUI
{
	public class CommandsUIController : MonoBehaviour
	{
		public CommandWheelController CommandWheelController;

		public TextMeshProUGUI TitleListInterns;

		public TextMeshProUGUI ListInterns;

		public TextMeshProUGUI ModNamePanelDescription;

		private TMP_FontAsset font;

		private void Start()
		{
			((TMP_Text)ModNamePanelDescription).text = PluginRuntimeProvider.Context.Plugin_Name + " v" + PluginRuntimeProvider.Context.Plugin_Version;
		}

		public void SetTitleListInterns(string title)
		{
			((TMP_Text)TitleListInterns).text = title;
		}

		public void SetTextListInterns(string textList)
		{
			((TMP_Text)ListInterns).text = textList;
		}

		public void SetFont(TMP_FontAsset font)
		{
			this.font = font;
			((TMP_Text)TitleListInterns).font = font;
			((TMP_Text)ListInterns).font = font;
			((TMP_Text)ModNamePanelDescription).font = font;
			CommandWheelController.SetFont(this.font);
		}

		public void CommandUIMouseDown()
		{
			CommandWheelController.CommandWheelMouseDown();
		}
	}
}
namespace LethalInternship.Core.UI.CommandButton
{
	public class CommandButtonController : MonoBehaviour
	{
		public int ID;

		public Image CommandFrameImage;

		public Image CommandIcon;

		public bool IsNotAvailable;

		public event EventHandler OnSelected = null;

		private void Start()
		{
			if ((Object)(object)CommandFrameImage == (Object)null)
			{
				CommandFrameImage = ((Component)this).GetComponent<Image>();
			}
			if ((Object)(object)CommandIcon == (Object)null)
			{
				CommandIcon = ((Component)this).GetComponentInChildren<Image>();
			}
		}

		private void Update()
		{
			float transparency = 1f;
			if (IsNotAvailable)
			{
				transparency = 0.2f;
			}
			SetTransparency(CommandFrameImage, transparency);
			SetTransparency(CommandIcon, transparency);
		}

		private void SetTransparency(Image image, float transparency)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: 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)
			if ((Object)(object)image != (Object)null)
			{
				Color color = ((Graphic)image).color;
				color.a = transparency;
				((Graphic)image).color = color;
			}
		}

		public void Selected()
		{
			this.OnSelected?.Invoke(this, null);
		}
	}
}
namespace LethalInternship.Core.TerminalAdapter
{
	public class TerminalParser
	{
		public TerminalState TerminalState = null;

		public TerminalParser()
		{
			TerminalState = new WaitForMainCommandPage(this);
		}

		public TerminalNode? ParseCommand(string command, ref Terminal terminal)
		{
			if (string.IsNullOrWhiteSpace(command))
			{
				return null;
			}
			RemovePunctuation_ReversePatchDelegate removePunctuation_ReversePatch = TerminalHook.RemovePunctuation_ReversePatch;
			command = ((removePunctuation_ReversePatch != null) ? removePunctuation_ReversePatch.Invoke((object)terminal, command) : null) ?? string.Empty;
			if (string.IsNullOrWhiteSpace(command))
			{
				return null;
			}
			string[] array = command.Split(" ", StringSplitOptions.RemoveEmptyEntries);
			if (array.Length == 0)
			{
				return null;
			}
			if (TerminalState.ParseCommandValid(array))
			{
				TerminalNode val = TerminalState.DisplayNode();
				if ((Object)(object)val != (Object)null)
				{
					val.displayText += "\n";
				}
				return val;
			}
			TerminalState = new WaitForMainCommandPage(this);
			return null;
		}

		public bool IsMatchWord(string word, string match)
		{
			return match.Contains(word) && match[0] == word[0];
		}

		public bool BuyCommandSetNextPage(string[] words)
		{
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Invalid comparison between Unknown and I4
			if (TerminalManager.Instance.GetTerminal().groupCredits < PluginRuntimeProvider.Context.Config.InternPrice)
			{
				TerminalState = new ErrorPage(TerminalState, (EnumErrorTypeTerminalPage)1);
				return true;
			}
			if (IdentityManager.Instance.GetNbIdentitiesAvailable() <= 0)
			{
				TerminalState = new ErrorPage(TerminalState, (EnumErrorTypeTerminalPage)2);
				return true;
			}
			if (StartOfRound.Instance.shipIsLeaving)
			{
				TerminalState = new ErrorPage(TerminalState, (EnumErrorTypeTerminalPage)3);
				return true;
			}
			if (words.Length <= 1)
			{
				TerminalState = new ConfirmCancelPurchasePage(TerminalState, 1);
				return true;
			}
			if (!string.IsNullOrWhiteSpace(words[1]) && int.TryParse(words[1], out var result) && result > 0)
			{
				TerminalState = new ConfirmCancelPurchasePage(TerminalState, result);
				return true;
			}
			string text = string.Empty;
			for (int i = 1; i < words.Length; i++)
			{
				text += words[i].Trim();
			}
			if (text.Length <= 2)
			{
				TerminalState = new ConfirmCancelPurchasePage(TerminalState, 1);
				return true;
			}
			string[] identitiesNamesLowerCaseWithoutSpace = IdentityManager.Instance.GetIdentitiesNamesLowerCaseWithoutSpace();
			for (int num = text.Length - 1; num >= 1; num--)
			{
				string value = text.Substring(0, num + 1);
				for (int j = 0; j < identitiesNamesLowerCaseWithoutSpace.Length; j++)
				{
					if (identitiesNamesLowerCaseWithoutSpace[j].Contains(value))
					{
						if (!IdentityManager.Instance.InternIdentities[j].Alive && !StartOfRound.Instance.inShipPhase)
						{
							TerminalState = new ErrorPage(TerminalState, (EnumErrorTypeTerminalPage)4);
							return true;
						}
						if ((int)IdentityManager.Instance.InternIdentities[j].Status == 1)
						{
							TerminalState = new ErrorPage(TerminalState, (EnumErrorTypeTerminalPage)5);
							return true;
						}
						TerminalState = new ConfirmCancelPurchasePage(TerminalState, 1, j);
						return true;
					}
				}
			}
			TerminalState = new ConfirmCancelPurchasePage(TerminalState, 1);
			return true;
		}
	}
	public abstract class TerminalState
	{
		private EnumTerminalStates currentState;

		protected TerminalParser terminalParser;

		protected Dictionary<EnumTerminalStates, TerminalNode> dictTerminalNodeByState;

		protected EnumTerminalStates CurrentState
		{
			get
			{
				//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 currentState;
			}
			set
			{
				//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)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				currentState = value;
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke($"TerminalState new state :                 {currentState}");
				}
			}
		}

		protected TerminalState(TerminalState oldState)
			: this(oldState.terminalParser)
		{
			dictTerminalNodeByState = oldState.dictTerminalNodeByState;
		}

		protected TerminalState(TerminalParser terminalParser)
		{
			if (terminalParser == null)
			{
				throw new NullReferenceException("TerminalParser is null.");
			}
			this.terminalParser = terminalParser;
			if (dictTerminalNodeByState == null)
			{
				dictTerminalNodeByState = new Dictionary<EnumTerminalStates, TerminalNode>();
			}
		}

		public virtual EnumTerminalStates GetTerminalState()
		{
			//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 CurrentState;
		}

		public abstract bool ParseCommandValid(string[] words);

		public abstract TerminalNode? DisplayNode();
	}
}
namespace LethalInternship.Core.TerminalAdapter.TerminalStates
{
	public class ConfirmCancelPurchasePage : TerminalState
	{
		private int nbOrdered;

		private int idIdentityChosen = -1;

		public ConfirmCancelPurchasePage(TerminalState oldState, int nbOrdered)
			: base(oldState)
		{
			base.CurrentState = (EnumTerminalStates)3;
			int nbIdentitiesAvailable = IdentityManager.Instance.GetNbIdentitiesAvailable();
			if (nbOrdered > nbIdentitiesAvailable)
			{
				nbOrdered = nbIdentitiesAvailable;
			}
			int internPrice = PluginRuntimeProvider.Context.Config.InternPrice;
			if (internPrice <= 0)
			{
				this.nbOrdered = nbOrdered;
				return;
			}
			int num = (int)Math.Floor((float)TerminalManager.Instance.GetTerminal().groupCredits / (float)internPrice);
			this.nbOrdered = ((nbOrdered < num) ? nbOrdered : num);
		}

		public ConfirmCancelPurchasePage(TerminalState oldState, int nbOrdered, int idIdentityChosen)
			: this(oldState, nbOrdered)
		{
			this.idIdentityChosen = idIdentityChosen;
		}

		public override bool ParseCommandValid(string[] words)
		{
			string text = words[0];
			if (string.IsNullOrWhiteSpace(text))
			{
				return false;
			}
			TerminalManager instance = TerminalManager.Instance;
			if (terminalParser.IsMatchWord(text, instance.CommandIntershipProgram) || terminalParser.IsMatchWord(text, TerminalConst.STRING_CANCEL_COMMAND) || terminalParser.IsMatchWord(text, TerminalConst.STRING_BACK_COMMAND))
			{
				terminalParser.TerminalState = new InfoPage(this);
				return true;
			}
			if (terminalParser.IsMatchWord(text, TerminalConst.STRING_CONFIRM_COMMAND))
			{
				int num = instance.GetTerminal().groupCredits - PluginRuntimeProvider.Context.Config.InternPrice * nbOrdered;
				instance.GetTerminal().groupCredits = num;
				if (idIdentityChosen == -1)
				{
					instance.BuyRandomInternsServerRpc(num, nbOrdered);
				}
				else
				{
					instance.BuySpecificInternServerRpc(num, idIdentityChosen);
				}
				if (((NetworkBehaviour)instance).IsServer)
				{
					terminalParser.TerminalState = new InfoPage(this);
				}
				else
				{
					int diffNbInternAvailable = -nbOrdered;
					int diffNbInternToDrop = nbOrdered;
					terminalParser.TerminalState = new InfoPage(this, diffNbInternAvailable, diffNbInternToDrop);
				}
				return true;
			}
			return false;
		}

		public override TerminalNode? DisplayNode()
		{
			//IL_0008: 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)
			if (!dictTerminalNodeByState.TryGetValue(GetTerminalState(), out TerminalNode value))
			{
				value = ScriptableObject.CreateInstance<TerminalNode>();
				dictTerminalNodeByState[GetTerminalState()] = value;
			}
			value.clearPreviousText = true;
			int nbIdentitiesAvailable = IdentityManager.Instance.GetNbIdentitiesAvailable();
			string arg = string.Empty;
			if (nbOrdered > nbIdentitiesAvailable)
			{
				arg = TerminalConst.TEXT_CONFIRM_CANCEL_PURCHASE_MAXIMUM;
				nbOrdered = nbIdentitiesAvailable;
			}
			if (idIdentityChosen < 0)
			{
				value.displayText = string.Format(TerminalConst.TEXT_CONFIRM_CANCEL_PURCHASE, nbOrdered, arg, PluginRuntimeProvider.Context.Config.InternPrice * nbOrdered);
			}
			else
			{
				IInternIdentity val = IdentityManager.Instance.InternIdentities[idIdentityChosen];
				string arg2 = (val.Alive ? string.Empty : TerminalConst.TEXT_CONFIRM_CANCEL_REVIVE_INTERN);
				value.displayText = string.Format(TerminalConst.TEXT_CONFIRM_CANCEL_SPECIFIC_PURCHASE, val.Name, arg2, PluginRuntimeProvider.Context.Config.InternPrice * nbOrdered);
			}
			return value;
		}
	}
	public class ErrorPage : TerminalState
	{
		private readonly EnumErrorTypeTerminalPage enumErrorType;

		public ErrorPage(TerminalState newState, EnumErrorTypeTerminalPage enumErrorType)
			: base(newState)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			base.CurrentState = (EnumTerminalStates)0;
			this.enumErrorType = enumErrorType;
		}

		public override bool ParseCommandValid(string[] words)
		{
			terminalParser.TerminalState = new InfoPage(this);
			return true;
		}

		public override TerminalNode? DisplayNode()
		{
			//IL_0008: 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_0043: 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_0045: 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_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected I4, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			if (!dictTerminalNodeByState.TryGetValue(GetTerminalState(), out TerminalNode value))
			{
				value = ScriptableObject.CreateInstance<TerminalNode>();
				dictTerminalNodeByState[GetTerminalState()] = value;
			}
			value.clearPreviousText = true;
			EnumErrorTypeTerminalPage val = enumErrorType;
			EnumErrorTypeTerminalPage val2 = val;
			switch (val2 - 1)
			{
			case 0:
				value.displayText = TerminalConst.TEXT_ERROR_NOT_ENOUGH_CREDITS;
				break;
			case 1:
				value.displayText = TerminalConst.TEXT_NO_MORE_INTERNS_PURCHASABLE;
				break;
			case 2:
				value.displayText = TerminalConst.TEXT_ERROR_SHIP_LEAVING;
				break;
			case 3:
				value.displayText = TerminalConst.TEXT_ERROR_INTERN_DEAD;
				break;
			case 4:
				value.displayText = TerminalConst.TEXT_ERROR_INTERN_ALREADY_SELECTED;
				break;
			default:
				value.displayText = TerminalConst.TEXT_ERROR_DEFAULT;
				break;
			}
			TerminalManager.Instance.GetTerminal().terminalAudio.PlayOneShot(TerminalManager.Instance.GetTerminal().syncedAudios[TerminalConst.INDEX_AUDIO_ERROR]);
			return value;
		}
	}
	public class InfoPage : TerminalState
	{
		private int diffNbInternAvailable;

		private int diffNbInternToDrop;

		public InfoPage(TerminalState newState)
			: base(newState)
		{
			base.CurrentState = (EnumTerminalStates)2;
			diffNbInternAvailable = 0;
			diffNbInternToDrop = 0;
		}

		public InfoPage(TerminalState newState, int diffNbInternAvailable, int diffNbInternToDrop)
			: base(newState)
		{
			base.CurrentState = (EnumTerminalStates)2;
			this.diffNbInternAvailable = diffNbInternAvailable;
			this.diffNbInternToDrop = diffNbInternToDrop;
		}

		public override bool ParseCommandValid(string[] words)
		{
			string text = words[0];
			if (string.IsNullOrWhiteSpace(text))
			{
				return false;
			}
			if (terminalParser.IsMatchWord(text, TerminalManager.Instance.CommandIntershipProgram) || terminalParser.IsMatchWord(text, TerminalConst.STRING_BACK_COMMAND))
			{
				return true;
			}
			if (terminalParser.IsMatchWord(text, TerminalConst.STRING_BUY_COMMAND))
			{
				return terminalParser.BuyCommandSetNextPage(words);
			}
			if (terminalParser.IsMatchWord(text, TerminalConst.STRING_LAND_COMMAND))
			{
				return LandingStatusCommand(text);
			}
			if (terminalParser.IsMatchWord(text, TerminalConst.STRING_STATUS_COMMAND))
			{
				terminalParser.TerminalState = new StatusPage(this);
				return true;
			}
			return false;
		}

		private bool LandingStatusCommand(string command)
		{
			TerminalManager instance = TerminalManager.Instance;
			InternManager instance2 = InternManager.Instance;
			if (terminalParser.IsMatchWord(command, TerminalConst.STRING_LAND_COMMAND))
			{
				instance2.LandingStatusAllowed = !instance2.LandingStatusAllowed;
			}
			instance.SyncLandingStatusServerRpc(instance2.LandingStatusAllowed);
			return true;
		}

		public override TerminalNode? DisplayNode()
		{
			//IL_001a: 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)
			StartOfRound instance = StartOfRound.Instance;
			InternManager instance2 = InternManager.Instance;
			IdentityManager instance3 = IdentityManager.Instance;
			if (!dictTerminalNodeByState.TryGetValue(GetTerminalState(), out TerminalNode value))
			{
				value = ScriptableObject.CreateInstance<TerminalNode>();
				dictTerminalNodeByState[GetTerminalState()] = value;
			}
			value.clearPreviousText = true;
			string text = (instance2.LandingStatusAllowed ? TerminalConst.STRING_LANDING_STATUS_ALLOWED : TerminalConst.STRING_LANDING_STATUS_ABORTED);
			bool flag = instance.currentLevel.levelID == Const.COMPANY_BUILDING_MOON_ID;
			if (flag)
			{
				text += TerminalConst.STRING_LANDING_STATUS_ABORTED_COMPANY_MOON;
			}
			int num = instance3.GetNbIdentitiesAvailable() + diffNbInternAvailable;
			int num2 = instance3.GetNbIdentitiesToDrop() + diffNbInternToDrop;
			diffNbInternAvailable = 0;
			diffNbInternToDrop = 0;
			string displayText;
			if (instance.inShipPhase || instance.shipIsLeaving || flag)
			{
				displayText = string.Format(TerminalConst.TEXT_INFO_PAGE_IN_SPACE, num, PluginRuntimeProvider.Context.Config.InternPrice, num2, text);
			}
			else
			{
				string text2 = string.Empty;
				int nbIdentitiesSpawned = instance3.GetNbIdentitiesSpawned();
				if (num2 > 0 && !instance.shipIsLeaving)
				{
					text2 = string.Format(TerminalConst.TEXT_INFO_PAGE_INTERN_TO_DROPSHIP, num2);
				}
				displayText = string.Format(TerminalConst.TEXT_INFO_PAGE_ON_MOON, num, PluginRuntimeProvider.Context.Config.InternPrice, text2, nbIdentitiesSpawned, text);
			}
			value.displayText = displayText;
			return value;
		}
	}
	public class StatusPage : TerminalState
	{
		public StatusPage(TerminalState newState)
			: base(newState)
		{
			base.CurrentState = (EnumTerminalStates)6;
		}

		public override bool ParseCommandValid(string[] words)
		{
			string text = words[0];
			if (string.IsNullOrWhiteSpace(text))
			{
				terminalParser.TerminalState = new InfoPage(this);
				return true;
			}
			if (terminalParser.IsMatchWord(text, TerminalConst.STRING_BUY_COMMAND))
			{
				return terminalParser.BuyCommandSetNextPage(words);
			}
			terminalParser.TerminalState = new InfoPage(this);
			return true;
		}

		public override TerminalNode? DisplayNode()
		{
			//IL_0008: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected I4, but got Unknown
			if (!dictTerminalNodeByState.TryGetValue(GetTerminalState(), out TerminalNode value))
			{
				value = ScriptableObject.CreateInstance<TerminalNode>();
				dictTerminalNodeByState[GetTerminalState()] = value;
			}
			value.clearPreviousText = true;
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(string.Format("{0,-20} {1,-3} {2,-7}  {3,-4}", "Name", "Hp", "Status", "Suit"));
			stringBuilder.AppendLine();
			stringBuilder.Append("---------------------------------------------------");
			IInternIdentity[] internIdentities = IdentityManager.Instance.InternIdentities;
			for (int i = 0; i < internIdentities.Length; i++)
			{
				InternIdentity internIdentity = (InternIdentity)(object)internIdentities[i];
				if (internIdentity != null)
				{
					string text = string.Empty;
					EnumStatusIdentity status = internIdentity.Status;
					EnumStatusIdentity val = status;
					switch ((int)val)
					{
					case 1:
						text = "to drop";
						break;
					case 2:
						text = "on moon";
						break;
					}
					if (!internIdentity.Alive)
					{
						text = "dead";
					}
					string text2 = internIdentity.Name.Truncate(19);
					string text3 = internIdentity.Suit.Truncate(16);
					stringBuilder.AppendLine();
					stringBuilder.Append($"{text2,-20} {internIdentity.Hp,-3} {text,-7}  {text3}");
				}
			}
			value.displayText = string.Format(TerminalConst.TEXT_STATUS, stringBuilder.ToString());
			return value;
		}
	}
	public static class StringExt
	{
		public static string? Truncate(this string? value, int maxLength, string truncationSuffix = "…")
		{
			return (value != null && value.Length > maxLength) ? (value.Substring(0, maxLength) + truncationSuffix) : value;
		}
	}
	public class WaitForMainCommandPage : TerminalState
	{
		public WaitForMainCommandPage(TerminalParser terminalParser)
			: base(terminalParser)
		{
			base.CurrentState = (EnumTerminalStates)1;
		}

		public WaitForMainCommandPage(TerminalState newState)
			: base(newState)
		{
			base.CurrentState = (EnumTerminalStates)1;
		}

		public override bool ParseCommandValid(string[] words)
		{
			string text = words[0];
			if (string.IsNullOrWhiteSpace(text) || !terminalParser.IsMatchWord(text, TerminalManager.Instance.CommandIntershipProgram))
			{
				return false;
			}
			terminalParser.TerminalState = new InfoPage(this);
			return true;
		}

		public override TerminalNode? DisplayNode()
		{
			return null;
		}
	}
}
namespace LethalInternship.Core.SaveAdapter
{
	[Serializable]
	internal class SaveFile
	{
		public bool LandingStatusAborted;

		public IdentitySaveFile[] IdentitiesSaveFiles;
	}
	[Serializable]
	internal class IdentitySaveFile
	{
		public int IdIdentity;

		public int SuitID;

		public int Hp;

		public int Status;

		public override string ToString()
		{
			return $"IdIdentity: {IdIdentity}, suitID {SuitID}, Hp {Hp}, Status {Status} {(object)(EnumStatusIdentity)Status}";
		}
	}
}
namespace LethalInternship.Core.Managers
{
	public class AudioManager : MonoBehaviour
	{
		public Dictionary<string, AudioClip?> DictAudioClipsByPath = new Dictionary<string, AudioClip>();

		public static AudioManager Instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this)
			{
				Object.Destroy((Object)(object)((Component)Instance).gameObject);
			}
			Instance = this;
			try
			{
				LoadAllVoiceLanguageAudioAssets();
			}
			catch (Exception ex)
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("Error while loading voice audios, error : " + ex.Message);
				}
			}
		}

		private void LoadAllVoiceLanguageAudioAssets()
		{
			string voicesPath = PluginRuntimeProvider.Context.VoicesPath;
			if (Directory.Exists(voicesPath))
			{
				string[] files = Directory.GetFiles(voicesPath, "*.ogg", SearchOption.AllDirectories);
				foreach (string text in files)
				{
					AddPath("file://" + text);
				}
				return;
			}
			voicesPath = Path.Combine(PluginRuntimeProvider.Context.DirectoryName, VoicesConst.VOICES_PATH);
			if (!Directory.Exists(voicesPath))
			{
				Directory.CreateDirectory(voicesPath);
				Assembly executingAssembly = Assembly.GetExecutingAssembly();
				using Stream stream = executingAssembly.GetManifestResourceStream(executingAssembly.GetName().Name + ".Assets.Audio.Voices.DefaultVoices.zip");
				using ZipArchive source = new ZipArchive(stream, ZipArchiveMode.Read);
				source.ExtractToDirectory(voicesPath);
			}
			string[] files2 = Directory.GetFiles(voicesPath, "*.ogg", SearchOption.AllDirectories);
			foreach (string text2 in files2)
			{
				AddPath("file://" + text2);
			}
		}

		private void AddPath(string path)
		{
			if (DictAudioClipsByPath == null)
			{
				DictAudioClipsByPath = new Dictionary<string, AudioClip>();
			}
			if (DictAudioClipsByPath.ContainsKey(path))
			{
				PluginLogWarningDelegate logWarning = PluginLoggerHook.LogWarning;
				if (logWarning != null)
				{
					logWarning.Invoke("A path of the same has already been added, path " + path);
				}
			}
			else
			{
				DictAudioClipsByPath.Add(path, null);
			}
		}

		public void SyncPlayAudio(string path, int internID)
		{
			string text = string.Empty;
			try
			{
				int startIndex = path.IndexOf(VoicesConst.VOICES_PATH);
				text = path.Substring(startIndex);
			}
			catch (Exception ex)
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("Error while loading voice audios, error : " + ex.Message);
				}
			}
			if (string.IsNullOrWhiteSpace(text))
			{
				PluginLogErrorDelegate logError2 = PluginLoggerHook.LogError;
				if (logError2 != null)
				{
					logError2.Invoke("Problem occured while getting the small path of audio clip, original path : " + path);
				}
			}
			else
			{
				InternManager.Instance.SyncPlayAudioIntern(internID, text);
			}
		}

		public void PlayAudio(string smallPathAudioClip, IInternVoice internVoice)
		{
			string smallPathAudioClip2 = smallPathAudioClip;
			KeyValuePair<string, AudioClip> keyValuePair = DictAudioClipsByPath.FirstOrDefault<KeyValuePair<string, AudioClip>>((KeyValuePair<string, AudioClip> x) => x.Key.Contains(smallPathAudioClip2));
			AudioClip value = keyValuePair.Value;
			if ((Object)(object)value == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(LoadAudioAndPlay(keyValuePair.Key, internVoice));
			}
			else
			{
				internVoice.PlayAudioClip(value);
			}
			PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
			if (logDebug != null)
			{
				logDebug.Invoke("New audioClip loaded " + smallPathAudioClip2);
			}
		}

		private IEnumerator LoadAudioAndPlay(string uri, IInternVoice internVoice)
		{
			UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(uri, (AudioType)14);
			try
			{
				yield return www.SendWebRequest();
				if ((int)www.result == 2 || (int)www.result == 3)
				{
					internVoice.ResetAboutToTalk();
					PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
					if (logError != null)
					{
						logError.Invoke("Error while loading audio file at " + uri + " : " + www.error);
					}
				}
				else
				{
					AudioClip audioClip = DownloadHandlerAudioClip.GetContent(www);
					AddAudioClip(uri, audioClip);
					internVoice.PlayAudioClip(audioClip);
				}
			}
			finally
			{
				((IDisposable)www)?.Dispose();
			}
		}

		private void AddAudioClip(string path, AudioClip audioClip)
		{
			if (DictAudioClipsByPath == null)
			{
				DictAudioClipsByPath = new Dictionary<string, AudioClip>();
			}
			if (DictAudioClipsByPath.ContainsKey(path))
			{
				DictAudioClipsByPath[path] = audioClip;
			}
			else
			{
				DictAudioClipsByPath.Add(path, audioClip);
			}
		}

		public void FadeInAudio(AudioSource audioSource, float fadeTime, float volumeMax)
		{
			if (StartOfRound.Instance.localPlayerController.isPlayerDead)
			{
				volumeMax *= 0.8f;
			}
			((MonoBehaviour)this).StartCoroutine(FadeInAudioCoroutine(audioSource, fadeTime, volumeMax));
		}

		private IEnumerator FadeInAudioCoroutine(AudioSource audioSource, float fadeTime, float volumeMax)
		{
			if (!((Object)(object)audioSource == (Object)null))
			{
				float startVolume = 0.2f;
				audioSource.volume = 0f;
				audioSource.Play();
				while (audioSource.volume < volumeMax)
				{
					audioSource.volume += startVolume * Time.deltaTime / fadeTime;
					yield return null;
				}
				audioSource.volume = volumeMax;
			}
		}

		public void FadeOutAndStopAudio(AudioSource audioSource, float fadeTime)
		{
			((MonoBehaviour)this).StartCoroutine(FadeOutAndStopAudioCoroutine(audioSource, fadeTime));
		}

		private IEnumerator FadeOutAndStopAudioCoroutine(AudioSource audioSource, float fadeTime)
		{
			if ((Object)(object)audioSource == (Object)null || !audioSource.isPlaying)
			{
				yield break;
			}
			float startVolume = audioSource.volume;
			while (audioSource.volume > 0f)
			{
				if ((Object)(object)audioSource == (Object)null || !audioSource.isPlaying)
				{
					yield break;
				}
				audioSource.volume -= startVolume * Time.deltaTime / fadeTime;
				yield return null;
			}
			audioSource.Stop();
			audioSource.volume = startVolume;
		}
	}
	public class IdentityManager : MonoBehaviour, IIdentityManager
	{
		public IInternIdentity[] InternIdentities = null;

		private ConfigIdentity[] configIdentities = null;

		public static IdentityManager Instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this)
			{
				Object.Destroy((Object)(object)((Component)Instance).gameObject);
			}
			Instance = this;
		}

		private void Update()
		{
			if (InternIdentities == null)
			{
				return;
			}
			for (int i = 0; i < InternIdentities.Length; i++)
			{
				IInternIdentity val = InternIdentities[i];
				if (val != null && val.Voice != null)
				{
					val.Voice.CountTime(Time.deltaTime);
				}
			}
		}

		public void InitIdentities(ConfigIdentity[] configIdentities)
		{
			PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
			if (logDebug != null)
			{
				logDebug.Invoke($"InitIdentities, nbIdentities {configIdentities.Length}");
			}
			IInternIdentity[] internIdentities = (IInternIdentity[])(object)new InternIdentity[configIdentities.Length];
			InternIdentities = internIdentities;
			this.configIdentities = configIdentities;
			for (int i = 0; i < configIdentities.Length; i++)
			{
				InternIdentities[i] = (IInternIdentity)(object)InitNewIdentity(i);
			}
		}

		private InternIdentity InitNewIdentity(int idIdentity)
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: 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_001b: 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_006f: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: 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_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Invalid comparison between Unknown and I4
			ConfigIdentity val;
			string name;
			if (idIdentity >= configIdentities.Length)
			{
				val = ConfigConst.DEFAULT_CONFIG_IDENTITY;
				name = string.Format(val.name, idIdentity);
				val.voicePitch = Random.Range(0.8f, 1.2f);
			}
			else
			{
				val = configIdentities[idIdentity];
				name = val.name;
			}
			int? suitID = null;
			EnumOptionSuitConfig val2;
			if (!Enum.IsDefined(typeof(EnumOptionSuitConfig), val.suitConfigOption))
			{
				PluginLogWarningDelegate logWarning = PluginLoggerHook.LogWarning;
				if (logWarning != null)
				{
					logWarning.Invoke($"Could not get option for intern suit config in config file, value {val.suitConfigOption} for {val.name}, now using random suit.");
				}
				val2 = (EnumOptionSuitConfig)1;
			}
			else
			{
				val2 = (EnumOptionSuitConfig)val.suitConfigOption;
			}
			EnumOptionSuitConfig val3 = val2;
			EnumOptionSuitConfig val4 = val3;
			if ((int)val4 != 0)
			{
				if ((int)val4 == 1)
				{
					suitID = null;
				}
			}
			else
			{
				suitID = val.suitID;
			}
			InternVoice voice = new InternVoice(val.voiceFolder, val.volume, val.voicePitch);
			return new InternIdentity(idIdentity, name, suitID, voice);
		}

		public string[] GetIdentitiesNamesLowerCaseWithoutSpace()
		{
			if (InternIdentities == null)
			{
				return new string[0];
			}
			return InternIdentities.Select((IInternIdentity x) => string.Join(' ', x.Name).ToLowerInvariant()).ToArray();
		}

		public int GetNewIdentityToSpawn()
		{
			int num = ((!PluginRuntimeProvider.Context.Config.SpawnIdentitiesRandomly) ? GetNextAvailableAliveIdentityIndex() : GetRandomAvailableAliveIdentityIndex());
			if (num == -1)
			{
				ExpandWithNewDefaultIdentities(1);
				return InternIdentities.Length - 1;
			}
			return num;
		}

		public int GetRandomAvailableAliveIdentityIndex()
		{
			IInternIdentity[] array = InternIdentities.FilterAvailableAlive().ToArray();
			if (array.Length == 0)
			{
				return -1;
			}
			Random random = new Random();
			int num = random.Next(0, array.Length);
			return array[num].IdIdentity;
		}

		public int GetNextAvailableAliveIdentityIndex()
		{
			IInternIdentity[] array = InternIdentities.FilterAvailableAl

plugins/Szumi57-LethalInternship/LethalInternship.Patches.dll

Decompiled a week 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 System.Text;
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.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.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]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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]
	[Microsoft.CodeAnalysis.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 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 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);
			}
		}
	}
}
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]
		private static bool SetControlTipsForItem_PreFix(GrabbableObject __instance)
		{
			return InternManagerProvider.Instance.IsAnInternAiOwnerOfObject(__instance);
		}

		[HarmonyPatch("DiscardItem")]
		[HarmonyPrefix]
		private 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]
		private 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.Value);
			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;
		}

		[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(typeof(RagdollGrabbableObject))]
	public class RagdollGrabbableObjectPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPrefix]
		private static bool Update_PreFix(RagdollGrabbableObject __instance, ref bool ___foundRagdollObject)
		{
			int value = __instance.bodyID.Value;
			if (value == 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[value].deadBody != (Object)null && (Object)(object)__instance.ragdoll != (Object)null && value != (int)__instance.ragdoll.playerScript.playerClientId)
			{
				___foundRagdollObject = false;
			}
			return true;
		}

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Update_PostFix(RagdollGrabbableObject __instance)
		{
			if (__instance.bodyID.Value == 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(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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: 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_0216: 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_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: 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_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: 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))
				{
					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)
			{
				PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
				if (logDebug != null)
				{
					logDebug.Invoke("intern found, no player found");
				}
				__result = val;
			}
			else if ((Object)(object)__result != (Object)null && (Object)(object)val == (Object)null)
			{
				PluginLogDebugDelegate logDebug2 = PluginLoggerHook.LogDebug;
				if (logDebug2 != null)
				{
					logDebug2.Invoke("intern not found, player found");
				}
			}
			else
			{
				if ((Object)(object)__result == (Object)null || (Object)(object)val == (Object)null)
				{
					return;
				}
				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)
				{
					PluginLogDebugDelegate logDebug3 = PluginLoggerHook.LogDebug;
					if (logDebug3 != null)
					{
						logDebug3.Invoke("intern closer");
					}
					__result = val;
				}
				else
				{
					PluginLogDebugDelegate logDebug4 = PluginLoggerHook.LogDebug;
					if (logDebug4 != null)
					{
						logDebug4.Invoke("player closer");
					}
				}
			}
		}

		[HarmonyPatch("GetClosestPlayer")]
		[HarmonyPostfix]
		private static void GetClosestPlayer_PostFix(EnemyAI __instance, ref PlayerControllerB __result, bool requireLineOfSight, bool cannotBeInShip, bool cannotBeNearShip)
		{
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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_0100: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: 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))
				{
					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_0038: 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_0087: 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_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: 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) && !__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;
			}
			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)
			{
				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)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				return 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 true;
			}
			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)
			//IL_0069: 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)
			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);
				internAI.NpcController.Npc.DamagePlayer(damageAmount, false, false, (CauseOfDeath)1, 0, false, default(Vector3));
				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 true;
			}
			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("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();
			}
			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_001d: Unknown result type (might be due to invalid IL or missing references)
			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_008d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: Expected O, but got Unknown
				int num = -1;
				List<CodeInstruction> list = new List<CodeInstruction>(instructions);
				for (int i = 0; i < list.Count - 5; i++)
				{
					if (((object)list[i]).ToString().StartsWith("ldarg.0 NULL") && ((object)list[i + 5]).ToString().StartsWith("call void GameNetcodeStuff.PlayerControllerB::LandFromJumpServerRpc("))
					{
						num = i;
						break;
					}
				}
				if (num > -1)
				{
					list[num + 5].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_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0094: 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 + 6]).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("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("ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void ConnectClientToPlayerObject_Postfix(PlayerControllerB __instance)
		{
			UIManagerProvider.Instance.AttachUIToLocalPlayer(__instance);
		}

		[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)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: 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)
				{
					return;
				}
				if (component.bodyID.Value == Const.INIT_RAGDOLL_ID)
				{
					((TMP_Text)__instance.cursorTip).text = string.Empty;
					((Behaviour)__instance.cursorIcon).enabled = false;
					return;
				}
			}
			RaycastHit[] array = (RaycastHit[])(object)new RaycastHit[3];
			int num = Physics.RaycastNonAlloc(___interactRay, array, __instance.grabDistance, ___playerMask);
			for (int i = 0; i < num; i++)
			{
				RaycastHit val = array[i];
				if ((Object)(object)((RaycastHit)(ref val)).collider == (Object)null || ((Component)((RaycastHit)(ref val)).collider).tag != "Player")
				{
					continue;
				}
				PlayerControllerB component2 = ((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<PlayerControllerB>();
				if ((Object)(object)component2 == (Object)null)
				{
					continue;
				}
				IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)component2.playerClientId);
				if (internAI == null)
				{
					continue;
				}
				internAI.NpcController.ShowFullNameBillboard();
				if (!internAI.IsSpawningAnimationRunning())
				{
					StringBuilder stringBuilder = new StringBuilder();
					if (!internAI.AreHandsFree())
					{
						stringBuilder.Append(string.Format(Const.TOOLTIP_DROP_ITEM, InputManagerProvider.Instance.GetKeyAction(PluginRuntimeProvider.Context.InputActionsInstance.GiveTakeItem))).AppendLine();
					}
					else if ((Object)(object)__instance.currentlyHeldObjectServer != (Object)null)
					{
						stringBuilder.Append(string.Format(Const.TOOLTIP_TAKE_ITEM, InputManagerProvider.Instance.GetKeyAction(PluginRuntimeProvider.Context.InputActionsInstance.GiveTakeItem))).AppendLine();
					}
					if (internAI.OwnerClientId != __instance.actualClientId)
					{
						stringBuilder.Append(string.Format(Const.TOOLTIP_FOLLOW_ME, InputManagerProvider.Instance.GetKeyAction(PluginRuntimeProvider.Context.InputActionsInstance.ManageIntern))).AppendLine();
					}
					stringBuilder.Append(string.Format(Const.TOOLTIP_GRAB_INTERNS, InputManagerProvider.Instance.GetKeyAction(PluginRuntimeProvider.Context.InputActionsInstance.GrabIntern))).AppendLine();
					if (__instance.currentSuitID != 0 || component2.currentSuitID != __instance.currentSuitID)
					{
						stringBuilder.Append(string.Format(Const.TOOLTIP_CHANGE_SUIT_INTERNS, InputManagerProvider.Instance.GetKeyAction(PluginRuntimeProvider.Context.InputActionsInstance.ChangeSuitIntern))).AppendLine();
					}
					stringBuilder.Append(string.Format(Const.TOOLTIP_COMMANDS, InputManagerProvider.Instance.GetKeyAction(PluginRuntimeProvider.Context.InputActionsInstance.OpenCommandsIntern))).AppendLine();
					((TMP_Text)__instance.cursorTip).text = stringBuilder.ToString();
					break;
				}
			}
		}

		[HarmonyPatch("IVisibleThreat.GetThreatTransform")]
		[HarmonyPostfix]
		private static void GetThreatTransform_PostFix(PlayerControllerB __instance, ref Transform __result)
		{
			IInternAI internAI = InternManagerProvider.Instance.GetInternAI((int)__instance.playerClientId);
			if (internAI != null)
			{
				__result = internAI.Transform;
			}
		}
	}
	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.NpcController.Npc).transform.rotation.y,
				IsOutside = (SpawnPosition.y >= -80f)
			});
			bool flag = (bool)FieldUsesLimited.GetValue(__instance);
			int num = (int)FieldUseLimit.GetValue(__instance);
			if (flag && num > 0)
			{
				FieldUseLimit.SetValue(__instance, num - 1);
				if ((int)FieldUseLimit.GetValue(__instance) <= 0)
				{
					Renderer[] array = (Renderer[])FieldDisplayRenderers.GetValue(__instance);
					Renderer[] array2 = array;
					foreach (Renderer val in array2)
					{
						val.material.SetColor("_EmissiveColor", Color.red);
					}
				}
			}
			return false;
		}

		public static void RevivePlayer_ReversePatch(object instance)
		{
			Transpiler(null);
			static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
			{
				//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: Expected O, but got Unknown
				int num = -1;
				List<CodeInstruction> list = new List<CodeInstruction>(instructions);
				for (int i = 0; i < list.Count; i++)
				{
					PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
					if (logDebug != null)
					{
						logDebug.Invoke($"{i} {list[i]}");
					}
				}
				for (int j = 0; j < list.Count - 5; j++)
				{
					if (((object)list[j]).ToString().StartsWith("ldarg.0 NULL") && ((object)list[j + 5]).ToString().StartsWith("call void GameNetcodeStuff.PlayerControllerB::LandFromJumpServerRpc("))
					{
						num = j;
						break;
					}
				}
				if (num > -1)
				{
					list[num + 5].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();
			}
		}
	}
}
namespace LethalInternship.Patches.ModPatches.TooManyEmotes
{
	[HarmonyPatch(typeof(EmoteControllerPlayer))]
	public class EmoteControllerPlayerPatch
	{
		[HarmonyPatch("PerformEmote", new Type[]
		{
			typeof(UnlockableEmote),
			typeof(int),
			typeof(bool)
		})]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> PerformEmote_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Expected O, but got Unknown
			int num = -1;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count - 2; i++)
			{
				if (((object)list[i]).ToString().StartsWith("call static void TooManyEmotes.Patches.ThirdPersonEmoteController::OnStartCustomEmoteLocal()") && ((object)list[i + 2]).ToString().StartsWith("nop NULL"))
				{
					num = i;
					break;
				}
			}
			if (num > -1)
			{
				Label label = generator.DefineLabel();
				list[num + 2].labels.Add(label);
				CodeInstruction item = new CodeInstruction(list[2].opcode, list[2].operand);
				List<CodeInstruction> collection = new List<CodeInstruction>
				{
					new CodeInstruction(OpCodes.Ldarg_0, (object)null),
					item,
					new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsPlayerInternMethod),
					new CodeInstruction(OpCodes.Brtrue, (object)label)
				};
				list.InsertRange(num, collection);
				num = -1;
			}
			else
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.ModPatches.TooManyEmotes.EmoteControllerPlayerPatch.PerformEmote_Transpiler could not not do OnStartCustomEmoteLocal when intern.");
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch("StopPerformingEmote")]
		[HarmonyTranspiler]
		public static IEnumerable<CodeInstruction> StopPerformingEmote_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Expected O, but got Unknown
			int num = -1;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count - 2; i++)
			{
				if (((object)list[i]).ToString().StartsWith("call static void TooManyEmotes.Patches.ThirdPersonEmoteController::OnStopCustomEmoteLocal()") && ((object)list[i + 2]).ToString().StartsWith("ldarg.0 NULL"))
				{
					num = i;
					break;
				}
			}
			if (num > -1)
			{
				Label label = generator.DefineLabel();
				list[num + 2].labels.Add(label);
				CodeInstruction item = new CodeInstruction(list[2].opcode, list[2].operand);
				List<CodeInstruction> collection = new List<CodeInstruction>
				{
					new CodeInstruction(OpCodes.Ldarg_0, (object)null),
					item,
					new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsPlayerInternMethod),
					new CodeInstruction(OpCodes.Brtrue, (object)label)
				};
				list.InsertRange(num, collection);
				num = -1;
			}
			else
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.ModPatches.TooManyEmotes.EmoteControllerPlayerPatch.StopPerformingEmote_Transpiler could not not do OnStopCustomEmoteLocal when intern.");
				}
			}
			return list.AsEnumerable();
		}
	}
	[HarmonyPatch(typeof(ThirdPersonEmoteController))]
	public class ThirdPersonEmoteControllerPatch
	{
		[HarmonyPatch("UseFreeCamWhileEmoting")]
		[HarmonyPrefix]
		public static bool UseFreeCamWhileEmoting_Prefix(PlayerControllerB __0)
		{
			if (InternManagerProvider.Instance.IsPlayerIntern(__0))
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch("InitLocalPlayerController")]
		[HarmonyPrefix]
		public static bool InitLocalPlayerController_Prefix(PlayerControllerB __0)
		{
			if (InternManagerProvider.Instance.IsPlayerIntern(__0))
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch("OnPlayerSpawn")]
		[HarmonyPrefix]
		public static bool OnPlayerSpawn_Prefix(PlayerControllerB __0)
		{
			if (InternManagerProvider.Instance.IsPlayerIntern(__0))
			{
				return false;
			}
			return true;
		}
	}
	public class TooManyEmotesUtils
	{
		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
			TooManyEmotesHook.CheckAndPerformTooManyEmote = new CheckAndPerformTooManyEmoteDelegate(CheckAndPerformTooManyEmote);
			TooManyEmotesHook.PerformTooManyEmote = new PerformTooManyEmoteDelegate(PerformTooManyEmote);
			TooManyEmotesHook.StopPerformingTooManyEmote = new StopPerformingTooManyEmoteDelegate(StopPerformingTooManyEmote);
		}

		public static void CheckAndPerformTooManyEmote(IInternAI internAI, PlayerControllerB playerToMimic)
		{
			EmoteControllerPlayer component = ((Component)playerToMimic).gameObject.GetComponent<EmoteControllerPlayer>();
			if ((Object)(object)component == (Object)null)
			{
				return;
			}
			EmoteControllerPlayer component2 = ((Component)internAI.NpcController.Npc).gameObject.GetComponent<EmoteControllerPlayer>();
			if ((Object)(object)component2 == (Object)null)
			{
				return;
			}
			if (!((EmoteController)component).isPerformingEmote)
			{
				if (((EmoteController)component2).isPerformingEmote)
				{
					((EmoteController)component2).StopPerformingEmote();
					internAI.StopPerformTooManyEmoteInternServerRpc();
				}
				internAI.NpcController.PerformDefaultEmote(playerToMimic.playerBodyAnimator.GetInteger("emoteNumber"));
			}
			else if (((EmoteController)component).performingEmote != null && (!((EmoteController)component2).isPerformingEmote || ((EmoteController)component).performingEmote.emoteId != ((EmoteController)component2).performingEmote?.emoteId))
			{
				internAI.PerformTooManyEmoteInternServerRpc(((EmoteController)component).performingEmote.emoteId);
			}
		}

		public static void PerformTooManyEmote(INpcController npcController, int tooManyEmoteID)
		{
			EmoteControllerPlayer component = ((Component)npcController.Npc).gameObject.GetComponent<EmoteControllerPlayer>();
			if (!((Object)(object)component == (Object)null))
			{
				if (((EmoteController)component).isPerformingEmote)
				{
					((EmoteController)component).StopPerformingEmote();
				}
				UnlockableEmote val = EmotesManager.allUnlockableEmotes[tooManyEmoteID];
				((EmoteController)component).PerformEmote(val, -1, false);
			}
		}

		public static void StopPerformingTooManyEmote(INpcController npcController)
		{
			EmoteControllerPlayer component = ((Component)npcController.Npc).gameObject.GetComponent<EmoteControllerPlayer>();
			if ((Object)(object)component != (Object)null)
			{
				((EmoteController)component).StopPerformingEmote();
			}
		}
	}
}
namespace LethalInternship.Patches.ModPatches.ShowCapacity
{
	public class ShowCapacityPatch
	{
		private static GameObject? capacityMeter;

		public static bool Update_PreFix_Prefix(bool __0, GrabbableObject __1, bool __2)
		{
			Update_ShowCapacityPatch(__0, __1, __2);
			return false;
		}

		private static void Update_ShowCapacityPatch(bool isHoldingObject, GrabbableObject currentlyHeldObjectServer, bool isCameraDisabled)
		{
			if ((Object)(object)capacityMeter == (Object)null)
			{
				GameObject val = GameObject.Find("CapacityMeter");
				if ((Object)(object)val != (Object)null)
				{
					capacityMeter = val;
					capacityMeter.SetActive(false);
				}
			}
			if ((Object)(object)capacityMeter == (Object)null)
			{
				return;
			}
			GrabbableObject val2 = StartOfRound.Instance?.localPlayerController?.currentlyHeldObjectServer;
			if ((Object)(object)val2 == (Object)null)
			{
				capacityMeter.SetActive(false);
			}
			else
			{
				if (isCameraDisabled || !isHoldingObject || (Object)(object)currentlyHeldObjectServer == (Object)null)
				{
					return;
				}
				if ((Object)(object)val2 != (Object)(object)currentlyHeldObjectServer)
				{
					if ((Object)(object)val2 == (Object)null)
					{
						capacityMeter.SetActive(false);
					}
					return;
				}
				SprayPaintItem component = ((Component)currentlyHeldObjectServer).GetComponent<SprayPaintItem>();
				if ((Object)(object)component != (Object)null)
				{
					FieldInfo field = typeof(SprayPaintItem).GetField("sprayCanTank", BindingFlags.Instance | BindingFlags.NonPublic);
					if (field != null)
					{
						float num = (float)field.GetValue(component);
						capacityMeter.GetComponent<Image>().fillAmount = num / 1.3f;
					}
					capacityMeter.SetActive(true);
					return;
				}
				TetraChemicalItem component2 = ((Component)currentlyHeldObjectServer).GetComponent<TetraChemicalItem>();
				if ((Object)(object)component2 != (Object)null)
				{
					FieldInfo field2 = typeof(TetraChemicalItem).GetField("fuel", BindingFlags.Instance | BindingFlags.NonPublic);
					if (field2 != null)
					{
						float num2 = (float)field2.GetValue(component2);
						capacityMeter.GetComponent<Image>().fillAmount = num2 / 1.3f;
					}
					capacityMeter.SetActive(true);
				}
				else
				{
					capacityMeter.SetActive(false);
				}
			}
		}
	}
}
namespace LethalInternship.Patches.ModPatches.ReviveCompany
{
	[HarmonyPatch(typeof(GeneralUtil))]
	public class ReviveCompanyGeneralUtilPatch
	{
		[HarmonyPatch("RevivePlayer")]
		[HarmonyPrefix]
		private static bool RevivePlayer_Prefix(int playerId)
		{
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: 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_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			if (!InternManagerProvider.Instance.IsIdPlayerIntern(playerId))
			{
				return true;
			}
			RagdollGrabbableObject ragdollGrabbableObjectLookingAt = GetRagdollGrabbableObjectLookingAt();
			if ((Object)(object)ragdollGrabbableObjectLookingAt == (Object)null)
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("Revive company with LethalInternship: error when trying to revive intern, could not find body.");
				}
				return false;
			}
			string headerText = ((Component)ragdollGrabbableObjectLookingAt.ragdoll).gameObject.GetComponentInChildren<ScanNodeProperties>().headerText;
			IInternIdentity val = IdentityManagerProvider.Instance.FindIdentityFromBodyName(headerText);
			if (val == null)
			{
				return true;
			}
			if (val.Alive)
			{
				PluginLogErrorDelegate logError2 = PluginLoggerHook.LogError;
				if (logError2 != null)
				{
					logError2.Invoke("Revive company with LethalInternship: error when trying to revive intern \"" + val.Name + "\", intern is already alive! do nothing more");
				}
				return false;
			}
			InternManagerProvider.Instance.UpdateReviveCompanyRemainingRevivesServerRpc(val.Name);
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			Vector3 position = ((Component)ragdollGrabbableObjectLookingAt).transform.position;
			Quaternion rotation = ((Component)localPlayerController).transform.rotation;
			float y = ((Quaternion)(ref rotation)).eulerAngles.y;
			if (Vector3.Distance(position, ((Component)localPlayerController).transform.position) > 7f)
			{
				position = ((Component)localPlayerController).transform.position;
			}
			bool isInsideFactory = localPlayerController.isInsideFactory;
			PluginLogDebugDelegate logDebug = PluginLoggerHook.LogDebug;
			if (logDebug != null)
			{
				logDebug.Invoke("Reviving intern " + val.Name);
			}
			InternManagerProvider.Instance.SpawnThisInternServerRpc(val.IdIdentity, new SpawnInternsParamsNetworkSerializable
			{
				ShouldDestroyDeadBody = true,
				enumSpawnAnimation = 1,
				SpawnPosition = position,
				YRot = y,
				IsOutside = !isInsideFactory
			});
			return false;
		}

		[HarmonyPatch("GetClosestDeadBody")]
		[HarmonyPostfix]
		private static void GetClosestDeadBody_PostFix(ref RagdollGrabbableObject __result)
		{
			__result = GetRagdollGrabbableObjectLookingAt();
			if ((Object)(object)__result != (Object)null && (Object)(object)__result.ragdoll == (Object)null)
			{
				__result = null;
			}
		}

		private static RagdollGrabbableObject GetRagdollGrabbableObjectLookingAt()
		{
			//IL_0019: 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)
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(((Component)localPlayerController.gameplayCamera).transform.position, ((Component)localPlayerController.gameplayCamera).transform.forward);
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(val, ref val2, localPlayerController.grabDistance, 1073742656) && ((Component)((RaycastHit)(ref val2)).collider).gameObject.layer != 8 && ((Component)((RaycastHit)(ref val2)).collider).gameObject.layer != 30 && ((Component)((RaycastHit)(ref val2)).collider).tag == "PhysicsProp")
			{
				RagdollGrabbableObject component = ((Component)((RaycastHit)(ref val2)).collider).gameObject.GetComponent<RagdollGrabbableObject>();
				if ((Object)(object)component == (Object)null)
				{
					return null;
				}
				return component;
			}
			return null;
		}
	}
	public class ReviveCompanyPlayerControllerBPatchPatch
	{
		private static readonly MethodInfo IsGrabbableObjectEqualsToNullMethod = SymbolExtensions.GetMethodInfo((Expression<Action>)(() => PatchesUtil.IsGrabbableObjectEqualsToNull((GrabbableObject)new object())));

		public static IEnumerable<CodeInstruction> SetHoverTipAndCurrentInteractTriggerPatch_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Expected O, but got Unknown
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Expected O, but got Unknown
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Expected O, but got Unknown
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Expected O, but got Unknown
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Expected O, but got Unknown
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Expected O, but got Unknown
			//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fc: Expected O, but got Unknown
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Expected O, but got Unknown
			int num = -1;
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			CodeInstruction item = new CodeInstruction(list[74]);
			for (int i = 0; i < list.Count - 2; i++)
			{
				if (((object)list[i]).ToString().StartsWith("stsfld bool OPJosMod.ReviveCompany.Patches.PlayerControllerBPatch::StartedRevive") && ((object)list[i + 1]).ToString().StartsWith("ldc.i4.1 NULL") && ((object)list[i + 2]).ToString().StartsWith("ldloc.s 5 (RagdollGrabbableObject)"))
				{
					num = i;
					break;
				}
			}
			if (num > -1)
			{
				Label label = generator.DefineLabel();
				list[num + 18].labels.Add(label);
				List<CodeInstruction> collection = new List<CodeInstruction>
				{
					item,
					new CodeInstruction(OpCodes.Call, (object)PatchesUtil.IsRagdollPlayerIdInternMethod),
					new CodeInstruction(OpCodes.Brtrue, (object)label)
				};
				list.InsertRange(num + 1, collection);
				num = -1;
			}
			else
			{
				PluginLogErrorDelegate logError = PluginLoggerHook.LogError;
				if (logError != null)
				{
					logError.Invoke("LethalInternship.Patches.ModPatches.ReviveCompany.ReviveCompanyPlayerControllerBPatchPatch.SetHoverTipAndCurrentInteractTriggerPatch_Transpiler could not check if intern to not send rpc 1");
				}
			}
			for (int j = 0; j < list.Count - 1; j++)
			{
				if (((object)list[j]).ToString().StartsWith("call static void OPJosMod.ReviveCompany.GeneralUtil::RevivePlayer(int playerId)") && ((object)list[j + 1]).ToString().StartsWith("nop NULL"))
		

plugins/Szumi57-LethalInternship/LethalInternship.SharedAbstractions.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using GameNetcodeStuff;
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 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.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]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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]
	[Microsoft.CodeAnalysis.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
	{
		string Key { get; }

		void SetIconActive(bool active);
	}
	public interface IIconUIInfos
	{
		string GetUIKey();

		List<GameObject> GetImagesPrefab();
	}
}
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; }

		bool UIAssetsLoaded { get; }

		GameObject CommandsWheelUIPrefab { get; }

		GameObject WorldIconPrefab { get; }

		GameObject InputIconPrefab { get; }

		GameObject DefaultIconImagePrefab { get; }

		GameObject PointerIconImagePrefab { get; }

		GameObject PedestrianIconImagePrefab { get; }

		GameObject VehicleIconImagePrefab { get; }

		GameObject ShipIconImagePrefab { get; }

		GameObject MeetingPointIconImagePrefab { get; }

		GameObject GatheringPointIconImagePrefab { get; }

		GameObject AttackIconImagePrefab { get; }

		string DirectoryName { get; }

		IConfig Config { get; }

		ILethalInternshipInputs InputActionsInstance { get; }

		int PluginIrlPlayersCount { get; set; }

		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 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 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)
			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));
		}

		public override string ToString()
		{
			return $"name: {name}, suitID {suitID}, suitConfigOption {suitConfigOption} {(EnumOptionSuitConfig)suitConfigOption}, voiceFolder {voiceFolder}, volume {volume}, voicePitch {voicePitch}";
		}
	}
	[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 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)
			((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));
		}
	}
	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[] GetIdentitiesSpawned();

		int[] GetIdentitiesToDrop();

		IInternIdentity? FindIdentityFromBodyName(string bodyName);
	}
	public interface IInputManager
	{
		void RemoveEventHandlers();

		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; }

		VehicleController? VehicleController { get; }

		IInternAI? GetInternAI(int playerClientId);

		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);

		IInternAI[] GetInternsAIOwnedByLocal();

		IInternAI? GetInternAiOwnerOfObject(GrabbableObject grabbableObject);

		IInternAI[] GetInternsAiHoldByPlayer(int idPlayerHolder);

		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);
	}
	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();
	}
	public interface IUIManager
	{
		void AddInternsControlTip(HUDManager hudManager);

		void AttachUIToLocalPlayer(PlayerControllerB player);

		void InitUI(Transform HUDContainerParent);
	}
}
namespace LethalInternship.SharedAbstractions.ManagerProviders
{
	public class IdentityManagerProvider
	{
		private static IIdentityManager instance;

		public static IIdentityManager Instance
		{
			get
			{
				if (instance == null)
				{
					PluginLoggerHook.LogError?.Invoke("Identity manager not initialized !");
					return null;
				}
				return instance;
			}
			set
			{
				instance = value;
			}
		}
	}
	public class InputManagerProvider
	{
		private static IInputManager instance;

		public static IInputManager Instance
		{
			get
			{
				if (instance == null)
				{
					PluginLoggerHook.LogError?.Invoke("Input manager not initialized !");
					return null;
				}
				return instance;
			}
			set
			{
				instance = value;
			}
		}
	}
	public static class InternManagerProvider
	{
		private static IInternManager instance;

		public static IInternManager Instance
		{
			get
			{
				if (instance == null)
				{
					PluginLoggerHook.LogError?.Invoke("Intern manager not initialized !");
					return null;
				}
				return instance;
			}
			set
			{
				instance = value;
			}
		}
	}
	public class SaveManagerProvider
	{
		private static ISaveManager instance;

		public static ISaveManager Instance
		{
			get
			{
				if (instance == null)
				{
					PluginLoggerHook.LogError?.Invoke("Save manager not initialized !");
					return null;
				}
				return instance;
			}
			set
			{
				instance = value;
			}
		}
	}
	public class TerminalManagerProvider
	{
		private static ITerminalManager instance;

		public static ITerminalManager Instance
		{
			get
			{
				if (instance == null)
				{
					PluginLoggerHook.LogError?.Invoke("Terminal manager not initialized !");
					return null;
				}
				return instance;
			}
			set
			{
				instance = value;
			}
		}
	}
	public class UIManagerProvider
	{
		private static IUIManager instance;

		public static IUIManager Instance
		{
			get
			{
				if (instance == null)
				{
					PluginLoggerHook.LogError?.Invoke("UI manager not initialized !");
					return null;
				}
				return instance;
			}
			set
			{
				instance = value;
			}
		}
	}
}
namespace LethalInternship.SharedAbstractions.Interns
{
	public interface IInterestPoint
	{
		Vector3 Point { get; }

		EnumCommandTypes? CommandType { get; }

		bool IsInvalid { get; }

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

		Vector3 GetUIPos(T interestPoint);
	}
	public interface IInterestPointRendererWrapper
	{
		GameObject GetImagePrefab(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<Component> ListModelReplacement { get; }

		GrabbableObject? HeldItem { get; set; }

		ulong OwnerClientId { get; }

		bool IsOwner { get; }

		NetworkObject NetworkObject { get; }

		Transform Transform { get; }

		bool IsSpawned { get; }

		bool IsEnemyDead { get; }

		IPointOfInterest? GetPointOfInterest();

		void SetCommandToFollowPlayer();

		void SetCommandTo(IPointOfInterest pointOfInterest);

		void AdaptController(PlayerControllerB playerControllerB);

		void UpdateController();

		void SyncJump();

		void SyncLandFromJump(bool fallHard);

		void DropItem();

		void StopSinkingState();

		void SyncDamageIntern(int damageNumber, 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 = 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 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);

		void GiveItemToInternServerRpc(ulong playerClientIdGiver, NetworkObjectReference networkObjectReference);

		void PlayAudioServerRpc(string smallPathAudioClip, int enumTalkativeness);

		Vector3 GetBillBoardPosition(GameObject bodyModel);

		float GetAngleFOVWithLocalPlayer(Transform localPlayerCameraTransform, Vector3 internBodyPos);
	}
	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
	{
		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 GetRandomSuitID();

		void UpdateIdentity(int Hp, int? suitID, EnumStatusIdentity enumStatusIdentity);
	}
	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);

		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(Vector3 internBodyPos);

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

		Vector3 GetPoint();

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

		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 GiveTakeItem { get; set; }

		InputAction GrabIntern { get; set; }

		InputAction ReleaseInterns { get; set; }

		InputAction ChangeSuitIntern { get; set; }

		InputAction MakeInternLookAtPosition { get; set; }

		InputAction OpenCommandsIntern { 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 EnumAIStates
	{
		BrainDead,
		SearchingForPlayer,
		GetCloseToPlayer,
		JustLostPlayer,
		ChillWithPlayer,
		FetchingObject,
		PlayerInCruiser,
		Panik,
		Waiting,
		Relax
	}
	public enum EnumBodyTypeCulling
	{
		InternBody,
		Ragdoll
	}
	public enum EnumCommandEnd
	{
		None,
		Repeat,
		Finished
	}
	public enum EnumCommandTypes
	{
		None,
		FollowPlayer,
		GoToVehicle,
		GoToPosition,
		Wait
	}
	public enum EnumErrorTypeTerminalPage
	{
		Default,
		NotEnoughCredits,
		NoMoreInterns,
		ShipLeavingMoon,
		InternDead,
		InternAlreadySelected
	}
	public enum EnumInputAction
	{
		None,
		GoToPosition,
		FollowMe,
		GoToShip,
		GoToVehicle
	}
	public enum EnumObjectsLookingAt
	{
		Forward,
		Player,
		Position
	}
	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 EnumTerminalStates
	{
		Error,
		WaitForMainCommand,
		Info,
		ConfirmCancelPurchase,
		AbortLanding,
		ConfirmCancelAbortLanding,
		Status
	}
	public enum EnumVoicesState
	{
		None,
		Chilling,
		EnteringCruiser,
		FollowingPlayer,
		FoundLoot,
		HearsPlayer,
		Hit,
		LosingPlayer,
		Lost,
		LostAndFound,
		RunningFromMonster,
		SteppedOnTrap,
		Sinking
	}
}
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 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 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 = 3f;

		public static readonly float INTERN_OBJECT_RANGE = 15f;

		public static readonly float WAIT_TIME_FOR_GRAB_DROPPED_OBJECTS = 10f;

		public static readonly float COLLISION_RANGE = 2.8f;

		public static readonly float CLIMB_SPEED = 8f;

		public static readonly int INIT_RAGDOLL_ID = -2;

		public static readonly float AGENT_SPEED = 3.5f;

		public static readonly float AGENT_SPEED_CROUCH = 1.75f;

		public static readonly float BASE_MAX_SPEED = 0.9f;

		public static readonly float BASE_MIN_SPEED = 0.01f;

		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_CHECK_FOR_HOLES = 2.5f;

		public static readonly float DISTANCE_ITEMS_TO_ENTRANCE = 6f;

		public static readonly int COMPANY_BUILDING_MOON_ID = 3;

		public static readonly float SHIP_EXPANDING_BOUNDS_DIFFERENCE = 10f;

		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 int MAX_COMMANDS_QUEUE = 10;

		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 = 8f;

		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_AWARENESS_HOR = 50f;

		public static readonly float DISTANCE_AWARENESS_VER = 50f;

		public static readonly float TIMER_LOOKING_AROUND = 6f;

		public static readonly float DISTANCE_STOP_SPRINT_LAST_KNOWN_POSITION = 2f;

		public static readonly float WAIT_TIME_TO_TELEPORT = 1f;

		public static readonly float DISTANCE_TO_ENTRANCE = 4f;

		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 TIMER_STUCK_TOO_MUCH = 2f;

		public static readonly float DISTANCE_TO_SHIP_BOUND_CLOSEST_POINT = 1f;

		public static readonly float DISTANCE_OF_DROPPED_OBJECT_SHIP_BOUND_CLOSEST_POINT = 2f;

		public static readonly float DISTANCE_TO_CRUISER = 4f;

		public static readonly Vector3 POS1_ENTRY_INTERN_CRUISER = new Vector3(-0.5f, -1f, -5.5f);

		public static readonly Vector3 POS2_ENTRY_INTERN_CRUISER = new Vector3(0.9f, -1f, -5.5f);

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

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

		public static readonly float DISTANCE_FLEEING = 20f;

		public static readonly float DISTANCE_FLEEING_NO_LOS = 5f;

		public static readonly float DISTANCE_NPCBODY_FROM_LADDER = 2f;

		public static readonly float DISTANCE_NPCBODY_FROM_DOOR = 2.5f;

		public static readonly float TIMER_CHECK_DOOR = 0.9f;

		public static readonly string TOOLTIP_DROP_ITEM = "Drop your item : [{0}]";

		public static readonly string TOOLTIP_TAKE_ITEM = "Take my item : [{0}]";

		public static readonly string TOOLTIP_FOLLOW_ME = "Follow me: [{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_CHANGE_SUIT_INTERNS = "Change suit : [{0}]";

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

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

		public static readonly string TOOLTIPS_ORDER_1 = "order 1 : [{0}]";
	}
	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 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_BUY_COMMAND = "buy";

		public static readonly string STRING_LAND_COMMAND = "land";

		public static readonly string STRING_STATUS_COMMAND = "status";

		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- 'land'  : allow/cancel\r\n- 'status': list of interns\r\n- 'buy'   : order new intern, 'buy 2' to order 2 interns, etc";

		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- 'land'  : allow/cancel\r\n- 'status': list of interns\r\n- 'buy'   : order new intern, 'buy 2' to order 2 interns, etc";

		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_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_STATUS = "Interns status : \r\n\r\n{0}";
	}
	public class UIConst
	{
		public static string UI_CHOOSE_LOCATION = "Choose this location";

		public static string[] COMMANDS_BUTTON_STRING = new string[5]
		{
			string.Empty,
			"Choose a position",
			"Follow me",
			"Go to the cruiser",
			"Go to the vehicle"
		};
	}
	public class VoicesConst
	{
		public static readonly string VOICES_PATH = "Audio\\Voices\\";

		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_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; }

		string TitleInHelpMenu { get; }

		string SubTitleInHelpMenu { get; }

		bool CanSpectateInterns { get; }

		bool RadarEnabled { get; }

		bool SpawnIdentitiesRandomly { get; }

		bool CanLosePlayer { get; }

		bool FollowCrouchWithPlayer { get; }

		bool ChangeSuitAutoBehaviour { get; }

		bool GrabItemsNearEntrances { get; }

		bool GrabBeesNest { get; }

		bool GrabDeadBodies { get; }

		bool GrabManeaterBaby { get; }

		bool GrabWheelbarrow { get; }

		bool GrabShoppingCart { 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();
	}
}