Decompiled source of ItemSCPs v0.1.0

plugins/ProjectSCP.ItemSCPs.dll

Decompiled 18 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using Dawn;
using Dawn.Utils;
using Dusk;
using GameNetcodeStuff;
using HarmonyLib;
using ItemSCPs.SCP;
using LethalDiseases;
using Microsoft.CodeAnalysis;
using PSCPLibrary;
using PSCPLibrary.Interfaces;
using ProjectSCP.ItemSCPs.NetcodePatcher;
using SnowyLib;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Rendering.HighDefinition;
using WearableItemsAPI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("DunGen")]
[assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")]
[assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")]
[assembly: IgnoresAccessChecksTo("EasyTextEffects")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.XR.CoreUtils")]
[assembly: IgnoresAccessChecksTo("Unity.XR.Management")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")]
[assembly: AssemblyCompany("ProjectSCP.ItemSCPs")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0+619e763883d8af16c1005cf03e92ba4d8b37ea3c")]
[assembly: AssemblyProduct("ItemSCPs")]
[assembly: AssemblyTitle("ProjectSCP.ItemSCPs")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ItemSCPs
{
	public static class Configs
	{
		public static void Init()
		{
			SCP3482Behavior.InitConfigs();
			SCP420JBehavior.InitConfigs();
			SCP498Behavior.InitConfigs();
			SCP500Behavior.InitConfigs();
			SCP689Behavior.InitConfigs();
			SCP735Behavior.InitConfigs();
			SCP983Behavior.InitConfigs();
		}
	}
	public class ItemSCPsContentHandler : ContentHandler<ItemSCPsContentHandler>
	{
		public class ItemSCPsAssetsAssets : AssetBundleLoader<ItemSCPsAssetsAssets>
		{
			[LoadFromBundle("ItemSCPsNetworkHandler.prefab")]
			public GameObject NetworkHandlerPrefab { get; private set; } = null;

			[LoadFromBundle("SCPDatabase.asset")]
			public SCPDatabase SCPDatabase { get; private set; } = null;

			public ItemSCPsAssetsAssets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP005Assets : AssetBundleLoader<SCP005Assets>
		{
			public SCP005Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP012Assets : AssetBundleLoader<SCP012Assets>
		{
			public SCP012Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP018Assets : AssetBundleLoader<SCP018Assets>
		{
			public SCP018Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP1025Assets : AssetBundleLoader<SCP1025Assets>
		{
			public SCP1025Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP1079Assets : AssetBundleLoader<SCP1079Assets>
		{
			[LoadFromBundle("PinkBloodDecalProjector.prefab")]
			public GameObject PinkBloodDecalProjector { get; private set; } = null;

			[LoadFromBundle("PinkBloodDecal.mat")]
			public Material PinkBloodDecal { get; private set; } = null;

			public SCP1079Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP207Assets : AssetBundleLoader<SCP207Assets>
		{
			public SCP207Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP268Assets : AssetBundleLoader<SCP268Assets>
		{
			public SCP268Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP3482Assets : AssetBundleLoader<SCP3482Assets>
		{
			[LoadFromBundle("SCP3482Overlay.prefab")]
			public GameObject Overlay { get; private set; } = null;

			public SCP3482Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP420JAssets : AssetBundleLoader<SCP420JAssets>
		{
			public SCP420JAssets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP498Assets : AssetBundleLoader<SCP498Assets>
		{
			public SCP498Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP500Assets : AssetBundleLoader<SCP500Assets>
		{
			public SCP500Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP689Assets : AssetBundleLoader<SCP689Assets>
		{
			public SCP689Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP714Assets : AssetBundleLoader<SCP714Assets>
		{
			public SCP714Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP735Assets : AssetBundleLoader<SCP735Assets>
		{
			public SCP735Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public class SCP983Assets : AssetBundleLoader<SCP983Assets>
		{
			[LoadFromBundle("LightFlash.prefab")]
			public GameObject LightFlashPrefab { get; private set; } = null;

			public SCP983Assets(DuskMod mod, string filePath)
				: base(mod, filePath)
			{
			}
		}

		public ItemSCPsAssetsAssets? ItemSCPsAssets;

		public SCP005Assets? SCP005;

		public SCP012Assets? SCP012;

		public SCP018Assets? SCP018;

		public SCP1025Assets? SCP1025;

		public SCP1079Assets? SCP1079;

		public SCP207Assets? SCP207;

		public SCP268Assets? SCP268;

		public SCP3482Assets? SCP3482;

		public SCP420JAssets? SCP420J;

		public SCP498Assets? SCP498;

		public SCP500Assets? SCP500;

		public SCP689Assets? SCP689;

		public SCP714Assets? SCP714;

		public SCP735Assets? SCP735;

		public SCP983Assets? SCP983;

		public ItemSCPsContentHandler(DuskMod mod)
			: base(mod)
		{
			((ContentHandler)this).RegisterContent<ItemSCPsAssetsAssets>("itemscps_assets", ref ItemSCPsAssets, false);
			((ContentHandler)this).RegisterContent<SCP005Assets>("scp005", ref SCP005, false);
			((ContentHandler)this).RegisterContent<SCP012Assets>("scp012", ref SCP012, false);
			((ContentHandler)this).RegisterContent<SCP1025Assets>("scp1025", ref SCP1025, false);
			((ContentHandler)this).RegisterContent<SCP1079Assets>("scp1079", ref SCP1079, false);
			((ContentHandler)this).RegisterContent<SCP207Assets>("scp207", ref SCP207, false);
			((ContentHandler)this).RegisterContent<SCP268Assets>("scp268", ref SCP268, false);
			((ContentHandler)this).RegisterContent<SCP3482Assets>("scp3482", ref SCP3482, false);
			((ContentHandler)this).RegisterContent<SCP420JAssets>("scp420j", ref SCP420J, false);
			((ContentHandler)this).RegisterContent<SCP498Assets>("scp498", ref SCP498, false);
			((ContentHandler)this).RegisterContent<SCP500Assets>("scp500", ref SCP500, false);
			((ContentHandler)this).RegisterContent<SCP689Assets>("scp689", ref SCP689, false);
			((ContentHandler)this).RegisterContent<SCP714Assets>("scp714", ref SCP714, false);
			((ContentHandler)this).RegisterContent<SCP735Assets>("scp735", ref SCP735, false);
			((ContentHandler)this).RegisterContent<SCP983Assets>("scp983", ref SCP983, false);
		}
	}
	public static class ItemSCPsKeys
	{
		public static readonly NamespacedKey<DawnItemInfo> SCP005 = NamespacedKey<DawnItemInfo>.From("itemscps", "scpzerozerofive");

		public static readonly NamespacedKey<DawnItemInfo> SCP012 = NamespacedKey<DawnItemInfo>.From("itemscps", "scpzeroonetwo");

		public static readonly NamespacedKey<DawnItemInfo> SCP2071 = NamespacedKey<DawnItemInfo>.From("itemscps", "scptwozerosevenone");

		public static readonly NamespacedKey<DawnItemInfo> SCP268 = NamespacedKey<DawnItemInfo>.From("itemscps", "scptwosixeight");

		public static readonly NamespacedKey<DawnItemInfo> SCP420J = NamespacedKey<DawnItemInfo>.From("itemscps", "scpfourtwozeroj");

		public static readonly NamespacedKey<DawnItemInfo> SCP498 = NamespacedKey<DawnItemInfo>.From("itemscps", "scpfournineeight");

		public static readonly NamespacedKey<DawnItemInfo> SCP500 = NamespacedKey<DawnItemInfo>.From("itemscps", "scpfivezerozero");

		public static readonly NamespacedKey<DawnItemInfo> SCP689 = NamespacedKey<DawnItemInfo>.From("itemscps", "scpsixeightnine");

		public static readonly NamespacedKey<DawnItemInfo> SCP714 = NamespacedKey<DawnItemInfo>.From("itemscps", "scpsevenonefour");

		public static readonly NamespacedKey<DawnItemInfo> SCP735 = NamespacedKey<DawnItemInfo>.From("itemscps", "scpseventhreefive");

		public static readonly NamespacedKey<DawnItemInfo> SCP983 = NamespacedKey<DawnItemInfo>.From("itemscps", "scpnineeightthree");

		public static readonly NamespacedKey<DawnItemInfo> SCP9831 = NamespacedKey<DawnItemInfo>.From("itemscps", "scpnineeightthreeone");

		public static readonly NamespacedKey<DawnItemInfo> SCP1025 = NamespacedKey<DawnItemInfo>.From("itemscps", "scponezerotwofive");

		public static readonly NamespacedKey<DawnItemInfo> SCP1079 = NamespacedKey<DawnItemInfo>.From("itemscps", "scponezerosevennine");

		public static readonly NamespacedKey<DawnItemInfo> SCP3482 = NamespacedKey<DawnItemInfo>.From("itemscps", "scpthreefoureighttwo");
	}
	internal class LethalDiseasesCompatibility
	{
		private static bool? _enabled;

		internal static bool enabled
		{
			get
			{
				if (!_enabled.HasValue)
				{
					_enabled = Chainloader.PluginInfos.ContainsKey("Snowlance.LethalDiseases");
				}
				return _enabled.Value;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		internal static void InfectPlayer(PlayerControllerB player)
		{
			DiseaseAPI.Infect(player);
		}
	}
	internal class NetworkHandler : NetworkBehaviour
	{
		public enum SoundEffect
		{
			Sneeze,
			Cough,
			CoughHeavy
		}

		public AudioClip[] sneezeSFX = null;

		public AudioClip[] coughSFX = null;

		public AudioClip[] coughHeavySFX = null;

		public AudioClip[] heartbeatSlowSFX = null;

		public AudioClip[] heartbeatFastSFX = null;

		public static NetworkHandler Instance { get; private set; }

		public void Update()
		{
			SCP689Behavior.StaticUpdate();
			SCP3482Behavior.StaticUpdate();
			SCP207Behavior.StaticUpdate();
			TESTING.Update();
		}

		public override void OnNetworkSpawn()
		{
			if (((NetworkBehaviour)this).IsServer && (Object)(object)Instance != (Object)null)
			{
				((Component)Instance).gameObject.GetComponent<NetworkObject>().Despawn(true);
			}
			Instance = this;
			Plugin.logger.LogDebug((object)"NetworkHandler spawned");
			((NetworkBehaviour)this).OnNetworkSpawn();
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void PlayPlayerSoundEffectRpc(ulong clientId, SoundEffect soundEffect, int bodyPartIndex = 5, float volume = 1f, float min3DDistance = 1f, float max3DDistance = 10f, float cutoffFrequency = 22000f, int audibleNoiseID = 0)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: 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)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(204303977u, val3, val, (SendTo)6, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, clientId);
				((FastBufferWriter)(ref val2)).WriteValueSafe<SoundEffect>(ref soundEffect, default(ForEnums));
				BytePacker.WriteValueBitPacked(val2, bodyPartIndex);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref volume, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref min3DDistance, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref max3DDistance, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref cutoffFrequency, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, audibleNoiseID);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 204303977u, val3, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1)
			{
				return;
			}
			base.__rpc_exec_stage = (__RpcExecStage)0;
			PlayerControllerB val4 = Plugin.PlayerFromId(clientId);
			if (!((Object)(object)val4 == (Object)null))
			{
				Transform val5 = val4.bodyParts[bodyPartIndex];
				AudioClip[] array;
				switch (soundEffect)
				{
				default:
					return;
				case SoundEffect.Sneeze:
					array = sneezeSFX;
					break;
				case SoundEffect.Cough:
					array = coughSFX;
					break;
				case SoundEffect.CoughHeavy:
					array = coughHeavySFX;
					break;
				}
				Utils.PlaySoundAtPosition(val5, array, volume, true, true, min3DDistance, max3DDistance, cutoffFrequency, audibleNoiseID);
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void DropPinkBloodRpc(Vector3 pos)
		{
			//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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1)
				{
					RpcAttributeParams val = new RpcAttributeParams
					{
						RequireOwnership = false
					};
					RpcParams val3 = default(RpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2577543608u, val3, val, (SendTo)6, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos);
					((NetworkBehaviour)this).__endSendRpc(ref val2, 2577543608u, val3, val, (SendTo)6, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1)
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					SCP1079Behavior.DropPinkBloodOnLocalClient(pos);
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void AddPinkBloodToBodyRpc(ulong clientId)
		{
			//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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: 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)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2700347560u, val3, val, (SendTo)6, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, clientId);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 2700347560u, val3, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1)
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				PlayerControllerB val4 = Plugin.PlayerFromId(clientId);
				if (!((Object)(object)val4 == (Object)null))
				{
					SCP1079Behavior.AddPinkBloodToBodyOnLocalClient(val4);
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void CreateLightFlashRpc(Vector3 position)
		{
			//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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: 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)
			{
				RpcAttributeParams val = new RpcAttributeParams
				{
					RequireOwnership = false
				};
				RpcParams val3 = default(RpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1843239011u, val3, val, (SendTo)6, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
				((NetworkBehaviour)this).__endSendRpc(ref val2, 1843239011u, val3, val, (SendTo)6, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1)
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				GameObject val4 = ContentHandler<ItemSCPsContentHandler>.Instance.SCP983?.LightFlashPrefab;
				if ((Object)(object)val4 == (Object)null)
				{
					Plugin.logger.LogError((object)"Unable to get LightFlashPrefab in CreateLightFlash");
					return;
				}
				Object.Instantiate<GameObject>(val4, position, Quaternion.identity);
				StunGrenadeItem.StunExplosion(((Component)this).transform.position, true, 1f, 10f, 1f, false, (PlayerControllerB)null, (PlayerControllerB)null, 0f);
			}
		}

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

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(204303977u, new RpcReceiveHandler(__rpc_handler_204303977), "PlayPlayerSoundEffectRpc");
			((NetworkBehaviour)this).__registerRpc(2577543608u, new RpcReceiveHandler(__rpc_handler_2577543608), "DropPinkBloodRpc");
			((NetworkBehaviour)this).__registerRpc(2700347560u, new RpcReceiveHandler(__rpc_handler_2700347560), "AddPinkBloodToBodyRpc");
			((NetworkBehaviour)this).__registerRpc(1843239011u, new RpcReceiveHandler(__rpc_handler_1843239011), "CreateLightFlashRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_204303977(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: 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_00c4: 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_010d: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong clientId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref clientId);
				SoundEffect soundEffect = default(SoundEffect);
				((FastBufferReader)(ref reader)).ReadValueSafe<SoundEffect>(ref soundEffect, default(ForEnums));
				int bodyPartIndex = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref bodyPartIndex);
				float volume = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref volume, default(ForPrimitives));
				float min3DDistance = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref min3DDistance, default(ForPrimitives));
				float max3DDistance = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref max3DDistance, default(ForPrimitives));
				float cutoffFrequency = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref cutoffFrequency, default(ForPrimitives));
				int audibleNoiseID = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref audibleNoiseID);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((NetworkHandler)(object)target).PlayPlayerSoundEffectRpc(clientId, soundEffect, bodyPartIndex, volume, min3DDistance, max3DDistance, cutoffFrequency, audibleNoiseID);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2577543608(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0036: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 pos = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref pos);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((NetworkHandler)(object)target).DropPinkBloodRpc(pos);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2700347560(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)
			{
				ulong clientId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref clientId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((NetworkHandler)(object)target).AddPinkBloodToBodyRpc(clientId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1843239011(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0036: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((NetworkHandler)(object)target).CreateLightFlashRpc(position);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "NetworkHandler";
		}
	}
	[HarmonyPatch]
	public class NetworkHandlerPatches
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(StartOfRound), "Awake")]
		private static void AwakePostFix()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.IsServerOrHost)
			{
				GameObject val = Object.Instantiate<GameObject>(ContentHandler<ItemSCPsContentHandler>.Instance.ItemSCPsAssets?.NetworkHandlerPrefab, Vector3.zero, Quaternion.identity);
				if (val != null)
				{
					val.GetComponent<NetworkObject>().Spawn(false);
				}
			}
		}
	}
	[BepInPlugin("ProjectSCP.ItemSCPs", "ItemSCPs", "0.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private readonly Harmony harmony = new Harmony("ProjectSCP.ItemSCPs");

		public static Plugin PluginInstance { get; private set; }

		public static ManualLogSource logger { get; private set; }

		public static DuskMod Mod { get; private set; }

		public static SCPDatabase SCPDatabase { get; private set; }

		public static PlayerControllerB localPlayer => StartOfRound.Instance.localPlayerController;

		public static bool IsServerOrHost => NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost;

		public static PlayerControllerB? PlayerFromId(ulong id)
		{
			return StartOfRound.Instance.allPlayerScripts.Where((PlayerControllerB x) => x.actualClientId == id).FirstOrDefault();
		}

		private void Awake()
		{
			if ((Object)(object)PluginInstance == (Object)null)
			{
				PluginInstance = this;
			}
			logger = ((BaseUnityPlugin)PluginInstance).Logger;
			harmony.PatchAll();
			AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "itemscps_mainassets"));
			Mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val);
			Mod.RegisterContentHandlers();
			SCPDatabase = ContentHandler<ItemSCPsContentHandler>.Instance.ItemSCPsAssets.SCPDatabase;
			SCPAPI.Register(SCPDatabase);
			Configs.Init();
			InitializeNetworkBehaviours();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"ProjectSCP.ItemSCPs v0.1.0 has loaded!");
		}

		private static void InitializeNetworkBehaviours()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
			logger.LogDebug((object)"Finished initializing network behaviours");
		}
	}
	[HarmonyPatch]
	public class TESTING : MonoBehaviour
	{
		public static bool immunity { get; private set; }

		[HarmonyPostfix]
		[HarmonyPatch(typeof(HUDManager), "PingScan_performed")]
		public static void PingScan_performedPostFix()
		{
		}

		public static void Update()
		{
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")]
		public static void SubmitChat_performedPrefix(HUDManager __instance)
		{
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (!Utils.testing || !Plugin.IsServerOrHost)
				{
					return;
				}
				string text = __instance.chatTextField.text;
				string[] array = text.Split(" ");
				switch (array[0])
				{
				case "/immunity":
					immunity = !immunity;
					HUDManager.Instance.DisplayTip("ItemSCPs", "Immunity: " + immunity, false, false, "LC_Tip1");
					break;
				case "/immune":
					immunity = !immunity;
					HUDManager.Instance.DisplayTip("ItemSCPs", "Immunity: " + immunity, false, false, "LC_Tip1");
					break;
				case "/testlight":
				{
					Vector3 position = ((Component)Plugin.localPlayer.bodyParts[5]).transform.position;
					NetworkHandler.Instance.CreateLightFlashRpc(position);
					break;
				}
				case "/disease":
				{
					if (array.Length != 1 && int.TryParse(array[1], out var result) && result <= 5 && result >= 0)
					{
						SCP1025Behavior.diseases[result]();
					}
					break;
				}
				case "/3482":
					SCP3482Behavior.localPlayerAffected = false;
					break;
				}
			}
			catch (Exception ex)
			{
				Plugin.logger.LogError((object)ex);
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "ProjectSCP.ItemSCPs";

		public const string PLUGIN_NAME = "ItemSCPs";

		public const string PLUGIN_VERSION = "0.1.0";
	}
}
namespace ItemSCPs.SCP
{
	internal class SCP005Behavior : PhysicsProp, ISCP, ISingletonItem
	{
		[SerializeField]
		private SCPInfo info = null;

		private const float unlockDistance = 1f;

		public SCPInfo SCPInfo => info;

		public void Awake()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0f, 0.1f, 0f);
			((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(-90f, 0f, 0f);
			((GrabbableObject)this).itemProperties.floorYOffset = 90;
			((GrabbableObject)this).itemProperties.toolTips = new string[1] { "Use Key [LMB]" };
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (!buttonDown)
			{
				return;
			}
			RaycastHit[] array = Physics.SphereCastAll(new Ray(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward), 1f);
			RaycastHit[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				RaycastHit val = array2[i];
				if (((Component)((RaycastHit)(ref val)).collider).CompareTag("PoweredObject"))
				{
					TerminalAccessibleObject component = ((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<TerminalAccessibleObject>();
					if ((Object)(object)component != (Object)null && component.isBigDoor && !component.isDoorOpen)
					{
						component.SetDoorOpenServerRpc(true);
					}
				}
				DoorLock component2 = ((Component)((RaycastHit)(ref val)).transform).GetComponent<DoorLock>();
				if ((Object)(object)component2 != (Object)null && component2.isLocked && !component2.isPickingLock)
				{
					component2.UnlockDoorSyncWithServer();
				}
			}
			foreach (MonoBehaviour item in Object.FindObjectsOfType<MonoBehaviour>().OfType<ISCP005Unlockable>())
			{
				MonoBehaviour val2 = item;
				Vector3 val3 = ((Component)val2).gameObject.transform.position - ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position;
				if (((Vector3)(ref val3)).sqrMagnitude < 1f)
				{
					((ISCP005Unlockable)val2).Unlock();
				}
			}
		}

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

		protected override void __initializeRpcs()
		{
			((PhysicsProp)this).__initializeRpcs();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "SCP005Behavior";
		}
	}
	internal class SCP012Behavior : PhysicsProp, ISCP, ISingletonItem
	{
		[SerializeField]
		private SCPInfo info = null;

		public AudioSource audioSource = null;

		public AudioSource audioSource2D = null;

		public AudioClip[] speechSFX = null;

		public AudioClip finalSpeechSFX = null;

		public AudioClip[] stabSFX = null;

		public Camera lightCamera = null;

		private int localPlayerStabAmount;

		private bool localPlayerPlayingFinalSpeech;

		private float timeSinceStartFinalSpeech;

		private float timeSinceSpeech;

		private float timeSinceIntervalUpdate;

		private float nextSpeechTime;

		private float distance;

		private float maxRange;

		private float minRange;

		private bool isOutside;

		private bool localPlayerAffected;

		private readonly BoundedRange speechInterval = new BoundedRange(10f, 15f);

		private readonly BoundedRange activationRange = new BoundedRange(3f, 10f);

		private const int speechDamage = 10;

		public SCPInfo SCPInfo => info;

		private bool isLit => IsLit();

		private bool heldByLocalPlayer => (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)Plugin.localPlayer && !((GrabbableObject)this).isPocketed;

		public void Awake()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0f, 0.1f, -0.19f);
			((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(170f, 90f, 0f);
			((GrabbableObject)this).itemProperties.floorYOffset = 90;
			((GrabbableObject)this).itemProperties.canBeGrabbedBeforeGameStart = true;
			((GrabbableObject)this).itemProperties.canBeInspected = true;
			((GrabbableObject)this).itemProperties.twoHanded = false;
			lightCamera.clearFlags = (CameraClearFlags)2;
			lightCamera.backgroundColor = Color.black;
			lightCamera.cullingMask = 1 << LayerMask.NameToLayer("Props");
		}

		public override void Update()
		{
			((GrabbableObject)this).Update();
			timeSinceStartFinalSpeech += Time.deltaTime;
			timeSinceSpeech += Time.deltaTime;
			timeSinceIntervalUpdate += Time.deltaTime;
			if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
			{
				isOutside = !((GrabbableObject)this).playerHeldBy.isInsideFactory;
			}
			if (timeSinceIntervalUpdate > 0.2f)
			{
				timeSinceIntervalUpdate = 0f;
				IntervalUpdate();
			}
			if (localPlayerAffected && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null)
			{
				ForcePlayerMovementUpdate();
			}
		}

		private void IntervalUpdate()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Invalid comparison between Unknown and I4
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			distance = Vector3.Distance(((Component)this).transform.position, ((Component)Plugin.localPlayer).transform.position);
			if (!Plugin.localPlayer.criticallyInjured)
			{
				localPlayerStabAmount = 0;
			}
			bool flag = isOutside && (int)TimeOfDay.Instance.currentLevelWeather == 3;
			maxRange = (flag ? (activationRange.Max / 2f) : activationRange.Max);
			minRange = (flag ? (activationRange.Min / 2f) : activationRange.Min);
			localPlayerAffected = CanAffectPlayer();
			audioSource.volume = (localPlayerAffected ? 1 : 0);
			audioSource.maxDistance = maxRange;
			if (!localPlayerAffected)
			{
				ResetVariables();
				return;
			}
			if (!heldByLocalPlayer)
			{
				if (distance <= 1f && !Plugin.localPlayer.isGrabbingObjectAnimation && !Plugin.localPlayer.isTypingChat && !Plugin.localPlayer.inTerminalMenu && !Plugin.localPlayer.throwingObject && !Plugin.localPlayer.IsInspectingItem && !((Object)(object)Plugin.localPlayer.inAnimationWithEnemy != (Object)null) && !Plugin.localPlayer.jetpackControls && !Plugin.localPlayer.disablingJetpackControls && !StartOfRound.Instance.suckingPlayersOutOfShip && !Plugin.localPlayer.activatingItem && !Plugin.localPlayer.waitingToDropItem)
				{
					if (IsInventoryFull(Plugin.localPlayer))
					{
						Plugin.localPlayer.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true);
					}
					Plugin.localPlayer.BeginGrabObject();
				}
				return;
			}
			Plugin.localPlayer.activatingItem = true;
			Plugin.localPlayer.sprintMeter = 0f;
			Plugin.localPlayer.isExhausted = true;
			if (Plugin.localPlayer.health > 0)
			{
				VignetteOverlay.SetIntensity((float)(1 - Plugin.localPlayer.health / 100), 0.01f);
			}
			if (localPlayerPlayingFinalSpeech)
			{
				if (timeSinceStartFinalSpeech > finalSpeechSFX.length)
				{
					RoundManager.PlayRandomClip(audioSource, stabSFX, true, 1f, 0, 1000);
					Plugin.localPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)14, 0, default(Vector3), false);
					Plugin.localPlayer.activatingItem = false;
					timeSinceStartFinalSpeech = 0f;
					localPlayerPlayingFinalSpeech = false;
				}
			}
			else if (timeSinceSpeech > nextSpeechTime)
			{
				timeSinceSpeech = 0f;
				nextSpeechTime = speechInterval.GetRandomInRange(Utils.randomLocal);
				DamageSelf();
			}
		}

		private bool IsInventoryFull(PlayerControllerB player)
		{
			GrabbableObject[] itemSlots = player.ItemSlots;
			foreach (GrabbableObject val in itemSlots)
			{
				if ((Object)(object)val == (Object)null)
				{
					return false;
				}
			}
			return true;
		}

		public override void EquipItem()
		{
			((PhysicsProp)this).EquipItem();
			if (((NetworkBehaviour)this).IsOwner)
			{
				timeSinceSpeech = 0f;
				nextSpeechTime = 3f;
				Plugin.localPlayer.activatingItem = CanAffectPlayer();
			}
		}

		public override void DiscardItem()
		{
			ResetVariables();
			((GrabbableObject)this).DiscardItem();
		}

		private void DamageSelf()
		{
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			localPlayerStabAmount++;
			int num = localPlayerStabAmount * 10;
			if (Plugin.localPlayer.health - num <= 0)
			{
				PlayFinalSpeech();
				return;
			}
			RoundManager.PlayRandomClip(audioSource, stabSFX, true, 1f, 0, 1000);
			Plugin.localPlayer.inSpecialInteractAnimation = true;
			Plugin.localPlayer.DamagePlayer(num, true, true, (CauseOfDeath)14, 0, false, default(Vector3));
			Plugin.localPlayer.inSpecialInteractAnimation = false;
			HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
			if (!Plugin.localPlayer.criticallyInjured)
			{
				Plugin.localPlayer.MakeCriticallyInjured(true);
			}
			Plugin.localPlayer.drunkness = 0.3f;
			RoundManager.PlayRandomClip(audioSource2D, speechSFX, true, 1f, 0, 1000);
		}

		private void ForcePlayerMovementUpdate()
		{
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.InverseLerp(maxRange, minRange, distance);
			float num2 = num * num;
			VignetteOverlay.SetIntensity(num / 2f, 0.01f);
			Vector3 val;
			if (distance > 1f)
			{
				val = ((Component)this).transform.position - ((Component)Plugin.localPlayer.playerCollider).transform.position;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				float num3 = num * Time.fixedDeltaTime;
				if (Vector3.Distance(((Component)Plugin.localPlayer.playerCollider).transform.position, ((Component)this).transform.position) > num3)
				{
					Transform transform = ((Component)Plugin.localPlayer.playerCollider).transform;
					transform.position += normalized * num3;
				}
				else
				{
					((Component)Plugin.localPlayer.playerCollider).transform.position = ((Component)this).transform.position;
				}
			}
			float num4 = Mathf.Clamp(Time.deltaTime, 0f, 0.1f);
			Vector3 val2 = ((Component)this).transform.position - Plugin.localPlayer.thisPlayerBody.position;
			val2.y = 0f;
			if (((Vector3)(ref val2)).sqrMagnitude > 0.001f)
			{
				Quaternion val3 = Quaternion.LookRotation(((Vector3)(ref val2)).normalized);
				Plugin.localPlayer.thisPlayerBody.rotation = Quaternion.Slerp(Plugin.localPlayer.thisPlayerBody.rotation, val3, num2 * num4);
			}
			val = ((Component)this).transform.position - ((Component)Plugin.localPlayer.gameplayCamera).transform.position;
			Vector3 normalized2 = ((Vector3)(ref val)).normalized;
			float num5 = (0f - Mathf.Asin(normalized2.y)) * 57.29578f;
			Plugin.localPlayer.cameraUp = Mathf.Lerp(Plugin.localPlayer.cameraUp, num5, num2 * num4);
			Plugin.localPlayer.cameraUp = Mathf.Clamp(Plugin.localPlayer.cameraUp, -89f, 89f);
			((Component)Plugin.localPlayer.gameplayCamera).transform.localEulerAngles = new Vector3(Plugin.localPlayer.cameraUp, ((Component)Plugin.localPlayer.gameplayCamera).transform.localEulerAngles.y, 0f);
		}

		private bool CanAffectPlayer()
		{
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			if (SCP714Behavior.localPlayerAffected)
			{
				return false;
			}
			if (TESTING.immunity)
			{
				return false;
			}
			if (localPlayerPlayingFinalSpeech)
			{
				return true;
			}
			if (StartOfRound.Instance.inShipPhase && !Utils.inTestRoom)
			{
				return false;
			}
			if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)Plugin.localPlayer != (Object)(object)((GrabbableObject)this).playerHeldBy)
			{
				return false;
			}
			if (((GrabbableObject)this).isPocketed)
			{
				return false;
			}
			if (heldByLocalPlayer)
			{
				return isLit;
			}
			if (distance > maxRange)
			{
				return false;
			}
			if (!isLit)
			{
				return false;
			}
			if (!Plugin.localPlayer.HasLineOfSightToPosition(((Component)this).transform.position, 45f, 60, -1f, -1))
			{
				return false;
			}
			return true;
		}

		private void PlayFinalSpeech()
		{
			localPlayerPlayingFinalSpeech = true;
			timeSinceStartFinalSpeech = 0f;
			audioSource2D.pitch = Random.Range(0.94f, 1.06f);
			audioSource2D.PlayOneShot(finalSpeechSFX);
		}

		private void ResetVariables()
		{
			if (heldByLocalPlayer && Plugin.localPlayer.activatingItem)
			{
				Plugin.localPlayer.activatingItem = false;
			}
			timeSinceSpeech = 0f;
			localPlayerPlayingFinalSpeech = false;
			timeSinceStartFinalSpeech = 0f;
			localPlayerStabAmount = 0;
		}

		public bool IsLit()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_003f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			lightCamera.Render();
			RenderTexture.active = lightCamera.targetTexture;
			Texture2D val = new Texture2D(32, 32, (TextureFormat)3, false);
			val.ReadPixels(new Rect(0f, 0f, 32f, 32f), 0, 0);
			val.Apply();
			Color[] pixels = val.GetPixels();
			float num = 0f;
			Color[] array = pixels;
			for (int i = 0; i < array.Length; i++)
			{
				Color val2 = array[i];
				num += ((Color)(ref val2)).grayscale;
			}
			float num2 = num / (float)pixels.Length;
			Plugin.logger.LogDebug((object)num2);
			return num2 > 0.015f;
		}

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

		protected override void __initializeRpcs()
		{
			((PhysicsProp)this).__initializeRpcs();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "SCP012Behavior";
		}
	}
	internal class SCP1025Behavior : PhysicsProp, ISCP, ISingletonItem
	{
		[SerializeField]
		private SCPInfo info = null;

		public Animator animator = null;

		public Material[] diseasePageMaterials = null;

		public SkinnedMeshRenderer renderer = null;

		public static readonly Action[] diseases = new Action[6]
		{
			delegate
			{
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_0088: Expected O, but got Unknown
				//IL_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_008d: Expected O, but got Unknown
				//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Expected O, but got Unknown
				//IL_015b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0165: Expected O, but got Unknown
				float num = Random.Range(1200, 1800);
				Utils.DisplayStatusEffect("Minor respiratory infection detected");
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(60f, 200f), (Action)delegate
				{
					NetworkHandler.Instance.PlayPlayerSoundEffectRpc(Plugin.localPlayer.actualClientId, NetworkHandler.SoundEffect.Sneeze, 0, 0.5f, 1f, 10f, 1500f);
					Plugin.localPlayer.playQuickSpecialAnimation(1f);
					Plugin.localPlayer.playerBodyAnimator.SetTrigger("SA_PushLeverBack");
				}, "scp1025", "sneeze", num, (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action<StatusEffect>)null, true, true, true));
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new LerpValueEffect((Action<float>)delegate(float x)
				{
					Plugin.localPlayer.sprintMultiplier = Mathf.Clamp(Plugin.localPlayer.sprintMultiplier, 0f, x);
				}, 1.7f, 2.5f, num, "scp1025", "sprintMultiplier", (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action<StatusEffect>)null, true, true, true));
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new LerpValueEffect((Action<float>)delegate(float x)
				{
					Plugin.localPlayer.sprintMeter = Mathf.Clamp(Plugin.localPlayer.sprintMeter, 0f, x);
				}, 0.7f, 1f, num, "scp1025", "sprintMeter", (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action<StatusEffect>)null, true, true, true));
			},
			delegate
			{
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Expected O, but got Unknown
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Expected O, but got Unknown
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d0: Expected O, but got Unknown
				//IL_0128: Unknown result type (might be due to invalid IL or missing references)
				//IL_0132: Expected O, but got Unknown
				float num = Random.Range(1800, 3000);
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new LerpValueEffect((Action<float>)delegate(float x)
				{
					Plugin.localPlayer.sprintMeter = Mathf.Clamp(Plugin.localPlayer.sprintMeter, 0f, x);
				}, 0.7f, 1f, num, "scp1025", "sprintMeter", (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action<StatusEffect>)null, true, true, true));
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(30f, 120f), (Action)delegate
				{
					//IL_0019: 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)
					Utils.DisplayStatusEffect("Localized skin inflammation detected");
					Plugin.localPlayer.DamagePlayer(1, false, true, (CauseOfDeath)0, 0, false, default(Vector3));
				}, "scp1025", "chickenpox itch", num, (Func<StatusEffect, StatusEffect, ConflictResult>)null, (Action<StatusEffect>)null, true, true, true));
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new TickActionEffect((Action)delegate
				{
					Plugin.localPlayer.healthRegenerateTimer = 1f;
				}, "scp1025", "healthRegenerateTimer", num, (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action<StatusEffect>)null, true, true, true));
			},
			delegate
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Expected O, but got Unknown
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Expected O, but got Unknown
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: Expected O, but got Unknown
				//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ea: Expected O, but got Unknown
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(30f, 120f), (Action)delegate
				{
					//IL_008c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0092: Unknown result type (might be due to invalid IL or missing references)
					Plugin.localPlayer.playQuickSpecialAnimation(1.5f);
					Plugin.localPlayer.playerBodyAnimator.SetTrigger("SA_Typing");
					NetworkHandler.Instance.PlayPlayerSoundEffectRpc(Plugin.localPlayer.actualClientId, NetworkHandler.SoundEffect.CoughHeavy, 0, 0.5f, 1f, 10f, 1500f);
					VignetteOverlay.SetIntensity(0.2f, 0.01f);
					if (Plugin.localPlayer.health > 1)
					{
						Plugin.localPlayer.inSpecialInteractAnimation = true;
						Plugin.localPlayer.DamagePlayer(1, false, true, (CauseOfDeath)0, 0, false, default(Vector3));
						Plugin.localPlayer.inSpecialInteractAnimation = false;
					}
				}, "scp1025", "lung cancer coughHeavy", 0f, (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action<StatusEffect>)null, true, true, true));
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(15f, 40f), (Action)delegate
				{
					NetworkHandler.Instance.PlayPlayerSoundEffectRpc(Plugin.localPlayer.actualClientId, NetworkHandler.SoundEffect.Cough, 0, 0.5f, 1f, 10f, 1500f);
					VignetteOverlay.SetIntensity(0.05f, 0.01f);
				}, "scp1025", "lung cancer cough", 0f, (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action<StatusEffect>)null, true, true, true));
			},
			delegate
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Expected O, but got Unknown
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Expected O, but got Unknown
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d0: Expected O, but got Unknown
				float num = Random.Range(600, 1200);
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(30f, 200f), (Action)delegate
				{
					//IL_000d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0013: Unknown result type (might be due to invalid IL or missing references)
					Plugin.localPlayer.DamagePlayer(1, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
				}, "scp1025", "appendicitis pain", num, (Func<StatusEffect, StatusEffect, ConflictResult>)null, (Action<StatusEffect>)null, true, true, true));
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new LerpValueEffect((Action<float>)delegate(float x)
				{
					Plugin.localPlayer.sprintMultiplier = Mathf.Clamp(Plugin.localPlayer.sprintMultiplier, 0f, x);
				}, 1f, 2.5f, num, "scp1025", "sprintMultiplier", (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action<StatusEffect>)null, true, true, true));
			},
			delegate
			{
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Expected O, but got Unknown
				//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d4: Expected O, but got Unknown
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new TickActionEffect((Action)delegate
				{
					float num = Mathf.Lerp(1f, 2.5f, Plugin.localPlayer.sprintMeter);
					Plugin.localPlayer.sprintMultiplier = Mathf.Clamp(Plugin.localPlayer.sprintMultiplier, 0f, num);
				}, "scp1025", "sprintMultiplier", 0f, (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft && incoming.source == existing.source) ? 1 : 2)), (Action<StatusEffect>)null, true, true, true));
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new ConditionalActionEffect((Func<bool>)(() => Plugin.localPlayer.sprintMeter < 0.5f), (Action)delegate
				{
					if (Random.Range(0, 2) != 0)
					{
						NetworkHandler.Instance.PlayPlayerSoundEffectRpc(Plugin.localPlayer.actualClientId, NetworkHandler.SoundEffect.Cough, 0, 0.5f, 1f, 10f, 1500f);
						VignetteOverlay.SetIntensity(0.05f, 0.01f);
					}
				}, false, "scp1025", 5f, 0, "asthmaCough", 0f, (Func<StatusEffect, StatusEffect, ConflictResult>)null, (Action<StatusEffect>)null, true, true, true));
			},
			delegate
			{
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Expected O, but got Unknown
				//IL_004d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Expected O, but got Unknown
				//IL_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_009e: Expected O, but got Unknown
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(10f, 20f), (Action)delegate
				{
					Utils.DisplayStatusEffect("WARNING: Heart rate unstable");
					VignetteOverlay.SetIntensity(0.4f, 0.01f);
					Utils.PlaySoundAtPosition(Plugin.localPlayer.bodyParts[0], NetworkHandler.Instance.heartbeatSlowSFX, 0.7f, true, true, 1f, 10f, 22000f, -1);
				}, "scp1025", "heartbeatSlow", 0f, (Func<StatusEffect, StatusEffect, ConflictResult>)null, (Action<StatusEffect>)null, true, true, true));
				PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action<StatusEffect>)delegate(StatusEffect effect)
				{
					//IL_005b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0065: Expected O, but got Unknown
					//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b7: Expected O, but got Unknown
					if (effect.timeExpired)
					{
						Utils.DisplayStatusEffect("WARNING: HEART RATE CRITICALLY UNSTABLE. CIRCULATORY FAILURE IMMINENT.");
						PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action<StatusEffect>)delegate(StatusEffect val)
						{
							//IL_0027: Unknown result type (might be due to invalid IL or missing references)
							//IL_0031: Unknown result type (might be due to invalid IL or missing references)
							//IL_0037: Unknown result type (might be due to invalid IL or missing references)
							if (val.timeExpired && !Plugin.localPlayer.isPlayerDead)
							{
								Plugin.localPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3), false);
							}
						}, "scp1025", "heart attack", 6f, (Func<StatusEffect, StatusEffect, ConflictResult>)null, true, true, true));
						PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new LerpValueEffect((Action<float>)delegate(float x)
						{
							VignetteOverlay.SetIntensity(x, 0.01f);
						}, 0.1f, 1f, 5f, "scp1025", "vignette", (Func<StatusEffect, StatusEffect, ConflictResult>)null, (Action<StatusEffect>)null, true, true, true));
						Utils.PlaySoundAtPosition(Plugin.localPlayer.bodyParts[0], NetworkHandler.Instance.heartbeatFastSFX, 1f, true, true, 1f, 10f, 22000f, -1);
						Plugin.localPlayer.MakeCriticallyInjured(true);
						Plugin.localPlayer.bleedingHeavily = false;
						Plugin.localPlayer.sprintMeter = 0f;
					}
				}, "scp1025", "incoming heart attack", 60f, (Func<StatusEffect, StatusEffect, ConflictResult>)null, true, true, true));
			}
		};

		public SCPInfo SCPInfo => info;

		public void Awake()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0.1f, 0.13f, -0.19f);
			((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(180f, 90f, 0f);
			((GrabbableObject)this).itemProperties.floorYOffset = 90;
			((GrabbableObject)this).itemProperties.canBeInspected = true;
			((GrabbableObject)this).itemProperties.canBeGrabbedBeforeGameStart = true;
			((GrabbableObject)this).itemProperties.toolTips = new string[1] { "Open Book [LMB]" };
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (buttonDown)
			{
				OpenBook();
			}
		}

		public override void DiscardItem()
		{
			((GrabbableObject)this).DiscardItem();
			CloseBookRpc();
		}

		public override void PocketItem()
		{
			((GrabbableObject)this).PocketItem();
			CloseBookRpc();
		}

		private void OpenBook()
		{
			int num = Random.Range(0, diseases.Length);
			OpenBookRpc(num);
			if (!TESTING.immunity && !SCP714Behavior.localPlayerAffected)
			{
				if (LethalDiseasesCompatibility.enabled)
				{
					LethalDiseasesCompatibility.InfectPlayer(Plugin.localPlayer);
				}
				else
				{
					diseases[num]();
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void CloseBookRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Invalid comparison between Unknown and I4
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
				{
					RpcAttributeParams val = new RpcAttributeParams
					{
						RequireOwnership = false
					};
					RpcParams val3 = default(RpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3622137458u, val3, val, (SendTo)6, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendRpc(ref val2, 3622137458u, val3, val, (SendTo)6, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					animator.SetBool("open", false);
				}
			}
		}

		[Rpc(/*Could not decode attribute arguments.*/)]
		public void OpenBookRpc(int pageIndex)
		{
			//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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: 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)
				{
					RpcAttributeParams val = new RpcAttributeParams
					{
						RequireOwnership = false
					};
					RpcParams val3 = default(RpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4082232844u, val3, val, (SendTo)6, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, pageIndex);
					((NetworkBehaviour)this).__endSendRpc(ref val2, 4082232844u, val3, val, (SendTo)6, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					Material[] materials = ((Renderer)renderer).materials;
					materials[2] = diseasePageMaterials[pageIndex];
					((Renderer)renderer).materials = materials;
					animator.SetBool("open", true);
				}
			}
		}

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

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(3622137458u, new RpcReceiveHandler(__rpc_handler_3622137458), "CloseBookRpc");
			((NetworkBehaviour)this).__registerRpc(4082232844u, new RpcReceiveHandler(__rpc_handler_4082232844), "OpenBookRpc");
			((PhysicsProp)this).__initializeRpcs();
		}

		private static void __rpc_handler_3622137458(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;
				((SCP1025Behavior)(object)target).CloseBookRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_4082232844(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 pageIndex = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref pageIndex);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SCP1025Behavior)(object)target).OpenBookRpc(pageIndex);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "SCP1025Behavior";
		}
	}
	internal class SCP1079Behavior : PhysicsProp, ISCP, ISingletonItem
	{
		[SerializeField]
		private SCPInfo info = null;

		public AudioClip[] chewingSounds = null;

		public GameObject pinkBloodSplatterProjectorPrefab = null;

		public AudioClip sizzleSFX = null;

		public static Dictionary<PlayerControllerB, List<GameObject>> PlayerPinkBodyBloodDecals = new Dictionary<PlayerControllerB, List<GameObject>>();

		private static int candiesEatenByLocalPlayer = 0;

		private float timeSinceCandyDecrement;

		public SCPInfo SCPInfo => info;

		public void Awake()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0.05f, 0.11f, -0.05f);
			((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(180f, 90f, -15f);
			((GrabbableObject)this).itemProperties.floorYOffset = 90;
			((GrabbableObject)this).itemProperties.canBeGrabbedBeforeGameStart = true;
			((GrabbableObject)this).itemProperties.canBeInspected = true;
			((GrabbableObject)this).itemProperties.toolTips = new string[1] { "Eat Candy [LMB]" };
		}

		public override void Update()
		{
			((GrabbableObject)this).Update();
			if (candiesEatenByLocalPlayer > 0)
			{
				timeSinceCandyDecrement += Time.deltaTime;
				if (timeSinceCandyDecrement > 60f)
				{
					timeSinceCandyDecrement = 0f;
					candiesEatenByLocalPlayer--;
				}
			}
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Expected O, but got Unknown
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (!buttonDown)
			{
				return;
			}
			RoundManager.PlayRandomClip(((GrabbableObject)this).playerHeldBy.itemAudio, chewingSounds, true, 1f, 0, 1000);
			candiesEatenByLocalPlayer++;
			if (TESTING.immunity)
			{
				return;
			}
			int bloodDropAmount = 2 * candiesEatenByLocalPlayer;
			AudioClip val = sizzleSFX;
			PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action<StatusEffect>)delegate(StatusEffect effect)
			{
				//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_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0076: Unknown result type (might be due to invalid IL or missing references)
				//IL_0087: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: Expected O, but got Unknown
				//IL_0151: Unknown result type (might be due to invalid IL or missing references)
				//IL_015b: Expected O, but got Unknown
				//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c7: Expected O, but got Unknown
				//IL_027d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0287: Expected O, but got Unknown
				if (effect.timeExpired)
				{
					float num = Mathf.Clamp01(0.5f + (float)candiesEatenByLocalPlayer * 0.15f);
					Plugin.logger.LogDebug((object)$"Peak sizzle: {num}");
					AnimationCurve val2 = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
					{
						new Keyframe(0f, 0f),
						new Keyframe(1f, num),
						new Keyframe(0f, 0f)
					});
					Plugin.localPlayer.itemAudio.clip = sizzleSFX;
					Plugin.localPlayer.itemAudio.volume = 0.5f;
					Plugin.localPlayer.itemAudio.Play();
					PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new CurveValueEffect((Action<float>)delegate(float value)
					{
						Plugin.localPlayer.itemAudio.volume = value;
					}, val2, 10f, "SCP-1079", "Blood Boiling", (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)1), (Action<StatusEffect>)delegate
					{
						Plugin.localPlayer.itemAudio.volume = 1f;
					}, true, true, true));
					PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new DistributedActionEffect((Action)delegate
					{
						//IL_0020: 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_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)
						Plugin.logger.LogDebug((object)"Dropping blood");
						Vector3 floorPosition = Vector3Extensions.GetFloorPosition(((Component)Plugin.localPlayer.gameplayCamera).transform.position, 0f);
						NetworkHandler.Instance.DropPinkBloodRpc(floorPosition);
					}, bloodDropAmount, "SCP-1079", "Dropping Pink Blood", 10f, (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)1), (Action<StatusEffect>)null, true, true, true));
					NetworkHandler.Instance.AddPinkBloodToBodyRpc(Plugin.localPlayer.actualClientId);
					int damagePerSecond = Mathf.RoundToInt(Mathf.Pow(2.5f, (float)candiesEatenByLocalPlayer) / 10f);
					if (damagePerSecond != 0)
					{
						Plugin.logger.LogDebug((object)$"Doing {damagePerSecond} damage per second");
						PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new IntervalActionEffect(1f, (Action)delegate
						{
							//IL_001e: Unknown result type (might be due to invalid IL or missing references)
							//IL_0024: Unknown result type (might be due to invalid IL or missing references)
							Plugin.localPlayer.inSpecialInteractAnimation = true;
							Plugin.localPlayer.DamagePlayer(damagePerSecond, false, true, (CauseOfDeath)0, 0, false, default(Vector3));
							Plugin.localPlayer.inSpecialInteractAnimation = false;
							Plugin.localPlayer.bleedingHeavily = false;
						}, "SCP-1079", "Blood Loss Damage", 10f, (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)1), (Action<StatusEffect>)null, true, true, true));
					}
				}
			}, "SCP-1079", "Pink Blood Secretion", Random.Range(10f, 15f), (Func<StatusEffect, StatusEffect, ConflictResult>)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)1), true, true, true));
		}

		public static void DropPinkBloodOnLocalClient(Vector3 pos)
		{
			//IL_0037: 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)
			GameObject val = ContentHandler<ItemSCPsContentHandler>.Instance.SCP1079?.PinkBloodDecalProjector;
			if ((Object)(object)val == (Object)null)
			{
				Plugin.logger.LogError((object)"PinkBloodSplatterProjector is null");
				return;
			}
			GameObject val2 = Object.Instantiate<GameObject>(val, pos, val.transform.rotation);
			DecalProjector component = val2.GetComponent<DecalProjector>();
			((Behaviour)component).enabled = true;
			Object.Destroy((Object)(object)val2, 300f);
		}

		public static void AddPinkBloodToBodyOnLocalClient(PlayerControllerB player)
		{
			Material val = ContentHandler<ItemSCPsContentHandler>.Instance.SCP1079?.PinkBloodDecal;
			if ((Object)(object)val == (Object)null)
			{
				Plugin.logger.LogError((object)"Couldnt get pinkBloodDecal in content container");
				return;
			}
			if (!PlayerPinkBodyBloodDecals.ContainsKey(player))
			{
				Plugin.logger.LogDebug((object)"No pink blood decals in dictionary, adding them");
				PlayerPinkBodyBloodDecals.Add(player, new List<GameObject>());
				GameObject[] bodyBloodDecals = player.bodyBloodDecals;
				foreach (GameObject val2 in bodyBloodDecals)
				{
					GameObject val3 = Object.Instantiate<GameObject>(val2, val2.transform.parent);
					((Object)val3).name = "Pink" + ((Object)val2).name;
					val3.GetComponent<DecalProjector>().material = val;
					PlayerPinkBodyBloodDecals[player].Add(val3);
				}
			}
			foreach (GameObject item in PlayerPinkBodyBloodDecals[player])
			{
				if (!item.activeSelf)
				{
					item.SetActive(true);
				}
			}
		}

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

		protected override void __initializeRpcs()
		{
			((PhysicsProp)this).__initializeRpcs();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "SCP1079Behavior";
		}
	}
	[HarmonyPatch]
	internal class SCP1079Patches
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlayerControllerB), "ResetPlayerBloodObjects")]
		private static void PlayerControllerB_ResetPlayerBloodObjects_Postfix(PlayerControllerB __instance, bool resetBodyBlood)
		{
			try
			{
				if (!resetBodyBlood || !SCP1079Behavior.PlayerPinkBodyBloodDecals.ContainsKey(__instance))
				{
					return;
				}
				foreach (GameObject item in SCP1079Behavior.PlayerPinkBodyBloodDecals[__instance])
				{
					item.SetActive(false);
				}
			}
			catch (Exception ex)
			{
				Plugin.logger.LogError((object)ex);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlayerControllerB), "RemoveBloodFromBody")]
		private static void PlayerControllerB_RemoveBloodFromBody_Postfix(PlayerControllerB __instance)
		{
			try
			{
				if (!SCP1079Behavior.PlayerPinkBodyBloodDecals.ContainsKey(__instance))
				{
					return;
				}
				foreach (GameObject item in SCP1079Behavior.PlayerPinkBodyBloodDecals[__instance])
				{
					item.SetActive(false);
				}
			}
			catch (Exception ex)
			{
				Plugin.logger.LogError((object)ex);
			}
		}
	}
	internal class SCP207Behavior : PhysicsProp, ISCP
	{
		[SerializeField]
		private SCPInfo info = null;

		public AudioSource audioSource = null;

		public GameObject capObject = null;

		public AnimationCurve intensityOverTime = null;

		public MeshRenderer liquidRenderer = null;

		public static Dictionary<int, float> contributions = new Dictionary<int, float>();

		public static int previousContributionsID = 0;

		public static bool heartAttackLocalPlayer = false;

		private PlayerControllerB previousPlayerHeldBy = null;

		private bool drinking;

		private float drinkAmountLeft;

		private float drinkingTime;

		private Coroutine? drinkingRoutine;

		private static float totalContributions;

		private Vector3 drinkingPositionOffset = new Vector3(0f, 0.1f, 0.1f);

		private Vector3 drinkingRotationOffset = new Vector3(50f, 170f, 0f);

		private Vector3 currentPositionOffset;

		private Vector3 currentRotationOffset;

		private const float effectDuration = 1200f;

		private const float drinkTimePerBottle = 10f;

		private const float maxSprintIncreaseBeforeHeartAttack = 9f;

		public SCPInfo SCPInfo => info;

		public void Awake()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			((GrabbableObject)this).itemProperties.positionOffset = new Vector3(-0.07f, 0.1f, -0.01f);
			((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(80f, 90f, 0f);
			((GrabbableObject)this).itemProperties.floorYOffset = 90;
			currentPositionOffset = ((GrabbableObject)this).itemProperties.positionOffset;
			currentRotationOffset = ((GrabbableObject)this).itemProperties.rotationOffset;
			((GrabbableObject)this).itemProperties.grabAnim = "HoldPatcherTool";
			((GrabbableObject)this).itemProperties.syncUseFunction = true;
			((GrabbableObject)this).itemProperties.toolTips = new string[1] { "Drink [Hold LMB]" };
		}

		public override void Start()
		{
			((GrabbableObject)this).Start();
			drinkAmountLeft = 10f;
		}

		public static void StaticUpdate()
		{
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Expected O, but got Unknown
			totalContributions = GetTotalContributions();
			if (totalContributions <= 0f)
			{
				return;
			}
			float num = Mathf.Clamp01(totalContributions / 9f);
			Plugin.localPlayer.sprintTime = Mathf.Max(11f + totalContributions, Plugin.localPlayer.sprintTime);
			Plugin.localPlayer.sprintMeter = Mathf.Clamp01(Plugin.localPlayer.sprintMeter + Time.deltaTime / (Plugin.localPlayer.sprintTime + Mathf.Lerp(15f, 5f, num)));
			Plugin.localPlayer.sprintMultiplier = Mathf.Max(Plugin.localPlayer.sprintMultiplier, Mathf.Lerp(1f, 3f, num));
			if (!(totalContributions > 9f) || heartAttackLocalPlayer)
			{
				return;
			}
			Plugin.logger.LogDebug((object)$"Total contributions {totalContributions} > {9f}, heart attack time");
			heartAttackLocalPlayer = true;
			Utils.PlaySoundAtPosition(Plugin.localPlayer.bodyParts[0], NetworkHandler.Instance.heartbeatFastSFX, 1f, true, true, 1f, 10f, 22000f, -1);
			PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action<StatusEffect>)delegate(StatusEffect effect)
			{
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				heartAttackLocalPlayer = false;
				if (effect.timeExpired && !Plugin.localPlayer.isPlayerDead && Plugin.localPlayer.isPlayerControlled)
				{
					Plugin.localPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3), false);
				}
			}, "scp207", "heart attack", 6f, (Func<StatusEffect, StatusEffect, ConflictResult>)null, true, true, true));
		}

		public override void Update()
		{
			((GrabbableObject)this).Update();
			if (!drinking)
			{
				return;
			}
			drinkAmountLeft -= Time.deltaTime;
			drinkingTime += Time.deltaTime;
			if (!(drinkAmountLeft <= 0f))
			{
				return;
			}
			StopDrinkRoutine();
			if (((NetworkBehaviour)this).IsOwner)
			{
				if (drinkingTime > 0f && !TESTING.immunity)
				{
					ApplyEffect(drinkingTime);
				}
				previousPlayerHeldBy.activatingItem = false;
				previousPlayerHeldBy.playerBodyAnimator.SetBool("useTZPItem", false);
			}
		}

		public override void LateUpdate()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((GrabbableObject)this).parentObject != (Object)null)
			{
				((Component)this).transform.rotation = ((GrabbableObject)this).parentObject.rotation;
				((Component)this).transform.Rotate(currentRotationOffset);
				((Component)this).transform.position = ((GrabbableObject)this).parentObject.position;
				Vector3 val = currentPositionOffset;
				val = ((GrabbableObject)this).parentObject.rotation * val;
				Transform transform = ((Component)this).transform;
				transform.position += val;
			}
			if (((GrabbableObject)this).rotateObject)
			{
				((Component)this).transform.Rotate(new Vector3(0f, Time.deltaTime * 60f, 0f), (Space)0);
			}
			if ((Object)(object)((GrabbableObject)this).radarIcon != (Object)null)
			{
				((GrabbableObject)this).radarIcon.position = ((Component)this).transform.position;
			}
		}

		public override void DiscardItem()
		{
			((GrabbableObject)this).DiscardItem();
			previousPlayerHeldBy.activatingItem = false;
			previousPlayerHeldBy.playerBodyAnimator.SetBool("useTZPItem", false);
			StopDrinkRoutine();
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			capObject.SetActive(false);
			if (buttonDown)
			{
				previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy;
				drinkingTime = 0f;
				if (drinkAmountLeft <= 0f)
				{
					if (((NetworkBehaviour)this).IsOwner)
					{
						previousPlayerHeldBy.playerBodyAnimator.SetTrigger("shakeItem");
					}
					return;
				}
				StopDrinkRoutine();
				drinkingRoutine = ((MonoBehaviour)this).StartCoroutine(DrinkRoutine());
			}
			else
			{
				StopDrinkRoutine();
				if (((NetworkBehaviour)this).IsOwner && drinkingTime > 0f && !TESTING.immunity)
				{
					ApplyEffect(drinkingTime);
				}
			}
			if (((NetworkBehaviour)this).IsOwner)
			{
				previousPlayerHeldBy.activatingItem = buttonDown;
				previousPlayerHeldBy.playerBodyAnimator.SetBool("useTZPItem", buttonDown);
			}
		}

		private void StopDrinkRoutine()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			if (drinkingRoutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(drinkingRoutine);
				drinkingRoutine = null;
			}
			currentRotationOffset = ((GrabbableObject)this).itemProperties.rotationOffset;
			currentPositionOffset = ((GrabbableObject)this).itemProperties.positionOffset;
			drinking = false;
			audioSource.Stop();
			((Renderer)liquidRenderer).enabled = drinkAmountLeft > 0f;
		}

		private IEnumerator DrinkRoutine()
		{
			float elapsedTime = 0f;
			while (elapsedTime < 1f)
			{
				elapsedTime += Time.deltaTime;
				float t = Mathf.Clamp01(elapsedTime / 0.5f);
				currentPositionOffset = Vector3.Lerp(((GrabbableObject)this).itemProperties.positionOffset, drinkingPositionOffset, t);
				currentRotationOffset = Vector3.Lerp(((GrabbableObject)this).itemProperties.rotationOffset, drinkingRotationOffset, t);
				yield return null;
			}
			drinking = true;
			if (((NetworkBehaviour)this).IsOwner)
			{
				audioSource.Play();
			}
			drinkingRoutine = null;
		}

		private void ApplyEffect(float amount)
		{
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Expected O, but got Unknown
			int id = previousContributionsID;
			previousContributionsID++;
			contributions[id] = 0f;
			PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new CurveValueEffect((Action<float>)delegate(float value)
			{
				contributions[id] = Mathf.Lerp(0f, amount, value);
			}, intensityOverTime, 1200f, "scp207", $"scp207_{id}", (Func<StatusEffect, StatusEffect, ConflictResult>)null, (Action<StatusEffect>)delegate
			{
				contributions.Remove(id);
			}, true, true, true));
			PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new ConditionalActionEffect((Func<bool>)(() => GetTotalContributions() > 4.5f), (Action)delegate
			{
				Utils.PlaySoundAtPosition(Plugin.localPlayer.bodyParts[0], NetworkHandler.Instance.heartbeatSlowSFX, 1f, true, true, 1f, 10f, 22000f, -1);
			}, false, "scp207", 30f, 0, "scp207_heartbeatSlow", 1200f, (Func<StatusEffect, StatusEffect, ConflictResult>)null, (Action<StatusEffect>)null, true, true, true));
		}

		private static float GetTotalContributions()
		{
			float num = 0f;
			foreach (float value in contributions.Values)
			{
				num += value;
			}
			return num;
		}

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

		protected override void __initializeRpcs()
		{
			((PhysicsProp)this).__initializeRpcs();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "SCP207Behavior";
		}
	}
	public class SCP268Behavior : WearableObject, ISCP, ISingletonItem
	{
		[SerializeField]
		private SCPInfo info = null;

		public AudioSource audioSource = null;

		public AudioClip activateSFX = null;

		public AudioClip deactivateSFX = null;

		public GameObject mesh = null;

		private bool playerWearingInvisible;

		public SCPInfo SCPInfo => info;

		public static SCP268Behavior? Instance { get; private set; }

		public void Awake()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due