Decompiled source of TheEar v1.0.0

plugins/Reiko888.TheEar.dll

Decompiled 25 minutes ago
using System;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using Dawn.Utils;
using Dusk;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Reiko888.TheEar.NetcodePatcher;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Video;

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

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

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

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace TheEar
{
	public class AudioAnimationEventPlus : MonoBehaviour
	{
		[Serializable]
		public struct RandomClipPool
		{
			public AudioClip[] clips;
		}

		public AudioSource[] audioSources;

		public AudioClip[] audioClips;

		public RandomClipPool[] randomClipPools;

		public bool randomizePitch;

		public float minPitch = 0.8f;

		public float maxPitch = 1.2f;

		public bool playAudibleNoise = true;

		private AudioSource GetSource(int sourceIndex)
		{
			if (audioSources == null || audioSources.Length == 0)
			{
				return null;
			}
			int num = Mathf.Clamp(sourceIndex, 0, audioSources.Length - 1);
			return audioSources[num];
		}

		public void PlayClip(int clipIndex)
		{
			PlayClipOnSource(clipIndex, 0);
		}

		public void PlayClipString(string eventData)
		{
			string[] array = eventData.Split(',');
			if (array.Length == 2 && int.TryParse(array[0], out var result) && int.TryParse(array[1], out var result2))
			{
				PlayClipOnSource(result, result2);
			}
		}

		public void PlayClipOnSource(int clipIndex, int sourceIndex)
		{
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			if (audioClips == null || clipIndex >= audioClips.Length || (Object)(object)audioClips[clipIndex] == (Object)null)
			{
				return;
			}
			AudioSource source = GetSource(sourceIndex);
			if (!((Object)(object)source == (Object)null))
			{
				if (randomizePitch)
				{
					source.pitch = Random.Range(minPitch, maxPitch);
				}
				source.PlayOneShot(audioClips[clipIndex]);
				WalkieTalkie.TransmitOneShotAudio(source, audioClips[clipIndex], 1f);
				if (playAudibleNoise)
				{
					RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 10f, 0.65f, 0, false, 546);
				}
			}
		}

		public void PlayRandomClipFromPool(int poolIndex)
		{
			PlayRandomClipFromPoolOnSource(poolIndex, 0);
		}

		public void PlayRandomClipFromPoolString(string eventData)
		{
			string[] array = eventData.Split(',');
			if (array.Length == 2 && int.TryParse(array[0], out var result) && int.TryParse(array[1], out var result2))
			{
				PlayRandomClipFromPoolOnSource(result, result2);
			}
		}

		public void PlayRandomClipFromPoolOnSource(int poolIndex, int sourceIndex)
		{
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			if (randomClipPools == null || poolIndex >= randomClipPools.Length)
			{
				return;
			}
			AudioClip[] clips = randomClipPools[poolIndex].clips;
			if (clips == null || clips.Length == 0)
			{
				return;
			}
			AudioClip val = clips[Random.Range(0, clips.Length)];
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			AudioSource source = GetSource(sourceIndex);
			if (!((Object)(object)source == (Object)null))
			{
				if (randomizePitch)
				{
					source.pitch = Random.Range(minPitch, maxPitch);
				}
				source.PlayOneShot(val);
				WalkieTalkie.TransmitOneShotAudio(source, val, 1f);
				if (playAudibleNoise)
				{
					RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 10f, 0.65f, 0, false, 546);
				}
			}
		}
	}
	public class EarAI : EnemyAI, INoiseListener
	{
		public AudioSource footstepSFX;

		public AudioSource breathingSFX;

		public AudioSource tentacleSFX;

		public AudioSource distantSFX;

		public AudioClip[] distantScreaming;

		public AudioClip[] alertedScreaming;

		public AudioClip[] wanderingNoises;

		public AudioClip calmerBreathing;

		public AudioClip frenziedBreathing;

		public AudioClip mouthScream;

		public AudioClip[] goreClips;

		public AudioClip[] tentacleClips;

		public AudioClip[] enragedScreams;

		public AudioClip[] doorSlam;

		public GameObject tentacleL1Drop;

		public GameObject tentacleL2Drop;

		public GameObject tentacleRDrop;

		public GameObject tentacleMouthStink;

		public GameObject tentacleMouthStink2;

		public GameObject tentacleMouthStink3;

		public GameObject earCanalGunk;

		private int earHealth;

		private float wanderSpeed;

		private float investigateSpeed;

		private float dashSpeed;

		public AISearchRoutine wanderFacility;

		private Random enemyRandom;

		public Transform headPos;

		public Transform torsoPos;

		private float hearNoiseCooldown;

		public int suspicionLevel;

		private float noiseApproximation = 14f;

		private Vector3 previousPosition;

		private Vector3 lastHeardNoisePosition;

		private Vector3 noisePositionGuess;

		private bool hasStartedKillAnim;

		private float killAnimTime;

		private float debugLogTimer = 1f;

		private PlayerControllerB targetPlayerHolder;

		private Coroutine killPlayerCoroutine;

		private bool isEnraged;

		private float suspicionTimer;

		private RoundManager roundManager;

		private float lastHeardNoiseDistanceWhenHeard;

		private float wanderNoiseTimer;

		private float timeSinceHittingOtherEnemy;

		private float noiseOverwhelmAccumulator;

		private float overwhelmTimer;

		private bool hasScreamedOverwhelmed;

		private DoorLock[] cachedDoors;

		private float breakDoorTimer;

		private float slowTimer;

		private int previousState;

		private float hearingRangeMultiplier;

		private float wanderSearchWidth = 400f;

		private float wanderSearchPrecision = 15f;

		private float voiceOverwhelmMultiplier;

		private float normalOverwhelmMultiplier;

		private float voiceLoudnessThreshold = 0.5f;

		private float normalLoudnessThreshold = 1.5f;

		private float killCooldown;

		private float attackTransitionCooldown;

		private bool serverIsAttackingOrGrabbing;

		private bool isExecutingKill;

		private bool wasStunned;

		public override void Start()
		{
			((EnemyAI)this).Start();
			earHealth = ((AssetBundleLoader<EarContentHandler.EarAssets>)(object)ContentHandler<EarContentHandler>.Instance.earAssets).GetConfig<int>("Ear health").Value;
			wanderSpeed = ((AssetBundleLoader<EarContentHandler.EarAssets>)(object)ContentHandler<EarContentHandler>.Instance.earAssets).GetConfig<float>("Wander speed").Value;
			investigateSpeed = ((AssetBundleLoader<EarContentHandler.EarAssets>)(object)ContentHandler<EarContentHandler>.Instance.earAssets).GetConfig<float>("Investigating speed").Value;
			dashSpeed = ((AssetBundleLoader<EarContentHandler.EarAssets>)(object)ContentHandler<EarContentHandler>.Instance.earAssets).GetConfig<float>("Frenzied speed").Value;
			hearingRangeMultiplier = ((AssetBundleLoader<EarContentHandler.EarAssets>)(object)ContentHandler<EarContentHandler>.Instance.earAssets).GetConfig<float>("Hearing range multiplier").Value;
			voiceOverwhelmMultiplier = ((AssetBundleLoader<EarContentHandler.EarAssets>)(object)ContentHandler<EarContentHandler>.Instance.earAssets).GetConfig<float>("Voice overwhelm multiplier").Value;
			normalOverwhelmMultiplier = ((AssetBundleLoader<EarContentHandler.EarAssets>)(object)ContentHandler<EarContentHandler>.Instance.earAssets).GetConfig<float>("Normal overwhelm multiplier").Value;
			previousState = base.currentBehaviourStateIndex;
			if (wanderFacility != null)
			{
				wanderFacility.searchWidth = wanderSearchWidth;
				wanderFacility.searchPrecision = wanderSearchPrecision;
			}
			cachedDoors = Object.FindObjectsOfType<DoorLock>();
			roundManager = Object.FindObjectOfType<RoundManager>();
			enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex);
			base.enemyHP = earHealth;
			breathingSFX.clip = calmerBreathing;
			breathingSFX.Play();
		}

		public override void DoAIInterval()
		{
			((EnemyAI)this).DoAIInterval();
		}

		public override void Update()
		{
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0544: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0785: Unknown result type (might be due to invalid IL or missing references)
			//IL_0666: Unknown result type (might be due to invalid IL or missing references)
			//IL_05df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0683: Unknown result type (might be due to invalid IL or missing references)
			//IL_068e: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a83: Unknown result type (might be due to invalid IL or missing references)
			//IL_0834: Unknown result type (might be due to invalid IL or missing references)
			//IL_0840: Unknown result type (might be due to invalid IL or missing references)
			//IL_0873: Unknown result type (might be due to invalid IL or missing references)
			//IL_087e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0883: Unknown result type (might be due to invalid IL or missing references)
			//IL_0888: Unknown result type (might be due to invalid IL or missing references)
			//IL_088c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0896: Unknown result type (might be due to invalid IL or missing references)
			//IL_089b: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a5: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Update();
			if (base.isEnemyDead)
			{
				return;
			}
			if (killCooldown > 0f)
			{
				killCooldown -= Time.deltaTime;
			}
			if (previousState == 2 && base.currentBehaviourStateIndex != 2 && base.enemyBehaviourStates != null && base.enemyBehaviourStates.Length > 2 && base.enemyBehaviourStates[2].IsAnimTrigger)
			{
				base.creatureAnimator.ResetTrigger(base.enemyBehaviourStates[2].parameterString);
			}
			if (previousState == 0 && (base.currentBehaviourStateIndex == 1 || base.currentBehaviourStateIndex == 2) && (Object)(object)earCanalGunk != (Object)null)
			{
				ParticleSystem[] componentsInChildren = earCanalGunk.GetComponentsInChildren<ParticleSystem>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					componentsInChildren[i].Play();
				}
			}
			previousState = base.currentBehaviourStateIndex;
			if ((Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null && !GameNetworkManager.Instance.localPlayerController.isPlayerDead)
			{
				if (base.currentBehaviourStateIndex == 2)
				{
					if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)this).transform.position, 50f, 25, 10f, -1))
					{
						GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(1f, true);
					}
				}
				else if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)this).transform.position, 50f, 30, 5f, -1))
				{
					GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.25f, 0.3f);
				}
			}
			timeSinceHittingOtherEnemy += Time.deltaTime;
			if (breakDoorTimer > 0f)
			{
				breakDoorTimer -= Time.deltaTime;
			}
			if (slowTimer > 0f)
			{
				slowTimer -= Time.deltaTime;
			}
			noiseOverwhelmAccumulator = Mathf.Max(0f, noiseOverwhelmAccumulator - Time.deltaTime);
			if (overwhelmTimer > 0f)
			{
				overwhelmTimer -= Time.deltaTime;
				if (!hasScreamedOverwhelmed)
				{
					hasScreamedOverwhelmed = true;
					base.creatureVoice.PlayOneShot(enragedScreams[enemyRandom.Next(0, enragedScreams.Length)]);
				}
				base.creatureAnimator.SetBool("isOverwhelmed", true);
			}
			else
			{
				base.creatureAnimator.SetBool("isOverwhelmed", false);
			}
			debugLogTimer -= Time.deltaTime;
			if (debugLogTimer <= 0f)
			{
				debugLogTimer = 1f;
			}
			if (base.currentBehaviourStateIndex == 2 || base.currentBehaviourStateIndex == 3)
			{
				if ((Object)(object)breathingSFX.clip != (Object)(object)frenziedBreathing)
				{
					breathingSFX.clip = frenziedBreathing;
					breathingSFX.Play();
				}
			}
			else if ((Object)(object)breathingSFX.clip != (Object)(object)calmerBreathing)
			{
				breathingSFX.clip = calmerBreathing;
				breathingSFX.Play();
			}
			bool flag = base.currentBehaviourStateIndex == 2 || base.currentBehaviourStateIndex == 3;
			if (tentacleL1Drop.activeSelf != flag)
			{
				tentacleL1Drop.SetActive(flag);
			}
			if (tentacleL2Drop.activeSelf != flag)
			{
				tentacleL2Drop.SetActive(flag);
			}
			if (tentacleRDrop.activeSelf != flag)
			{
				tentacleRDrop.SetActive(flag);
			}
			bool flag2 = base.currentBehaviourStateIndex == 3;
			if (tentacleMouthStink.activeSelf != flag2)
			{
				tentacleMouthStink.SetActive(flag2);
			}
			if (tentacleMouthStink2.activeSelf != flag2)
			{
				tentacleMouthStink2.SetActive(flag2);
			}
			if (tentacleMouthStink3.activeSelf != flag2)
			{
				tentacleMouthStink3.SetActive(flag2);
			}
			hearNoiseCooldown -= Time.deltaTime;
			previousPosition = ((Component)this).transform.position;
			if (hasStartedKillAnim)
			{
				killAnimTime -= Time.deltaTime;
			}
			else
			{
				killAnimTime = 0f;
			}
			if (base.stunNormalizedTimer > 0f)
			{
				wasStunned = true;
				base.agent.speed = 0f;
				if ((Object)(object)base.creatureAnimator != (Object)null)
				{
					base.creatureAnimator.SetBool("stunned", true);
				}
				if (hasStartedKillAnim && ((NetworkBehaviour)this).IsServer)
				{
					StopKillAnimationServerRpc(-1);
				}
			}
			else
			{
				if ((Object)(object)base.creatureAnimator != (Object)null)
				{
					base.creatureAnimator.SetBool("stunned", false);
				}
				if (wasStunned)
				{
					wasStunned = false;
					if (((NetworkBehaviour)this).IsOwner)
					{
						if (suspicionLevel <= 1)
						{
							((EnemyAI)this).SwitchToBehaviourState(0);
						}
						else if (suspicionLevel <= 8)
						{
							string parameterString = base.enemyBehaviourStates[2].parameterString;
							if (base.enemyBehaviourStates[2].IsAnimTrigger)
							{
								base.creatureAnimator.ResetTrigger(parameterString);
							}
							((EnemyAI)this).SwitchToBehaviourState(1);
						}
						else
						{
							((EnemyAI)this).SwitchToBehaviourState(2);
						}
					}
				}
			}
			if ((base.currentBehaviourStateIndex == 3 || base.inSpecialAnimation) && ((NetworkBehaviour)this).IsOwner)
			{
				base.agent.speed = 0f;
				base.agent.velocity = Vector3.zero;
			}
			switch (base.currentBehaviourStateIndex)
			{
			case 0:
				if (((NetworkBehaviour)this).IsOwner)
				{
					if (base.stunNormalizedTimer <= 0f)
					{
						base.agent.speed = wanderSpeed;
					}
					else
					{
						base.agent.speed = 0f;
						base.agent.velocity = Vector3.zero;
					}
					if (((NetworkBehaviour)this).IsOwner && !wanderFacility.inProgress)
					{
						((EnemyAI)this).StartSearch(((Component)this).transform.position, wanderFacility);
					}
				}
				break;
			case 1:
				if (isEnraged)
				{
					isEnraged = false;
				}
				if (!((NetworkBehaviour)this).IsOwner)
				{
					break;
				}
				if (((NetworkBehaviour)this).IsOwner && wanderFacility.inProgress)
				{
					((EnemyAI)this).StopSearch(wanderFacility, true);
				}
				if (base.stunNormalizedTimer <= 0f)
				{
					base.agent.speed = investigateSpeed;
				}
				else
				{
					base.agent.speed = 0f;
					base.agent.velocity = Vector3.zero;
				}
				if (!base.agent.pathPending && Vector3.Distance(((Component)this).transform.position, base.agent.destination) < 3f)
				{
					SearchForPreviouslyHeardSound();
				}
				suspicionTimer -= Time.deltaTime;
				if (!(suspicionTimer <= 0f))
				{
					break;
				}
				suspicionTimer = 4f;
				suspicionLevel--;
				SyncSuspicionServerRpc(suspicionLevel);
				if (suspicionLevel <= 1)
				{
					((EnemyAI)this).SwitchToBehaviourState(0);
					if (((NetworkBehaviour)this).IsOwner && !((NetworkBehaviour)this).IsServer)
					{
						((EnemyAI)this).ChangeOwnershipOfEnemy(0uL);
					}
				}
				break;
			case 2:
				if (!((NetworkBehaviour)this).IsOwner)
				{
					break;
				}
				if (((NetworkBehaviour)this).IsOwner && wanderFacility.inProgress)
				{
					((EnemyAI)this).StopSearch(wanderFacility, true);
				}
				if (base.stunNormalizedTimer <= 0f)
				{
					base.agent.speed = dashSpeed;
				}
				else
				{
					base.agent.speed = 0f;
					base.agent.velocity = Vector3.zero;
				}
				if (breakDoorTimer <= 0f && cachedDoors != null)
				{
					DoorLock[] array = cachedDoors;
					foreach (DoorLock val in array)
					{
						if ((Object)(object)val == (Object)null)
						{
							continue;
						}
						AnimatedObjectTrigger component = ((Component)val).GetComponent<AnimatedObjectTrigger>();
						if (!((Object)(object)component != (Object)null) || !component.boolValue || val.isLocked)
						{
							GameObject gameObject = ((Component)((Component)((Component)((Component)val).transform.parent).transform.parent).transform.parent).gameObject;
							if (!Object.op_Implicit((Object)(object)gameObject.GetComponent<Rigidbody>()) && Vector3.Distance(((Component)this).transform.position, gameObject.transform.position) <= 4f)
							{
								breakDoorTimer = 1f;
								base.creatureAnimator.SetTrigger("breakDoor");
								Vector3 val2 = gameObject.transform.position - ((Component)this).transform.position;
								Vector3 force = ((Vector3)(ref val2)).normalized * 20f;
								BreakDoorServerRpc(NetworkObjectReference.op_Implicit(gameObject), force);
								break;
							}
						}
					}
				}
				if (!base.agent.pathPending && Vector3.Distance(((Component)this).transform.position, base.agent.destination) < 3f)
				{
					SearchForPreviouslyHeardSound();
				}
				suspicionTimer -= Time.deltaTime;
				if (!(suspicionTimer <= 0f))
				{
					break;
				}
				suspicionTimer = 3f;
				suspicionLevel--;
				SyncSuspicionServerRpc(suspicionLevel);
				if (suspicionLevel <= 8)
				{
					string parameterString2 = base.enemyBehaviourStates[2].parameterString;
					if (base.enemyBehaviourStates[2].IsAnimTrigger)
					{
						base.creatureAnimator.ResetTrigger(parameterString2);
					}
					((EnemyAI)this).SwitchToBehaviourState(1);
				}
				break;
			case 3:
				if (!base.inSpecialAnimation)
				{
					base.inSpecialAnimation = true;
				}
				break;
			}
			if (base.currentBehaviourStateIndex == 0 || base.currentBehaviourStateIndex == 1)
			{
				wanderNoiseTimer -= Time.deltaTime;
				if (wanderNoiseTimer <= 0f)
				{
					wanderNoiseTimer = Random.Range(8f, 15f);
					base.creatureSFX.PlayOneShot(wanderingNoises[enemyRandom.Next(0, wanderingNoises.Length)]);
				}
			}
			if (slowTimer > 0f)
			{
				base.agent.speed = 0.2f;
			}
			if (breakDoorTimer > 0f)
			{
				base.agent.speed = 0f;
			}
			if (overwhelmTimer > 0f)
			{
				base.agent.speed = 0.5f;
			}
			if (attackTransitionCooldown > 0f)
			{
				attackTransitionCooldown -= Time.deltaTime;
				if (((NetworkBehaviour)this).IsOwner)
				{
					base.agent.speed = 0f;
					base.agent.velocity = Vector3.zero;
				}
			}
		}

		private void SearchForPreviouslyHeardSound()
		{
			//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_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			Vector3 val = ((Component)this).transform.position;
			while (num < 5 && Vector3.Distance(val, ((Component)this).transform.position) < 8f)
			{
				num++;
				val = roundManager.GetRandomNavMeshPositionInRadius(lastHeardNoisePosition, 18f, default(NavMeshHit));
			}
			((EnemyAI)this).SetDestinationToPosition(val, false);
			noisePositionGuess = val;
		}

		public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesNoisePlayedInOneSpot = 0, int noiseID = 0)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).DetectNoise(noisePosition, noiseLoudness, timesNoisePlayedInOneSpot, noiseID);
			if (base.isEnemyDead || base.stunNormalizedTimer > 0f || hearNoiseCooldown > 0f || hasStartedKillAnim || noiseID == 546 || noiseID == 7 || timesNoisePlayedInOneSpot > 15)
			{
				return;
			}
			hearNoiseCooldown = 0.03f;
			float num = Vector3.Distance(((Component)this).transform.position, noisePosition);
			float num2 = hearingRangeMultiplier * noiseLoudness;
			if (Physics.Linecast(((Component)this).transform.position, noisePosition, 256))
			{
				noiseLoudness /= 2f;
				num2 /= 2f;
			}
			if (noiseLoudness < 0.25f)
			{
				return;
			}
			if (overwhelmTimer <= 0f)
			{
				if (noiseID == 75)
				{
					if (noiseLoudness >= voiceLoudnessThreshold)
					{
						noiseOverwhelmAccumulator += noiseLoudness * voiceOverwhelmMultiplier;
					}
				}
				else if (noiseLoudness >= normalLoudnessThreshold)
				{
					noiseOverwhelmAccumulator += noiseLoudness * normalOverwhelmMultiplier;
				}
				if (noiseOverwhelmAccumulator >= 5f)
				{
					noiseOverwhelmAccumulator = 0f;
					TriggerOverwhelmServerRpc();
				}
			}
			if (num < num2)
			{
				if (!((NetworkBehaviour)this).IsOwner)
				{
					((EnemyAI)this).ChangeOwnershipOfEnemy(NetworkManager.Singleton.LocalClientId);
				}
				if (base.currentBehaviourStateIndex < 2)
				{
					suspicionLevel = 9;
				}
				else
				{
					suspicionLevel++;
				}
				suspicionLevel = Mathf.Min(suspicionLevel, 10);
				SyncSuspicionServerRpc(suspicionLevel);
				Vector3 targetPosition = noisePosition;
				if (num > 2f)
				{
					targetPosition = RoundManager.Instance.GetRandomNavMeshPositionInRadius(noisePosition, num / noiseApproximation, default(NavMeshHit));
				}
				SyncNoiseTargetServerRpc(targetPosition, num);
			}
		}

		private void ApplyNoiseAlert(Vector3 targetPosition, float distanceToNoise)
		{
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			if (distanceToNoise < 8f)
			{
				if (base.currentBehaviourStateIndex < 2)
				{
					base.creatureVoice.PlayOneShot(enragedScreams[enemyRandom.Next(0, enragedScreams.Length)]);
					base.creatureSFX.PlayOneShot(alertedScreaming[enemyRandom.Next(0, alertedScreaming.Length)]);
					distantSFX.PlayOneShot(distantScreaming[enemyRandom.Next(0, distantScreaming.Length)]);
					((EnemyAI)this).SwitchToBehaviourState(2);
					suspicionLevel = 10;
					SyncSuspicionServerRpc(suspicionLevel);
					if (wanderFacility != null && wanderFacility.inProgress)
					{
						((EnemyAI)this).StopSearch(wanderFacility, true);
					}
				}
			}
			else if (suspicionLevel >= 5 && base.currentBehaviourStateIndex == 0)
			{
				base.creatureSFX.PlayOneShot(alertedScreaming[enemyRandom.Next(0, alertedScreaming.Length)]);
				distantSFX.PlayOneShot(distantScreaming[enemyRandom.Next(0, distantScreaming.Length)]);
				((EnemyAI)this).SwitchToBehaviourState(1);
				if (wanderFacility != null && wanderFacility.inProgress)
				{
					((EnemyAI)this).StopSearch(wanderFacility, true);
				}
			}
			((EnemyAI)this).SetDestinationToPosition(targetPosition, false);
		}

		public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			if (base.inSpecialAnimation && (Object)(object)playerWhoHit == (Object)(object)targetPlayerHolder)
			{
				return;
			}
			((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
			base.enemyHP -= force;
			base.creatureSFX.PlayOneShot(base.enemyType.hitBodySFX);
			base.creatureVoice.PlayOneShot(base.enemyType.hitEnemyVoiceSFX);
			if (((NetworkBehaviour)this).IsOwner)
			{
				if (base.enemyHP <= 0)
				{
					if ((Object)(object)footstepSFX != (Object)null && (Object)(object)base.creatureVoice != (Object)null)
					{
						footstepSFX.Stop();
						base.creatureVoice.Stop();
					}
					((EnemyAI)this).KillEnemyOnOwnerClient(false);
					return;
				}
				if (base.inSpecialAnimation && (Object)(object)playerWhoHit != (Object)(object)targetPlayerHolder)
				{
					StopKillAnimationServerRpc(((Object)(object)playerWhoHit != (Object)null) ? ((int)playerWhoHit.playerClientId) : (-1));
				}
			}
			if ((Object)(object)playerWhoHit != (Object)null && ((NetworkBehaviour)this).IsServer)
			{
				base.targetPlayer = playerWhoHit;
			}
		}

		public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1f, PlayerControllerB setStunnedByPlayer = null)
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer);
			if (!base.isEnemyDead && base.enemyType.canBeStunned && setToStunned && base.postStunInvincibilityTimer <= 0f)
			{
				base.creatureVoice.PlayOneShot(base.enemyType.stunSFX);
				if (((NetworkBehaviour)this).IsOwner)
				{
					base.agent.speed = 0f;
					base.agent.velocity = Vector3.zero;
				}
			}
		}

		public override void OnCollideWithPlayer(Collider other)
		{
			((EnemyAI)this).OnCollideWithPlayer(other);
			if (!(overwhelmTimer > 0f) && ((NetworkBehaviour)this).IsOwner && !(killCooldown > 0f) && !isExecutingKill)
			{
				PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, hasStartedKillAnim, false);
				if ((Object)(object)val != (Object)null && !hasStartedKillAnim && !base.inSpecialAnimation && !isExecutingKill && base.currentBehaviourStateIndex == 2)
				{
					GrabPlayerServerRpc((int)val.playerClientId);
				}
			}
		}

		public override void OnCollideWithEnemy(Collider other, EnemyAI collidedEnemy = null)
		{
			((EnemyAI)this).OnCollideWithEnemy(other, collidedEnemy);
			if (!(overwhelmTimer > 0f) && (Object)(object)collidedEnemy != (Object)null && (Object)(object)collidedEnemy.enemyType != (Object)(object)base.enemyType && !collidedEnemy.isEnemyDead && base.currentBehaviourStateIndex == 2)
			{
				slowTimer = 1f;
				if (collidedEnemy.enemyType.canDie && timeSinceHittingOtherEnemy >= 1f)
				{
					timeSinceHittingOtherEnemy = 0f;
					base.creatureAnimator.SetTrigger("attack");
					collidedEnemy.HitEnemy(2, (PlayerControllerB)null, true, -1);
					TriggerLocalCameraShake();
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void GrabPlayerServerRpc(int playerId)
		{
			//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)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val2 = default(ServerRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2806427261u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				((NetworkBehaviour)this).__endSendServerRpc(ref val, 2806427261u, val2, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			Debug.Log((object)$"EAR !!SERVER!!: Player grab  called playerId={playerId}, Atttack or grab?={serverIsAttackingOrGrabbing}, hasStartedKillAnim={hasStartedKillAnim}");
			if (serverIsAttackingOrGrabbing || hasStartedKillAnim || isExecutingKill)
			{
				Debug.Log((object)"EAR !!SERVER!!: G rab player early return due to active guard.");
				return;
			}
			PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
			if ((Object)(object)val3 == (Object)null || val3.isPlayerDead)
			{
				Debug.Log((object)$"EAR !!SERVER!!: Grab player early return. player is null or dead. isPlayerDead={val3?.isPlayerDead}");
				return;
			}
			Debug.Log((object)$"EAR !!SERVER!! Checking player health on server. playerHealth={val3.health}");
			if (val3.health < 80)
			{
				serverIsAttackingOrGrabbing = true;
				Debug.Log((object)"EAR !!SERVER!!: Health is below 80. Triggering tentacle slap attack");
				TriggerAttackClientRpc(playerId);
				((MonoBehaviour)this).StartCoroutine(ResetKillAnimFlagAfterDelay(3f));
			}
			else
			{
				serverIsAttackingOrGrabbing = true;
				hasStartedKillAnim = true;
				isExecutingKill = true;
				Debug.Log((object)"EAR !!SERVER!!: Health is 80 or above. Triggering Grab Execution.");
				GrabPlayerClientRpc(playerId);
			}
		}

		private IEnumerator ResetKillAnimFlagAfterDelay(float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			serverIsAttackingOrGrabbing = false;
			hasStartedKillAnim = false;
		}

		[ClientRpc]
		public void TriggerAttackClientRpc(int playerId)
		{
			//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)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(876775644u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 876775644u, val2, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				Debug.Log((object)$"!!EAR Client!!: Trigger attack called. IsOwner={((NetworkBehaviour)this).IsOwner}");
				base.creatureAnimator.SetTrigger("attack");
				TriggerLocalCameraShake();
				killCooldown = 3f;
				attackTransitionCooldown = 1.5f;
				PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
				if ((Object)(object)val3 == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					val3.DamagePlayer(100, true, true, (CauseOfDeath)6, 0, false, default(Vector3));
				}
				if (((NetworkBehaviour)this).IsOwner && !((NetworkBehaviour)this).IsServer)
				{
					((EnemyAI)this).ChangeOwnershipOfEnemy(0uL);
				}
			}
		}

		[ClientRpc]
		public void GrabPlayerClientRpc(int playerId)
		{
			//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)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(718832928u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 718832928u, val2, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				Debug.Log((object)$"!!EAR Client!!:Grab player called. playerId={playerId}, IsOwner={((NetworkBehaviour)this).IsOwner}");
				if (killPlayerCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(killPlayerCoroutine);
				}
				Debug.Log((object)"Grabbed player!");
				targetPlayerHolder = StartOfRound.Instance.allPlayerScripts[playerId];
				targetPlayerHolder.inAnimationWithEnemy = (EnemyAI)(object)this;
				base.inSpecialAnimation = true;
				hasStartedKillAnim = true;
				isExecutingKill = true;
				killCooldown = 3f;
				base.creatureAnimator.SetBool("isExecuting", true);
				if (((NetworkBehaviour)this).IsOwner)
				{
					((EnemyAI)this).SwitchToBehaviourState(3);
				}
				killPlayerCoroutine = ((MonoBehaviour)this).StartCoroutine(executionRoutine(targetPlayerHolder));
			}
		}

		private IEnumerator executionRoutine(PlayerControllerB targetPlayer)
		{
			if (((NetworkBehaviour)this).IsOwner)
			{
				base.agent.speed = 0f;
			}
			if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)targetPlayer)
			{
				targetPlayer.DamagePlayer(75, true, true, (CauseOfDeath)6, 1, false, default(Vector3));
			}
			targetPlayer.JumpToFearLevel(1f, true);
			float duration = 5f;
			float elapsed = 0f;
			while (elapsed < duration)
			{
				if (((NetworkBehaviour)this).IsOwner)
				{
					base.agent.speed = 0f;
					base.agent.velocity = Vector3.zero;
				}
				targetPlayer.JumpToFearLevel(1f, true);
				if ((Object)(object)targetPlayer == (Object)null)
				{
					if (((NetworkBehaviour)this).IsServer)
					{
						StopKillAnimationServerRpc(-1);
					}
					yield break;
				}
				if ((Object)(object)targetPlayer.inAnimationWithEnemy != (Object)(object)this)
				{
					if (((NetworkBehaviour)this).IsServer)
					{
						StopKillAnimationServerRpc(-1);
					}
					yield break;
				}
				if (targetPlayer.isPlayerDead)
				{
					if (((NetworkBehaviour)this).IsServer)
					{
						StopKillAnimationServerRpc(-1);
					}
					yield break;
				}
				if (!hasStartedKillAnim || !isExecutingKill || base.isEnemyDead)
				{
					yield break;
				}
				float num = Mathf.Clamp01(elapsed / 3f);
				float num2 = Mathf.Lerp(2f, 0f, num);
				Vector3 val = torsoPos.position + ((Component)this).transform.forward * num2;
				val.y = Mathf.Max(val.y, ((Component)this).transform.position.y);
				((Component)targetPlayer).transform.position = val;
				elapsed += Time.deltaTime;
				yield return null;
			}
			if (((NetworkBehaviour)this).IsServer)
			{
				KillFinishedServerRpc((int)targetPlayer.playerClientId);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void KillFinishedServerRpc(int playerId)
		{
			//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)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val2 = default(ServerRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2263388109u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				((NetworkBehaviour)this).__endSendServerRpc(ref val, 2263388109u, val2, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (hasStartedKillAnim || isExecutingKill)
				{
					KillFinishedClientRpc(playerId);
				}
			}
		}

		[ClientRpc]
		public void KillFinishedClientRpc(int playerId)
		{
			//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)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1878487708u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, playerId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 1878487708u, val2, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			if (playerId >= 0 && playerId < StartOfRound.Instance.allPlayerScripts.Length)
			{
				PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
				if ((Object)(object)val3 != (Object)null && (Object)(object)val3 == (Object)(object)GameNetworkManager.Instance.localPlayerController && !val3.isPlayerDead)
				{
					val3.DamagePlayer(100, true, true, (CauseOfDeath)6, 1, false, default(Vector3));
				}
			}
			if (killPlayerCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(killPlayerCoroutine);
			}
			hasStartedKillAnim = false;
			base.inSpecialAnimation = false;
			serverIsAttackingOrGrabbing = false;
			isExecutingKill = false;
			hearNoiseCooldown = 2f;
			killCooldown = 3f;
			Debug.Log((object)"EAR: Kill finished.");
			if ((Object)(object)targetPlayerHolder != (Object)null)
			{
				targetPlayerHolder.inAnimationWithEnemy = null;
				targetPlayerHolder = null;
			}
			base.creatureAnimator.SetBool("isExecuting", false);
			Debug.Log((object)$"!!EAR Client!!: Finished kill called. IsOwner={((NetworkBehaviour)this).IsOwner}, suspicionLevel={suspicionLevel}");
			if (((NetworkBehaviour)this).IsOwner && !((NetworkBehaviour)this).IsServer)
			{
				((EnemyAI)this).ChangeOwnershipOfEnemy(0uL);
			}
			if (suspicionLevel <= 1)
			{
				((EnemyAI)this).SwitchToBehaviourState(0);
			}
			else if (suspicionLevel <= 8)
			{
				string parameterString = base.enemyBehaviourStates[2].parameterString;
				if (base.enemyBehaviourStates[2].IsAnimTrigger)
				{
					base.creatureAnimator.ResetTrigger(parameterString);
				}
				((EnemyAI)this).SwitchToBehaviourState(1);
			}
			else
			{
				((EnemyAI)this).SwitchToBehaviourState(2);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void StopKillAnimationServerRpc(int hitterId)
		{
			//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)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1929216529u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, hitterId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 1929216529u, val2, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					StopKillAnimationClientRpc(hitterId);
				}
			}
		}

		[ClientRpc]
		public void StopKillAnimationClientRpc(int hitterId)
		{
			//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)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(599056750u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, hitterId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 599056750u, val2, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			if (killPlayerCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(killPlayerCoroutine);
			}
			if ((Object)(object)targetPlayerHolder != (Object)null)
			{
				targetPlayerHolder.inAnimationWithEnemy = null;
				targetPlayerHolder = null;
			}
			base.inSpecialAnimation = false;
			hasStartedKillAnim = false;
			serverIsAttackingOrGrabbing = false;
			isExecutingKill = false;
			killCooldown = 3f;
			base.creatureAnimator.SetBool("isExecuting", false);
			if (hitterId != -1)
			{
				PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[hitterId];
				if ((Object)(object)val3 != (Object)null && ((NetworkBehaviour)this).IsServer)
				{
					base.targetPlayer = val3;
				}
			}
			Debug.Log((object)$"!!EAR Client!!t: Stop kiill anim called. IsOwner={((NetworkBehaviour)this).IsOwner}, suspicionLevel={suspicionLevel}");
			if (((NetworkBehaviour)this).IsOwner && !((NetworkBehaviour)this).IsServer)
			{
				((EnemyAI)this).ChangeOwnershipOfEnemy(0uL);
			}
			if (suspicionLevel <= 1)
			{
				((EnemyAI)this).SwitchToBehaviourState(0);
			}
			else if (suspicionLevel <= 8)
			{
				string parameterString = base.enemyBehaviourStates[2].parameterString;
				if (base.enemyBehaviourStates[2].IsAnimTrigger)
				{
					base.creatureAnimator.ResetTrigger(parameterString);
				}
				((EnemyAI)this).SwitchToBehaviourState(1);
			}
			else
			{
				((EnemyAI)this).SwitchToBehaviourState(2);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SyncSuspicionServerRpc(int level)
		{
			//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)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2736450885u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, level);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 2736450885u, val2, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SyncSuspicionClientRpc(level);
				}
			}
		}

		[ClientRpc]
		public void SyncSuspicionClientRpc(int level)
		{
			//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)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1620945847u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val, level);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 1620945847u, val2, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (!((NetworkBehaviour)this).IsOwner)
				{
					suspicionLevel = level;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SyncNoiseTargetServerRpc(Vector3 targetPosition, float distanceToNoise)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2313721645u, val2, (RpcDelivery)0);
					((FastBufferWriter)(ref val)).WriteValueSafe(ref targetPosition);
					((FastBufferWriter)(ref val)).WriteValueSafe<float>(ref distanceToNoise, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 2313721645u, val2, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SyncNoiseTargetClientRpc(targetPosition, distanceToNoise);
				}
			}
		}

		[ClientRpc]
		public void SyncNoiseTargetClientRpc(Vector3 targetPosition, float distanceToNoise)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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_00f0: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val2 = default(ClientRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2452861004u, val2, (RpcDelivery)0);
					((FastBufferWriter)(ref val)).WriteValueSafe(ref targetPosition);
					((FastBufferWriter)(ref val)).WriteValueSafe<float>(ref distanceToNoise, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val, 2452861004u, val2, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					noisePositionGuess = targetPosition;
					lastHeardNoisePosition = targetPosition;
					lastHeardNoiseDistanceWhenHeard = distanceToNoise;
					ApplyNoiseAlert(targetPosition, distanceToNoise);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void TriggerOverwhelmServerRpc()
		{
			//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_00c1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3713719718u, val2, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 3713719718u, val2, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					TriggerOverwhelmClientRpc();
				}
			}
		}

		[ClientRpc]
		public void TriggerOverwhelmClientRpc()
		{
			//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_00c1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val2 = default(ClientRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3468562425u, val2, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val, 3468562425u, val2, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					overwhelmTimer = 4f;
					hasScreamedOverwhelmed = false;
				}
			}
		}

		[ClientRpc]
		public void CancelKillAnimationWithPlayerClientRpc(int playerObjectId)
		{
			//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)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val2 = default(ClientRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2310101679u, val2, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, playerObjectId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val, 2310101679u, val2, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					StartOfRound.Instance.allPlayerScripts[playerObjectId].inAnimationWithEnemy = null;
				}
			}
		}

		public override void KillEnemy(bool destroy = false)
		{
			((EnemyAI)this).KillEnemy(destroy);
			distantSFX.Stop();
			base.creatureSFX.Stop();
			tentacleSFX.Stop();
			breathingSFX.Stop();
			footstepSFX.Stop();
			tentacleL1Drop.SetActive(false);
			tentacleL2Drop.SetActive(false);
			tentacleRDrop.SetActive(false);
			tentacleMouthStink.SetActive(false);
			tentacleMouthStink2.SetActive(false);
			tentacleMouthStink3.SetActive(false);
			ParticleSystem[] componentsInChildren = earCanalGunk.GetComponentsInChildren<ParticleSystem>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				componentsInChildren[i].Stop();
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void BreakDoorServerRpc(NetworkObjectReference netObjRef, Vector3 force)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val2 = default(ServerRpcParams);
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(148886704u, val2, (RpcDelivery)0);
					((FastBufferWriter)(ref val)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val)).WriteValueSafe(ref force);
					((NetworkBehaviour)this).__endSendServerRpc(ref val, 148886704u, val2, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					BreakDoorClientRpc(netObjRef, force);
				}
			}
		}

		[ClientRpc]
		public void BreakDoorClientRpc(NetworkObjectReference netObjRef, Vector3 force)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1466543963u, val2, (RpcDelivery)0);
				((FastBufferWriter)(ref val)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable));
				((FastBufferWriter)(ref val)).WriteValueSafe(ref force);
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 1466543963u, val2, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				NetworkObject val3 = default(NetworkObject);
				if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null))
				{
					GameObject gameObject = ((Component)val3).gameObject;
					Rigidbody val4 = gameObject.AddComponent<Rigidbody>();
					AudioSource val5 = gameObject.AddComponent<AudioSource>();
					val5.PlayOneShot(doorSlam[enemyRandom.Next(0, doorSlam.Length)]);
					val5.spatialBlend = 1f;
					val5.maxDistance = 60f;
					val5.rolloffMode = (AudioRolloffMode)1;
					val5.volume = 3f;
					((MonoBehaviour)this).StartCoroutine(TurnOffC(val4, 0.12f));
					val4.AddForce(force, (ForceMode)1);
				}
			}
		}

		private IEnumerator TurnOffC(Rigidbody rigidbody, float time)
		{
			rigidbody.detectCollisions = false;
			yield return (object)new WaitForSeconds(time);
			rigidbody.detectCollisions = true;
			if (((NetworkBehaviour)this).IsServer)
			{
				Object.Destroy((Object)(object)((Component)rigidbody).gameObject, 5f);
			}
		}

		private void TriggerLocalCameraShake()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)HUDManager.Instance != (Object)null)
			{
				PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
				if ((Object)(object)localPlayerController != (Object)null && !localPlayerController.isPlayerDead && Vector3.Distance(((Component)this).transform.position, ((Component)localPlayerController).transform.position) < 15f)
				{
					HUDManager.Instance.ShakeCamera((ScreenShakeType)3);
				}
			}
		}

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

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Expected O, but got Unknown
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Expected O, but got Unknown
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Expected O, but got Unknown
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Expected O, but got Unknown
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(2806427261u, new RpcReceiveHandler(__rpc_handler_2806427261), "GrabPlayerServerRpc");
			((NetworkBehaviour)this).__registerRpc(876775644u, new RpcReceiveHandler(__rpc_handler_876775644), "TriggerAttackClientRpc");
			((NetworkBehaviour)this).__registerRpc(718832928u, new RpcReceiveHandler(__rpc_handler_718832928), "GrabPlayerClientRpc");
			((NetworkBehaviour)this).__registerRpc(2263388109u, new RpcReceiveHandler(__rpc_handler_2263388109), "KillFinishedServerRpc");
			((NetworkBehaviour)this).__registerRpc(1878487708u, new RpcReceiveHandler(__rpc_handler_1878487708), "KillFinishedClientRpc");
			((NetworkBehaviour)this).__registerRpc(1929216529u, new RpcReceiveHandler(__rpc_handler_1929216529), "StopKillAnimationServerRpc");
			((NetworkBehaviour)this).__registerRpc(599056750u, new RpcReceiveHandler(__rpc_handler_599056750), "StopKillAnimationClientRpc");
			((NetworkBehaviour)this).__registerRpc(2736450885u, new RpcReceiveHandler(__rpc_handler_2736450885), "SyncSuspicionServerRpc");
			((NetworkBehaviour)this).__registerRpc(1620945847u, new RpcReceiveHandler(__rpc_handler_1620945847), "SyncSuspicionClientRpc");
			((NetworkBehaviour)this).__registerRpc(2313721645u, new RpcReceiveHandler(__rpc_handler_2313721645), "SyncNoiseTargetServerRpc");
			((NetworkBehaviour)this).__registerRpc(2452861004u, new RpcReceiveHandler(__rpc_handler_2452861004), "SyncNoiseTargetClientRpc");
			((NetworkBehaviour)this).__registerRpc(3713719718u, new RpcReceiveHandler(__rpc_handler_3713719718), "TriggerOverwhelmServerRpc");
			((NetworkBehaviour)this).__registerRpc(3468562425u, new RpcReceiveHandler(__rpc_handler_3468562425), "TriggerOverwhelmClientRpc");
			((NetworkBehaviour)this).__registerRpc(2310101679u, new RpcReceiveHandler(__rpc_handler_2310101679), "CancelKillAnimationWithPlayerClientRpc");
			((NetworkBehaviour)this).__registerRpc(148886704u, new RpcReceiveHandler(__rpc_handler_148886704), "BreakDoorServerRpc");
			((NetworkBehaviour)this).__registerRpc(1466543963u, new RpcReceiveHandler(__rpc_handler_1466543963), "BreakDoorClientRpc");
			((EnemyAI)this).__initializeRpcs();
		}

		private static void __rpc_handler_2806427261(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).GrabPlayerServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_876775644(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).TriggerAttackClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_718832928(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).GrabPlayerClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2263388109(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).KillFinishedServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1878487708(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).KillFinishedClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1929216529(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int hitterId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref hitterId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).StopKillAnimationServerRpc(hitterId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_599056750(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int hitterId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref hitterId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).StopKillAnimationClientRpc(hitterId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2736450885(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int level = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref level);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).SyncSuspicionServerRpc(level);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1620945847(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int level = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref level);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).SyncSuspicionClientRpc(level);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2313721645(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 targetPosition = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPosition);
				float distanceToNoise = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref distanceToNoise, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).SyncNoiseTargetServerRpc(targetPosition, distanceToNoise);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2452861004(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 targetPosition = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPosition);
				float distanceToNoise = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref distanceToNoise, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).SyncNoiseTargetClientRpc(targetPosition, distanceToNoise);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3713719718(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;
				((EarAI)(object)target).TriggerOverwhelmServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3468562425(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;
				((EarAI)(object)target).TriggerOverwhelmClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2310101679(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerObjectId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerObjectId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).CancelKillAnimationWithPlayerClientRpc(playerObjectId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_148886704(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_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference netObjRef = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable));
				Vector3 force = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref force);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).BreakDoorServerRpc(netObjRef, force);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1466543963(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_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference netObjRef = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable));
				Vector3 force = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref force);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EarAI)(object)target).BreakDoorClientRpc(netObjRef, force);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "EarAI";
		}
	}
	internal class EarContentHandler : ContentHandler<EarContentHandler>
	{
		public class EarAssets : AssetBundleLoader<EarAssets>
		{
			[LoadFromBundle("TheEar.prefab")]
			public GameObject TheEar { get; private set; }

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

		internal EarAssets? earAssets;

		public EarContentHandler(DuskMod mod)
			: base(mod)
		{
			((ContentHandler)this).RegisterContent<EarAssets>("theear", ref earAssets, false);
		}
	}
	[BepInPlugin("reiko888.TheEar", "The Ear", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	internal class Plugin : BaseUnityPlugin
	{
		public const string modGUID = "reiko888.TheEar";

		public const string modName = "The Ear";

		public const string modVersion = "1.0.0";

		public static Plugin Instance = null;

		internal static ManualLogSource Logger = null;

		internal static readonly Harmony harmony = new Harmony("reiko888.TheEar");

		internal static DuskMod mod = null;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			Logger = ((BaseUnityPlugin)this).Logger;
			AssetBundle val = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "ear_container");
			mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val);
			mod.RegisterContentHandlers();
			harmony.PatchAll(Assembly.GetExecutingAssembly());
			Logger.LogInfo((object)"Plugin The Ear is loaded!");
		}
	}
	public class EarTerminalAssets : MonoBehaviour
	{
		public VideoClip bestiaryVideo;
	}
	[HarmonyPatch(typeof(Terminal))]
	internal class TerminalVideoInjectorPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void InjectVideo(Terminal __instance)
		{
			if ((Object)(object)ContentHandler<EarContentHandler>.Instance.earAssets.TheEar == (Object)null)
			{
				return;
			}
			EarTerminalAssets component = ContentHandler<EarContentHandler>.Instance.earAssets.TheEar.GetComponent<EarTerminalAssets>();
			if ((Object)(object)component == (Object)null || (Object)(object)component.bestiaryVideo == (Object)null)
			{
				return;
			}
			foreach (TerminalNode enemyFile in __instance.enemyFiles)
			{
				if ((Object)(object)enemyFile != (Object)null && ((Object)enemyFile).name == "The EarBestiaryNode")
				{
					enemyFile.displayVideo = component.bestiaryVideo;
					return;
				}
			}
			Plugin.Logger.LogWarning((object)"Could not find a TerminalNode named 'TheEarBestiaryNode' in the Bestiary.");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "Reiko888.TheEar";

		public const string PLUGIN_NAME = "The Ear";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace __GEN
{
	internal class NetworkVariableSerializationHelper
	{
		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeSerialization()
		{
		}
	}
}
namespace Reiko888.TheEar.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}