Decompiled source of CoolPeopleMod v1.1.5

CoolPeopleMod/Snowlance.CoolPeopleMod.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CoolPeopleMod.Items.PinataPlush;
using CoolPeopleMod.Items.RatPlush;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Snowlance.CoolPeopleMod.NetcodePatcher;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;

[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("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.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("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: AssemblyCompany("Snowlance.CoolPeopleMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.1.5.0")]
[assembly: AssemblyInformationalVersion("1.1.5+4a8cb8236172485e0020306156e87552954980b3")]
[assembly: AssemblyProduct("CoolPeopleMod")]
[assembly: AssemblyTitle("Snowlance.CoolPeopleMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.5.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class Spinner : MonoBehaviour
{
	public bool IsBeingUsed = false;

	private float SpinVelocity = 0f;

	private float SpinAcceleration = 100f;

	private float NormalSpinVelocity = 90f;

	private float CurrentTimer = 0f;

	private float SpinningTime = 3f;

	private Quaternion InitialRotation;

	private Quaternion FromRotation;

	private void Start()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		InitialRotation = ((Component)this).transform.rotation;
	}

	public void StartHyperSpinning(float spinTime)
	{
		IsBeingUsed = true;
		SpinVelocity = NormalSpinVelocity;
		SpinAcceleration = 1000f;
		SpinningTime = spinTime;
	}

	public void StopHyperSpinning()
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		IsBeingUsed = false;
		SpinVelocity = 0f;
		SpinAcceleration = 0f;
		FromRotation = ((Component)this).transform.rotation;
	}

	private void Update()
	{
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		if (IsBeingUsed)
		{
			CurrentTimer += Time.deltaTime;
			if (CurrentTimer >= SpinningTime)
			{
				StopHyperSpinning();
				CurrentTimer = 0f;
			}
		}
		if (!IsBeingUsed)
		{
			((Component)this).transform.Rotate(Vector3.forward, NormalSpinVelocity * Time.deltaTime);
			return;
		}
		SpinVelocity += SpinAcceleration * Time.deltaTime;
		((Component)this).transform.Rotate(Vector3.up, SpinVelocity * Time.deltaTime);
		((Component)this).transform.Rotate(Vector3.forward, SpinVelocity * Time.deltaTime);
		((Component)this).transform.Rotate(Vector3.right, SpinVelocity * Time.deltaTime);
	}
}
namespace CoolPeopleMod
{
	internal class GlitchPlushBehavior : PhysicsProp
	{
		private static ManualLogSource logger = Plugin.LoggerInstance;

		public AnimationCurve grenadeFallCurve;

		public AnimationCurve grenadeVerticalFallCurve;

		public AnimationCurve grenadeVerticalFallCurveNoBounce;

		public AudioSource ItemAudio;

		public AudioClip BaldSFX;

		public AudioClip DefaultSFX;

		public AudioClip RodrigoSFX;

		public Animator ItemAnimator;

		public Material HairMat;

		public SkinnedMeshRenderer HairRenderer;

		private Random? random;

		private bool initializedRandomSeed;

		private Ray grenadeThrowRay;

		private RaycastHit grenadeHit;

		private int stunGrenadeMask = 268437761;

		private int explodeGlitchChance = 500;

		private bool isThrown;

		public override void Start()
		{
			((GrabbableObject)this).Start();
			if (!RoundManager.Instance.hasInitializedLevelRandomSeed)
			{
				RoundManager.Instance.InitializeRandomNumberGenerators();
			}
			logger.LogDebug((object)"initialized random number generators");
			if (Plugin.localPlayer.playerSteamId == 76561198984467725L || TESTING.testing)
			{
				((Renderer)HairRenderer).material = HairMat;
			}
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_00fb: 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)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || ((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198984467725L || TESTING.testing)
			{
				if (!initializedRandomSeed)
				{
					int seed = StartOfRound.Instance.randomMapSeed + 158;
					logger.LogDebug((object)("Assigning new random with seed: " + seed));
					random = new Random(seed);
					initializedRandomSeed = true;
				}
				if (random.Next(1, explodeGlitchChance + 1) == 1)
				{
					Landmine.SpawnExplosion(((Component)this).transform.position, true, 10f, 6f, 50, 0f, (GameObject)null, false);
					return;
				}
				isThrown = true;
				((GrabbableObject)this).playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetGrenadeThrowDestination(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform), true);
				ItemAudio.PlayOneShot(BaldSFX);
			}
			else if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198164429786L)
			{
				ItemAnimator.SetTrigger("squeeze");
				ItemAudio.PlayOneShot(RodrigoSFX);
			}
			else
			{
				ItemAnimator.SetTrigger("squeeze");
				ItemAudio.PlayOneShot(DefaultSFX);
			}
		}

		public Vector3 GetGrenadeThrowDestination(Transform ejectPoint)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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_0088: 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_008d: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: 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)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = ((Component)this).transform.position;
			Debug.DrawRay(ejectPoint.position, ejectPoint.forward, Color.yellow, 15f);
			grenadeThrowRay = new Ray(ejectPoint.position, ejectPoint.forward);
			position = ((!Physics.Raycast(grenadeThrowRay, ref grenadeHit, 12f, stunGrenadeMask, (QueryTriggerInteraction)1)) ? ((Ray)(ref grenadeThrowRay)).GetPoint(10f) : ((Ray)(ref grenadeThrowRay)).GetPoint(((RaycastHit)(ref grenadeHit)).distance - 0.05f));
			Debug.DrawRay(position, Vector3.down, Color.blue, 15f);
			grenadeThrowRay = new Ray(position, Vector3.down);
			position = ((!Physics.Raycast(grenadeThrowRay, ref grenadeHit, 30f, stunGrenadeMask, (QueryTriggerInteraction)1)) ? ((Ray)(ref grenadeThrowRay)).GetPoint(30f) : (((RaycastHit)(ref grenadeHit)).point + Vector3.up * 0.05f));
			return position + new Vector3(Random.Range(-1f, 1f), 0f, Random.Range(-1f, 1f));
		}

		public override void FallWithCurve()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: 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_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: 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_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: 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)
			Vector3 val = ((GrabbableObject)this).startFallingPosition - ((GrabbableObject)this).targetFloorPosition;
			float magnitude = ((Vector3)(ref val)).magnitude;
			Quaternion val2 = Quaternion.Euler(((GrabbableObject)this).itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, ((GrabbableObject)this).itemProperties.restingRotation.z);
			((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, val2, 14f * Time.deltaTime / magnitude);
			((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, grenadeFallCurve.Evaluate(((GrabbableObject)this).fallTime));
			if (magnitude > 5f)
			{
				((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), grenadeVerticalFallCurveNoBounce.Evaluate(((GrabbableObject)this).fallTime));
			}
			else
			{
				((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), grenadeVerticalFallCurve.Evaluate(((GrabbableObject)this).fallTime));
			}
			((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 12f / magnitude);
		}

		public override void OnHitGround()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).OnHitGround();
			if (isThrown)
			{
				Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up, true, 1.5f, 5.7f, 50, 0f, (GameObject)null, false);
				isThrown = false;
			}
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "GlitchPlushBehavior";
		}
	}
	public class StatusEffectController : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <DamagePlayerOverTimeCoroutine>d__35 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public int damage;

			public int perSeconds;

			public bool untilDead;

			public int totalSeconds;

			public StatusEffectController <>4__this;

			private int <seconds>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DamagePlayerOverTimeCoroutine>d__35(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_005f: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ab: Expected O, but got Unknown
				//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0116: Unknown result type (might be due to invalid IL or missing references)
				//IL_0120: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (untilDead)
					{
						goto IL_00bc;
					}
					<seconds>5__1 = 0;
					break;
				case 1:
					<>1__state = -1;
					goto IL_00bc;
				case 2:
					{
						<>1__state = -1;
						break;
					}
					IL_00bc:
					if (!Plugin.localPlayer.isPlayerDead)
					{
						Plugin.localPlayer.inSpecialInteractAnimation = true;
						Plugin.localPlayer.DamagePlayer(damage, false, true, (CauseOfDeath)0, 0, false, default(Vector3));
						HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
						Plugin.localPlayer.inSpecialInteractAnimation = false;
						HUDManager.Instance.UpdateHealthUI(Plugin.localPlayer.health, false);
						<>2__current = (object)new WaitForSecondsRealtime((float)perSeconds);
						<>1__state = 1;
						return true;
					}
					return false;
				}
				if (<seconds>5__1 < totalSeconds)
				{
					Plugin.localPlayer.DamagePlayer(damage, false, true, (CauseOfDeath)0, 0, false, default(Vector3));
					<seconds>5__1 += perSeconds;
					<>2__current = (object)new WaitForSecondsRealtime((float)perSeconds);
					<>1__state = 2;
					return true;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <DamageReductionCoroutine>d__32 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public int seconds;

			public int percent;

			public StatusEffectController <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DamageReductionCoroutine>d__32(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.damageReductionSeconds = seconds;
					<>4__this.damageReductionPercent = percent;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<>4__this.damageReductionSeconds > 0)
				{
					logger.LogDebug((object)("Damage Reduction: " + <>4__this.damageReductionPercent + " " + <>4__this.damageReductionSeconds));
					<>4__this.damageReductionSeconds--;
					<>2__current = (object)new WaitForSecondsRealtime(1f);
					<>1__state = 1;
					return true;
				}
				<>4__this.damageReductionPercent = 0;
				<>4__this.damageReductionSeconds = 0;
				<>4__this.damageReductionCoroutine = null;
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <HealthRegenCoroutine>d__30 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public int hpPerSecond;

			public int seconds;

			public StatusEffectController <>4__this;

			private int <i>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <HealthRegenCoroutine>d__30(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_004d: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<i>5__1 = 0;
					break;
				case 1:
					<>1__state = -1;
					<i>5__1++;
					break;
				}
				if (<i>5__1 < seconds)
				{
					<>4__this.HealPlayer(hpPerSecond);
					<>2__current = (object)new WaitForSecondsRealtime(1f);
					<>1__state = 1;
					return true;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <IncreasedMovementSpeedCoroutine>d__34 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public int seconds;

			public int percent;

			public StatusEffectController <>4__this;

			private float <movementSpeedMultiplier>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <IncreasedMovementSpeedCoroutine>d__34(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fc: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.baseMovementSpeed = Plugin.localPlayer.movementSpeed;
					<>4__this.increasedMovementSpeedSeconds = seconds;
					<>4__this.increasedMovementSpeedPercent = percent;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<>4__this.increasedMovementSpeedSeconds > 0)
				{
					<movementSpeedMultiplier>5__1 = 1f + (float)<>4__this.increasedMovementSpeedPercent / 100f;
					Plugin.localPlayer.movementSpeed = <>4__this.baseMovementSpeed * <movementSpeedMultiplier>5__1;
					<>4__this.increasedMovementSpeedSeconds--;
					logger.LogDebug((object)("Increased movement speed: " + <>4__this.increasedMovementSpeedPercent + "% " + <>4__this.increasedMovementSpeedSeconds));
					<>2__current = (object)new WaitForSecondsRealtime(1f);
					<>1__state = 1;
					return true;
				}
				<>4__this.increasedMovementSpeedPercent = 0;
				Plugin.localPlayer.movementSpeed = <>4__this.baseMovementSpeed;
				<>4__this.increasedMovementSpeedSeconds = 0;
				<>4__this.increasedMovementSpeedCoroutine = null;
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <InfiniteSprintCoroutine>d__33 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public int seconds;

			public StatusEffectController <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <InfiniteSprintCoroutine>d__33(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.freezeSprintMeter = Plugin.localPlayer.sprintMeter;
					<>4__this.infiniteSprintSeconds = seconds;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<>4__this.infiniteSprintSeconds > 0)
				{
					<>4__this.infiniteSprintSeconds--;
					logger.LogDebug((object)("Infinite sprint: " + <>4__this.infiniteSprintSeconds));
					<>2__current = (object)new WaitForSecondsRealtime(1f);
					<>1__state = 1;
					return true;
				}
				<>4__this.infiniteSprintSeconds = 0;
				<>4__this.infiniteSprintCoroutine = null;
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <StatusNegationCoroutine>d__31 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public int seconds;

			public StatusEffectController <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <StatusNegationCoroutine>d__31(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.statusNegationSeconds = seconds;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<>4__this.statusNegationSeconds > 0)
				{
					logger.LogDebug((object)("Status Negation: " + <>4__this.statusNegationSeconds));
					<>4__this.statusNegationSeconds--;
					<>2__current = (object)new WaitForSecondsRealtime(1f);
					<>1__state = 1;
					return true;
				}
				<>4__this.statusNegationSeconds = 0;
				<>4__this.statusNegationCoroutine = null;
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static StatusEffectController _instance;

		private static ManualLogSource logger = Plugin.LoggerInstance;

		private Coroutine statusNegationCoroutine;

		private Coroutine damageReductionCoroutine;

		private Coroutine infiniteSprintCoroutine;

		private Coroutine increasedMovementSpeedCoroutine;

		public int statusNegationSeconds = 0;

		public int damageReductionSeconds = 0;

		public int infiniteSprintSeconds = 0;

		public int increasedMovementSpeedSeconds = 0;

		public int damageReductionPercent = 0;

		public int increasedMovementSpeedPercent = 0;

		public float freezeSprintMeter;

		public float baseMovementSpeed = 4.6f;

		public int bulletProofMultiplier = 0;

		private readonly string[] effectNames = new string[7] { "HealPlayer", "RestoreStamina", "HealthRegen", "StatusNegation", "DamageReduction", "InfiniteSprint", "IncreasedMovementSpeed" };

		private Dictionary<string, MethodInfo> effectMethods = null;

		public float pitchAdjust;

		public static StatusEffectController Instance
		{
			get
			{
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_0036: Expected O, but got Unknown
				if ((Object)(object)_instance == (Object)null)
				{
					_instance = Object.FindObjectOfType<StatusEffectController>();
					if ((Object)(object)_instance == (Object)null)
					{
						GameObject val = new GameObject("SCP-956 StatusEffectController");
						_instance = val.AddComponent<StatusEffectController>();
					}
				}
				return _instance;
			}
		}

		private void Awake()
		{
			if ((Object)(object)_instance == (Object)null)
			{
				_instance = this;
				Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			}
			else if ((Object)(object)this != (Object)(object)_instance)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			effectMethods = new Dictionary<string, MethodInfo>();
			MethodInfo[] methods = typeof(StatusEffectController).GetMethods(BindingFlags.Instance | BindingFlags.Public);
			foreach (MethodInfo methodInfo in methods)
			{
				if (effectNames.Contains(methodInfo.Name))
				{
					effectMethods[methodInfo.Name] = methodInfo;
				}
			}
			logger.LogDebug((object)("Effect methods: " + string.Join(", ", effectMethods.Keys)));
		}

		public void ApplyCandyEffects(string config)
		{
			string[] array = config.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries);
			string[] array2 = array;
			foreach (string text in array2)
			{
				string[] array3 = text.Split(new char[1] { ':' }, 2);
				if (array3.Length != 2)
				{
					continue;
				}
				string text2 = array3[0].Trim();
				string[] array4 = array3[1].Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries);
				if (!effectMethods.TryGetValue(text2, out MethodInfo value))
				{
					continue;
				}
				try
				{
					ParameterInfo[] parameters = value.GetParameters();
					object[] array5 = new object[parameters.Length];
					for (int j = 0; j < parameters.Length; j++)
					{
						if (j < array4.Length)
						{
							array5[j] = Convert.ChangeType(array4[j], parameters[j].ParameterType);
							continue;
						}
						if (parameters[j].IsOptional)
						{
							array5[j] = parameters[j].DefaultValue;
							continue;
						}
						throw new ArgumentException("Not enough parameters provided for non-optional parameters.");
					}
					value.Invoke(Instance, array5);
				}
				catch (Exception ex)
				{
					logger.LogError((object)("Failed to apply effect " + text2 + ": " + ex.Message));
				}
			}
		}

		public void HealPlayer(int amount, bool overHeal = false)
		{
			logger.LogDebug((object)("Healing: " + amount));
			PlayerControllerB localPlayer = Plugin.localPlayer;
			localPlayer.MakeCriticallyInjured(false);
			int num = localPlayer.health + amount;
			if (num > 100 && !overHeal)
			{
				num = 100;
			}
			localPlayer.health = num;
			HUDManager.Instance.UpdateHealthUI(num, false);
		}

		public void RestoreStamina(int percent)
		{
			float num = (float)percent / 100f;
			float sprintMeter = Plugin.localPlayer.sprintMeter + 1f * num;
			Plugin.localPlayer.sprintMeter = sprintMeter;
		}

		public void HealthRegen(int hpPerSecond, int seconds)
		{
			((MonoBehaviour)this).StartCoroutine(HealthRegenCoroutine(hpPerSecond, seconds));
		}

		public void StatusNegation(int seconds, bool timeStackable = false)
		{
			if (statusNegationCoroutine != null)
			{
				if (timeStackable)
				{
					statusNegationSeconds += seconds;
					return;
				}
				((MonoBehaviour)this).StopCoroutine(statusNegationCoroutine);
			}
			statusNegationCoroutine = ((MonoBehaviour)this).StartCoroutine(StatusNegationCoroutine(seconds));
		}

		public void DamageReduction(int seconds, int percent, bool timeStackable = false, bool stackable = false)
		{
			if (damageReductionCoroutine != null)
			{
				if (timeStackable)
				{
					damageReductionSeconds += seconds;
				}
				if (stackable)
				{
					damageReductionPercent += percent;
				}
				if (timeStackable || stackable)
				{
					return;
				}
				((MonoBehaviour)this).StopCoroutine(damageReductionCoroutine);
			}
			damageReductionCoroutine = ((MonoBehaviour)this).StartCoroutine(DamageReductionCoroutine(seconds, percent));
		}

		public void InfiniteSprint(int seconds, bool timeStackable = false)
		{
			if (infiniteSprintCoroutine != null)
			{
				if (timeStackable)
				{
					infiniteSprintSeconds += seconds;
					return;
				}
				((MonoBehaviour)this).StopCoroutine(infiniteSprintCoroutine);
			}
			infiniteSprintCoroutine = ((MonoBehaviour)this).StartCoroutine(InfiniteSprintCoroutine(seconds));
		}

		public void IncreasedMovementSpeed(int seconds, int percent, bool timeStackable = false, bool stackable = false)
		{
			if (increasedMovementSpeedCoroutine != null)
			{
				if (timeStackable)
				{
					increasedMovementSpeedSeconds += seconds;
				}
				if (stackable)
				{
					increasedMovementSpeedPercent += percent;
				}
				if (timeStackable || stackable)
				{
					return;
				}
				((MonoBehaviour)this).StopCoroutine(increasedMovementSpeedCoroutine);
				if (baseMovementSpeed != 0f)
				{
					Plugin.localPlayer.movementSpeed = baseMovementSpeed;
				}
			}
			increasedMovementSpeedCoroutine = ((MonoBehaviour)this).StartCoroutine(IncreasedMovementSpeedCoroutine(seconds, percent));
		}

		public void DamagePlayerOverTime(int damage, int perSeconds, bool untilDead = false, int totalSeconds = 10)
		{
			((MonoBehaviour)this).StartCoroutine(DamagePlayerOverTimeCoroutine(damage, perSeconds, untilDead, totalSeconds));
		}

		[IteratorStateMachine(typeof(<HealthRegenCoroutine>d__30))]
		private IEnumerator HealthRegenCoroutine(int hpPerSecond, int seconds)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <HealthRegenCoroutine>d__30(0)
			{
				<>4__this = this,
				hpPerSecond = hpPerSecond,
				seconds = seconds
			};
		}

		[IteratorStateMachine(typeof(<StatusNegationCoroutine>d__31))]
		private IEnumerator StatusNegationCoroutine(int seconds)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <StatusNegationCoroutine>d__31(0)
			{
				<>4__this = this,
				seconds = seconds
			};
		}

		[IteratorStateMachine(typeof(<DamageReductionCoroutine>d__32))]
		private IEnumerator DamageReductionCoroutine(int seconds, int percent)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DamageReductionCoroutine>d__32(0)
			{
				<>4__this = this,
				seconds = seconds,
				percent = percent
			};
		}

		[IteratorStateMachine(typeof(<InfiniteSprintCoroutine>d__33))]
		private IEnumerator InfiniteSprintCoroutine(int seconds)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <InfiniteSprintCoroutine>d__33(0)
			{
				<>4__this = this,
				seconds = seconds
			};
		}

		[IteratorStateMachine(typeof(<IncreasedMovementSpeedCoroutine>d__34))]
		private IEnumerator IncreasedMovementSpeedCoroutine(int seconds, int percent)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <IncreasedMovementSpeedCoroutine>d__34(0)
			{
				<>4__this = this,
				seconds = seconds,
				percent = percent
			};
		}

		[IteratorStateMachine(typeof(<DamagePlayerOverTimeCoroutine>d__35))]
		private IEnumerator DamagePlayerOverTimeCoroutine(int damage, int perSeconds, bool untilDead, int totalSeconds)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DamagePlayerOverTimeCoroutine>d__35(0)
			{
				<>4__this = this,
				damage = damage,
				perSeconds = perSeconds,
				untilDead = untilDead,
				totalSeconds = totalSeconds
			};
		}
	}
	internal class TESTING : MonoBehaviour
	{
		public static bool testing;

		private static ManualLogSource logger = Plugin.LoggerInstance;

		public static bool mimic = true;

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

		[HarmonyPrefix]
		[HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")]
		public static void SubmitChat_performedPrefix(HUDManager __instance)
		{
			try
			{
				string text = __instance.chatTextField.text;
				string[] array = text.Split(" ");
				switch (array[0])
				{
				case "/mimic":
					mimic = !mimic;
					HUDManager.Instance.DisplayTip("Mimic Spawning", testing.ToString(), false, false, "LC_Tip1");
					break;
				case "/testing":
					testing = !testing;
					HUDManager.Instance.DisplayTip("Testing", testing.ToString(), false, false, "LC_Tip1");
					break;
				case "/crash":
					Application.Quit();
					break;
				case "/refresh":
					RoundManager.Instance.RefreshEnemiesList();
					HoarderBugAI.RefreshGrabbableObjectsInMapList();
					break;
				case "/levels":
				{
					SelectableLevel[] levels = StartOfRound.Instance.levels;
					foreach (SelectableLevel val2 in levels)
					{
						logger.LogDebug((object)((Object)val2).name);
					}
					break;
				}
				case "/dungeon":
					logger.LogDebug((object)((Object)RoundManager.Instance.dungeonGenerator.Generator.DungeonFlow).name);
					break;
				case "/dungeons":
				{
					IndoorMapType[] dungeonFlowTypes = RoundManager.Instance.dungeonFlowTypes;
					foreach (IndoorMapType val in dungeonFlowTypes)
					{
						logger.LogDebug((object)((Object)val.dungeonFlow).name);
					}
					break;
				}
				}
			}
			catch
			{
				logger.LogError((object)"Invalid chat command");
			}
		}
	}
	[BepInPlugin("Snowlance.CoolPeopleMod", "CoolPeopleMod", "1.1.5")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public static Plugin PluginInstance;

		public static ManualLogSource LoggerInstance;

		private readonly Harmony harmony = new Harmony("Snowlance.CoolPeopleMod");

		public static AssetBundle? ModAssets;

		public const ulong RodrigoSteamID = 76561198164429786uL;

		public const ulong LizzieSteamID = 76561199094139351uL;

		public const ulong GlitchSteamID = 76561198984467725uL;

		public const ulong RatSteamID = 76561199182474292uL;

		public const ulong XuSteamID = 76561198399127090uL;

		public const ulong SlayerSteamID = 76561198077184650uL;

		public const ulong SnowySteamID = 76561198253760639uL;

		public const ulong FunoSteamID = 76561198993437314uL;

		public static ConfigEntry<bool> configGlitchPlushEnable;

		public static ConfigEntry<string> configGlitchPlushLevelRarities;

		public static ConfigEntry<string> configGlitchPlushCustomLevelRarities;

		public static ConfigEntry<int> configGlitchPlushMinValue;

		public static ConfigEntry<int> configGlitchPlushMaxValue;

		public static ConfigEntry<bool> configPinataPlushEnable;

		public static ConfigEntry<string> configPinataPlushLevelRarities;

		public static ConfigEntry<string> configPinataPlushCustomLevelRarities;

		public static ConfigEntry<int> configPinataPlushMinValue;

		public static ConfigEntry<int> configPinataPlushMaxValue;

		public static ConfigEntry<bool> configSCP999PlushEnable;

		public static ConfigEntry<string> configSCP999PlushLevelRarities;

		public static ConfigEntry<string> configSCP999PlushCustomLevelRarities;

		public static ConfigEntry<int> configSCP999PlushMinValue;

		public static ConfigEntry<int> configSCP999PlushMaxValue;

		public static ConfigEntry<bool> configDiceMimicPlushEnable;

		public static ConfigEntry<string> configDiceMimicPlushLevelRarities;

		public static ConfigEntry<string> configDiceMimicPlushCustomLevelRarities;

		public static ConfigEntry<int> configDiceMimicPlushMinValue;

		public static ConfigEntry<int> configDiceMimicPlushMaxValue;

		public static ConfigEntry<bool> configRatPlushEnable;

		public static ConfigEntry<string> configRatPlushLevelRarities;

		public static ConfigEntry<string> configRatPlushCustomLevelRarities;

		public static ConfigEntry<int> configRatPlushMinValue;

		public static ConfigEntry<int> configRatPlushMaxValue;

		public static ConfigEntry<bool> configFunoPlushEnable;

		public static ConfigEntry<string> configFunoPlushLevelRarities;

		public static ConfigEntry<string> configFunoPlushCustomLevelRarities;

		public static ConfigEntry<int> configFunoPlushMinValue;

		public static ConfigEntry<int> configFunoPlushMaxValue;

		public static PlayerControllerB localPlayer => GameNetworkManager.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).First();
		}

		private void Awake()
		{
			if ((Object)(object)PluginInstance == (Object)null)
			{
				PluginInstance = this;
			}
			LoggerInstance = ((BaseUnityPlugin)PluginInstance).Logger;
			harmony.PatchAll();
			InitializeNetworkBehaviours();
			configGlitchPlushEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("GlitchPlush", "Enable", true, "Set to false to prevent loading assets");
			configGlitchPlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("GlitchPlush", "Level Rarities", "All: 10", "Rarities for each level. See default for formatting.");
			configGlitchPlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("GlitchPlush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities.");
			configGlitchPlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("GlitchPlush", "Min Value", 150, "Minimum scrap value.");
			configGlitchPlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("GlitchPlush", "Max Value", 200, "Maximum scrap value.");
			configPinataPlushEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("PinataPlush", "Enable", true, "Set to false to prevent loading assets");
			configPinataPlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("PinataPlush", "Level Rarities", "All: 10", "Rarities for each level. See default for formatting.");
			configPinataPlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("PinataPlush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities.");
			configPinataPlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("PinataPlush", "Min Value", 150, "Minimum scrap value.");
			configPinataPlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("PinataPlush", "Max Value", 200, "Maximum scrap value.");
			configSCP999PlushEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("SCP999Plush", "Enable", true, "Set to false to prevent loading assets");
			configSCP999PlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("SCP999Plush", "Level Rarities", "All: 10", "Rarities for each level. See default for formatting.");
			configSCP999PlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("SCP999Plush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities.");
			configSCP999PlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("SCP999Plush", "Min Value", 150, "Minimum scrap value.");
			configSCP999PlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("SCP999Plush", "Max Value", 200, "Maximum scrap value.");
			configDiceMimicPlushEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("DiceMimicPlush", "Enable", true, "Set to false to prevent loading assets");
			configDiceMimicPlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("DiceMimicPlush", "Level Rarities", "All: 10", "Rarities for each level. See default for formatting.");
			configDiceMimicPlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("DiceMimicPlush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities.");
			configDiceMimicPlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("DiceMimicPlush", "Min Value", 150, "Minimum scrap value.");
			configDiceMimicPlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("DiceMimicPlush", "Max Value", 200, "Maximum scrap value.");
			configRatPlushEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("RatPlush", "Enable", true, "Set to false to prevent loading assets");
			configRatPlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("RatPlush", "Level Rarities", "All: 12", "Rarities for each level. See default for formatting.");
			configRatPlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("RatPlush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities.");
			configRatPlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("RatPlush", "Min Value", 150, "Minimum scrap value.");
			configRatPlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("RatPlush", "Max Value", 200, "Maximum scrap value.");
			configFunoPlushEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("FunoPlush", "Enable", true, "Set to false to prevent loading assets");
			configFunoPlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("FunoPlush", "Level Rarities", "All: 8", "Rarities for each level. See default for formatting.");
			configFunoPlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("FunoPlush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities.");
			configFunoPlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("FunoPlush", "Min Value", 150, "Minimum scrap value.");
			configFunoPlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("FunoPlush", "Max Value", 200, "Maximum scrap value.");
			new StatusEffectController();
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			ModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "cool_assets"));
			if ((Object)(object)ModAssets == (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load custom assets.");
				return;
			}
			LoggerInstance.LogDebug((object)("Got AssetBundle at: " + Path.Combine(directoryName, "cool_assets")));
			RegisterScrap(configGlitchPlushEnable, "Assets/ModAssets/Glitch/GlitchPlushItem.asset", configGlitchPlushLevelRarities, configGlitchPlushCustomLevelRarities, configGlitchPlushMinValue, configGlitchPlushMaxValue);
			RegisterScrap(configPinataPlushEnable, "Assets/ModAssets/Snowy/PinataPlushItem.asset", configPinataPlushLevelRarities, configPinataPlushCustomLevelRarities, configPinataPlushMinValue, configPinataPlushMaxValue);
			RegisterScrap(configSCP999PlushEnable, "Assets/ModAssets/Lizzie/SCP999PlushItem.asset", configSCP999PlushLevelRarities, configSCP999PlushCustomLevelRarities, configSCP999PlushMinValue, configSCP999PlushMaxValue);
			RegisterScrap(configDiceMimicPlushEnable, "Assets/ModAssets/Slayer/DiceMimicItem.asset", configDiceMimicPlushLevelRarities, configDiceMimicPlushCustomLevelRarities, configDiceMimicPlushMinValue, configDiceMimicPlushMaxValue);
			RegisterScrap(configRatPlushEnable, "Assets/ModAssets/Rat/RatPlushItem.asset", configRatPlushLevelRarities, configRatPlushCustomLevelRarities, configRatPlushMinValue, configRatPlushMaxValue);
			RegisterScrap(configFunoPlushEnable, "Assets/ModAssets/Funo/FunoPlushItem.asset", configFunoPlushLevelRarities, configFunoPlushCustomLevelRarities, configFunoPlushMinValue, configFunoPlushMaxValue);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Snowlance.CoolPeopleMod v1.1.5 has loaded!");
		}

		public void RegisterScrap(ConfigEntry<bool> enabled, string assetPath, ConfigEntry<string> levelRarities, ConfigEntry<string> customLevelRarities, ConfigEntry<int> minValue, ConfigEntry<int> maxValue)
		{
			if (enabled.Value)
			{
				Item val = ModAssets.LoadAsset<Item>(assetPath);
				if ((Object)(object)val == (Object)null)
				{
					LoggerInstance.LogError((object)("Error: Couldnt get assets from path: " + assetPath));
					return;
				}
				LoggerInstance.LogDebug((object)("Got " + ((Object)val).name + " prefab"));
				val.minValue = minValue.Value;
				val.maxValue = maxValue.Value;
				NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
				Utilities.FixMixerGroups(val.spawnPrefab);
				Items.RegisterScrap(val, GetLevelRarities(levelRarities.Value), GetCustomLevelRarities(customLevelRarities.Value));
			}
		}

		public Dictionary<LevelTypes, int> GetLevelRarities(string levelsString)
		{
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Dictionary<LevelTypes, int> dictionary = new Dictionary<LevelTypes, int>();
				if (levelsString != null && levelsString != "")
				{
					string[] array = levelsString.Split(',');
					string[] array2 = array;
					foreach (string text in array2)
					{
						string[] array3 = text.Split(':');
						if (array3.Length == 2)
						{
							string text2 = array3[0].Trim();
							string text3 = array3[1].Trim();
							if (Enum.TryParse<LevelTypes>(text2, out LevelTypes result) && int.TryParse(text3, out var result2))
							{
								dictionary.Add(result, result2);
							}
							else
							{
								LoggerInstance.LogError((object)("Error: Invalid level rarity: " + text2 + ":" + text3));
							}
						}
					}
				}
				return dictionary;
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)$"Error: {arg}");
				return null;
			}
		}

		public Dictionary<string, int> GetCustomLevelRarities(string levelsString)
		{
			try
			{
				Dictionary<string, int> dictionary = new Dictionary<string, int>();
				if (levelsString != null)
				{
					string[] array = levelsString.Split(',');
					string[] array2 = array;
					foreach (string text in array2)
					{
						string[] array3 = text.Split(':');
						if (array3.Length == 2)
						{
							string text2 = array3[0].Trim();
							string text3 = array3[1].Trim();
							if (int.TryParse(text3, out var result))
							{
								dictionary.Add(text2, result);
							}
							else
							{
								LoggerInstance.LogError((object)("Error: Invalid level rarity: " + text2 + ":" + text3));
							}
						}
					}
				}
				return dictionary;
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)$"Error: {arg}");
				return null;
			}
		}

		public static void FreezePlayer(PlayerControllerB player, bool value)
		{
			player.disableInteract = value;
			player.disableLookInput = value;
			player.disableMoveInput = value;
		}

		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);
					}
				}
			}
			LoggerInstance.LogDebug((object)"Finished initializing network behaviours");
		}
	}
	internal static class Utils
	{
		private static ManualLogSource logger = Plugin.LoggerInstance;

		public static bool CalculatePath(Vector3 fromPos, Vector3 toPos)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0075: Unknown result type (might be due to invalid IL or missing references)
			Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(fromPos, RoundManager.Instance.navHit, 1.75f, -1);
			Vector3 navMeshPosition2 = RoundManager.Instance.GetNavMeshPosition(toPos, RoundManager.Instance.navHit, 1.75f, -1);
			NavMeshPath val = new NavMeshPath();
			return NavMesh.CalculatePath(navMeshPosition, navMeshPosition2, -1, val) && Vector3.Distance(val.corners[val.corners.Length - 1], RoundManager.Instance.GetNavMeshPosition(navMeshPosition2, RoundManager.Instance.navHit, 2.7f, -1)) <= 1.55f;
		}

		public static SpawnableEnemyWithRarity getEnemyByName(string name)
		{
			string name2 = name;
			List<SpawnableEnemyWithRarity> list = new List<SpawnableEnemyWithRarity>();
			SelectableLevel[] levels = StartOfRound.Instance.levels;
			foreach (SelectableLevel val in levels)
			{
				list = list.Union(val.Enemies).Union(val.OutsideEnemies).Union(val.DaytimeEnemies)
					.ToList();
			}
			list = (from x in list
				group x by x.enemyType.enemyName into g
				select g.First() into x
				orderby x.enemyType.enemyName
				select x).ToList();
			SpawnableEnemyWithRarity val2 = ((IEnumerable<SpawnableEnemyWithRarity>)list).FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName == name2));
			if (val2 == null)
			{
				SelectableLevel[] levels2 = StartOfRound.Instance.levels;
				foreach (SelectableLevel val3 in levels2)
				{
					val2 = ((IEnumerable<SpawnableEnemyWithRarity>)val3.Enemies).FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName.ToLower() == name2.ToLower()));
					if (val2 == null)
					{
						val2 = ((IEnumerable<SpawnableEnemyWithRarity>)val3.DaytimeEnemies).FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName.ToLower() == name2.ToLower()));
					}
					if (val2 == null)
					{
						val2 = ((IEnumerable<SpawnableEnemyWithRarity>)val3.OutsideEnemies).FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName.ToLower() == name2.ToLower()));
					}
				}
			}
			if (val2 == null)
			{
				logger.LogWarning((object)("Enemy '" + name2 + "' not found. Available enemies: " + string.Join(", ", list.Select((SpawnableEnemyWithRarity e) => e.enemyType.enemyName))));
				return null;
			}
			return val2;
		}

		public static Transform? GetRandomNode(bool outside = false)
		{
			try
			{
				GameObject[] array = (outside ? RoundManager.Instance.outsideAINodes : RoundManager.Instance.insideAINodes);
				int num = Random.Range(0, array.Length);
				return array[num].transform;
			}
			catch
			{
				return null;
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "Snowlance.CoolPeopleMod";

		public const string PLUGIN_NAME = "CoolPeopleMod";

		public const string PLUGIN_VERSION = "1.1.5";
	}
}
namespace CoolPeopleMod.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		private static ManualLogSource logger = Plugin.LoggerInstance;

		[HarmonyPostfix]
		[HarmonyPatch("Update")]
		private static void UpdatePostfix(ref bool ___inTerminalMenu, ref Transform ___thisPlayerBody, ref float ___fallValue)
		{
			if (StatusEffectController.Instance.infiniteSprintSeconds > 0)
			{
				Plugin.localPlayer.sprintMeter = StatusEffectController.Instance.freezeSprintMeter;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("Update")]
		private static void UpdatePrefix()
		{
			if (StatusEffectController.Instance.statusNegationSeconds > 0)
			{
				Plugin.localPlayer.bleedingHeavily = false;
				Plugin.localPlayer.criticallyInjured = false;
				Plugin.localPlayer.isMovementHindered = 0;
				Plugin.localPlayer.isExhausted = false;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("DamagePlayer")]
		private static void DamagePlayerPrefix(ref int damageNumber, ref CauseOfDeath causeOfDeath)
		{
			try
			{
				if (StatusEffectController.Instance.damageReductionSeconds > 0)
				{
					logger.LogDebug((object)("Applying " + StatusEffectController.Instance.damageReductionPercent + "% damage reduction"));
					float num = (float)StatusEffectController.Instance.damageReductionPercent / 100f;
					int num2 = Convert.ToInt32((float)damageNumber * num);
					int num3 = damageNumber - num2;
					logger.LogDebug((object)$"Initial damage: {damageNumber}, Damage reduction: {num2}, damage after reduction: {num3}");
					damageNumber = num3;
				}
				if (StatusEffectController.Instance.bulletProofMultiplier != 0 && (int)causeOfDeath == 7)
				{
					float num4 = (float)StatusEffectController.Instance.bulletProofMultiplier * 0.1f;
					int num5 = (int)((float)damageNumber * num4);
					int num6 = damageNumber - num5;
					logger.LogDebug((object)$"Initial damage: {damageNumber}, Damage reduction: {num5}, damage after reduction: {num6}");
					damageNumber = num6;
				}
			}
			catch (Exception ex)
			{
				logger.LogError((object)("Error in DamagePlayerPrefix: " + ex));
			}
		}
	}
}
namespace CoolPeopleMod.Items
{
	internal class CrossPlush
	{
	}
	internal class FunoPlushBehavior : PhysicsProp
	{
		public Animator ItemAnimator;

		public AudioSource ItemAudio;

		public AudioClip[] FunoSFX;

		public Material BlackMat;

		public static float pushDistance = 5f;

		public static float pushForce = 50f;

		public override void Start()
		{
			((GrabbableObject)this).Start();
			if (Plugin.localPlayer.playerSteamId == 76561198984467725L || TESTING.testing)
			{
				((Renderer)((GrabbableObject)this).mainObjectRenderer).material = BlackMat;
			}
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (buttonDown)
			{
				ItemAnimator.SetTrigger("squeeze");
				RoundManager.PlayRandomClip(ItemAudio, FunoSFX, true, 1f, 0, 1000);
				if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198993437314L || ((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing)
				{
					Landmine.SpawnExplosion(((Component)((GrabbableObject)this).playerHeldBy).transform.position + Vector3.up, true, 0f, 5f, 1, 100f, (GameObject)null, false);
					PushNearbyPlayers();
				}
				else if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198984467725L)
				{
					Landmine.SpawnExplosion(((Component)this).transform.position, true, 1f, 5f, 50, 100f, (GameObject)null, false);
				}
			}
		}

		private Vector3 GetDirectionToPlayer(PlayerControllerB player)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = ((Component)player).transform.position - ((Component)this).transform.position;
			return ((Vector3)(ref val)).normalized;
		}

		public void PushNearbyPlayers()
		{
			//IL_0042: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val in allPlayerScripts)
			{
				if (val.isPlayerControlled && !((Object)(object)val == (Object)(object)((GrabbableObject)this).playerHeldBy) && !(Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) > pushDistance))
				{
					Vector3 directionToPlayer = GetDirectionToPlayer(val);
					val.playerRigidbody.isKinematic = false;
					val.playerRigidbody.velocity = Vector3.zero;
					val.externalForceAutoFade += directionToPlayer * pushForce;
					DropBabyIfHolding(val);
					val.playerRigidbody.isKinematic = true;
				}
			}
		}

		private void DropBabyIfHolding(PlayerControllerB player)
		{
			//IL_0036: 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)
			if ((Object)(object)player.currentlyHeldObjectServer != (Object)null && ((Object)player.currentlyHeldObjectServer.itemProperties).name == "CaveDwellerBaby")
			{
				player.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true);
			}
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "FunoPlushBehavior";
		}
	}
	internal class LeverPlushBehavior : PhysicsProp
	{
		public Animator ItemAnimator;

		public AudioSource ItemAudio;

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "LeverPlushBehavior";
		}
	}
	internal class LunxaraPlushBehavior : PhysicsProp
	{
		public Animator ItemAnimator;

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "LunxaraPlushBehavior";
		}
	}
	internal class RedrigoPlushBehavior : PhysicsProp
	{
		public Animator ItemAnimator;

		public AudioSource ItemAudio;

		public GameObject SeaminePrefab;

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "RedrigoPlushBehavior";
		}
	}
	internal class SCP999PlushBehavior : PhysicsProp
	{
		[CompilerGenerated]
		private sealed class <HugCoroutine>d__7 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public SCP999PlushBehavior <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <HugCoroutine>d__7(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0108: Expected O, but got Unknown
				//IL_009e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.ItemAnimator.SetBool("hug", true);
					goto IL_00b9;
				case 1:
					<>1__state = -1;
					goto IL_00b9;
				case 2:
					{
						<>1__state = -1;
						<>4__this.ItemAnimator.SetBool("hug", false);
						<>4__this.hugRoutine = null;
						return false;
					}
					IL_00b9:
					if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy != (Object)null && ((GrabbableObject)<>4__this).playerHeldBy.health < 100 && !((GrabbableObject)<>4__this).isPocketed)
					{
						PlayerControllerB playerHeldBy = ((GrabbableObject)<>4__this).playerHeldBy;
						playerHeldBy.health += healthPerSecond;
						if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy == (Object)(object)Plugin.localPlayer)
						{
							HUDManager.Instance.UpdateHealthUI(Plugin.localPlayer.health, false);
						}
						<>2__current = (object)new WaitForSecondsRealtime(1f);
						<>1__state = 1;
						return true;
					}
					<>2__current = (object)new WaitForSecondsRealtime(3f);
					<>1__state = 2;
					return true;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public Animator ItemAnimator;

		public AudioSource ItemAudio;

		public AudioClip[] HugSFX;

		public AudioClip[] RoamSFX;

		private Coroutine? hugRoutine;

		public static int healthPerSecond = 2;

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (!buttonDown)
			{
				return;
			}
			if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561199094139351L || ((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing)
			{
				RoundManager.PlayRandomClip(ItemAudio, HugSFX, true, 1f, 0, 1000);
				if (hugRoutine == null)
				{
					hugRoutine = ((MonoBehaviour)this).StartCoroutine(HugCoroutine());
				}
			}
			else
			{
				ItemAnimator.SetTrigger("squeeze");
				RoundManager.PlayRandomClip(ItemAudio, RoamSFX, true, 1f, 0, 1000);
			}
		}

		[IteratorStateMachine(typeof(<HugCoroutine>d__7))]
		private IEnumerator HugCoroutine()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <HugCoroutine>d__7(0)
			{
				<>4__this = this
			};
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "SCP999PlushBehavior";
		}
	}
}
namespace CoolPeopleMod.Items.RatPlush
{
	internal class RatPlushBehavior : PhysicsProp
	{
		public AudioSource ItemAudio;

		public AudioClip[] BirthdaySFX;

		public Animator ItemAnimator;

		public GameObject RatPrefab;

		private RatScript? currentRat;

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (buttonDown)
			{
				RoundManager.PlayRandomClip(ItemAudio, BirthdaySFX, true, 1f, 0, 1000);
				ItemAnimator.SetTrigger("squeeze");
				if (!IsSlayerInGame() && (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561199182474292L || ((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing))
				{
					TrySpawnRatOnServer();
				}
			}
		}

		private void TrySpawnRatOnServer()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			if (!Plugin.IsServerOrHost || !((GrabbableObject)this).playerHeldBy.isInsideFactory)
			{
				return;
			}
			Vector3 toPos = RoundManager.FindMainEntrancePosition(true, false);
			if (Utils.CalculatePath(((Component)((GrabbableObject)this).playerHeldBy).transform.position, toPos))
			{
				if ((Object)(object)currentRat != (Object)null)
				{
					currentRat.DisappearClientRpc();
				}
				float num = 1f;
				Vector3 val = ((Component)((GrabbableObject)this).playerHeldBy).transform.position + ((Component)((GrabbableObject)this).playerHeldBy).transform.forward * num;
				currentRat = Object.Instantiate<GameObject>(RatPrefab, val, ((Component)((GrabbableObject)this).playerHeldBy).transform.rotation).GetComponent<RatScript>();
				((NetworkBehaviour)currentRat).NetworkObject.Spawn(true);
			}
		}

		private bool IsSlayerInGame()
		{
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val in allPlayerScripts)
			{
				if (val.playerSteamId == 76561198077184650L)
				{
					return true;
				}
			}
			return false;
		}

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "RatPlushBehavior";
		}
	}
	internal class RatScript : NetworkBehaviour
	{
		[CompilerGenerated]
		private sealed class <DisappearCoroutine>d__16 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public float delay;

			public RatScript <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DisappearCoroutine>d__16(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0031: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSecondsRealtime(delay);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					((NetworkBehaviour)<>4__this).NetworkObject.Despawn(true);
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public AudioSource RatAudio;

		public AudioClip BirthdayMixtapeSFX;

		public NavMeshAgent agent;

		public float AIIntervalTime;

		public ParticleSystem particleSystem;

		private float timeSinceAIInterval;

		private Vector3 mainEntrancePosition;

		private NavMeshPath path1;

		private bool moveTowardsDestination;

		private Vector3 destination;

		private bool inSpecialAnimation;

		public void Start()
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			mainEntrancePosition = RoundManager.FindMainEntrancePosition(true, false);
		}

		public void Update()
		{
			if (Plugin.IsServerOrHost)
			{
				timeSinceAIInterval += Time.deltaTime;
				if (timeSinceAIInterval > AIIntervalTime)
				{
					DoAIInterval();
					timeSinceAIInterval = 0f;
				}
			}
		}

		private void DoAIInterval()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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)
			if (!inSpecialAnimation)
			{
				if (moveTowardsDestination)
				{
					agent.SetDestination(destination);
				}
				if (!SetDestinationToPosition(mainEntrancePosition, checkForPath: true) || Vector3.Distance(((Component)this).transform.position, mainEntrancePosition) < 1f)
				{
					inSpecialAnimation = true;
					DisappearClientRpc();
				}
			}
		}

		public bool SetDestinationToPosition(Vector3 position, bool checkForPath = false)
		{
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0038: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			if (checkForPath)
			{
				position = RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, 1.75f, -1);
				path1 = new NavMeshPath();
				if (!agent.CalculatePath(position, path1))
				{
					return false;
				}
				if (Vector3.Distance(path1.corners[path1.corners.Length - 1], RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, 2.7f, -1)) > 1.55f)
				{
					return false;
				}
			}
			moveTowardsDestination = true;
			destination = RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, -1f, -1);
			return true;
		}

		public void Disappear()
		{
			particleSystem.Play();
			if (Plugin.IsServerOrHost)
			{
				((NetworkBehaviour)this).NetworkObject.Despawn(true);
			}
		}

		[IteratorStateMachine(typeof(<DisappearCoroutine>d__16))]
		private IEnumerator DisappearCoroutine(float delay)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DisappearCoroutine>d__16(0)
			{
				<>4__this = this,
				delay = delay
			};
		}

		[ClientRpc]
		public void DisappearClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3291613333u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3291613333u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Disappear();
				}
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_RatScript()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3291613333u, new RpcReceiveHandler(__rpc_handler_3291613333));
		}

		private static void __rpc_handler_3291613333(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((RatScript)(object)target).DisappearClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "RatScript";
		}
	}
}
namespace CoolPeopleMod.Items.PinataPlush
{
	internal class PinataPlushBehavior : PhysicsProp
	{
		[CompilerGenerated]
		private sealed class <ShutUpSnowyCoroutine>d__17 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public float delay;

			public PinataPlushBehavior <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <ShutUpSnowyCoroutine>d__17(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0031: Expected O, but got Unknown
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(delay);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					Landmine.SpawnExplosion(((Component)<>4__this).transform.position, true, 5.7f, 6f, 50, 0f, (GameObject)null, false);
					<>4__this.shutUpSnowy = false;
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public Animator ItemAnimator;

		public AudioSource ItemAudio;

		public AudioClip AttackSFX;

		public AudioClip PartySFX;

		public AudioClip ShutUpSnowySFX;

		private PlayerControllerB? previousPlayerHeldBy;

		private int damage = 5;

		public static float explodeChance = 0.2f;

		public static float shutUpSnowyChance = 0.1f;

		private bool shutUpSnowy;

		public override void Update()
		{
			((GrabbableObject)this).Update();
			if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
			{
				previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy;
			}
			Plugin.localPlayer.equippedUsableItemQE = (Object)(object)previousPlayerHeldBy != (Object)null && (Object)(object)Plugin.localPlayer == (Object)(object)previousPlayerHeldBy;
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (!shutUpSnowy && buttonDown)
			{
				if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing)
				{
					ItemAnimator.SetTrigger("squeeze");
					ItemAudio.PlayOneShot(PartySFX);
					ActivateRandomCandyEffect();
				}
				else
				{
					ItemAnimator.SetTrigger("headbutt");
				}
			}
		}

		public override void ItemInteractLeftRight(bool right)
		{
			((GrabbableObject)this).ItemInteractLeftRight(right);
			if (right)
			{
				if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing)
				{
					ItemAnimator.SetTrigger("squeeze");
					ItemAudio.PlayOneShot(PartySFX);
					TeleportPlayerToRandomNode(((GrabbableObject)this).playerHeldBy);
				}
			}
			else if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing)
			{
				ItemAnimator.SetTrigger("headbutt");
			}
		}

		public void DamagePlayerHeldBy()
		{
			//IL_0046: 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_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy;
			ItemAudio.PlayOneShot(AttackSFX);
			if (playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing)
			{
				CatchTheBus();
				return;
			}
			playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true);
			playerHeldBy.DamagePlayer(damage, false, false, (CauseOfDeath)1, 7, false, ((Component)playerHeldBy).transform.forward * 10f);
			TeleportPlayerToRandomNode(playerHeldBy);
		}

		private void CatchTheBus()
		{
			//IL_0041: 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_0051: Unknown result type (might be due to invalid IL or missing references)
			if ((((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing) && !((Object)(object)Plugin.localPlayer != (Object)(object)((GrabbableObject)this).playerHeldBy))
			{
				((GrabbableObject)this).playerHeldBy.KillPlayer(Vector3.zero, false, (CauseOfDeath)0, 0, default(Vector3));
			}
		}

		public void TeleportPlayerToRandomNode(PlayerControllerB player)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			Transform randomNode = Utils.GetRandomNode();
			if (!((Object)(object)randomNode == (Object)null))
			{
				player.TeleportPlayer(randomNode.position, false, 0f, false, true);
			}
		}

		private void ActivateRandomCandyEffect()
		{
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)Plugin.localPlayer)
			{
				return;
			}
			if (Random.Range(0f, 1f) <= shutUpSnowyChance)
			{
				shutUpSnowy = true;
				ShutUpSnowyServerRpc();
				return;
			}
			switch (Random.Range(0, 7))
			{
			case 0:
				HUDManager.Instance.DisplayTip("Blue", "", false, false, "LC_Tip1");
				StatusEffectController.Instance.HealPlayer(30, overHeal: true);
				break;
			case 1:
				HUDManager.Instance.DisplayTip("Green", "", false, false, "LC_Tip1");
				StatusEffectController.Instance.StatusNegation(30);
				StatusEffectController.Instance.HealthRegen(1, 80);
				break;
			case 2:
				HUDManager.Instance.DisplayTip("Purple", "", false, false, "LC_Tip1");
				StatusEffectController.Instance.DamageReduction(15, 20, timeStackable: true);
				StatusEffectController.Instance.HealthRegen(2, 10);
				break;
			case 3:
				HUDManager.Instance.DisplayTip("Red", "", false, false, "LC_Tip1");
				StatusEffectController.Instance.HealthRegen(9, 5);
				break;
			case 4:
				HUDManager.Instance.DisplayTip("Yellow", "", false, false, "LC_Tip1");
				StatusEffectController.Instance.RestoreStamina(25);
				StatusEffectController.Instance.InfiniteSprint(8);
				StatusEffectController.Instance.IncreasedMovementSpeed(8, 2, timeStackable: true, stackable: true);
				break;
			case 5:
				HUDManager.Instance.DisplayTip("Pink", "", false, false, "LC_Tip1");
				if (!(Random.Range(0f, 1f) > explodeChance))
				{
					Landmine.SpawnExplosion(((Component)this).transform.position, true, 5.7f, 6f, 50, 0f, (GameObject)null, false);
				}
				break;
			case 6:
				HUDManager.Instance.DisplayTip("Rainbow", "", false, false, "LC_Tip1");
				StatusEffectController.Instance.HealPlayer(15);
				StatusEffectController.Instance.InfiniteSprint(5, timeStackable: true);
				StatusEffectController.Instance.bulletProofMultiplier++;
				StatusEffectController.Instance.StatusNegation(10);
				StatusEffectController.Instance.HealPlayer(20, overHeal: true);
				break;
			}
		}

		[IteratorStateMachine(typeof(<ShutUpSnowyCoroutine>d__17))]
		private IEnumerator ShutUpSnowyCoroutine(float delay)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <ShutUpSnowyCoroutine>d__17(0)
			{
				<>4__this = this,
				delay = delay
			};
		}

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

		[ClientRpc]
		public void ShutUpSnowyClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2820405468u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2820405468u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					ItemAudio.PlayOneShot(ShutUpSnowySFX);
					((MonoBehaviour)this).StartCoroutine(ShutUpSnowyCoroutine(3f));
				}
			}
		}

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

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

		private static void __rpc_handler_2073402381(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;
				((PinataPlushBehavior)(object)target).ShutUpSnowyServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2820405468(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PinataPlushBehavior)(object)target).ShutUpSnowyClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "PinataPlushBehavior";
		}
	}
}
namespace CoolPeopleMod.Items.DiceMimic
{
	internal class DiceMimicPlushBehavior : PhysicsProp
	{
		[CompilerGenerated]
		private sealed class <HugCoroutine>d__32 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public DiceMimicPlushBehavior <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <HugCoroutine>d__32(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fa: Expected O, but got Unknown
				//IL_009e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.ItemAnimator.SetBool("hug", true);
					goto IL_00b9;
				case 1:
					<>1__state = -1;
					goto IL_00b9;
				case 2:
					{
						<>1__state = -1;
						<>4__this.ItemAnimator.SetBool("hug", false);
						<>4__this.hugRoutine = null;
						return false;
					}
					IL_00b9:
					if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy != (Object)null && ((GrabbableObject)<>4__this).playerHeldBy.health < 100)
					{
						PlayerControllerB playerHeldBy = ((GrabbableObject)<>4__this).playerHeldBy;
						playerHeldBy.health += SCP999PlushBehavior.healthPerSecond;
						if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy == (Object)(object)Plugin.localPlayer)
						{
							HUDManager.Instance.UpdateHealthUI(Plugin.localPlayer.health, false);
						}
						<>2__current = (object)new WaitForSecondsRealtime(1f);
						<>1__state = 1;
						return true;
					}
					<>2__current = (object)new WaitForSecondsRealtime(3f);
					<>1__state = 2;
					return true;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static ManualLogSource logger = Plugin.LoggerInstance;

		public Animator ItemAnimator;

		public AudioSource ItemAudio;

		public AudioClip DiceSFX;

		public Spinner DiceScript;

		private bool isThrown;

		private const int plushieCount = 5;

		private int currentBehavior;

		public AnimationCurve grenadeFallCurve;

		public AnimationCurve grenadeVerticalFallCurve;

		public AnimationCurve grenadeVerticalFallCurveNoBounce;

		public AudioClip BaldSFX;

		private Ray grenadeThrowRay;

		private RaycastHit grenadeHit;

		private int stunGrenadeMask = 268437761;

		public AudioClip PartySFX;

		public AudioClip[] HugSFX;

		private Coroutine? hugRoutine;

		public AudioClip[] BirthdaySFX;

		public GameObject RatPrefab;

		private RatScript? currentRat;

		public AudioClip[] FunoSFX;

		public AudioClip LeverPullSFX;

		public GameObject SeaminePrefab;

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (!buttonDown)
			{
				return;
			}
			ItemAudio.PlayOneShot(DiceSFX);
			ItemAnimator.SetTrigger("squeeze");
			DiceScript.StartHyperSpinning(3f);
			if (!((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)Plugin.localPlayer) && !IsRatInGame())
			{
				if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198077184650L || ((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing)
				{
					int index = Random.Range(0, 6);
					DoPlushieEffectServerRpc(index);
				}
				else
				{
					SpawnMimicServerRpc();
				}
			}
		}

		private bool IsRatInGame()
		{
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val in allPlayerScripts)
			{
				if (val.playerSteamId == 76561199182474292L)
				{
					return true;
				}
			}
			return false;
		}

		private void DoPlushieEffect(int index)
		{
			currentBehavior = index;
			switch (currentBehavior)
			{
			case 1:
				DoGlitchPlushBehavior();
				break;
			case 2:
				DoPinataPlushBehavior();
				break;
			case 3:
				DoSCP999PlushBehavior();
				break;
			case 4:
				DoRatPlushBehavior();
				break;
			case 5:
				DoFunoPlushBehavior();
				break;
			}
		}

		public override void OnHitGround()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or