Decompiled source of Tartarus v1.1.0

plugins/Tartarus.dll

Decompiled 2 weeks ago
#define DEBUG
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security.Cryptography;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Tartarus;
using Tartarus.NetcodePatcher;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Tartarus")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+060df6979a76df09f8a5500b62c42229debc41fd")]
[assembly: AssemblyProduct("Tartarus")]
[assembly: AssemblyTitle("Tartarus")]
[assembly: AssemblyVersion("1.0.0.0")]
[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 Block2FloodTrapController : MonoBehaviour
{
	[SerializeField]
	private List<AudioSource> faceAudioSources;

	[SerializeField]
	private AudioSource doorAudioSource;

	[SerializeField]
	private Animator m_Animator;

	[SerializeField]
	private Transform purpleIdolDetectBox;

	[SerializeField]
	private AudioClip doorCloseSound;

	[SerializeField]
	private AudioClip doorOpenSound;

	[SerializeField]
	private AudioClip tentaclesShiftSound;

	private bool foundIdol = false;

	private PurpleIdol purpleIdol;

	private Vector3 purpleIdolSpawnPosition;

	private bool startedFloodTrap = false;

	private float timeSinceAlive = 0f;

	private void Start()
	{
		CheckForIdol();
	}

	private void CheckForIdol()
	{
		((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate
		{
		}, 1f, delegate
		{
			//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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			Debug.LogWarning((object)"CHECKING FOR IDOL!!");
			int num = 64;
			Collider[] array = Physics.OverlapBox(purpleIdolDetectBox.position, purpleIdolDetectBox.localScale, Quaternion.identity, num);
			if (array.Length != 0)
			{
				Collider[] array2 = array;
				PurpleIdol purpleIdol = default(PurpleIdol);
				foreach (Collider val in array2)
				{
					if (((Component)val).TryGetComponent<PurpleIdol>(ref purpleIdol))
					{
						Debug.LogWarning((object)"FOUND IDOL!!");
						this.purpleIdol = purpleIdol;
						purpleIdolSpawnPosition = ((Component)this.purpleIdol).transform.position;
						break;
					}
				}
			}
			if ((Object)(object)this.purpleIdol == (Object)null)
			{
				CheckForIdol();
			}
		}));
	}

	private void Update()
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		timeSinceAlive += Time.deltaTime;
		if ((Object)(object)purpleIdol != (Object)null && ((Component)purpleIdol).transform.position != purpleIdolSpawnPosition && !startedFloodTrap && timeSinceAlive > 2f)
		{
			startedFloodTrap = true;
			FloodStart();
		}
	}

	private void FloodStart()
	{
		m_Animator.SetTrigger("FloodStart");
		doorAudioSource.PlayOneShot(doorCloseSound);
		doorAudioSource.PlayOneShot(tentaclesShiftSound);
		foreach (AudioSource faceAudioSource in faceAudioSources)
		{
			((MonoBehaviour)this).StartCoroutine(FadeSource(faceAudioSource, fadeIn: true));
		}
	}

	private void FloodStop()
	{
		doorAudioSource.PlayOneShot(doorOpenSound);
		doorAudioSource.PlayOneShot(tentaclesShiftSound);
		foreach (AudioSource faceAudioSource in faceAudioSources)
		{
			((MonoBehaviour)this).StartCoroutine(FadeSource(faceAudioSource, fadeIn: false));
		}
	}

	private IEnumerator FadeSource(AudioSource audioSource, bool fadeIn)
	{
		float timeElapsed = 0f;
		while (timeElapsed < 0.25f)
		{
			if (!fadeIn)
			{
				audioSource.volume = Mathf.Lerp(0.3f, 0f, timeElapsed / 0.25f);
			}
			else
			{
				audioSource.volume = Mathf.Lerp(0f, 0.3f, timeElapsed / 0.25f);
			}
			timeElapsed += Time.deltaTime;
			yield return null;
		}
		if (fadeIn)
		{
			audioSource.volume = 0.3f;
		}
		else
		{
			audioSource.volume = 0f;
		}
	}
}
public class Block2TentacleController : NetworkBehaviour
{
	[SerializeField]
	private AudioSource audioSource;

	[SerializeField]
	private AudioClip tentacleAttack;

	[SerializeField]
	private AudioClip tentacleSearch;

	private bool exploring = false;

	private bool canKill = false;

	public bool collidedWithPlayer = false;

	[SerializeField]
	private Animator animator;

	[SerializeField]
	private Transform grabPosition;

	private void Start()
	{
	}

	private void Update()
	{
	}

	private void OnTriggerEnter(Collider other)
	{
		if (((Component)other).CompareTag("Player") && !collidedWithPlayer && !exploring)
		{
			Explore();
		}
	}

	private void OnTriggerStay(Collider other)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		if (canKill && ((Component)other).CompareTag("Player"))
		{
			exploring = false;
			canKill = false;
			CheckAnimationGrabPlayerServerRpc(new NetworkBehaviourReference((NetworkBehaviour)(object)((Component)other).GetComponent<PlayerControllerB>()));
		}
	}

	public void Explore()
	{
		exploring = true;
		((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate
		{
			((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate
			{
				animator.SetTrigger("Explore");
				audioSource.PlayOneShot(tentacleSearch);
			}, 0.5f, delegate
			{
				canKill = true;
			}));
		}, 4f, delegate
		{
			if (exploring)
			{
				exploring = false;
			}
		}));
	}

	[ServerRpc(RequireOwnership = false)]
	public void CheckAnimationGrabPlayerServerRpc(NetworkBehaviourReference playerRef)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(838673928u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref playerRef, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 838673928u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && !collidedWithPlayer)
			{
				collidedWithPlayer = true;
				ConfirmAnimationGrabPlayerClientRpc(playerRef);
			}
		}
	}

	[ClientRpc]
	public void ConfirmAnimationGrabPlayerClientRpc(NetworkBehaviourReference playerRef)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: 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(1442225214u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref playerRef, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1442225214u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				collidedWithPlayer = true;
				((MonoBehaviour)this).StartCoroutine(AnimationGrabPlayer(playerRef));
			}
		}
	}

	private IEnumerator AnimationGrabPlayer(NetworkBehaviourReference playerRef)
	{
		//IL_000e: 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)
		PlayerControllerB playerDying = default(PlayerControllerB);
		((NetworkBehaviourReference)(ref playerRef)).TryGet<PlayerControllerB>(ref playerDying, (NetworkManager)null);
		animator.SetBool("grabbingPlayer", true);
		audioSource.PlayOneShot(tentacleAttack);
		grabPosition.position = ((Component)playerDying).transform.position;
		yield return (object)new WaitForSeconds(0.05f);
		if (((NetworkBehaviour)playerDying).IsOwner)
		{
			playerDying.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3));
		}
		float startTime = Time.timeSinceLevelLoad;
		yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)playerDying.deadBody != (Object)null || Time.timeSinceLevelLoad - startTime > 4f));
		if ((Object)(object)playerDying.deadBody != (Object)null)
		{
			playerDying.deadBody.attachedTo = grabPosition;
			playerDying.deadBody.attachedLimb = playerDying.deadBody.bodyParts[6];
			playerDying.deadBody.matchPositionExactly = true;
		}
		else
		{
			Debug.Log((object)"Player body was not spawned in time for animation.");
		}
		animator.SetBool("grabbingPlayer", false);
		yield return (object)new WaitForSeconds(5f);
		if ((Object)(object)playerDying.deadBody != (Object)null)
		{
			playerDying.deadBody.attachedTo = null;
			playerDying.deadBody.attachedLimb = null;
			playerDying.deadBody.matchPositionExactly = false;
			((Component)playerDying.deadBody).gameObject.SetActive(false);
		}
	}

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

	[RuntimeInitializeOnLoadMethod]
	internal static void InitializeRPCS_Block2TentacleController()
	{
		//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(838673928u, new RpcReceiveHandler(__rpc_handler_838673928));
		NetworkManager.__rpc_func_table.Add(1442225214u, new RpcReceiveHandler(__rpc_handler_1442225214));
	}

	private static void __rpc_handler_838673928(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			NetworkBehaviourReference playerRef = default(NetworkBehaviourReference);
			((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref playerRef, default(ForNetworkSerializable));
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((Block2TentacleController)(object)target).CheckAnimationGrabPlayerServerRpc(playerRef);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_1442225214(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			NetworkBehaviourReference playerRef = default(NetworkBehaviourReference);
			((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref playerRef, default(ForNetworkSerializable));
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((Block2TentacleController)(object)target).ConfirmAnimationGrabPlayerClientRpc(playerRef);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "Block2TentacleController";
	}
}
public class BreakableObject : NetworkBehaviour, IHittable
{
	[SerializeField]
	private List<GameObject> possibleDrops;

	[Range(0f, 100f)]
	[SerializeField]
	private int spawnChance;

	private Animator animator;

	private AudioSource audioSource;

	[SerializeField]
	private AudioClip breakSound;

	private void Start()
	{
		animator = ((Component)this).GetComponent<Animator>();
		audioSource = ((Component)this).GetComponent<AudioSource>();
	}

	bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID = -1)
	{
		OnHitServerRpc();
		return true;
	}

	[ServerRpc(RequireOwnership = false)]
	private void OnHitServerRpc()
	{
		//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)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
		{
			ServerRpcParams val = default(ServerRpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(407486771u, val, (RpcDelivery)0);
			((NetworkBehaviour)this).__endSendServerRpc(ref val2, 407486771u, val, (RpcDelivery)0);
		}
		if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
		{
			return;
		}
		int num = Random.Range(0, 101);
		if (num <= spawnChance)
		{
			int index = Random.Range(0, possibleDrops.Count);
			GameObject val3 = Object.Instantiate<GameObject>(possibleDrops[index], ((Component)((Component)this).GetComponentInChildren<Light>()).transform.position, ((Component)this).transform.rotation);
			if ((Object)(object)val3 != (Object)null)
			{
				val3.GetComponent<NetworkObject>().Spawn(false);
			}
		}
		OnHitClientRpc();
	}

	[ClientRpc]
	private void OnHitClientRpc()
	{
		//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(1283710748u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1283710748u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				animator.SetTrigger("Break");
				audioSource.PlayOneShot(breakSound);
			}
		}
	}

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

	[RuntimeInitializeOnLoadMethod]
	internal static void InitializeRPCS_BreakableObject()
	{
		//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(407486771u, new RpcReceiveHandler(__rpc_handler_407486771));
		NetworkManager.__rpc_func_table.Add(1283710748u, new RpcReceiveHandler(__rpc_handler_1283710748));
	}

	private static void __rpc_handler_407486771(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;
			((BreakableObject)(object)target).OnHitServerRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_1283710748(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;
			((BreakableObject)(object)target).OnHitClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "BreakableObject";
	}
}
public static class Extensions
{
	public static void SetLayer(this GameObject obj, LayerMask layerMask, bool children)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		obj.layer = LayerMask.op_Implicit(layerMask);
		if (children && obj.transform.childCount > 0)
		{
			Transform[] componentsInChildren = obj.GetComponentsInChildren<Transform>();
			Transform[] array = componentsInChildren;
			foreach (Transform val in array)
			{
				((Component)val).gameObject.layer = LayerMask.op_Implicit(layerMask);
			}
		}
	}

	public static void SetLayer(this GameObject obj, string layerName, bool children)
	{
		//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_0054: Unknown result type (might be due to invalid IL or missing references)
		LayerMask val = LayerMask.op_Implicit(LayerMask.NameToLayer(layerName));
		obj.layer = LayerMask.op_Implicit(val);
		if (children && obj.transform.childCount > 0)
		{
			Transform[] componentsInChildren = obj.GetComponentsInChildren<Transform>();
			Transform[] array = componentsInChildren;
			foreach (Transform val2 in array)
			{
				((Component)val2).gameObject.layer = LayerMask.op_Implicit(val);
			}
		}
	}

	public static Transform GetClosest(this Transform _transform, params Component[] array)
	{
		//IL_0017: 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)
		Transform result = null;
		float num = float.PositiveInfinity;
		foreach (Component val in array)
		{
			float num2 = Vector3.Distance(_transform.position, val.transform.position);
			if (num2 < num)
			{
				num = num2;
				result = val.transform;
			}
		}
		return result;
	}

	public static void SetColliderEnabled(this GameObject obj, bool enable, bool children)
	{
		obj.GetComponent<Collider>().enabled = enable;
		if (children)
		{
			Collider[] componentsInChildren = obj.GetComponentsInChildren<Collider>();
			Collider[] array = componentsInChildren;
			foreach (Collider val in array)
			{
				val.enabled = enable;
			}
		}
	}

	public static void SetTag(this GameObject obj, string newTag, bool children)
	{
		obj.tag = newTag;
		if (children)
		{
			Transform[] componentsInChildren = obj.GetComponentsInChildren<Transform>();
			Transform[] array = componentsInChildren;
			foreach (Transform val in array)
			{
				((Component)val).gameObject.tag = newTag;
			}
		}
	}

	public static void AddComponent<T>(this GameObject obj, bool children) where T : Component
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Expected O, but got Unknown
		obj.AddComponent<T>();
		if (!children)
		{
			return;
		}
		foreach (Transform item in obj.transform)
		{
			Transform val = item;
			((Component)val).gameObject.AddComponent<T>();
		}
	}

	public static T GetVariableFromString<T>(this Component comp, string varName)
	{
		return (T)((object)comp).GetType().GetField(varName).GetValue(comp);
	}

	public static void MoveTowards(this Transform trans, Vector3 target, float maxDistanceDelta)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		trans.position = Vector3.MoveTowards(trans.position, target, maxDistanceDelta);
	}

	public static Vector3 GetCenter(this GameObject obj)
	{
		//IL_002e: 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_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
		List<float> list = new List<float>();
		List<float> list2 = new List<float>();
		List<float> list3 = new List<float>();
		Renderer[] componentsInChildren = obj.GetComponentsInChildren<Renderer>();
		Renderer[] array = componentsInChildren;
		foreach (Renderer val in array)
		{
			Bounds bounds = val.bounds;
			list.Add(((Bounds)(ref bounds)).center.x);
			bounds = val.bounds;
			list2.Add(((Bounds)(ref bounds)).center.y);
			bounds = val.bounds;
			list3.Add(((Bounds)(ref bounds)).center.z);
		}
		float num = (Mathf.Max(list.ToArray()) + Mathf.Min(list.ToArray())) / 2f;
		float num2 = (Mathf.Max(list2.ToArray()) + Mathf.Min(list2.ToArray())) / 2f;
		float num3 = (Mathf.Max(list3.ToArray()) + Mathf.Min(list3.ToArray())) / 2f;
		return new Vector3(num, num2, num3);
	}

	public static Vector3 GetBottom(this GameObject obj)
	{
		//IL_0009: 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_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: 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_009b: 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_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: 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_006c: 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)
		MeshFilter[] componentsInChildren = obj.GetComponentsInChildren<MeshFilter>();
		Vector3 center = obj.GetCenter();
		Vector3 val = componentsInChildren[0].mesh.vertices[0];
		MeshFilter[] array = componentsInChildren;
		foreach (MeshFilter val2 in array)
		{
			Mesh mesh = val2.mesh;
			Vector3[] vertices = mesh.vertices;
			foreach (Vector3 val3 in vertices)
			{
				if (val3.y < val.y)
				{
					val = val3;
				}
			}
		}
		center.y = val.y;
		return center;
	}

	public static Vector3 GetCenterNew(this GameObject obj)
	{
		//IL_0003: 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_0026: Expected O, but got Unknown
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		Bounds val = default(Bounds);
		bool flag = true;
		foreach (Transform item in obj.transform)
		{
			Transform val2 = item;
			if (Object.op_Implicit((Object)(object)((Component)val2).GetComponent<MeshRenderer>()))
			{
				if (flag)
				{
					flag = false;
					val = ((Renderer)((Component)val2).GetComponent<MeshRenderer>()).bounds;
				}
				else
				{
					((Bounds)(ref val)).Encapsulate(((Renderer)((Component)val2).GetComponent<MeshRenderer>()).bounds);
				}
			}
		}
		return ((Bounds)(ref val)).center;
	}

	public static Transform[] GetAllChildren(this Transform trans)
	{
		return ((Component)trans).GetComponentsInChildren<Transform>();
	}

	public static void SetAlpha(this Image image, float alpha)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		Color color = ((Graphic)image).color;
		color.a = alpha;
		((Graphic)image).color = color;
	}

	public static void SetAlpha(this Material mat, float alpha)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		Color color = mat.color;
		color.a = alpha;
		mat.color = color;
	}

	public static void SetX(this Transform trans, float newX, bool relative)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = trans.position;
		position.x = (relative ? (position.x + newX) : newX);
		trans.position = position;
	}

	public static void SetY(this Transform trans, float newY, bool relative)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = trans.position;
		position.y = (relative ? (position.y + newY) : newY);
		trans.position = position;
	}

	public static void SetZ(this Transform trans, float newZ, bool relative)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = trans.position;
		position.z = (relative ? (position.z + newZ) : newZ);
		trans.position = position;
	}

	public static bool IsSimilar(this Material mat, Material other)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Expected O, but got Unknown
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		Texture2D val = (Texture2D)mat.mainTexture;
		Texture2D val2 = (Texture2D)other.mainTexture;
		if ((Object)(object)mat.mainTexture == (Object)null && (Object)(object)other.mainTexture == (Object)null)
		{
			return mat.color == other.color;
		}
		return mat.color == other.color && (Object)(object)val == (Object)(object)val2;
	}
}
public class Ext
{
	public static void LoadSceneOffline(string sceneName)
	{
		SceneManager.LoadScene(sceneName);
	}

	public static Scene GetActiveScene()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		return SceneManager.GetActiveScene();
	}

	public static int CryptoRandomInt(int min, int max)
	{
		return RandomNumberGenerator.GetInt32(min, max);
	}

	public static float CryptoRandomFloat(float min, float max)
	{
		RandomNumberGenerator randomNumberGenerator = RandomNumberGenerator.Create();
		byte[] array = new byte[4];
		randomNumberGenerator.GetBytes(array);
		float num = BitConverter.ToSingle(array, 0);
		return num * (max - min) + min;
	}

	public static IEnumerator WaitAndDo(Action firstAction, float time, Action secondAction)
	{
		firstAction();
		yield return (object)new WaitForSeconds(time);
		secondAction();
	}

	public static IEnumerator WaitAndDo(Func<bool> condition, Action action)
	{
		while (condition())
		{
			yield return null;
		}
		action();
	}
}
public class MathExt
{
	public static float Wrap(float value, float min, float max)
	{
		if (value % 1f == 0f)
		{
			while (value > max || value < min)
			{
				if (value > max)
				{
					value += min - max - 1f;
				}
				else if (value < min)
				{
					value += max - min + 1f;
				}
			}
			return value;
		}
		float num = value + 1f;
		while (value != num)
		{
			num = value;
			if (value < min)
			{
				value = max - (min - value);
			}
			else if (value > max)
			{
				value = min + (value - max);
			}
		}
		return value;
	}

	public static int Wrap(int value, int min, int max)
	{
		if (value % 1 == 0)
		{
			while (value > max || value < min)
			{
				if (value > max)
				{
					value += min - max - 1;
				}
				else if (value < min)
				{
					value += max - min + 1;
				}
			}
			return value;
		}
		int num = value + 1;
		while (value != num)
		{
			num = value;
			if (value < min)
			{
				value = max - (min - value);
			}
			else if (value > max)
			{
				value = min + (value - max);
			}
		}
		return value;
	}

	public static bool Chance(float chance)
	{
		return chance > Random.Range(0f, 1f);
	}

	public static bool CryptoChance(float chance)
	{
		return chance > Ext.CryptoRandomFloat(0f, 1f);
	}

	public static T Choose<T>(params T[] array)
	{
		int num = array.Length;
		return array[Random.Range(0, num)];
	}

	public static T Choose<T>(List<T> list)
	{
		return Choose(list.ToArray());
	}

	public static T CryptoChoose<T>(params T[] array)
	{
		int max = array.Length;
		return array[Ext.CryptoRandomInt(0, max)];
	}

	public static T CryptoChoose<T>(List<T> list)
	{
		return CryptoChoose(list.ToArray());
	}
}
public class FunnyDoor : NetworkBehaviour
{
	private Animator animator;

	private AudioSource audioSource;

	public int inTriggerCount = 0;

	private bool isOpen = false;

	public AudioClip doorOpenSound;

	public AudioClip doorCloseSound;

	public bool inverseOpenAndClose;

	private void Start()
	{
		animator = ((Component)this).GetComponent<Animator>();
		audioSource = ((Component)this).GetComponent<AudioSource>();
	}

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

	[ClientRpc]
	private void OpenDoorClientRpc()
	{
		//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(4065661993u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4065661993u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				animator.SetTrigger("Open");
				audioSource.PlayOneShot(doorOpenSound);
			}
		}
	}

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

	[ClientRpc]
	private void CloseDoorClientRpc()
	{
		//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(1431199571u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1431199571u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				animator.SetTrigger("Close");
				audioSource.PlayOneShot(doorCloseSound);
			}
		}
	}

	private void OnTriggerEnter(Collider other)
	{
		if (((Component)other).CompareTag("Player") || ((Component)other).CompareTag("Enemy"))
		{
			UpdateCount(1);
		}
	}

	private void OnTriggerExit(Collider other)
	{
		if (((Component)other).CompareTag("Player") || ((Component)other).CompareTag("Enemy"))
		{
			UpdateCount(-1);
		}
	}

	private void UpdateCount(int update)
	{
		inTriggerCount += update;
		if (inTriggerCount == 1 && !isOpen)
		{
			if (inverseOpenAndClose)
			{
				CloseDoorServerRpc();
			}
			else
			{
				OpenDoorServerRpc();
			}
			isOpen = true;
		}
		else if (inTriggerCount == 0 && isOpen)
		{
			if (inverseOpenAndClose)
			{
				OpenDoorServerRpc();
			}
			else
			{
				CloseDoorServerRpc();
			}
			isOpen = false;
		}
	}

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

	[RuntimeInitializeOnLoadMethod]
	internal static void InitializeRPCS_FunnyDoor()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Expected O, but got Unknown
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Expected O, but got Unknown
		NetworkManager.__rpc_func_table.Add(3143191769u, new RpcReceiveHandler(__rpc_handler_3143191769));
		NetworkManager.__rpc_func_table.Add(4065661993u, new RpcReceiveHandler(__rpc_handler_4065661993));
		NetworkManager.__rpc_func_table.Add(4222948552u, new RpcReceiveHandler(__rpc_handler_4222948552));
		NetworkManager.__rpc_func_table.Add(1431199571u, new RpcReceiveHandler(__rpc_handler_1431199571));
	}

	private static void __rpc_handler_3143191769(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;
			((FunnyDoor)(object)target).OpenDoorServerRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_4065661993(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;
			((FunnyDoor)(object)target).OpenDoorClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_4222948552(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;
			((FunnyDoor)(object)target).CloseDoorServerRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_1431199571(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;
			((FunnyDoor)(object)target).CloseDoorClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "FunnyDoor";
	}
}
public class MoveBackAndForth : MonoBehaviour
{
	[SerializeField]
	private Vector3 frequency;

	[SerializeField]
	private Vector3 magnitude;

	[SerializeField]
	private Vector3 offset;

	private void Update()
	{
		//IL_009e: 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)
		float num = Mathf.Sin(Time.time * frequency.x + offset.x) * magnitude.x;
		float num2 = Mathf.Sin(Time.time * frequency.y + offset.y) * magnitude.y;
		float num3 = Mathf.Sin(Time.time * frequency.z + offset.z) * magnitude.z;
		Vector3 val = default(Vector3);
		((Vector3)(ref val))..ctor(num, num2, num3);
		((Component)this).transform.Translate(val * Time.deltaTime);
	}
}
public class MovingHall : NetworkBehaviour
{
	public enum State
	{
		Rotating,
		Moving
	}

	[Header("State")]
	public State stateType;

	[SerializeField]
	private Animator animator;

	private AudioSource audioSource;

	public int inTriggerCount = 0;

	private bool isOpen = false;

	public AudioClip rotateInSound;

	public AudioClip rotateOutSound;

	private void Start()
	{
		animator = ((Component)this).GetComponent<Animator>();
		audioSource = ((Component)this).GetComponent<AudioSource>();
		ChooseRandomStateServerRpc();
	}

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

	[ClientRpc]
	private void ChooseMovingStateClientRpc()
	{
		//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(4177774798u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4177774798u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				stateType = State.Moving;
				animator.SetTrigger("MoveIn");
			}
		}
	}

	[ClientRpc]
	private void ChooseRotatingStateClientRpc()
	{
		//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(4194608017u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4194608017u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				stateType = State.Rotating;
				animator.SetTrigger("RotateIn");
			}
		}
	}

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

	[ClientRpc]
	private void MoveHallInClientRpc()
	{
		//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(2741421546u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2741421546u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				animator.SetTrigger("MoveIn");
				audioSource.PlayOneShot(rotateInSound);
				isOpen = false;
			}
		}
	}

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

	[ClientRpc]
	private void MoveHallOutClientRpc()
	{
		//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(1636503903u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1636503903u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				animator.SetTrigger("MoveOut");
				audioSource.PlayOneShot(rotateOutSound);
				isOpen = true;
			}
		}
	}

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

	[ClientRpc]
	private void RotateHallInClientRpc()
	{
		//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(22915890u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 22915890u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				animator.SetTrigger("RotateIn");
				audioSource.PlayOneShot(rotateInSound);
				isOpen = false;
			}
		}
	}

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

	[ClientRpc]
	private void RotateHallOutClientRpc()
	{
		//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(3163489516u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3163489516u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				animator.SetTrigger("RotateOut");
				audioSource.PlayOneShot(rotateOutSound);
				isOpen = true;
			}
		}
	}

	private void OnTriggerEnter(Collider other)
	{
		if (((Component)other).CompareTag("Player") || ((Component)other).CompareTag("Enemy"))
		{
			UpdateCount(1);
		}
	}

	private void OnTriggerExit(Collider other)
	{
		if (((Component)other).CompareTag("Player") || ((Component)other).CompareTag("Enemy"))
		{
			UpdateCount(-1);
		}
	}

	private void UpdateCount(int update)
	{
		inTriggerCount += update;
		if (inTriggerCount == 1 && !isOpen)
		{
			TriggerOut();
		}
		else if (inTriggerCount == 0 && isOpen)
		{
			TriggerIn();
		}
	}

	private void TriggerOut()
	{
		if (stateType == State.Rotating)
		{
			RotateHallOutServerRpc();
		}
		else
		{
			MoveHallOutServerRpc();
		}
	}

	private void TriggerIn()
	{
		if (stateType == State.Rotating)
		{
			RotateHallInServerRpc();
		}
		else
		{
			MoveHallInServerRpc();
		}
	}

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

	[RuntimeInitializeOnLoadMethod]
	internal static void InitializeRPCS_MovingHall()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Expected O, but got Unknown
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Expected O, but got Unknown
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Expected O, but got Unknown
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Expected O, but got Unknown
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Expected O, but got Unknown
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Expected O, but got Unknown
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Expected O, but got Unknown
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Expected O, but got Unknown
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Expected O, but got Unknown
		NetworkManager.__rpc_func_table.Add(3014800413u, new RpcReceiveHandler(__rpc_handler_3014800413));
		NetworkManager.__rpc_func_table.Add(4177774798u, new RpcReceiveHandler(__rpc_handler_4177774798));
		NetworkManager.__rpc_func_table.Add(4194608017u, new RpcReceiveHandler(__rpc_handler_4194608017));
		NetworkManager.__rpc_func_table.Add(1691049414u, new RpcReceiveHandler(__rpc_handler_1691049414));
		NetworkManager.__rpc_func_table.Add(2741421546u, new RpcReceiveHandler(__rpc_handler_2741421546));
		NetworkManager.__rpc_func_table.Add(3398077963u, new RpcReceiveHandler(__rpc_handler_3398077963));
		NetworkManager.__rpc_func_table.Add(1636503903u, new RpcReceiveHandler(__rpc_handler_1636503903));
		NetworkManager.__rpc_func_table.Add(2298284086u, new RpcReceiveHandler(__rpc_handler_2298284086));
		NetworkManager.__rpc_func_table.Add(22915890u, new RpcReceiveHandler(__rpc_handler_22915890));
		NetworkManager.__rpc_func_table.Add(4027467699u, new RpcReceiveHandler(__rpc_handler_4027467699));
		NetworkManager.__rpc_func_table.Add(3163489516u, new RpcReceiveHandler(__rpc_handler_3163489516));
	}

	private static void __rpc_handler_3014800413(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;
			((MovingHall)(object)target).ChooseRandomStateServerRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_4177774798(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;
			((MovingHall)(object)target).ChooseMovingStateClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_4194608017(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;
			((MovingHall)(object)target).ChooseRotatingStateClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_1691049414(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;
			((MovingHall)(object)target).MoveHallInServerRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_2741421546(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;
			((MovingHall)(object)target).MoveHallInClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_3398077963(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;
			((MovingHall)(object)target).MoveHallOutServerRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_1636503903(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;
			((MovingHall)(object)target).MoveHallOutClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_2298284086(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;
			((MovingHall)(object)target).RotateHallInServerRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_22915890(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;
			((MovingHall)(object)target).RotateHallInClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_4027467699(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;
			((MovingHall)(object)target).RotateHallOutServerRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_3163489516(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;
			((MovingHall)(object)target).RotateHallOutClientRpc();
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "MovingHall";
	}
}
public class NormalTeleport : MonoBehaviour
{
	[SerializeField]
	private Transform telePoint;

	public void Teleport()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		GameNetworkManager.Instance.localPlayerController.TeleportPlayer(telePoint.position, false, 0f, false, true);
	}
}
public class PurpleIdol : GrabbableObject
{
	private bool activated = false;

	[SerializeField]
	private Animator animator;

	[SerializeField]
	private AudioClip pickupSound;

	[SerializeField]
	private AudioSource pickupSource;

	public override void Start()
	{
		((GrabbableObject)this).Start();
	}

	public override void Update()
	{
		((GrabbableObject)this).Update();
		if (base.hasBeenHeld && !activated)
		{
			activated = true;
			pickupSource.PlayOneShot(pickupSound);
			animator.SetTrigger("Activate");
		}
	}

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

	protected internal override string __getTypeName()
	{
		return "PurpleIdol";
	}
}
public class RotateObject : MonoBehaviour
{
	public Vector3 rotationVelocity;

	private void Update()
	{
		//IL_0008: 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)
		((Component)this).transform.Rotate(rotationVelocity * Time.deltaTime, (Space)1);
	}
}
public class TarotCard : GrabbableObject
{
	public GameObject tarotLight;

	private Vector3 rotationVelocity;

	public override void Start()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		((GrabbableObject)this).Start();
		((Component)this).transform.rotation = new Quaternion(0f, 0f, 0f, 0f);
		rotationVelocity = new Vector3(0f, 8f, 0f);
	}

	public override void Update()
	{
		//IL_000f: 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_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		((GrabbableObject)this).Update();
		((Component)this).transform.Rotate(rotationVelocity * Time.deltaTime, (Space)1);
		if (base.hasBeenHeld && rotationVelocity == new Vector3(0f, 8f, 0f))
		{
			rotationVelocity = new Vector3(0f, 0f, 0f);
			tarotLight.SetActive(false);
		}
	}

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

	protected internal override string __getTypeName()
	{
		return "TarotCard";
	}
}
public class TartarusChestController : NetworkBehaviour
{
	[SerializeField]
	private AudioSource audioSource;

	public Transform detectArea;

	private bool openingChest = false;

	[SerializeField]
	private Transform instantiatePosition;

	public GameObject objectToSpawn;

	private Item objectToSpawnItem;

	private int scrapValueSpawned;

	[SerializeField]
	private Animator animator;

	private void Awake()
	{
		Debug.LogError((object)"ADDING THIS CHEST");
		TartarusInteriorController.Instance.chests.Add(((Component)this).gameObject);
	}

	public void ChestConfirmedOpenable(GameObject prop)
	{
		GameObject prop2 = prop;
		((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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)
			objectToSpawn = prop2;
			objectToSpawn.GetComponent<GrabbableObject>().targetFloorPosition = instantiatePosition.position;
			objectToSpawn.transform.rotation = Quaternion.identity;
			scrapValueSpawned = objectToSpawn.GetComponent<GrabbableObject>().scrapValue;
		}, 1f, delegate
		{
			prop2.gameObject.SetActive(false);
		}));
	}

	public void OpenChest()
	{
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		if (!openingChest)
		{
			if ((Object)(object)objectToSpawn == (Object)null)
			{
				Debug.LogError((object)"Tartarus (TartarusChestController) Error: Object to spawn is NULL. Please report this!");
			}
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			OpenChestServerRpc(new NetworkBehaviourReference((NetworkBehaviour)(object)localPlayerController));
		}
	}

	[ServerRpc(RequireOwnership = false)]
	public void OpenChestServerRpc(NetworkBehaviourReference playerRef)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2744617203u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref playerRef, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2744617203u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				SpawnItemClientRpc(playerRef, NetworkObjectReference.op_Implicit(objectToSpawn));
			}
		}
	}

	[ClientRpc]
	public void SpawnItemClientRpc(NetworkBehaviourReference playerRef, NetworkObjectReference objectSpawned)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
		{
			ClientRpcParams val = default(ClientRpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2027617925u, val, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref playerRef, default(ForNetworkSerializable));
			((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref objectSpawned, default(ForNetworkSerializable));
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2027617925u, val, (RpcDelivery)0);
		}
		if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
		{
			return;
		}
		NetworkBehaviourReference playerRef2 = playerRef;
		((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate
		{
			animator.SetTrigger("OpenChest");
			openingChest = true;
			audioSource.Play();
		}, 0.4f, delegate
		{
			List<int> list = new List<int>(RoundManager.Instance.currentLevel.spawnableScrap.Count);
			for (int i = 0; i < RoundManager.Instance.currentLevel.spawnableScrap.Count; i++)
			{
				if (RoundManager.Instance.currentLevel.spawnableScrap[i].spawnableItem.itemId == 152767)
				{
					list.Add(0);
				}
				else
				{
					list.Add(RoundManager.Instance.currentLevel.spawnableScrap[i].rarity);
				}
			}
			PlayerControllerB val3 = default(PlayerControllerB);
			((NetworkBehaviourReference)(ref playerRef2)).TryGet<PlayerControllerB>(ref val3, (NetworkManager)null);
			Transform val4 = ((((!((Object)(object)val3 != (Object)null) || !val3.isInElevator) && !StartOfRound.Instance.inShipPhase) || !((Object)(object)RoundManager.Instance.spawnedScrapContainer != (Object)null)) ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.spawnedScrapContainer);
			objectToSpawn.SetActive(true);
			openingChest = false;
		}));
	}

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

	[RuntimeInitializeOnLoadMethod]
	internal static void InitializeRPCS_TartarusChestController()
	{
		//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(2744617203u, new RpcReceiveHandler(__rpc_handler_2744617203));
		NetworkManager.__rpc_func_table.Add(2027617925u, new RpcReceiveHandler(__rpc_handler_2027617925));
	}

	private static void __rpc_handler_2744617203(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			NetworkBehaviourReference playerRef = default(NetworkBehaviourReference);
			((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref playerRef, default(ForNetworkSerializable));
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((TartarusChestController)(object)target).OpenChestServerRpc(playerRef);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_2027617925(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			NetworkBehaviourReference playerRef = default(NetworkBehaviourReference);
			((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref playerRef, default(ForNetworkSerializable));
			NetworkObjectReference objectSpawned = default(NetworkObjectReference);
			((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref objectSpawned, default(ForNetworkSerializable));
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((TartarusChestController)(object)target).SpawnItemClientRpc(playerRef, objectSpawned);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "TartarusChestController";
	}
}
public class TartarusInteriorController : MonoBehaviour
{
	public bool inVelvetRoom = false;

	[SerializeField]
	private AudioSource musicSource1;

	[SerializeField]
	private AudioSource musicSource2;

	public int currTartarusFloor = 0;

	public List<AudioClip> tartarusSongs = new List<AudioClip>();

	[SerializeField]
	private AudioClip velvetRoomSong;

	private PlayerControllerB player;

	[SerializeField]
	private float fadeSourceSpeed;

	[SerializeField]
	private float songMaxVolume;

	public List<GameObject> scrapTakenByChests = new List<GameObject>();

	public List<GameObject> chests = new List<GameObject>();

	private bool isPlayingSong1;

	private Coroutine fadeSourceCoroutine;

	public static TartarusInteriorController Instance { get; private set; }

	private void Awake()
	{
		Instance = this;
	}

	private void Start()
	{
		player = GameNetworkManager.Instance.localPlayerController;
		((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate
		{
		}, 5f, delegate
		{
			//IL_0051: 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)
			int num = 64;
			Debug.LogError((object)("Chests count: " + chests.Count));
			GrabbableObject val2 = default(GrabbableObject);
			foreach (GameObject chest in chests)
			{
				TartarusChestController component = chest.GetComponent<TartarusChestController>();
				Collider[] array = Physics.OverlapBox(component.detectArea.position, component.detectArea.localScale, Quaternion.identity, num);
				if (array.Length != 0)
				{
					Collider[] array2 = array;
					foreach (Collider val in array2)
					{
						if (!ScrapAlreadyTaken(((Component)val).gameObject) && ((Component)val).TryGetComponent<GrabbableObject>(ref val2) && !(val2.itemProperties.itemName == "Bus Stop Sign"))
						{
							scrapTakenByChests.Add(((Component)val2).gameObject);
							Debug.LogError((object)("Chest " + ((Object)chest).name + " is receiving prop: " + val2.itemProperties.itemName));
							component.ChestConfirmedOpenable(((Component)val2).gameObject);
							break;
						}
					}
				}
				if ((Object)(object)component.objectToSpawn == (Object)null)
				{
					chest.SetActive(false);
				}
			}
		}));
	}

	private void Update()
	{
		CheckIfStopSource();
	}

	public void UpdateTartarusFloor(GameObject volume)
	{
		currTartarusFloor = volume.GetComponent<TartarusVolumeController>().blockNum;
		ChangeSong(tartarusSongs[currTartarusFloor]);
	}

	private bool ScrapAlreadyTaken(GameObject scrap)
	{
		int num = 0;
		foreach (GameObject scrapTakenByChest in scrapTakenByChests)
		{
			if ((Object)(object)scrap == (Object)(object)scrapTakenByChest)
			{
				return true;
			}
			num++;
		}
		return false;
	}

	private void CheckIfStopSource()
	{
		if (isPlayingSong1)
		{
			if (player.isInsideFactory && !musicSource1.isPlaying)
			{
				musicSource1.Play();
			}
			else if (!player.isInsideFactory && musicSource1.isPlaying)
			{
				musicSource1.Stop();
			}
		}
		else if (player.isInsideFactory && !musicSource2.isPlaying)
		{
			musicSource2.Play();
		}
		else if (!player.isInsideFactory && musicSource2.isPlaying)
		{
			musicSource2.Stop();
		}
	}

	public void EnterVelvetRoom()
	{
		ChangeSong(velvetRoomSong);
	}

	public void ExitVelvetRoom()
	{
		ChangeSong(tartarusSongs[currTartarusFloor]);
	}

	public void ChangeSong(AudioClip newSong)
	{
		if (fadeSourceCoroutine != null)
		{
			((MonoBehaviour)this).StopCoroutine(fadeSourceCoroutine);
		}
		fadeSourceCoroutine = ((MonoBehaviour)this).StartCoroutine(FadeSource(newSong));
		isPlayingSong1 = !isPlayingSong1;
	}

	private IEnumerator FadeSource(AudioClip newSong)
	{
		float timeToFade = fadeSourceSpeed;
		float timeElapsed = 0f;
		if (isPlayingSong1)
		{
			musicSource2.clip = newSong;
			musicSource2.Play();
			while (timeElapsed < timeToFade)
			{
				musicSource2.volume = Mathf.Lerp(0f, songMaxVolume, timeElapsed / timeToFade);
				musicSource1.volume = Mathf.Lerp(songMaxVolume, 0f, timeElapsed / timeToFade);
				timeElapsed += Time.deltaTime;
				yield return null;
			}
			musicSource2.volume = songMaxVolume;
			musicSource1.volume = 0f;
		}
		else
		{
			musicSource1.clip = newSong;
			musicSource1.Play();
			while (timeElapsed < timeToFade)
			{
				musicSource2.volume = Mathf.Lerp(songMaxVolume, 0f, timeElapsed / timeToFade);
				musicSource1.volume = Mathf.Lerp(0f, songMaxVolume, timeElapsed / timeToFade);
				timeElapsed += Time.deltaTime;
				yield return null;
			}
			musicSource2.volume = 0f;
			musicSource1.volume = songMaxVolume;
		}
	}
}
public class TartarusQuicksand : NetworkBehaviour
{
	public Animator handsTrapAnimator;

	public bool isWater;

	public bool isInsideWater;

	public int audioClipIndex;

	[Space(5f)]
	public bool sinkingLocalPlayer;

	public float movementHinderance = 1.6f;

	public float sinkingSpeedMultiplier = 0.15f;

	private void OnTriggerStay(Collider other)
	{
		if (isWater)
		{
			if (!((Component)other).gameObject.CompareTag("Player"))
			{
				return;
			}
			PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>();
			if ((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController && (Object)(object)component != (Object)null && (Object)(object)component.underwaterCollider != (Object)(object)this)
			{
				component.underwaterCollider = ((Component)this).gameObject.GetComponent<Collider>();
				return;
			}
		}
		if (!isWater && !((Component)other).gameObject.CompareTag("Player"))
		{
			return;
		}
		PlayerControllerB component2 = ((Component)other).gameObject.GetComponent<PlayerControllerB>();
		if ((Object)(object)component2 != (Object)(object)GameNetworkManager.Instance.localPlayerController)
		{
			return;
		}
		if (isWater)
		{
			if (sinkingLocalPlayer)
			{
				StopSinkingLocalPlayer(component2);
			}
			return;
		}
		if (isWater && !component2.isUnderwater)
		{
			component2.underwaterCollider = ((Component)this).gameObject.GetComponent<Collider>();
			component2.isUnderwater = true;
		}
		component2.statusEffectAudioIndex = audioClipIndex;
		if (component2.isSinking)
		{
			return;
		}
		if (sinkingLocalPlayer)
		{
			if (!CheckConditionsForSinkingInQuicksand())
			{
				StopSinkingLocalPlayer(component2);
			}
		}
		else if (CheckConditionsForSinkingInQuicksand())
		{
			if ((Object)(object)handsTrapAnimator != (Object)null)
			{
				HandsTrapServerRpc(startSinking: true);
			}
			sinkingLocalPlayer = true;
			component2.sourcesCausingSinking++;
			component2.isMovementHindered++;
			component2.hinderedMultiplier *= movementHinderance;
			if (isWater)
			{
				component2.sinkingSpeedMultiplier = 0f;
			}
			else
			{
				component2.sinkingSpeedMultiplier = sinkingSpeedMultiplier;
			}
		}
	}

	[ServerRpc(RequireOwnership = false)]
	private void HandsTrapServerRpc(bool startSinking)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(802276439u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref startSinking, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 802276439u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				HandsTrapClientRpc(startSinking);
			}
		}
	}

	[ClientRpc]
	private void HandsTrapClientRpc(bool startSinking)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
		{
			ClientRpcParams val = default(ClientRpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4015755068u, val, (RpcDelivery)0);
			((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref startSinking, default(ForPrimitives));
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4015755068u, val, (RpcDelivery)0);
		}
		if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
		{
			if (startSinking)
			{
				handsTrapAnimator.SetTrigger("startSinking");
			}
			else
			{
				handsTrapAnimator.SetTrigger("stopSinking");
			}
		}
	}

	private void OnTriggerExit(Collider other)
	{
		OnExit(other);
	}

	public void OnExit(Collider other)
	{
		if (!sinkingLocalPlayer)
		{
			if (isWater && ((Component)other).CompareTag("Player") && !((Object)(object)((Component)other).gameObject.GetComponent<PlayerControllerB>() == (Object)(object)GameNetworkManager.Instance.localPlayerController))
			{
				((Component)other).gameObject.GetComponent<PlayerControllerB>().isUnderwater = false;
			}
		}
		else if (((Component)other).CompareTag("Player"))
		{
			PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>();
			if (!((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController))
			{
				StopSinkingLocalPlayer(component);
			}
		}
	}

	public void StopSinkingLocalPlayer(PlayerControllerB playerScript)
	{
		if (sinkingLocalPlayer)
		{
			if ((Object)(object)handsTrapAnimator != (Object)null)
			{
				HandsTrapServerRpc(startSinking: false);
			}
			sinkingLocalPlayer = false;
			playerScript.sourcesCausingSinking = Mathf.Clamp(playerScript.sourcesCausingSinking - 1, 0, 100);
			playerScript.isMovementHindered = Mathf.Clamp(playerScript.isMovementHindered - 1, 0, 100);
			playerScript.hinderedMultiplier = Mathf.Clamp(playerScript.hinderedMultiplier / movementHinderance, 1f, 100f);
			if (playerScript.isMovementHindered == 0 && isWater)
			{
				playerScript.isUnderwater = false;
			}
		}
	}

	public bool CheckConditionsForSinkingInQuicksand()
	{
		PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
		if (!localPlayerController.thisController.isGrounded)
		{
			return false;
		}
		if (localPlayerController.inSpecialInteractAnimation || Object.op_Implicit((Object)(object)localPlayerController.inAnimationWithEnemy) || localPlayerController.isClimbingLadder)
		{
			return false;
		}
		if ((Object)(object)localPlayerController.physicsParent != (Object)null)
		{
			return false;
		}
		if (localPlayerController.isInHangarShipRoom)
		{
			return false;
		}
		if (localPlayerController.isInElevator)
		{
			return false;
		}
		return true;
	}

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

	[RuntimeInitializeOnLoadMethod]
	internal static void InitializeRPCS_TartarusQuicksand()
	{
		//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(802276439u, new RpcReceiveHandler(__rpc_handler_802276439));
		NetworkManager.__rpc_func_table.Add(4015755068u, new RpcReceiveHandler(__rpc_handler_4015755068));
	}

	private static void __rpc_handler_802276439(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			bool startSinking = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref startSinking, default(ForPrimitives));
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((TartarusQuicksand)(object)target).HandsTrapServerRpc(startSinking);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_4015755068(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			bool startSinking = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref startSinking, default(ForPrimitives));
			target.__rpc_exec_stage = (__RpcExecStage)2;
			((TartarusQuicksand)(object)target).HandsTrapClientRpc(startSinking);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "TartarusQuicksand";
	}
}
public class TartarusTeleporter : NetworkBehaviour
{
	private Animator _animator;

	public GameObject teleporterVFX;

	public bool isEntranceToBuilding;

	private Transform exitPoint;

	public int entranceId;

	public StartOfRound playersManager;

	private bool initializedVariables;

	public int audioReverbPreset = -1;

	public AudioSource entrancePointAudio;

	private AudioSource exitPointAudio;

	public AudioClip[] doorAudios;

	public AudioClip firstTimeAudio;

	public int dungeonFlowId = -1;

	private InteractTrigger triggerScript;

	private float checkForEnemiesInterval;

	private bool enemyNearLastCheck;

	private bool gotExitPoint;

	private bool checkedForFirstTime;

	public float timeAtLastUse;

	public bool poweredOn;

	private void Awake()
	{
		playersManager = Object.FindObjectOfType<StartOfRound>();
		triggerScript = ((Component)this).gameObject.GetComponent<InteractTrigger>();
		checkForEnemiesInterval = 10f;
		_animator = ((Component)this).GetComponent<Animator>();
	}

	public bool FindExitPoint()
	{
		EntranceTeleport[] array = Object.FindObjectsOfType<EntranceTeleport>();
		for (int i = 0; i < array.Length; i++)
		{
			if (array[i].isEntranceToBuilding != isEntranceToBuilding && array[i].entranceId == entranceId)
			{
				if ((Object)(object)array[i].entrancePointAudio != (Object)null)
				{
					exitPointAudio = array