Decompiled source of Tartarus v1.3.0

plugins/com.github.Teaisnt.Tartarus.dll

Decompiled 17 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLevelLoader;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using com.github.Teaisnt.Tartarus.NetcodePatcher;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.github.Teaisnt.Tartarus")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0")]
[assembly: AssemblyProduct("com.github.Teaisnt.Tartarus")]
[assembly: AssemblyTitle("Tartarus")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace Tartarus
{
	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;

		private PurpleIdol purpleIdol;

		private Vector3 purpleIdolSpawnPosition;

		private bool startedFloodTrap;

		private float timeSinceAlive;

		private void Start()
		{
			CheckForIdol();
		}

		private void CheckForIdol()
		{
			((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate
			{
			}, 1f, delegate
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: 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)
				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_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			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;

		private bool canKill;

		public bool collidedWithPlayer;

		[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_002a: 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_00e6: 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(1235459733u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref playerRef, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1235459733u, 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_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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(30454083u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref playerRef, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 30454083u, 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(1235459733u, new RpcReceiveHandler(__rpc_handler_1235459733));
			NetworkManager.__rpc_func_table.Add(30454083u, new RpcReceiveHandler(__rpc_handler_30454083));
		}

		private static void __rpc_handler_1235459733(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_30454083(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;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		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_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: 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(1402955514u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1402955514u, 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(1847422185u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1847422185u, 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(1402955514u, new RpcReceiveHandler(__rpc_handler_1402955514));
			NetworkManager.__rpc_func_table.Add(1847422185u, new RpcReceiveHandler(__rpc_handler_1847422185));
		}

		private static void __rpc_handler_1402955514(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_1847422185(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;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "BreakableObject";
		}
	}
	public static class Extensions
	{
		public static void SetLayer(this GameObject obj, LayerMask layerMask, bool children)
		{
			//IL_0001: 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)
			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_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			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_0014: 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)
			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_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: 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_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_0009: 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_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: 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_0061: 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_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			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_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: 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)
			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_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			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_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_0010: 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_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_0010: 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_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_000f: 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)
			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_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_000f: 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)
			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_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_000f: 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)
			Vector3 position = trans.position;
			position.z = (relative ? (position.z + newZ) : newZ);
			trans.position = position;
		}

		public static bool IsSimilar(this Material mat, Material other)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			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;
			}
			if (mat.color == other.color)
			{
				return (Object)(object)val == (Object)(object)val2;
			}
			return false;
		}
	}
	public class Ext
	{
		public static void LoadSceneOffline(string sceneName)
		{
			SceneManager.LoadScene(sceneName);
		}

		public static Scene GetActiveScene()
		{
			//IL_0000: 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;

		private bool isOpen;

		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(2690358738u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2690358738u, 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(1347848462u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1347848462u, 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(4005796717u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4005796717u, 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(3045237554u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3045237554u, 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(2690358738u, new RpcReceiveHandler(__rpc_handler_2690358738));
			NetworkManager.__rpc_func_table.Add(1347848462u, new RpcReceiveHandler(__rpc_handler_1347848462));
			NetworkManager.__rpc_func_table.Add(4005796717u, new RpcReceiveHandler(__rpc_handler_4005796717));
			NetworkManager.__rpc_func_table.Add(3045237554u, new RpcReceiveHandler(__rpc_handler_3045237554));
		}

		private static void __rpc_handler_2690358738(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_1347848462(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_4005796717(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_3045237554(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;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "FunnyDoor";
		}
	}
	public class InteractAnimator : NetworkBehaviour
	{
		private Animator animator;

		private AudioSource audioSource;

		private bool isOpen;

		public AudioClip doorOpenSound;

		public AudioClip doorCloseSound;

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

		public void ToggleDoor()
		{
			ToggleDoorServerRpc();
		}

		[ServerRpc(RequireOwnership = false)]
		private void ToggleDoorServerRpc()
		{
			//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(1958622022u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1958622022u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ToggleDoorClientRpc();
				}
			}
		}

		[ClientRpc]
		private void ToggleDoorClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1815429160u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1815429160u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				isOpen = !isOpen;
				animator.SetBool("Opened", isOpen);
				if (isOpen && (Object)(object)doorOpenSound != (Object)null)
				{
					audioSource.PlayOneShot(doorOpenSound);
				}
				else if (!isOpen && (Object)(object)doorOpenSound != (Object)null)
				{
					audioSource.PlayOneShot(doorCloseSound);
				}
			}
		}

		[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(1712824035u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1712824035u, 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)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4254024752u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4254024752u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				animator.SetBool("Opened", true);
				if ((Object)(object)doorOpenSound != (Object)null)
				{
					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(466233496u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 466233496u, 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)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3101562087u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3101562087u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				animator.SetBool("Opened", false);
				if ((Object)(object)doorCloseSound != (Object)null)
				{
					audioSource.PlayOneShot(doorCloseSound);
				}
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_InteractAnimator()
		{
			//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
			NetworkManager.__rpc_func_table.Add(1958622022u, new RpcReceiveHandler(__rpc_handler_1958622022));
			NetworkManager.__rpc_func_table.Add(1815429160u, new RpcReceiveHandler(__rpc_handler_1815429160));
			NetworkManager.__rpc_func_table.Add(1712824035u, new RpcReceiveHandler(__rpc_handler_1712824035));
			NetworkManager.__rpc_func_table.Add(4254024752u, new RpcReceiveHandler(__rpc_handler_4254024752));
			NetworkManager.__rpc_func_table.Add(466233496u, new RpcReceiveHandler(__rpc_handler_466233496));
			NetworkManager.__rpc_func_table.Add(3101562087u, new RpcReceiveHandler(__rpc_handler_3101562087));
		}

		private static void __rpc_handler_1958622022(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;
				((InteractAnimator)(object)target).ToggleDoorServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1815429160(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;
				((InteractAnimator)(object)target).ToggleDoorClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

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

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "InteractAnimator";
		}
	}
	public class MoveBackAndForth : MonoBehaviour
	{
		[SerializeField]
		private Vector3 frequency;

		[SerializeField]
		private Vector3 magnitude;

		[SerializeField]
		private Vector3 offset;

		private void Update()
		{
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			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;

		private bool isOpen;

		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(2715313328u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2715313328u, 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(279694926u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 279694926u, 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(1643055937u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1643055937u, 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(1697866694u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1697866694u, 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(452736862u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 452736862u, 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(839009823u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 839009823u, 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(756128656u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 756128656u, 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(2592273077u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2592273077u, 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(374958616u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 374958616u, 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(2217170805u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2217170805u, 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(1236911777u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1236911777u, 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(2715313328u, new RpcReceiveHandler(__rpc_handler_2715313328));
			NetworkManager.__rpc_func_table.Add(279694926u, new RpcReceiveHandler(__rpc_handler_279694926));
			NetworkManager.__rpc_func_table.Add(1643055937u, new RpcReceiveHandler(__rpc_handler_1643055937));
			NetworkManager.__rpc_func_table.Add(1697866694u, new RpcReceiveHandler(__rpc_handler_1697866694));
			NetworkManager.__rpc_func_table.Add(452736862u, new RpcReceiveHandler(__rpc_handler_452736862));
			NetworkManager.__rpc_func_table.Add(839009823u, new RpcReceiveHandler(__rpc_handler_839009823));
			NetworkManager.__rpc_func_table.Add(756128656u, new RpcReceiveHandler(__rpc_handler_756128656));
			NetworkManager.__rpc_func_table.Add(2592273077u, new RpcReceiveHandler(__rpc_handler_2592273077));
			NetworkManager.__rpc_func_table.Add(374958616u, new RpcReceiveHandler(__rpc_handler_374958616));
			NetworkManager.__rpc_func_table.Add(2217170805u, new RpcReceiveHandler(__rpc_handler_2217170805));
			NetworkManager.__rpc_func_table.Add(1236911777u, new RpcReceiveHandler(__rpc_handler_1236911777));
		}

		private static void __rpc_handler_2715313328(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_279694926(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_1643055937(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_1697866694(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_452736862(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_839009823(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_756128656(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_2592273077(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_374958616(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_2217170805(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_1236911777(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;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "MovingHall";
		}
	}
	internal class NormalShadowAI : EnemyAI
	{
		public enum State
		{
			Wander,
			Attack,
			Chase,
			Alert
		}

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

		public Transform turnCompass;

		public Transform attackArea;

		public ParticleSystem deathParticles;

		public float wanderMoveSpeed;

		public float chaseMoveSpeed;

		private float timeSinceNewRandPos;

		private float timeSinceAttacking;

		private float timeSinceAlerted;

		private Vector3 StalkPos;

		private Random enemyRandom;

		private bool isDeadAnimationDone;

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

		[Conditional("DEBUG")]
		private void LogIfDebugBuild(string text)
		{
		}

		public override void Start()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Start();
			base.creatureAnimator.SetTrigger("startWalk");
			timeSinceNewRandPos = 0f;
			timeSinceAlerted = 0f;
			enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex);
			isDeadAnimationDone = false;
			((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
		}

		public override void Update()
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Update();
			if (base.isEnemyDead)
			{
				if (!isDeadAnimationDone)
				{
					isDeadAnimationDone = true;
					StopSfxClientRpc();
					PlaySoundClientRpc(3);
				}
				return;
			}
			timeSinceAttacking += Time.deltaTime;
			timeSinceNewRandPos += Time.deltaTime;
			timeSinceAlerted += Time.deltaTime;
			if ((Object)(object)base.targetPlayer != (Object)null && (stateType == State.Chase || stateType == State.Attack))
			{
				turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position);
				((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime);
			}
		}

		public override void DoAIInterval()
		{
			//IL_0153: 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)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).DoAIInterval();
			if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead)
			{
				return;
			}
			switch (stateType)
			{
			case State.Wander:
				base.agent.speed = wanderMoveSpeed;
				if (FoundClosestPlayerInRange(25f, 1f))
				{
					((EnemyAI)this).StopSearch(base.currentSearch, true);
					DoAnimationClientRpc("alert");
					PlaySoundClientRpc(0);
					ChangeSfxClipClientRpc(6);
					timeSinceAlerted = 0f;
					ChangeStateClientRpc(State.Alert);
				}
				break;
			case State.Alert:
				base.agent.speed = 0f;
				if (timeSinceAlerted > 1f)
				{
					ChangeStateClientRpc(State.Chase);
				}
				break;
			case State.Chase:
				base.agent.speed = chaseMoveSpeed;
				if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 25f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)) || Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 50f)
				{
					((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
					ChangeStateClientRpc(State.Wander);
					ChangeSfxClipClientRpc(5);
					DoAnimationClientRpc("wander");
				}
				else
				{
					ChasingPlayer();
				}
				break;
			case State.Attack:
				break;
			}
		}

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

		[ClientRpc(/*Could not decode attribute arguments.*/)]
		public void ChangeSfxClipClientRpc(int clipNum)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1279912407u, val, (RpcDelivery)1);
					BytePacker.WriteValueBitPacked(val2, clipNum);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1279912407u, val, (RpcDelivery)1);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.creatureSFX.clip = audioClips[clipNum];
					base.creatureSFX.Play();
				}
			}
		}

		private bool FoundClosestPlayerInRange(float range, float senseRange)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f);
			if ((Object)(object)base.targetPlayer != (Object)null)
			{
				return Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range;
			}
			return false;
		}

		private bool TargetClosestPlayerInAnyCase()
		{
			//IL_001d: 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)
			base.mostOptimalDistance = 2000f;
			base.targetPlayer = null;
			for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++)
			{
				base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position);
				if (base.tempDist < base.mostOptimalDistance)
				{
					base.mostOptimalDistance = base.tempDist;
					base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i];
				}
			}
			if ((Object)(object)base.targetPlayer == (Object)null)
			{
				return false;
			}
			return true;
		}

		private void ChasingPlayer()
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)base.targetPlayer == (Object)null) && ((NetworkBehaviour)this).IsOwner)
			{
				if (enemyRandom.Next(0, 1) == 0 && timeSinceAttacking > 1f && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < 4f)
				{
					((MonoBehaviour)this).StartCoroutine(SwingAttack());
				}
				else
				{
					StalkPos = ((Component)base.targetPlayer).transform.position - ((Component)this).transform.forward * 2f;
				}
				((EnemyAI)this).SetDestinationToPosition(StalkPos, false);
			}
		}

		private IEnumerator SwingAttack()
		{
			timeSinceAttacking = 0f;
			ChangeStateClientRpc(State.Attack);
			PlaySoundClientRpc(1);
			yield return (object)new WaitForSeconds(0.5f);
			if (!base.isEnemyDead)
			{
				DoAnimationClientRpc("startAttack");
				yield return (object)new WaitForSeconds(0.3f);
				SwingAttackHitServerRpc();
				if (stateType == State.Attack)
				{
					ChangeStateClientRpc(State.Chase);
				}
			}
		}

		public override void OnCollideWithPlayer(Collider other)
		{
		}

		public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
			if (base.isEnemyDead)
			{
				return;
			}
			base.enemyHP -= force;
			PlaySoundClientRpc(2);
			if (((NetworkBehaviour)this).IsOwner)
			{
				if (base.enemyHP <= 0 && !base.isEnemyDead)
				{
					DeathServerRpc();
					((MonoBehaviour)this).StopCoroutine(SwingAttack());
					((MonoBehaviour)this).StopCoroutine(base.searchCoroutine);
					((EnemyAI)this).KillEnemyOnOwnerClient(false);
				}
				else
				{
					((MonoBehaviour)this).StartCoroutine(TakeDamage());
				}
			}
		}

		[ServerRpc]
		public void DeathServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3079537280u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3079537280u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				DeathClientRpc();
			}
		}

		[ClientRpc(/*Could not decode attribute arguments.*/)]
		public void DeathClientRpc()
		{
			//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: