Decompiled source of LowIntelligenceSpecimens v2.3.0

BepInEx\Plugins\LowIntelligenceSpecimens.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CSync.Extensions;
using CSync.Lib;
using GameNetcodeStuff;
using LethalLib.Modules;
using LowIntelligenceSpecimens.AssetLoaders;
using LowIntelligenceSpecimens.ExtraFunctions;
using LowIntelligenceSpecimens.Helpers;
using LowIntelligenceSpecimens.ItemScripts;
using LowIntelligenceSpecimens.NetcodePatcher;
using LowIntelligenceSpecimens.Paranoia;
using Microsoft.CodeAnalysis;
using On;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Serialization;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("MMHOOK_Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SIGIL_02")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("2.3.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d377005afa7f7a9f028a30ade465490e4ed5a3af")]
[assembly: AssemblyProduct("LowIntelligenceSpecimens")]
[assembly: AssemblyTitle("LowIntelligenceSpecimens")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.3.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>();
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>();
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[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 LowIntelligenceSpecimens
{
	[BepInPlugin("sigil02.lowintelligencespecimens", "LowIntelligenceSpecimens", "2.3.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency("com.sigurd.csync", "5.0.1")]
	internal class LowIntelligencePlugin : BaseUnityPlugin
	{
		private const string PluginName = "LowIntelligenceSpecimens";

		private const string PluginVersion = "2.3.0";

		private const string PluginGuid = "sigil02.lowintelligencespecimens";

		internal static readonly string AssemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

		internal static ManualLogSource modConsole;

		internal static LowIntelligenceConfig config;

		private void Awake()
		{
			modConsole = ((BaseUnityPlugin)this).Logger;
			modConsole.LogInfo((object)"Plugin sigil02.lowintelligencespecimens is loaded!");
			config = new LowIntelligenceConfig(((BaseUnityPlugin)this).Config);
			NetcodePatcher();
			AssetLoader.CreateAssetLoaders();
			ExtraLoader.Instance.Load();
			BrackenKillSound.Init();
			ThatsCrazy.Init();
			BoomboxSongLoader.Instance.Load();
			ScrapLoader.Instance.Load();
			LootBugTracker.Init();
			ShopLoader.Instance.Load();
			ParanoiaLoader.Instance.Load();
			ParanoiaStoredObjects.Init();
			ParanoiaManager.Init();
			ParanoiaNetwork.Init();
		}

		private static void NetcodePatcher()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			for (int i = 0; i < types.Length; i++)
			{
				MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				foreach (MethodInfo methodInfo in methods)
				{
					if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
	internal class LowIntelligenceConfig : SyncedConfig2<LowIntelligenceConfig>
	{
		private const string BoomboxSection = "Custom Boombox Music";

		private const string ExtraFunctionsSection = "Extra Functions";

		private const string ScrapSection = "Scrap";

		private const string ShopSection = "Shop Items";

		private const string ParanoiaSection = "Paranoia";

		private const string ParanoiaGhostSection = "Paranoia Ghost";

		[field: SyncedEntryField]
		public SyncedEntry<bool> AddCustomBoomboxSongs { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> TurnKidnapperFoxBlue { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> BrackenKillSound { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> BluePaintSpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> EggSpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> Halo17SpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> PictureFrameSpawnChance { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> PanelKSpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> PatrickLowValueSpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> PatrickHighValueSpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> RockSpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> FuckassGoombaSpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> TapeRecorderSpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> WalkmanSpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> SkullSpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> UnstableDynamiteSpawnWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> DynamitePrice { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> DynamiteExplodeTime { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> AddParanoiaSounds { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<bool> AddParanoiaGhost { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> GhostChance { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> ActionTimeCooldown { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> GhostCrazyPeriod { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> GhostCrazyActionInterval { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> CrazyGhostChance { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> DoNothingWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> OpenCloseBigDoorsWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> MessWithLightsWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> MessWithBreakerWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> OpenCloseDoorsWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> LockUnlockDoorsWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> DisableTurretsWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> DisableLandminesWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<int> DisableSpikeTrapsWeight { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> ChanceToOpenCloseDoor { get; set; }

		[field: SyncedEntryField]
		public SyncedEntry<float> ChanceToLockUnlockDoor { get; set; }

		public LowIntelligenceConfig(ConfigFile configFile)
			: base("LowIntelligenceSpecimens")
		{
			AddCustomBoomboxSongs = SyncedBindingExtensions.BindSyncedEntry<bool>(configFile, "Custom Boombox Music", "AddCustomBoomboxSongs", true, "Whether to add custom boombox songs or not.");
			TurnKidnapperFoxBlue = SyncedBindingExtensions.BindSyncedEntry<bool>(configFile, "Extra Functions", "TurnKidnapperFoxBlue", true, "Whether to turn the kidnapper fox blue or not.");
			BrackenKillSound = SyncedBindingExtensions.BindSyncedEntry<bool>(configFile, "Extra Functions", "BrackenKillSound", true, "Whether to play a sound when Bracken kills a player or not.");
			BluePaintSpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "BluePaintSpawnWeight", 10, "Poisonous to everyone except blue people.");
			EggSpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "EggSpawnWeight", 20, "Fragile (she doesn't see her beauty).");
			Halo17SpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "Halo17SpawnWeight", 30, "For all we could have done, and all that could have been.");
			PictureFrameSpawnChance = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "PictureFrameSpawnChance", 45, "Why is there Young Sheldon in my game. I'm killing you.");
			PanelKSpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "PanelKSpawnWeight", 10, "Add a little violence.");
			PatrickLowValueSpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "PatrickLowValueSpawnWeight", 20, "Might forget to check the o-ring on the SRBs.");
			PatrickHighValueSpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "PatrickHighValueSpawnWeight", 10, "Will most likely forget to check the o-ring on the SRBs.");
			RockSpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "RockSpawnWeight", 30, "I found a rock :D");
			TapeRecorderSpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "TapeRecorderSpawnWeight", 30, "FISH! FISH! FISH! FISH!");
			WalkmanSpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "WalkmanSpawnWeight", 30, "Are you alone? Isn't everyone?");
			SkullSpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "SkullSpawnWeight", 20, "bad to the bone");
			FuckassGoombaSpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "FuckassGoombaSpawnWeight", 20, "FUCKASS GOOMBA?");
			UnstableDynamiteSpawnWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Scrap", "UnstableDynamiteSpawnWeight", 10, "Only the void knows when it'll explode.");
			DynamitePrice = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Shop Items", "DynamitePrice", 150, "I FUCKING LOVE BLOWING THINGS UP!");
			DynamiteExplodeTime = SyncedBindingExtensions.BindSyncedEntry<float>(configFile, "Shop Items", "DynamiteExplodeTime", 4f, "EXPLOSIONS!!!!!");
			AddParanoiaSounds = SyncedBindingExtensions.BindSyncedEntry<bool>(configFile, "Paranoia", "AddParanoiaSounds", true, "I don't believe it. I came back haunted.");
			AddParanoiaGhost = SyncedBindingExtensions.BindSyncedEntry<bool>(configFile, "Paranoia", "AddParanoiaGhost", true, "I had to see it. I came back haunted.");
			GhostChance = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Paranoia", "GhostChance", 10, "I said goodbye. I came back haunted.");
			ActionTimeCooldown = SyncedBindingExtensions.BindSyncedEntry<float>(configFile, "Paranoia Ghost", "ActionTimeCooldown", 15f, "The throat is deep and the mouth is wide.");
			GhostCrazyPeriod = SyncedBindingExtensions.BindSyncedEntry<float>(configFile, "Paranoia Ghost", "GhostCrazyPeriod", 3f, "Saw some things on the other side.");
			GhostCrazyActionInterval = SyncedBindingExtensions.BindSyncedEntry<float>(configFile, "Paranoia Ghost", "GhostCrazyActionInterval", 0.1f, "Made me promise to never tell.");
			CrazyGhostChance = SyncedBindingExtensions.BindSyncedEntry<float>(configFile, "Paranoia Ghost", "CrazyGhostChance", 0.1f, "But you know me, I can't help myself, no.");
			DoNothingWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Paranoia Ghost", "DoNothingWeight", 20, "Now I got something you have to see.");
			OpenCloseBigDoorsWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Paranoia Ghost", "OpenCloseBigDoorsWeight", 20, "They put something inside of me.");
			MessWithLightsWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Paranoia Ghost", "MessWithLightsWeight", 16, "The smile is red and its eyes are black.");
			MessWithBreakerWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Paranoia Ghost", "MessWithBreakerWeight", 4, "I don't think I'll be coming back.");
			OpenCloseDoorsWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Paranoia Ghost", "OpenCloseDoorsWeight", 9, "I don't believe in it.");
			LockUnlockDoorsWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Paranoia Ghost", "LockUnlockDoorsWeight", 3, "I had to see it.");
			DisableTurretsWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Paranoia Ghost", "DisableTurretsWeight", 5, "I came back haunted.");
			DisableLandminesWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Paranoia Ghost", "DisableLandminesWeight", 5, "I came back haunted.");
			DisableSpikeTrapsWeight = SyncedBindingExtensions.BindSyncedEntry<int>(configFile, "Paranoia Ghost", "DisableSpikeTrapsWeight", 5, "I said goodbye, but I-");
			ChanceToOpenCloseDoor = SyncedBindingExtensions.BindSyncedEntry<float>(configFile, "Paranoia Ghost", "ChanceToOpenCloseDoor", 0.3f, "I had to try, and-");
			ChanceToLockUnlockDoor = SyncedBindingExtensions.BindSyncedEntry<float>(configFile, "Paranoia Ghost", "ChanceToLockUnlockDoor", 0.3f, "I came back haunted.");
			ConfigManager.Register<LowIntelligenceConfig>((SyncedConfig2<LowIntelligenceConfig>)this);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LowIntelligenceSpecimens";

		public const string PLUGIN_NAME = "LowIntelligenceSpecimens";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace LowIntelligenceSpecimens.Paranoia
{
	[CreateAssetMenu(fileName = "ParanoiaAudio", menuName = "Low Intelligence Specimens/Paranoia/Paranoia Audio")]
	internal class ParanoiaAudio : ScriptableObject
	{
		public RandomAudioClip[] insideAmbienceInsanity = Array.Empty<RandomAudioClip>();
	}
	internal static class ParanoiaGhost
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Update <0>__OnUpdate;
		}

		private static bool _exists;

		private static float _actionCurrentTime;

		private static float _ghostCrazyCurrentTime;

		private static Random _rng = new Random();

		public static void Init()
		{
			//IL_0034: 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: Expected O, but got Unknown
			if (!_exists && !(RoundManager.Instance.currentLevel.PlanetName == "71 Gordion"))
			{
				object obj = <>O.<0>__OnUpdate;
				if (obj == null)
				{
					hook_Update val = OnUpdate;
					<>O.<0>__OnUpdate = val;
					obj = (object)val;
				}
				RoundManager.Update += (hook_Update)obj;
				_exists = true;
				LowIntelligencePlugin.modConsole.LogWarning((object)"It's here.");
			}
		}

		public static void Vaporize()
		{
			//IL_0018: 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_0023: Expected O, but got Unknown
			if (_exists)
			{
				object obj = <>O.<0>__OnUpdate;
				if (obj == null)
				{
					hook_Update val = OnUpdate;
					<>O.<0>__OnUpdate = val;
					obj = (object)val;
				}
				RoundManager.Update -= (hook_Update)obj;
				_exists = false;
				LowIntelligencePlugin.modConsole.LogDebug((object)"It's gone.");
			}
		}

		private static void OnUpdate(orig_Update orig, RoundManager self)
		{
			orig.Invoke(self);
			if (!((NetworkBehaviour)self).IsHost)
			{
				return;
			}
			bool flag = _ghostCrazyCurrentTime > 0f;
			if (flag)
			{
				_ghostCrazyCurrentTime -= Time.deltaTime;
			}
			if (_actionCurrentTime > 0f)
			{
				_actionCurrentTime -= Time.deltaTime;
				return;
			}
			int seed = ParanoiaNetwork.Instance.seed;
			ParanoiaNetwork.Instance.seed = seed + 1;
			_rng = new Random(seed);
			if (_rng.NextDouble() <= (double)SyncedEntry<float>.op_Implicit(LowIntelligencePlugin.config.CrazyGhostChance) && _ghostCrazyCurrentTime <= 0f)
			{
				_ghostCrazyCurrentTime = SyncedEntry<float>.op_Implicit(LowIntelligencePlugin.config.GhostCrazyPeriod);
			}
			_actionCurrentTime = SyncedEntry<float>.op_Implicit(flag ? LowIntelligencePlugin.config.GhostCrazyActionInterval : LowIntelligencePlugin.config.ActionTimeCooldown);
			int[] array = new int[9]
			{
				LowIntelligencePlugin.config.DoNothingWeight.LocalValue,
				LowIntelligencePlugin.config.OpenCloseBigDoorsWeight.LocalValue,
				LowIntelligencePlugin.config.MessWithLightsWeight.LocalValue,
				LowIntelligencePlugin.config.MessWithBreakerWeight.LocalValue,
				LowIntelligencePlugin.config.OpenCloseDoorsWeight.LocalValue,
				LowIntelligencePlugin.config.LockUnlockDoorsWeight.LocalValue,
				LowIntelligencePlugin.config.DisableTurretsWeight.LocalValue,
				LowIntelligencePlugin.config.DisableLandminesWeight.LocalValue,
				LowIntelligencePlugin.config.DisableSpikeTrapsWeight.LocalValue
			};
			if (flag)
			{
				array[0] = 0;
				array[5] = 0;
				array[6] = 0;
				array[7] = 0;
				array[8] = 0;
			}
			switch (self.GetRandomWeightedIndex(array, _rng))
			{
			case 0:
				LowIntelligencePlugin.modConsole.LogDebug((object)"Ghost will do nothing.");
				break;
			case 1:
				if (ParanoiaStoredObjects.TerminalDoors.Count > 0)
				{
					foreach (TerminalAccessibleObject terminalDoor in ParanoiaStoredObjects.TerminalDoors)
					{
						terminalDoor.SetDoorOpenServerRpc(Convert.ToBoolean(_rng.Next(2)));
					}
				}
				LowIntelligencePlugin.modConsole.LogDebug((object)"Ghost will open/close big doors.");
				break;
			case 2:
				ParanoiaNetwork.Instance.MessWithLightsServerRpc();
				((MonoBehaviour)self).StartCoroutine(FlickerShipLights(ParanoiaStoredObjects.ShipLights));
				LowIntelligencePlugin.modConsole.LogDebug((object)"Ghost will mess with lights.");
				break;
			case 3:
				ParanoiaNetwork.Instance.MessWithBreakerServerRpc(Convert.ToBoolean(_rng.Next(2)));
				LowIntelligencePlugin.modConsole.LogDebug((object)"Ghost will mess with breaker.");
				break;
			case 4:
				ParanoiaNetwork.Instance.MessWithDoorsServerRpc(SyncedEntry<float>.op_Implicit(LowIntelligencePlugin.config.ChanceToOpenCloseDoor));
				LowIntelligencePlugin.modConsole.LogDebug((object)"Ghost will open/close doors.");
				break;
			case 5:
				ParanoiaNetwork.Instance.MessWithDoorsServerRpc(SyncedEntry<float>.op_Implicit(LowIntelligencePlugin.config.ChanceToOpenCloseDoor), messWithLock: true, SyncedEntry<float>.op_Implicit(LowIntelligencePlugin.config.ChanceToLockUnlockDoor));
				LowIntelligencePlugin.modConsole.LogDebug((object)"Ghost will lock/unlock doors.");
				break;
			case 6:
				foreach (Turret item in from turret in ParanoiaStoredObjects.Turrets
					let disable = Convert.ToBoolean(_rng.Next(2))
					where disable
					select turret)
				{
					((MonoBehaviour)self).StartCoroutine(DisableTurret(item));
				}
				LowIntelligencePlugin.modConsole.LogDebug((object)"Ghost will disable turrets.");
				break;
			case 7:
				foreach (Landmine item2 in from landmine in ParanoiaStoredObjects.Landmines
					let disable = Convert.ToBoolean(_rng.Next(2))
					where disable
					select landmine)
				{
					((MonoBehaviour)self).StartCoroutine(DisableLandmine(item2));
				}
				LowIntelligencePlugin.modConsole.LogDebug((object)"Ghost will disable landmines.");
				break;
			case 8:
				foreach (SpikeRoofTrap item3 in from spiketrap in ParanoiaStoredObjects.SpikeTraps
					let disable = Convert.ToBoolean(_rng.Next(2))
					where disable
					select spiketrap)
				{
					((MonoBehaviour)self).StartCoroutine(DisableSpikeTrap(item3));
				}
				LowIntelligencePlugin.modConsole.LogDebug((object)"Ghost will disable spike traps.");
				break;
			}
		}

		private static IEnumerator DisableTurret(Turret turret)
		{
			turret.ToggleTurretEnabled(false);
			yield return (object)new WaitForSeconds(7f);
			turret.ToggleTurretEnabled(true);
		}

		private static IEnumerator DisableLandmine(Landmine landmine)
		{
			landmine.ToggleMine(false);
			yield return (object)new WaitForSeconds(7f);
			landmine.ToggleMine(true);
		}

		private static IEnumerator DisableSpikeTrap(SpikeRoofTrap trap)
		{
			trap.ToggleSpikesEnabled(false);
			yield return (object)new WaitForSeconds(7f);
			trap.ToggleSpikesEnabled(true);
		}

		private static IEnumerator FlickerShipLights(ShipLights shipLights)
		{
			shipLights.SetShipLightsBoolean(false);
			yield return (object)new WaitForSeconds(1f);
			shipLights.SetShipLightsBoolean(true);
			yield return (object)new WaitForSeconds(1f);
			shipLights.SetShipLightsBoolean(false);
			yield return (object)new WaitForSeconds(1f);
			shipLights.SetShipLightsBoolean(true);
		}
	}
	internal static class ParanoiaManager
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_openingDoorsSequence <0>__OnOpeningDoorsSequence;

			public static hook_ShipLeave <1>__OnShipLeave;
		}

		public static ParanoiaAudio Audio;

		private static readonly List<RandomAudioClip> InsideAmbienceInsanity = new List<RandomAudioClip>();

		public static void Init()
		{
			//IL_0010: 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_001b: Expected O, but got Unknown
			//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_003b: Expected O, but got Unknown
			object obj = <>O.<0>__OnOpeningDoorsSequence;
			if (obj == null)
			{
				hook_openingDoorsSequence val = OnOpeningDoorsSequence;
				<>O.<0>__OnOpeningDoorsSequence = val;
				obj = (object)val;
			}
			StartOfRound.openingDoorsSequence += (hook_openingDoorsSequence)obj;
			object obj2 = <>O.<1>__OnShipLeave;
			if (obj2 == null)
			{
				hook_ShipLeave val2 = OnShipLeave;
				<>O.<1>__OnShipLeave = val2;
				obj2 = (object)val2;
			}
			StartOfRound.ShipLeave += (hook_ShipLeave)obj2;
			LowIntelligencePlugin.modConsole.LogDebug((object)"StartOfRound.openingDoorsSequence hooked!");
		}

		private static IEnumerator OnOpeningDoorsSequence(orig_openingDoorsSequence orig, StartOfRound self)
		{
			IEnumerator origIEnumerator = orig.Invoke(self);
			while (origIEnumerator.MoveNext())
			{
				yield return origIEnumerator.Current;
			}
			LowIntelligencePlugin.modConsole.LogDebug((object)"Arrived at level!");
			InsideAmbienceInsanity.Clear();
			if (SyncedEntry<bool>.op_Implicit(LowIntelligencePlugin.config.AddParanoiaSounds))
			{
				LowIntelligencePlugin.modConsole.LogDebug((object)"Adding paranoia sounds!");
				LevelAmbienceLibrary levelAmbienceClips = self.currentLevel.levelAmbienceClips;
				InsideAmbienceInsanity.AddRange(levelAmbienceClips.insideAmbienceInsanity);
				InsideAmbienceInsanity.AddRange(Audio.insideAmbienceInsanity);
				levelAmbienceClips.insideAmbienceInsanity = InsideAmbienceInsanity.ToArray();
				LowIntelligencePlugin.modConsole.LogDebug((object)"Added paranoia sounds!");
			}
			if (SyncedEntry<bool>.op_Implicit(LowIntelligencePlugin.config.AddParanoiaGhost) && new Random(ParanoiaNetwork.Instance.seed).NextDouble() * 100.0 < (double)SyncedEntry<int>.op_Implicit(LowIntelligencePlugin.config.GhostChance))
			{
				ParanoiaGhost.Init();
			}
		}

		private static void OnShipLeave(orig_ShipLeave orig, StartOfRound self)
		{
			orig.Invoke(self);
			if (SyncedEntry<bool>.op_Implicit(LowIntelligencePlugin.config.AddParanoiaGhost))
			{
				ParanoiaGhost.Vaporize();
			}
		}
	}
	[AddComponentMenu("Low Intelligence Specimens/Paranoia/Paranoia Network")]
	internal class ParanoiaNetwork : NetworkBehaviour
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Start <0>__OnStartOfRoundStart;
		}

		public int seed = 49;

		public static ParanoiaNetwork Instance { get; private set; }

		public static void Init()
		{
			//IL_0010: 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_001b: Expected O, but got Unknown
			object obj = <>O.<0>__OnStartOfRoundStart;
			if (obj == null)
			{
				hook_Start val = OnStartOfRoundStart;
				<>O.<0>__OnStartOfRoundStart = val;
				obj = (object)val;
			}
			StartOfRound.Start += (hook_Start)obj;
			LowIntelligencePlugin.modConsole.LogDebug((object)"StartOfRound.Start hooked!");
		}

		private static void OnStartOfRoundStart(orig_Start orig, StartOfRound self)
		{
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)Instance))
			{
				GameObject obj = Object.Instantiate<GameObject>(ParanoiaLoader.Instance.ParanoiaNetworkObj);
				Object.DontDestroyOnLoad((Object)(object)obj);
				obj.GetComponent<NetworkObject>().Spawn(false);
			}
		}

		public override void OnNetworkSpawn()
		{
			Instance = this;
			LowIntelligencePlugin.modConsole.LogInfo((object)"'hi i exist now' - the network manager, probably");
		}

		[ServerRpc(RequireOwnership = false)]
		public void MessWithLightsServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1598907332u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1598907332u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					MessWithLightsClientRpc();
				}
			}
		}

		[ClientRpc]
		public void MessWithLightsClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1402913709u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1402913709u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					RoundManager.Instance.FlickerLights(true, true);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void MessWithBreakerServerRpc(bool state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3862801061u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3862801061u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					MessWithBreakerClientRpc(state);
				}
			}
		}

		[ClientRpc]
		public void MessWithBreakerClientRpc(bool state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1946697180u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1946697180u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((Object)(object)ParanoiaStoredObjects.BreakerBox == (Object)null))
				{
					ParanoiaStoredObjects.BreakerBox.SetSwitchesOff();
					RoundManager.Instance.TurnOnAllLights(state);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void MessWithDoorsServerRpc(float openCloseChance, bool messWithLock = false, float messWithLockChance = 0f)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2781267365u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref openCloseChance, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref messWithLock, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref messWithLockChance, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2781267365u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				if (seed == 0)
				{
					seed = StartOfRound.Instance.randomMapSeed;
				}
				seed++;
				MessWithDoorsClientRpc(openCloseChance, seed, messWithLock, messWithLockChance);
			}
		}

		[ClientRpc]
		public void MessWithDoorsClientRpc(float openCloseChance, int seed1, bool messWithLock = false, float messWithLockChance = 0f)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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_00c6: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1170808386u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref openCloseChance, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, seed1);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref messWithLock, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref messWithLockChance, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1170808386u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			Random random = new Random(seed1);
			foreach (FacilityDoor door in ParanoiaStoredObjects.Doors)
			{
				if (!(random.NextDouble() <= (double)openCloseChance))
				{
					continue;
				}
				if (messWithLock && random.NextDouble() <= (double)messWithLockChance)
				{
					if (random.Next(0, 2) == 0)
					{
						door.DoorLock.LockDoor(30f);
					}
					else
					{
						door.DoorLock.UnlockDoor();
					}
					break;
				}
				if (!door.DoorLock.isLocked)
				{
					door.AnimatedObjectTrigger.TriggerAnimationNonPlayer(false, true, false);
					door.DoorLock.SetDoorAsOpen(Convert.ToBoolean(random.Next(0, 2)));
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void UnlockAndOpenAllDoorsServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2848055018u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2848055018u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			foreach (TerminalAccessibleObject terminalDoor in ParanoiaStoredObjects.TerminalDoors)
			{
				terminalDoor.SetDoorOpenServerRpc(true);
			}
			UnlockAndOpenAllDoorsClientRpc();
		}

		[ClientRpc]
		public void UnlockAndOpenAllDoorsClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2461300985u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2461300985u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			foreach (FacilityDoor door in ParanoiaStoredObjects.Doors)
			{
				if (door.DoorLock.isLocked)
				{
					door.DoorLock.UnlockDoor();
				}
				door.AnimatedObjectTrigger.TriggerAnimationNonPlayer(false, true, false);
				door.DoorLock.SetDoorAsOpen(true);
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_ParanoiaNetwork()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1598907332u, new RpcReceiveHandler(__rpc_handler_1598907332));
			NetworkManager.__rpc_func_table.Add(1402913709u, new RpcReceiveHandler(__rpc_handler_1402913709));
			NetworkManager.__rpc_func_table.Add(3862801061u, new RpcReceiveHandler(__rpc_handler_3862801061));
			NetworkManager.__rpc_func_table.Add(1946697180u, new RpcReceiveHandler(__rpc_handler_1946697180));
			NetworkManager.__rpc_func_table.Add(2781267365u, new RpcReceiveHandler(__rpc_handler_2781267365));
			NetworkManager.__rpc_func_table.Add(1170808386u, new RpcReceiveHandler(__rpc_handler_1170808386));
			NetworkManager.__rpc_func_table.Add(2848055018u, new RpcReceiveHandler(__rpc_handler_2848055018));
			NetworkManager.__rpc_func_table.Add(2461300985u, new RpcReceiveHandler(__rpc_handler_2461300985));
		}

		private static void __rpc_handler_1598907332(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((ParanoiaNetwork)(object)target).MessWithLightsServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1402913709(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((ParanoiaNetwork)(object)target).MessWithLightsClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3862801061(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool state = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref state, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((ParanoiaNetwork)(object)target).MessWithBreakerServerRpc(state);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1946697180(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool state = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref state, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((ParanoiaNetwork)(object)target).MessWithBreakerClientRpc(state);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2781267365(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_004a: 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_0065: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float openCloseChance = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref openCloseChance, default(ForPrimitives));
				bool messWithLock = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref messWithLock, default(ForPrimitives));
				float messWithLockChance = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref messWithLockChance, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((ParanoiaNetwork)(object)target).MessWithDoorsServerRpc(openCloseChance, messWithLock, messWithLockChance);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1170808386(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_003e: 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_0072: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float openCloseChance = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref openCloseChance, default(ForPrimitives));
				int seed = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref seed);
				bool messWithLock = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref messWithLock, default(ForPrimitives));
				float messWithLockChance = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref messWithLockChance, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((ParanoiaNetwork)(object)target).MessWithDoorsClientRpc(openCloseChance, seed, messWithLock, messWithLockChance);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2848055018(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((ParanoiaNetwork)(object)target).UnlockAndOpenAllDoorsServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2461300985(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((ParanoiaNetwork)(object)target).UnlockAndOpenAllDoorsClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "ParanoiaNetwork";
		}
	}
	internal static class ParanoiaStoredObjects
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_ArriveAtLevel <0>__CacheValues;

			public static hook_ShipLeave <1>__ClearValues;
		}

		public static readonly List<Turret> Turrets = new List<Turret>();

		public static readonly List<Landmine> Landmines = new List<Landmine>();

		public static readonly List<SpikeRoofTrap> SpikeTraps = new List<SpikeRoofTrap>();

		public static readonly List<TerminalAccessibleObject> TerminalDoors = new List<TerminalAccessibleObject>();

		public static readonly List<FacilityDoor> Doors = new List<FacilityDoor>();

		public static ShipLights ShipLights { get; private set; }

		public static BreakerBox BreakerBox { get; private set; }

		public static void Init()
		{
			//IL_0010: 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_001b: Expected O, but got Unknown
			//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_003b: Expected O, but got Unknown
			object obj = <>O.<0>__CacheValues;
			if (obj == null)
			{
				hook_ArriveAtLevel val = CacheValues;
				<>O.<0>__CacheValues = val;
				obj = (object)val;
			}
			StartOfRound.ArriveAtLevel += (hook_ArriveAtLevel)obj;
			object obj2 = <>O.<1>__ClearValues;
			if (obj2 == null)
			{
				hook_ShipLeave val2 = ClearValues;
				<>O.<1>__ClearValues = val2;
				obj2 = (object)val2;
			}
			StartOfRound.ShipLeave += (hook_ShipLeave)obj2;
		}

		private static void CacheValues(orig_ArriveAtLevel orig, StartOfRound self)
		{
			orig.Invoke(self);
			BreakerBox = Object.FindObjectOfType<BreakerBox>();
			ShipLights = Object.FindObjectOfType<ShipLights>();
			Turret[] collection = Object.FindObjectsOfType<Turret>();
			Turrets.AddRange(collection);
			Landmine[] collection2 = Object.FindObjectsOfType<Landmine>();
			Landmines.AddRange(collection2);
			SpikeRoofTrap[] collection3 = Object.FindObjectsOfType<SpikeRoofTrap>();
			SpikeTraps.AddRange(collection3);
			DoorLock[] array = Object.FindObjectsOfType<DoorLock>();
			foreach (DoorLock val in array)
			{
				AnimatedObjectTrigger component = ((Component)val).gameObject.GetComponent<AnimatedObjectTrigger>();
				Doors.Add(new FacilityDoor(val, component));
			}
			TerminalDoors.AddRange(Object.FindObjectsOfType<TerminalAccessibleObject>());
		}

		private static void ClearValues(orig_ShipLeave orig, StartOfRound self)
		{
			orig.Invoke(self);
			BreakerBox = null;
			ShipLights = null;
			Turrets.Clear();
			Landmines.Clear();
			SpikeTraps.Clear();
			Doors.Clear();
			TerminalDoors.Clear();
		}
	}
	internal readonly struct FacilityDoor
	{
		public DoorLock DoorLock { get; }

		public AnimatedObjectTrigger AnimatedObjectTrigger { get; }

		public FacilityDoor(DoorLock doorLock, AnimatedObjectTrigger animatedObjectTrigger)
		{
			DoorLock = doorLock;
			AnimatedObjectTrigger = animatedObjectTrigger;
		}
	}
}
namespace LowIntelligenceSpecimens.ItemScripts
{
	[AddComponentMenu("Low Intelligence Specimens/Blue Paint")]
	public class BluePaint : GrabbableObject
	{
		[Space(10f)]
		[Tooltip("The cause of death to show if the player dies while holding it.")]
		public CauseOfDeath causeOfDeath = (CauseOfDeath)5;

		[Tooltip("The amount of damage to deal per tick.")]
		public int damagePerTick = 1;

		[Tooltip("Time between damage ticks in seconds.")]
		public float tickRate = 5f;

		[Tooltip("The steamID to ignore when doing damage.")]
		public ulong steamId = 76561198291823907uL;

		[Tooltip("Box collider to reenable when killing lootbugs.")]
		public BoxCollider boxCollider;

		public override void GrabItem()
		{
			((GrabbableObject)this).GrabItem();
			((MonoBehaviour)this).StartCoroutine(PlayerDamageCoroutine());
		}

		public override void GrabItemFromEnemy(EnemyAI enemyAI)
		{
			HoarderBugAI val = (HoarderBugAI)(object)((enemyAI is HoarderBugAI) ? enemyAI : null);
			if ((Object)(object)val != (Object)null)
			{
				val.DropItemAndCallDropRPC(((NetworkBehaviour)this).NetworkObject, false);
				((EnemyAI)val).KillEnemyServerRpc(false);
				((MonoBehaviour)this).Invoke("FixCollider", 2f);
			}
			LowIntelligencePlugin.modConsole.LogInfo((object)"A lootbug just succumbed to the blue paint. His funeral is scheduled for next week, provided free by The Company! Attendance cost is 1000 credits.");
		}

		public void FixCollider()
		{
			((Collider)boxCollider).enabled = true;
		}

		private IEnumerator PlayerDamageCoroutine()
		{
			while (base.isHeld)
			{
				DamagePlayer(base.playerHeldBy);
				yield return (object)new WaitForSeconds(tickRate);
			}
		}

		public void DamagePlayer(PlayerControllerB player)
		{
			//IL_0019: 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)
			if (player.playerSteamId != steamId)
			{
				player.DamagePlayer(damagePerTick, true, true, causeOfDeath, 0, false, Vector3.zero);
			}
		}

		protected override void __initializeVariables()
		{
			((GrabbableObject)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "BluePaint";
		}
	}
	[AddComponentMenu("Low Intelligence Specimens/Dynamite")]
	public class Dynamite : GrabbableObject
	{
		[Space(10f)]
		[Header("Explosion Settings")]
		public GameObject litParticles;

		public float timeBeforeExplosion = 4f;

		[Header("Throw Curve Settings")]
		public AnimationCurve itemFallCurve;

		public AnimationCurve itemVerticalFallCurveNoBounce;

		private bool _exploding;

		private readonly NetworkVariable<bool> _willExplode = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		private bool _armed;

		private RaycastHit _itemHit;

		private Ray _itemThrowRay;

		private const int StunGrenadeMask = 268437761;

		public override void OnNetworkSpawn()
		{
			((NetworkBehaviour)this).OnNetworkSpawn();
			timeBeforeExplosion = SyncedEntry<float>.op_Implicit(LowIntelligencePlugin.config.DynamiteExplodeTime);
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (((NetworkBehaviour)this).IsOwner)
			{
				base.playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetGrenadeThrowDestination(), true);
			}
		}

		public override void FallWithCurve()
		{
			//IL_0001: 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_0011: 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_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: 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_0136: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = base.startFallingPosition - base.targetFloorPosition;
			float magnitude = ((Vector3)(ref val)).magnitude;
			((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(base.itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, base.itemProperties.restingRotation.z), 14f * Time.deltaTime / magnitude);
			((Component)this).transform.localPosition = Vector3.Lerp(base.startFallingPosition, base.targetFloorPosition, itemFallCurve.Evaluate(base.fallTime));
			((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, base.startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, base.targetFloorPosition.y, ((Component)this).transform.localPosition.z), (magnitude > 5f) ? itemVerticalFallCurveNoBounce.Evaluate(base.fallTime) : itemFallCurve.Evaluate(base.fallTime));
			base.fallTime += Mathf.Abs(Time.deltaTime * 12f / magnitude);
		}

		private Vector3 GetGrenadeThrowDestination()
		{
			//IL_0010: 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)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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)
			//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)
			//IL_00b5: 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_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_00bc: 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_00d1: 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_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: 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_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			Debug.DrawRay(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward, Color.yellow, 15f);
			_itemThrowRay = new Ray(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward);
			Vector3 val = ((!Physics.Raycast(_itemThrowRay, ref _itemHit, 12f, 268437761, (QueryTriggerInteraction)1)) ? ((Ray)(ref _itemThrowRay)).GetPoint(10f) : ((Ray)(ref _itemThrowRay)).GetPoint(((RaycastHit)(ref _itemHit)).distance - 0.05f));
			Debug.DrawRay(val, Vector3.down, Color.blue, 15f);
			_itemThrowRay = new Ray(val, Vector3.down);
			if (Physics.Raycast(_itemThrowRay, ref _itemHit, 30f, 268437761, (QueryTriggerInteraction)1))
			{
				return ((RaycastHit)(ref _itemHit)).point + Vector3.up * 0.05f;
			}
			return ((Ray)(ref _itemThrowRay)).GetPoint(30f);
		}

		public override void PlayDropSFX()
		{
			((GrabbableObject)this).PlayDropSFX();
			if (_armed && !_exploding)
			{
				ExplodeServerRpc();
			}
		}

		public override void DiscardItem()
		{
			if ((Object)(object)base.playerHeldBy != (Object)null)
			{
				base.playerHeldBy.equippedUsableItemQE = false;
			}
			base.isBeingUsed = false;
			((GrabbableObject)this).DiscardItem();
		}

		public override void PocketItem()
		{
			if ((Object)(object)base.playerHeldBy != (Object)null)
			{
				base.playerHeldBy.equippedUsableItemQE = false;
			}
			base.isBeingUsed = false;
			((GrabbableObject)this).PocketItem();
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			base.playerHeldBy.equippedUsableItemQE = true;
		}

		[ServerRpc(RequireOwnership = false)]
		public void ExplodeServerRpc(bool instant = false)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2117466389u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref instant, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2117466389u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					_willExplode.Value = true;
					ExplodeClientRpc(instant);
				}
			}
		}

		[ClientRpc]
		public void ExplodeClientRpc(bool instant)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0083: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3588304284u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref instant, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3588304284u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					((MonoBehaviour)this).StartCoroutine(Explode(instant));
					_exploding = true;
				}
			}
		}

		protected virtual IEnumerator Explode(bool instant)
		{
			if (instant)
			{
				Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, 100, 0f, 6.4f, 6, (CauseOfDeath)3);
				litParticles.SetActive(false);
				yield return (object)new WaitForSeconds(2f);
				if (((NetworkBehaviour)this).IsServer)
				{
					((Component)this).gameObject.GetComponent<NetworkObject>().Despawn(true);
				}
				yield break;
			}
			yield return (object)new WaitForSeconds(timeBeforeExplosion);
			if (_armed)
			{
				Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, 100, 0f, 6.4f, 6, (CauseOfDeath)3);
				litParticles.SetActive(false);
				yield return (object)new WaitForSeconds(2f);
				if (((NetworkBehaviour)this).IsServer)
				{
					((Component)this).gameObject.GetComponent<NetworkObject>().Despawn(true);
				}
			}
		}

		public override void ItemInteractLeftRight(bool right)
		{
			((GrabbableObject)this).ItemInteractLeftRight(right);
			if (!right)
			{
				_armed = !_armed;
				litParticles.SetActive(_armed);
			}
			else if (_armed)
			{
				ExplodeServerRpc(instant: true);
			}
		}

		protected override void __initializeVariables()
		{
			if (_willExplode == null)
			{
				throw new Exception("Dynamite._willExplode cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)_willExplode).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)_willExplode, "_willExplode");
			((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)_willExplode);
			((GrabbableObject)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Dynamite()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(2117466389u, new RpcReceiveHandler(__rpc_handler_2117466389));
			NetworkManager.__rpc_func_table.Add(3588304284u, new RpcReceiveHandler(__rpc_handler_3588304284));
		}

		private static void __rpc_handler_2117466389(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool instant = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref instant, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Dynamite)(object)target).ExplodeServerRpc(instant);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3588304284(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0044: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool instant = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref instant, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Dynamite)(object)target).ExplodeClientRpc(instant);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "Dynamite";
		}
	}
	[AddComponentMenu("Low Intelligence Specimens/Egg")]
	public class Egg : GrabbableObject
	{
		[Space(10f)]
		[Tooltip("The prefab of the cracked egg.")]
		public GameObject crackedEggObj;

		[Space(5f)]
		[Tooltip("Noises to play when the egg cracks.")]
		public AudioClip[] crackNoise;

		[Space(5f)]
		[Tooltip("The scan node properties to change the text of.")]
		public ScanNodeProperties scanNodeProperties;

		private AudioSource _audioSource;

		public override void OnNetworkSpawn()
		{
			((NetworkBehaviour)this).OnNetworkSpawn();
			_audioSource = ((Component)this).GetComponent<AudioSource>();
		}

		public override void PlayDropSFX()
		{
			((GrabbableObject)this).PlayDropSFX();
			if (!(RoundManager.Instance.currentLevel.PlanetName == "71 Gordion"))
			{
				CrackEggServerRpc();
				LowIntelligencePlugin.modConsole.LogInfo((object)"btw some dumbfuck just dropped an egg and it broke.");
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void CrackEggServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1764100325u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1764100325u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					CrackEggClientRpc();
				}
			}
		}

		[ClientRpc]
		public void CrackEggClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3350416130u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3350416130u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					int num = Random.Range(0, crackNoise.Length);
					_audioSource.PlayOneShot(crackNoise[num]);
					((Renderer)base.mainObjectRenderer).enabled = false;
					Object.Instantiate<GameObject>(crackedEggObj, ((Component)this).transform);
					base.grabbable = false;
					base.grabbableToEnemies = false;
					base.scrapValue = 0;
					scanNodeProperties.headerText = "Cracked Egg";
					scanNodeProperties.scrapValue = 0;
					scanNodeProperties.subText = "Worthless, you moron.";
				}
			}
		}

		protected override void __initializeVariables()
		{
			((GrabbableObject)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Egg()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1764100325u, new RpcReceiveHandler(__rpc_handler_1764100325));
			NetworkManager.__rpc_func_table.Add(3350416130u, new RpcReceiveHandler(__rpc_handler_3350416130));
		}

		private static void __rpc_handler_1764100325(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Egg)(object)target).CrackEggServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3350416130(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Egg)(object)target).CrackEggClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "Egg";
		}
	}
	[AddComponentMenu("Low Intelligence Specimens/Halo 17")]
	public class Halo17 : GiftBoxItem
	{
		public Item discItem;

		public override void LoadItemSaveData(int saveData)
		{
		}

		public override int GetItemDataToSave()
		{
			return 0;
		}

		public override void Start()
		{
			((GiftBoxItem)this).Start();
			Random random = new Random((int)((GrabbableObject)this).targetFloorPosition.x + (int)((GrabbableObject)this).targetFloorPosition.y);
			base.objectInPresentItem = discItem;
			base.objectInPresent = base.objectInPresentItem.spawnPrefab;
			base.objectInPresentValue = (int)((double)random.Next(base.objectInPresentItem.minValue + 25, base.objectInPresentItem.maxValue + 35) * (double)RoundManager.Instance.scrapValueMultiplier);
		}

		protected override void __initializeVariables()
		{
			((GiftBoxItem)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "Halo17";
		}
	}
	[AddComponentMenu("Low Intelligence Specimens/Mafia's Favorite")]
	public class MafiasFavorite : GrabbableObject
	{
		public override void Update()
		{
			((GrabbableObject)this).Update();
			if (base.isHeld && LootBugTracker.LootBugs.Count > 0)
			{
				AngerTheMafiaServerRpc();
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void AngerTheMafiaServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2083895904u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2083895904u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					AngerTheMafiaClientRpc();
				}
			}
		}

		[ClientRpc]
		public void AngerTheMafiaClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2243251144u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2243251144u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			foreach (HoarderBugAI lootBug in LootBugTracker.LootBugs)
			{
				((EnemyAI)lootBug).targetNode = ((Component)base.playerHeldBy).transform;
			}
		}

		protected override void __initializeVariables()
		{
			((GrabbableObject)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_MafiasFavorite()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(2083895904u, new RpcReceiveHandler(__rpc_handler_2083895904));
			NetworkManager.__rpc_func_table.Add(2243251144u, new RpcReceiveHandler(__rpc_handler_2243251144));
		}

		private static void __rpc_handler_2083895904(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((MafiasFavorite)(object)target).AngerTheMafiaServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2243251144(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((MafiasFavorite)(object)target).AngerTheMafiaClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "MafiasFavorite";
		}
	}
	public static class LootBugTracker
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Start <0>__AddNewBug;

			public static hook_KillEnemy <1>__RemoveDeadBug;

			public static hook_PullLever <2>__ClearList;
		}

		public static List<HoarderBugAI> LootBugs { get; private set; }

		public static void Init()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0078: 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_0083: Expected O, but got Unknown
			LootBugs = new List<HoarderBugAI>();
			object obj = <>O.<0>__AddNewBug;
			if (obj == null)
			{
				hook_Start val = AddNewBug;
				<>O.<0>__AddNewBug = val;
				obj = (object)val;
			}
			HoarderBugAI.Start += (hook_Start)obj;
			LowIntelligencePlugin.modConsole.LogDebug((object)"HoarderBugAI.Start hooked!");
			object obj2 = <>O.<1>__RemoveDeadBug;
			if (obj2 == null)
			{
				hook_KillEnemy val2 = RemoveDeadBug;
				<>O.<1>__RemoveDeadBug = val2;
				obj2 = (object)val2;
			}
			HoarderBugAI.KillEnemy += (hook_KillEnemy)obj2;
			LowIntelligencePlugin.modConsole.LogDebug((object)"HoarderBugAI.KillEnemy hooked!");
			object obj3 = <>O.<2>__ClearList;
			if (obj3 == null)
			{
				hook_PullLever val3 = ClearList;
				<>O.<2>__ClearList = val3;
				obj3 = (object)val3;
			}
			StartMatchLever.PullLever += (hook_PullLever)obj3;
			LowIntelligencePlugin.modConsole.LogDebug((object)"StartMatchLever.PullLever hooked!");
		}

		private static void AddNewBug(orig_Start orig, HoarderBugAI self)
		{
			orig.Invoke(self);
			if (!LootBugs.Contains(self))
			{
				LootBugs.Add(self);
			}
		}

		private static void RemoveDeadBug(orig_KillEnemy orig, HoarderBugAI self, bool destroy)
		{
			orig.Invoke(self, destroy);
			if (LootBugs.Contains(self))
			{
				LootBugs.Remove(self);
			}
		}

		private static void ClearList(orig_PullLever orig, StartMatchLever self)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			foreach (HoarderBugAI lootBug in LootBugs)
			{
				((EnemyAI)lootBug).agent.SetDestination(((Component)self).transform.position);
			}
		}
	}
	[AddComponentMenu("Low Intelligence Specimens/Material Variants")]
	public class MaterialVariants : NetworkBehaviour
	{
		[Tooltip("The item data of the scrap.")]
		public Item itemData;

		[Space(5f)]
		[Tooltip("The mesh renderers to change the material of. This will use the first material in the array.")]
		public MeshRenderer[] meshRenderers;

		[FormerlySerializedAs("ChangeScanNodeText")]
		[Space(5f)]
		public bool changeScanNodeText;

		[Tooltip("The text to change to when the material is changed.")]
		public string[] scanNodeText;

		[Space(5f)]
		[Tooltip("The scan node properties to change the text of.")]
		public ScanNodeProperties scanNodeProperties;

		[Space(5f)]
		[Tooltip("The currently saved material variant.")]
		public int savedMaterialVariant = -1;

		public override void OnNetworkSpawn()
		{
			((NetworkBehaviour)this).OnNetworkSpawn();
			SetRendererServerRpc();
		}

		[ServerRpc(RequireOwnership = false)]
		private void SetRendererServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1998739181u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1998739181u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					savedMaterialVariant = ((savedMaterialVariant != -1) ? Math.Clamp(savedMaterialVariant, 0, itemData.materialVariants.Length - 1) : Random.Range(0, itemData.materialVariants.Length));
					SetRendererClientRpc(savedMaterialVariant);
				}
			}
		}

		[ClientRpc]
		private void SetRendererClientRpc(int materialVariant)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(774198903u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, materialVariant);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 774198903u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			MeshRenderer[] array = meshRenderers;
			for (int i = 0; i < array.Length; i++)
			{
				((Renderer)array[i]).material = itemData.materialVariants[materialVariant];
				if (changeScanNodeText)
				{
					scanNodeProperties.headerText = scanNodeText[materialVariant];
				}
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_MaterialVariants()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1998739181u, new RpcReceiveHandler(__rpc_handler_1998739181));
			NetworkManager.__rpc_func_table.Add(774198903u, new RpcReceiveHandler(__rpc_handler_774198903));
		}

		private static void __rpc_handler_1998739181(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((MaterialVariants)(object)target).SetRendererServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_774198903(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int rendererClientRpc = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref rendererClientRpc);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((MaterialVariants)(object)target).SetRendererClientRpc(rendererClientRpc);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "MaterialVariants";
		}
	}
	[AddComponentMenu("Low Intelligence Specimens/Panel K")]
	public class PanelK : GrabbableObject
	{
		[Header("WARNING: TAMPERING WITH, OR MODIFIYING HARDWARE AND/OR")]
		[Header("SOFTWARE ON THIS SYSTEM IN ANY WAY, OR ATTEMPTED")]
		[Header("SERVICE OR REPAIR BY ANY UNAUTHORIZED PERSONS WILL")]
		[Header("IMMEDIATELY VOID ALL WARRANTIES, TERMINATE ALL LICENSE,")]
		[Header("AND WILL BE REPORTED TO THE AUTHORITIES.")]
		[Space(10f)]
		[Tooltip("The audiosource music is coming from.")]
		public AudioSource musicSource;

		private readonly NetworkVariable<bool> _isPlaying = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1);

		public override void DiscardItem()
		{
			if ((Object)(object)base.playerHeldBy != (Object)null)
			{
				base.playerHeldBy.equippedUsableItemQE = false;
			}
			base.isBeingUsed = false;
			((GrabbableObject)this).DiscardItem();
		}

		public override void PocketItem()
		{
			if ((Object)(object)base.playerHeldBy != (Object)null)
			{
				base.playerHeldBy.equippedUsableItemQE = false;
			}
			base.isBeingUsed = false;
			((GrabbableObject)this).PocketItem();
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			base.playerHeldBy.equippedUsableItemQE = true;
		}

		public override void ItemInteractLeftRight(bool right)
		{
			((GrabbableObject)this).ItemInteractLeftRight(right);
			if (!right && !((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null))
			{
				_isPlaying.Value = !_isPlaying.Value;
				musicSource.mute = !_isPlaying.Value;
			}
		}

		protected override void __initializeVariables()
		{
			if (_isPlaying == null)
			{
				throw new Exception("PanelK._isPlaying cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)_isPlaying).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)_isPlaying, "_isPlaying");
			((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)_isPlaying);
			((GrabbableObject)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "PanelK";
		}
	}
	[AddComponentMenu("Low Intelligence Specimens/Patrick")]
	public class Patrick : GrabbableObject
	{
		[Space(10f)]
		[Tooltip("The noise to play before he explodes.")]
		public AudioClip explodeNoise;

		[Tooltip("The chance that he forgot to check the O-Ring on the SRBs.")]
		public float memoryLossChance = 15f;

		[Tooltip("Time before he explodes.")]
		public float timeBeforeExplosion = 0.7f;

		private bool _exploding;

		private readonly NetworkVariable<bool> _forgotToCheckSRBs = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		private readonly NetworkVariable<bool> _willExplode = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		private AudioSource _audioSource;

		public override void OnNetworkSpawn()
		{
			((NetworkBehaviour)this).OnNetworkSpawn();
			_audioSource = ((Component)this).GetComponent<AudioSource>();
			if (((NetworkBehaviour)this).IsHost && !StartOfRound.Instance.inShipPhase)
			{
				_forgotToCheckSRBs.Value = Random.Range(0f, 100f) <= memoryLossChance;
			}
		}

		public override void InteractItem()
		{
			((GrabbableObject)this).InteractItem();
			if (_forgotToCheckSRBs.Value && !_exploding && !_willExplode.Value)
			{
				ChallengerExplosionServerRpc();
				LowIntelligencePlugin.modConsole.LogInfo((object)"Patrick forgot to check the O-Ring on the SRBs. Also, someone's dead.");
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ChallengerExplosionServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3922383671u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3922383671u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					_willExplode.Value = true;
					ChallengerExplosionClientRpc();
				}
			}
		}

		[ClientRpc]
		public void ChallengerExplosionClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3380742983u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3380742983u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					((MonoBehaviour)this).StartCoroutine(ChallengerExplosion());
					_exploding = true;
				}
			}
		}

		private IEnumerator ChallengerExplosion()
		{
			yield return (object)new WaitForSeconds(1f);
			_audioSource.PlayOneShot(explodeNoise, 1f);
			Utilities.PlayAudibleNoise(_audioSource, explodeNoise, ((Component)this).transform.position, 17f, 1f, base.isInElevator);
			yield return (object)new WaitForSeconds(timeBeforeExplosion);
			Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, 100, 0f, 6.4f, 6, (CauseOfDeath)3);
			yield return (object)new WaitForSeconds(2f);
			if (((NetworkBehaviour)this).IsServer)
			{
				((Component)this).gameObject.GetComponent<NetworkObject>().Despawn(true);
			}
		}

		protected override void __initializeVariables()
		{
			if (_forgotToCheckSRBs == null)
			{
				throw new Exception("Patrick._forgotToCheckSRBs cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)_forgotToCheckSRBs).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)_forgotToCheckSRBs, "_forgotToCheckSRBs");
			((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)_forgotToCheckSRBs);
			if (_willExplode == null)
			{
				throw new Exception("Patrick._willExplode cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)_willExplode).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)_willExplode, "_willExplode");
			((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)_willExplode);
			((GrabbableObject)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Patrick()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3922383671u, new RpcReceiveHandler(__rpc_handler_3922383671));
			NetworkManager.__rpc_func_table.Add(3380742983u, new RpcReceiveHandler(__rpc_handler_3380742983));
		}

		private static void __rpc_handler_3922383671(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Patrick)(object)target).ChallengerExplosionServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3380742983(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Patrick)(object)target).ChallengerExplosionClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "Patrick";
		}
	}
	[AddComponentMenu("Low Intelligence Specimens/Tape Recorder")]
	public class TapeRecorder : GrabbableObject
	{
		[Space(10f)]
		[Tooltip("The audiosource to play the noise from.")]
		public AudioClip[] noiseSfx;

		[Space(5f)]
		[Tooltip("The audiosource to play the sound from.")]
		public AudioSource audioSource;

		[Space(5f)]
		[Tooltip("The range of the noise.")]
		public float noiseRange;

		[Space(5f)]
		[Tooltip("The minimum loudness of the noise.")]
		public float minLoudness;

		[Tooltip("The maximum loudness of t