Decompiled source of TelepathicObject v1.0.0

TelepathicObject.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using TelepathicObject.NetcodePatcher;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("TelepathicObject")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TelepathicObject")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("0d5a713e-12f0-4e0b-aa52-c73a0ed7dd01")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace TelepathicObject
{
	internal class Assets
	{
		public enum LoadStatusCode : ushort
		{
			Success,
			Failed,
			Exists
		}

		public static AssetBundle Bundle;

		public static Dictionary<string, GameObject> Prefabs = new Dictionary<string, GameObject>();

		public static readonly Dictionary<string, string> Manifest = new Dictionary<string, string>
		{
			{ "burer", "Assets/LethalCompany/Mods/TelepathicObject/Prefabs/burer.prefab" },
			{ "burerenemy", "Assets/LethalCompany/Mods/TelepathicObject/ScriptableObjects/burerenemy.asset" }
		};

		public static LoadStatusCode Load()
		{
			if ((Object)(object)Bundle != (Object)null)
			{
				return LoadStatusCode.Exists;
			}
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TelepathicObject");
			Bundle = AssetBundle.LoadFromFile(text);
			if ((Object)(object)Bundle == (Object)null)
			{
				Plugin.logger.LogInfo((object)("Failed to load asset bundle from path: " + text));
				return LoadStatusCode.Failed;
			}
			Plugin.logger.LogInfo((object)("Loaded asset bundle from path: " + text));
			string[] allAssetNames = Bundle.GetAllAssetNames();
			foreach (string text2 in allAssetNames)
			{
				Plugin.logger.LogDebug((object)("Found asset: " + text2));
			}
			foreach (KeyValuePair<string, string> item in Manifest)
			{
				Prefabs.Add(item.Key, Bundle.LoadAsset<GameObject>(item.Value));
			}
			return LoadStatusCode.Success;
		}

		public static GameObject SpawnPrefab(string name, Vector3 position)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (Prefabs.ContainsKey(name))
				{
					Plugin.logger.LogDebug((object)("Loading prefab '" + name + "'"));
					return Object.Instantiate<GameObject>(Prefabs[name], position, Quaternion.identity);
				}
				Plugin.logger.LogWarning((object)("Prefab " + name + " not found!"));
			}
			catch (Exception ex) when (ex is ArgumentException || ex is NullReferenceException)
			{
				Plugin.logger.LogError((object)ex.Message);
			}
			return null;
		}

		public static GameObject Get(string name)
		{
			if (Prefabs.ContainsKey(name))
			{
				return Prefabs[name];
			}
			return null;
		}
	}
	public class BurerAI : EnemyAI
	{
		public AISearchRoutine searchForPlayers;

		private float checkLineOfSightInterval;

		public float maxSearchAndRoamRadius = 100f;

		[Space(5f)]
		public float noticePlayerTimer;

		private bool hasEnteredChaseMode;

		private bool lostPlayerInChase;

		private bool beginningChasingThisClient;

		private Collider[] nearPlayerColliders;

		public AudioClip shortRoar;

		public AudioClip[] hitWallSFX;

		public AudioClip bitePlayerSFX;

		private Vector3 previousPosition;

		private float previousVelocity;

		private float averageVelocity;

		private float velocityInterval;

		private float velocityAverageCount;

		private float wallCollisionSFXDebounce;

		private float timeSinceHittingPlayer;

		public Transform mouthTarget;

		public AudioClip eatPlayerSFX;

		public AudioClip[] hitCrawlerSFX;

		public AudioClip[] longRoarSFX;

		public DeadBodyInfo currentlyHeldBody;

		private float agentSpeedWithNegative;

		private Vector3 lastPositionOfSeenPlayer;

		[Space(5f)]
		public float BaseAcceleration = 55f;

		public float SpeedAccelerationEffect = 2f;

		public float SpeedIncreaseRate = 5f;

		private float lastTimeHit;

		private float distanceToMelee = Config.BurerDistanceToMelee.Value;

		private float timerToNextTelepathicAttack;

		private float telepathicAttackTime = Config.BurerTelepathicAttackTime.Value;

		private bool isTelepathing;

		private bool isChasingOnPlayer;

		private bool isAttackingNowAsTelepathic;

		private float timerBeforeTelephaticAttack = 0.9f;

		private float timerBeforeSecondAttack;

		private bool isSecondAttackCasted;

		public AudioClip SearchingStageSFX;

		private float timerToNextCrySound;

		public AudioSource creatureSearchingSFX;

		private float speedInChase = Config.BurerSpeedInChase.Value;

		private int damagePerHitOnPlayer = Config.BurerDamagePerHitOnPlayer.Value;

		private bool DropItemsOnSecondAttack = Config.DropItemsInSecondAttack.Value;

		public override void Start()
		{
			((EnemyAI)this).Start();
			nearPlayerColliders = (Collider[])(object)new Collider[4];
		}

		public override void DoAIInterval()
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).DoAIInterval();
			if (StartOfRound.Instance.livingPlayers == 0 || base.isEnemyDead)
			{
				return;
			}
			switch (base.currentBehaviourStateIndex)
			{
			case 0:
				if (!searchForPlayers.inProgress)
				{
					((EnemyAI)this).StartSearch(((Component)this).transform.position, searchForPlayers);
				}
				break;
			case 1:
				CheckForVeryClosePlayer();
				if (lostPlayerInChase)
				{
					base.movingTowardsTargetPlayer = false;
					if (!searchForPlayers.inProgress)
					{
						searchForPlayers.searchWidth = 30f;
						((EnemyAI)this).StartSearch(lastPositionOfSeenPlayer, searchForPlayers);
					}
				}
				else if (searchForPlayers.inProgress)
				{
					((EnemyAI)this).StopSearch(searchForPlayers, true);
					isChasingOnPlayer = true;
					base.movingTowardsTargetPlayer = true;
				}
				break;
			}
		}

		public override void FinishedCurrentSearchRoutine()
		{
			((EnemyAI)this).FinishedCurrentSearchRoutine();
			searchForPlayers.searchWidth = Mathf.Clamp(searchForPlayers.searchWidth + 10f, 1f, maxSearchAndRoamRadius);
		}

		public override void Update()
		{
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_055d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0562: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c1: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Update();
			if (base.isEnemyDead)
			{
				return;
			}
			if (!((NetworkBehaviour)this).IsOwner)
			{
				base.inSpecialAnimation = false;
			}
			CalculateAgentSpeed();
			timeSinceHittingPlayer += Time.deltaTime;
			timerToNextTelepathicAttack -= Time.deltaTime;
			timerToNextCrySound -= Time.deltaTime;
			if (isAttackingNowAsTelepathic)
			{
				timerBeforeTelephaticAttack -= Time.deltaTime;
			}
			if (isSecondAttackCasted)
			{
				timerBeforeSecondAttack -= Time.deltaTime;
			}
			if (base.currentBehaviourStateIndex == 0)
			{
				if (timerToNextCrySound <= 0f)
				{
					PlaySearchingSoundServerRpc();
					timerToNextCrySound = 33f;
				}
			}
			else
			{
				StopSearchingSoundServerRpc();
				timerToNextCrySound = 0f;
			}
			if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)this).transform.position + Vector3.up * 0.25f, 80f, 25, 5f))
			{
				if (base.currentBehaviourStateIndex == 1)
				{
					GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 1f);
				}
				else
				{
					GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 0.5f);
				}
			}
			switch (base.currentBehaviourStateIndex)
			{
			case 0:
			{
				if (hasEnteredChaseMode)
				{
					hasEnteredChaseMode = false;
					searchForPlayers.searchWidth = 25f;
					beginningChasingThisClient = false;
					noticePlayerTimer = 0f;
					base.useSecondaryAudiosOnAnimatedObjects = false;
					base.openDoorSpeedMultiplier = 0.6f;
					base.agent.stoppingDistance = 0f;
					base.agent.speed = 7f;
				}
				if (checkLineOfSightInterval <= 0.05f)
				{
					checkLineOfSightInterval += Time.deltaTime;
					break;
				}
				checkLineOfSightInterval = 0f;
				PlayerControllerB val3;
				if ((Object)(object)base.stunnedByPlayer != (Object)null)
				{
					val3 = base.stunnedByPlayer;
					noticePlayerTimer = 1f;
				}
				else
				{
					val3 = ((EnemyAI)this).CheckLineOfSightForPlayer(45f, 30, -1);
				}
				if ((Object)(object)val3 == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					noticePlayerTimer = Mathf.Clamp(noticePlayerTimer + 0.05f, 0f, 10f);
					if (noticePlayerTimer > 0.2f && !beginningChasingThisClient)
					{
						beginningChasingThisClient = true;
						BeginChasingPlayerServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId);
						((EnemyAI)this).ChangeOwnershipOfEnemy(val3.actualClientId);
					}
				}
				else
				{
					noticePlayerTimer -= Time.deltaTime;
				}
				break;
			}
			case 1:
			{
				if (!hasEnteredChaseMode)
				{
					hasEnteredChaseMode = true;
					lostPlayerInChase = false;
					checkLineOfSightInterval = 0f;
					noticePlayerTimer = 0f;
					beginningChasingThisClient = false;
					base.useSecondaryAudiosOnAnimatedObjects = true;
					base.openDoorSpeedMultiplier = 1.5f;
					base.agent.stoppingDistance = 0.5f;
					base.agent.speed = 0f;
				}
				if (!((NetworkBehaviour)this).IsOwner || base.stunNormalizedTimer > 0f)
				{
					break;
				}
				if (checkLineOfSightInterval <= 0.075f)
				{
					checkLineOfSightInterval += Time.deltaTime;
					break;
				}
				checkLineOfSightInterval = 0f;
				if ((Object)(object)base.targetPlayer != (Object)null && (Object)(object)base.targetPlayer.deadBody != (Object)null && (Object)(object)base.targetPlayer.deadBody.grabBodyObject != (Object)null && base.targetPlayer.deadBody.grabBodyObject.grabbableToEnemies)
				{
					lostPlayerInChase = true;
				}
				if (base.inSpecialAnimation)
				{
					break;
				}
				if (lostPlayerInChase)
				{
					isTelepathing = false;
					PlayerControllerB val = ((EnemyAI)this).CheckLineOfSightForPlayer(45f, 30, -1);
					if (Object.op_Implicit((Object)(object)val))
					{
						noticePlayerTimer = 0f;
						lostPlayerInChase = false;
						MakeScreechNoiseServerRpc();
						if ((Object)(object)val != (Object)(object)base.targetPlayer)
						{
							((EnemyAI)this).SetMovingTowardsTargetPlayer(val);
							((EnemyAI)this).ChangeOwnershipOfEnemy(val.actualClientId);
						}
					}
					else
					{
						noticePlayerTimer -= 0.075f;
						if (noticePlayerTimer < -15f)
						{
							((EnemyAI)this).SwitchToBehaviourState(0);
						}
					}
					break;
				}
				PlayerControllerB val2 = ((EnemyAI)this).CheckLineOfSightForPlayer(65f, 80, -1);
				if ((Object)(object)val2 != (Object)null)
				{
					if ((Object)(object)val2 == (Object)(object)base.targetPlayer)
					{
						noticePlayerTimer = 0f;
						lastPositionOfSeenPlayer = ((Component)val2).transform.position;
					}
				}
				else
				{
					noticePlayerTimer += 0.075f;
					if (noticePlayerTimer > 1.8f)
					{
						lostPlayerInChase = true;
					}
				}
				if (!lostPlayerInChase)
				{
					if (Vector3.Distance(((Component)base.targetPlayer).transform.position, ((Component)this).transform.position) > distanceToMelee)
					{
						isTelepathing = true;
						TelepathicAttack((int)base.targetPlayer.actualClientId);
					}
					else
					{
						isTelepathing = false;
						base.movingTowardsTargetPlayer = true;
					}
				}
				break;
			}
			}
		}

		private void CalculateAgentSpeed()
		{
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			if (base.stunNormalizedTimer >= 0f)
			{
				base.agent.speed = 0.1f;
				base.agent.acceleration = 200f;
				base.creatureAnimator.SetBool("stunned", true);
				return;
			}
			base.creatureAnimator.SetBool("stunned", false);
			base.creatureAnimator.SetFloat("speedMultiplier", Mathf.Clamp(averageVelocity / 12f * 2.5f, 0.1f, 6f));
			Vector3 val = ((Component)this).transform.position - previousPosition;
			float num = ((Vector3)(ref val)).magnitude / (Time.deltaTime / 1.4f);
			if (velocityInterval <= 0f)
			{
				previousVelocity = averageVelocity;
				velocityInterval = 0.05f;
				velocityAverageCount += 1f;
				if (velocityAverageCount > 5f)
				{
					averageVelocity += (num - averageVelocity) / 3f;
				}
				else
				{
					averageVelocity += num;
					if (velocityAverageCount == 2f)
					{
						averageVelocity /= velocityAverageCount;
					}
				}
			}
			else
			{
				velocityInterval -= Time.deltaTime;
			}
			if (((NetworkBehaviour)this).IsOwner && averageVelocity - num > Mathf.Clamp(num * 0.17f, 2f, 100f) && num > 3f && base.currentBehaviourStateIndex == 1)
			{
				if (!(wallCollisionSFXDebounce > 0.5f) || ((NetworkBehaviour)this).IsServer)
				{
				}
				agentSpeedWithNegative *= 0.2f;
				wallCollisionSFXDebounce = 0f;
			}
			wallCollisionSFXDebounce += Time.deltaTime;
			previousPosition = ((Component)this).transform.position;
			if (base.currentBehaviourStateIndex == 0)
			{
				base.agent.speed = 6f;
				base.agent.acceleration = 26f;
			}
			else
			{
				if (base.currentBehaviourStateIndex != 1)
				{
					return;
				}
				if (!lostPlayerInChase)
				{
					if (isTelepathing)
					{
						if (timerToNextTelepathicAttack <= 0f)
						{
							base.agent.speed = 0.1f;
							base.agent.acceleration = 200f;
						}
						else if ((timerToNextTelepathicAttack <= telepathicAttackTime / 2f) & (timerToNextTelepathicAttack > 0f) & !isSecondAttackCasted)
						{
							base.agent.speed = 0.1f;
							base.agent.acceleration = 200f;
						}
						else if (timerBeforeSecondAttack <= 0f)
						{
							base.agent.speed = speedInChase;
							base.agent.acceleration = 70f;
						}
					}
					else
					{
						base.agent.speed = speedInChase;
						base.agent.acceleration = 70f;
					}
				}
				else
				{
					base.agent.speed = 6f;
					base.agent.acceleration = 26f;
				}
			}
		}

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

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

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

		[ClientRpc]
		public void PlaySearchingSoundClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3371805668u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3371805668u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					creatureSearchingSFX.Stop();
					creatureSearchingSFX.PlayOneShot(SearchingStageSFX);
					Debug.Log((object)"Burer: Playing crying sound, because searching players.");
				}
			}
		}

		public void TelepathicAttack(int targetPlayerId)
		{
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[targetPlayerId];
			if (!isTelepathing)
			{
				return;
			}
			if (timerToNextTelepathicAttack <= 0f)
			{
				if (!isAttackingNowAsTelepathic && !base.inSpecialAnimation)
				{
					TelepathicAttackAnimServerRpc((int)val.actualClientId);
				}
				isAttackingNowAsTelepathic = true;
				((Component)this).transform.rotation = Quaternion.LookRotation(((Component)val).transform.position - ((Component)this).transform.position);
				base.movingTowardsTargetPlayer = false;
				if (timerBeforeTelephaticAttack <= 0f)
				{
					ExplosionAttackServerRpc((int)val.actualClientId);
					timerToNextTelepathicAttack = telepathicAttackTime;
					TelepathicAttackSoundServerRpc((int)val.actualClientId);
					isAttackingNowAsTelepathic = false;
					timerBeforeTelephaticAttack = 0.9f;
					isSecondAttackCasted = false;
				}
			}
			else if ((timerToNextTelepathicAttack <= telepathicAttackTime / 2f) & (timerToNextTelepathicAttack > 0f) & !isSecondAttackCasted)
			{
				isSecondAttackCasted = true;
				timerBeforeSecondAttack = 1f;
				base.movingTowardsTargetPlayer = false;
				((Component)this).transform.rotation = Quaternion.LookRotation(((Component)val).transform.position - ((Component)this).transform.position);
				if (!base.inSpecialAnimation)
				{
					SecondAttackAnimServerRpc((int)val.actualClientId);
				}
				SecondAttackSoundServerRpc((int)val.actualClientId);
				if (DropItemsOnSecondAttack)
				{
					val.DropAllHeldItemsAndSync();
				}
				val.sprintMeter = 0.2f;
			}
			else if (timerBeforeSecondAttack <= 0f)
			{
				base.movingTowardsTargetPlayer = true;
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ExplosionAttackServerRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(826098742u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 826098742u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ExplosionAttackClientRpc(playerId);
				}
			}
		}

		[ClientRpc]
		public void ExplosionAttackClientRpc(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_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1550329930u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1550329930u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
					Landmine.SpawnExplosion(((Component)val3).transform.position + ((Component)val3).transform.forward * 0.2f, false, 0f, 3f, 0, 1f, (GameObject)null, false);
				}
			}
		}

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

		[ClientRpc]
		public void CollideWithWallClientRpc()
		{
			//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_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3854096757u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3854096757u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position);
				if (num < 15f)
				{
					HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
				}
				else if (num < 24f)
				{
					HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
				}
			}
		}

		private void CheckForVeryClosePlayer()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			if (Physics.OverlapSphereNonAlloc(((Component)this).transform.position, 1.5f, nearPlayerColliders, 8, (QueryTriggerInteraction)1) > 0)
			{
				PlayerControllerB component = ((Component)((Component)nearPlayerColliders[0]).transform).GetComponent<PlayerControllerB>();
				if ((Object)(object)component != (Object)null && (Object)(object)component != (Object)(object)base.targetPlayer && !Physics.Linecast(((Component)this).transform.position + Vector3.up * 0.3f, ((Component)component).transform.position, StartOfRound.Instance.collidersAndRoomMask))
				{
					base.targetPlayer = component;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void BeginChasingPlayerServerRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1552964997u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerObjectId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1552964997u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					BeginChasingPlayerClientRpc(playerObjectId);
				}
			}
		}

		[ClientRpc]
		public void BeginChasingPlayerClientRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2298455555u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerObjectId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2298455555u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					MakeScreech();
					((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1);
					((EnemyAI)this).SetMovingTowardsTargetPlayer(StartOfRound.Instance.allPlayerScripts[playerObjectId]);
					isChasingOnPlayer = true;
				}
			}
		}

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

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

		private void MakeScreech()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			int num = Random.Range(0, longRoarSFX.Length);
			base.creatureVoice.PlayOneShot(longRoarSFX[num]);
			WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, longRoarSFX[num], 1f);
			if (Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position) < 15f)
			{
				GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.75f, true);
			}
		}

		public override void OnCollideWithPlayer(Collider other)
		{
			//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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).OnCollideWithPlayer(other);
			if (timeSinceHittingPlayer < 0.65f)
			{
				return;
			}
			PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false);
			if (!((Object)(object)val != (Object)null))
			{
				return;
			}
			timeSinceHittingPlayer = 0f;
			((Component)this).transform.rotation = Quaternion.LookRotation(((Component)val).transform.position - ((Component)this).transform.position);
			base.agent.speed = 0f;
			val.DamagePlayer(damagePerHitOnPlayer, true, true, (CauseOfDeath)6, 0, false, default(Vector3));
			HitPlayerServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId);
			GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(1f, true);
			if (base.currentBehaviourStateIndex == 1)
			{
				if (!lostPlayerInChase && (Object)(object)base.targetPlayer == (Object)(object)val)
				{
					noticePlayerTimer = 0f;
				}
				else if (lostPlayerInChase)
				{
					noticePlayerTimer = 0f;
					lostPlayerInChase = false;
					MakeScreechNoiseServerRpc();
					if ((Object)(object)val != (Object)(object)base.targetPlayer)
					{
						((EnemyAI)this).SetMovingTowardsTargetPlayer(val);
						((EnemyAI)this).ChangeOwnershipOfEnemy(val.actualClientId);
					}
				}
			}
			else
			{
				beginningChasingThisClient = true;
				BeginChasingPlayerServerRpc((int)val.actualClientId);
				((EnemyAI)this).ChangeOwnershipOfEnemy(val.actualClientId);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SecondAttackSoundServerRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3544247570u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3544247570u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					SecondAttackSoundClientRpc(playerId);
				}
			}
		}

		[ClientRpc]
		public void SecondAttackSoundClientRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2522390208u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2522390208u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !base.inSpecialAnimation)
				{
					base.creatureVoice.PlayOneShot(hitCrawlerSFX[0]);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SecondAttackAnimServerRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2095037640u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2095037640u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					SecondAttackAnimClientRpc(playerId);
				}
			}
		}

		[ClientRpc]
		public void SecondAttackAnimClientRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2783170136u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2783170136u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !base.inSpecialAnimation)
				{
					DoAnimationClientRpc("HitPlayer");
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void TelepathicAttackSoundServerRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1544417760u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1544417760u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					TelepathicAttackSoundClientRpc(playerId);
				}
			}
		}

		[ClientRpc]
		public void TelepathicAttackSoundClientRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1186768308u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1186768308u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !base.inSpecialAnimation)
				{
					base.creatureVoice.PlayOneShot(bitePlayerSFX);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void TelepathicAttackAnimServerRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1234086307u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1234086307u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					TelepathicAttackAnimClientRpc(playerId);
				}
			}
		}

		[ClientRpc]
		public void TelepathicAttackAnimClientRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2193903316u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2193903316u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !base.inSpecialAnimation)
				{
					DoAnimationClientRpc("TelepathicAttack");
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void HitPlayerServerRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3324094318u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3324094318u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					HitPlayerClientRpc(playerId);
				}
			}
		}

		[ClientRpc]
		public void HitPlayerClientRpc(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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1209709130u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1209709130u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (!base.inSpecialAnimation)
				{
					base.creatureAnimator.SetTrigger("HitPlayer");
				}
				base.creatureVoice.PlayOneShot(bitePlayerSFX);
				agentSpeedWithNegative = Random.Range(-2f, 0.25f);
			}
		}

		public override void KillEnemy(bool destroy = false)
		{
			((EnemyAI)this).KillEnemy(false);
		}

		public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
			if (base.isEnemyDead)
			{
				return;
			}
			base.agent.speed = 2f;
			if (!base.inSpecialAnimation)
			{
				base.creatureAnimator.SetTrigger("HurtEnemy");
			}
			base.enemyHP -= force;
			agentSpeedWithNegative = Random.Range(-2.8f, -2f);
			lastTimeHit = Time.realtimeSinceStartup;
			averageVelocity = 0f;
			RoundManager.PlayRandomClip(base.creatureVoice, hitCrawlerSFX, true, 1f, 0, 1000);
			if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner)
			{
				((EnemyAI)this).KillEnemyOnOwnerClient(false);
			}
			if (base.enemyHP <= 0 || !((Object)(object)playerWhoHit != (Object)null))
			{
				return;
			}
			if (base.currentBehaviourStateIndex == 1)
			{
				if (!lostPlayerInChase && (Object)(object)base.targetPlayer == (Object)(object)playerWhoHit)
				{
					noticePlayerTimer = 0f;
				}
				else if (lostPlayerInChase)
				{
					noticePlayerTimer = 0f;
					lostPlayerInChase = false;
					MakeScreechNoiseServerRpc();
					if ((Object)(object)playerWhoHit != (Object)(object)base.targetPlayer)
					{
						((EnemyAI)this).SetMovingTowardsTargetPlayer(playerWhoHit);
						((EnemyAI)this).ChangeOwnershipOfEnemy(playerWhoHit.actualClientId);
					}
				}
			}
			else
			{
				beginningChasingThisClient = true;
				BeginChasingPlayerServerRpc((int)playerWhoHit.actualClientId);
				((EnemyAI)this).ChangeOwnershipOfEnemy(playerWhoHit.actualClientId);
			}
		}

		[ClientRpc]
		public void DoAnimationClientRpc(string animationName)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3632159987u, val, (RpcDelivery)0);
				bool flag = animationName != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(animationName, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3632159987u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				base.creatureAnimator.SetTrigger(animationName);
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_BurerAI()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Expected O, but got Unknown
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Expected O, but got Unknown
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Expected O, but got Unknown
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Expected O, but got Unknown
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Expected O, but got Unknown
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Expected O, but got Unknown
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Expected O, but got Unknown
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Expected O, but got Unknown
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Expected O, but got Unknown
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3463808627u, new RpcReceiveHandler(__rpc_handler_3463808627));
			NetworkManager.__rpc_func_table.Add(4176163219u, new RpcReceiveHandler(__rpc_handler_4176163219));
			NetworkManager.__rpc_func_table.Add(3150090968u, new RpcReceiveHandler(__rpc_handler_3150090968));
			NetworkManager.__rpc_func_table.Add(3371805668u, new RpcReceiveHandler(__rpc_handler_3371805668));
			NetworkManager.__rpc_func_table.Add(826098742u, new RpcReceiveHandler(__rpc_handler_826098742));
			NetworkManager.__rpc_func_table.Add(1550329930u, new RpcReceiveHandler(__rpc_handler_1550329930));
			NetworkManager.__rpc_func_table.Add(1080096194u, new RpcReceiveHandler(__rpc_handler_1080096194));
			NetworkManager.__rpc_func_table.Add(3854096757u, new RpcReceiveHandler(__rpc_handler_3854096757));
			NetworkManager.__rpc_func_table.Add(1552964997u, new RpcReceiveHandler(__rpc_handler_1552964997));
			NetworkManager.__rpc_func_table.Add(2298455555u, new RpcReceiveHandler(__rpc_handler_2298455555));
			NetworkManager.__rpc_func_table.Add(526103672u, new RpcReceiveHandler(__rpc_handler_526103672));
			NetworkManager.__rpc_func_table.Add(3523166295u, new RpcReceiveHandler(__rpc_handler_3523166295));
			NetworkManager.__rpc_func_table.Add(3544247570u, new RpcReceiveHandler(__rpc_handler_3544247570));
			NetworkManager.__rpc_func_table.Add(2522390208u, new RpcReceiveHandler(__rpc_handler_2522390208));
			NetworkManager.__rpc_func_table.Add(2095037640u, new RpcReceiveHandler(__rpc_handler_2095037640));
			NetworkManager.__rpc_func_table.Add(2783170136u, new RpcReceiveHandler(__rpc_handler_2783170136));
			NetworkManager.__rpc_func_table.Add(1544417760u, new RpcReceiveHandler(__rpc_handler_1544417760));
			NetworkManager.__rpc_func_table.Add(1186768308u, new RpcReceiveHandler(__rpc_handler_1186768308));
			NetworkManager.__rpc_func_table.Add(1234086307u, new RpcReceiveHandler(__rpc_handler_1234086307));
			NetworkManager.__rpc_func_table.Add(2193903316u, new RpcReceiveHandler(__rpc_handler_2193903316));
			NetworkManager.__rpc_func_table.Add(3324094318u, new RpcReceiveHandler(__rpc_handler_3324094318));
			NetworkManager.__rpc_func_table.Add(1209709130u, new RpcReceiveHandler(__rpc_handler_1209709130));
			NetworkManager.__rpc_func_table.Add(3632159987u, new RpcReceiveHandler(__rpc_handler_3632159987));
		}

		private static void __rpc_handler_3463808627(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;
				((BurerAI)(object)target).StopSearchingSoundServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_3150090968(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;
				((BurerAI)(object)target).PlaySearchingSoundServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_826098742(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;
				((BurerAI)(object)target).ExplosionAttackServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1550329930(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)2;
				((BurerAI)(object)target).ExplosionAttackClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1080096194(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;
				((BurerAI)(object)target).CollideWithWallServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_1552964997(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;
				((BurerAI)(object)target).BeginChasingPlayerServerRpc(playerObjectId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2298455555(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)2;
				((BurerAI)(object)target).BeginChasingPlayerClientRpc(playerObjectId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_526103672(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;
				((BurerAI)(object)target).MakeScreechNoiseServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_3544247570(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;
				((BurerAI)(object)target).SecondAttackSoundServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2522390208(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)2;
				((BurerAI)(object)target).SecondAttackSoundClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2095037640(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;
				((BurerAI)(object)target).SecondAttackAnimServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2783170136(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)2;
				((BurerAI)(object)target).SecondAttackAnimClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1544417760(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;
				((BurerAI)(object)target).TelepathicAttackSoundServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1186768308(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)2;
				((BurerAI)(object)target).TelepathicAttackSoundClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1234086307(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;
				((BurerAI)(object)target).TelepathicAttackAnimServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2193903316(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)2;
				((BurerAI)(object)target).TelepathicAttackAnimClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3324094318(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;
				((BurerAI)(object)target).HitPlayerServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1209709130(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)2;
				((BurerAI)(object)target).HitPlayerClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3632159987(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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string animationName = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((BurerAI)(object)target).DoAnimationClientRpc(animationName);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "BurerAI";
		}
	}
	public class Config
	{
		public static ConfigEntry<int> BurerSpawnWeight;

		public static ConfigEntry<float> BurerSpawnPower;

		public static ConfigEntry<int> BurerSpawnMax;

		public static ConfigEntry<string> BurerSpawnLevelsSet;

		public static ConfigEntry<string> BurerSpawnLevelsWithWeight;

		public static ConfigEntry<float> BurerDistanceToMelee;

		public static ConfigEntry<float> BurerTelepathicAttackTime;

		public static ConfigEntry<float> BurerSpeedInChase;

		public static ConfigEntry<int> BurerDamagePerHitOnPlayer;

		public static ConfigEntry<bool> DropItemsInSecondAttack;

		public static void Load()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Expected O, but got Unknown
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Expected O, but got Unknown
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected O, but got Unknown
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Expected O, but got Unknown
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Expected O, but got Unknown
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Expected O, but got Unknown
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Expected O, but got Unknown
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Expected O, but got Unknown
			BurerSpawnWeight = Plugin.config.Bind<int>("Spawn", "BurerSpawnWeight", 50, new ConfigDescription("What is the chance of the Burer spawning - higher values make it more common (this is like adding tickets to a lottery - it doesn't guarantee getting picked but it vastly increases the chances)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 99999), Array.Empty<object>()));
			BurerSpawnPower = Plugin.config.Bind<float>("Spawn", "BurerSpawnPower", 3f, new ConfigDescription("What's the spawn power of a Burer? How much does it subtract from the moon power pool on spawn?", (AcceptableValueBase)null, Array.Empty<object>()));
			BurerSpawnMax = Plugin.config.Bind<int>("Spawn", "BurerSpawnMax", 3, new ConfigDescription("What's the maximum amount of Burers that can spawn on a given moon?", (AcceptableValueBase)null, Array.Empty<object>()));
			BurerSpawnLevelsSet = Plugin.config.Bind<string>("Spawn", "BurerSpawnLevelsSet", "all", new ConfigDescription("Which set of levels should by default let the Burer spawn on them? (Options are: all/none/modded/vanilla)", (AcceptableValueBase)null, Array.Empty<object>()));
			BurerSpawnLevelsWithWeight = Plugin.config.Bind<string>("Spawn", "BurerSpawnLevels", "experimentation:25, assurance:75, vow:50, march:100, offense:150, titan:300", new ConfigDescription("Which specific moons/levels can the Burer spawn on and with what weight? (This takes priority over the level set config option - names are matched leniently and case insensitive)", (AcceptableValueBase)null, Array.Empty<object>()));
			BurerDistanceToMelee = Plugin.config.Bind<float>("Behavior", "BurerDistanceToMelee", 7.5f, new ConfigDescription("The distance at which the Burer stops fighting with telepathic attacks.", (AcceptableValueBase)null, Array.Empty<object>()));
			BurerTelepathicAttackTime = Plugin.config.Bind<float>("Behavior", "BurerTelepathicAttackTime", 6f, new ConfigDescription("The time it takes the Burer to complete both telepathic attacks (they are distributed evenly).", (AcceptableValueBase)null, Array.Empty<object>()));
			BurerSpeedInChase = Plugin.config.Bind<float>("Behavior", "BurerSpeedInChase", 6f, new ConfigDescription("Burer's movement speed in chase.", (AcceptableValueBase)null, Array.Empty<object>()));
			BurerDamagePerHitOnPlayer = Plugin.config.Bind<int>("Behavior", "BurerDamagePerHitOnPlayer", 10, new ConfigDescription("Damage dealt by the Burer per hit on the player.", (AcceptableValueBase)null, Array.Empty<object>()));
			DropItemsInSecondAttack = Plugin.config.Bind<bool>("Behavior", "DropItemsInSecondAttack", true, new ConfigDescription("An option that configures whether Burer can knock out all items from the player's inventory on the second attack. If you find this ability too unfair, or are tired of a rather rare bug where the player will lose the ability to interact with anything if they pick up an item at the exact moment when the Burer tries to throw items out of the player's inventory, you can disable this option.", (AcceptableValueBase)null, Array.Empty<object>()));
		}
	}
	[BepInPlugin("com.MrUnrealTeam.TelepathicObject", "TelepathicObject", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public const string ModGUID = "com.MrUnrealTeam.TelepathicObject";

		public const string ModName = "TelepathicObject";

		public const string ModVersion = "1.0.0";

		public static ManualLogSource logger;

		public static ConfigFile config;

		private readonly Harmony harmony = new Harmony("com.MrUnrealTeam.TelepathicObject");

		public void Awake()
		{
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			logger = ((BaseUnityPlugin)this).Logger;
			config = ((BaseUnityPlugin)this).Config;
			Config.Load();
			if (Assets.Load() != 0)
			{
				return;
			}
			EnemyType val = Assets.Bundle.LoadAsset<EnemyType>("Assets/LethalCompany/Mods/TelepathicObject/ScriptableObjects/burerenemy.asset");
			TerminalNode val2 = Assets.Bundle.LoadAsset<TerminalNode>("Assets/LethalCompany/Mods/TelepathicObject/ScriptableObjects/BurerFile.asset");
			TerminalKeyword val3 = Assets.Bundle.LoadAsset<TerminalKeyword>("Assets/LethalCompany/Mods/TelepathicObject/ScriptableObjects/TerminalKeyword_Burer.asset");
			NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab);
			val.PowerLevel = Config.BurerSpawnPower.Value;
			val.MaxCount = Config.BurerSpawnMax.Value;
			string[] source = new string[4] { "all", "modded", "vanilla", "none" };
			string text = source.FirstOrDefault((string s) => new string((from c in Config.BurerSpawnLevelsSet.Value.ToLower().ToCharArray()
				where !char.IsWhiteSpace(c)
				select c).ToArray()).Contains(s));
			LevelTypes val4 = (LevelTypes)1;
			switch (text)
			{
			case "all":
				val4 = (LevelTypes)(-1);
				break;
			case "modded":
				val4 = (LevelTypes)1024;
				break;
			case "vanilla":
				val4 = (LevelTypes)15356;
				break;
			}
			Dictionary<string, int> dictionary = new Dictionary<string, int>();
			string text2 = new string((from c in Config.BurerSpawnLevelsWithWeight.Value.ToLower().ToCharArray()
				where !char.IsWhiteSpace(c)
				select c).ToArray());
			string[] array = text2.Split(new char[1] { ',' });
			foreach (string text3 in array)
			{
				string[] array2 = text3.Split(new char[1] { ':' });
				if (array2.Length == 1)
				{
					dictionary.Add(array2[0], Config.BurerSpawnWeight.Value);
				}
				else
				{
					if (array2.Length != 2)
					{
						continue;
					}
					int num = 0;
					try
					{
						num = int.Parse(array2[1]);
					}
					catch (Exception ex)
					{
						if (ex is ArgumentException || ex is FormatException || ex is OverflowException)
						{
							logger.LogError((object)$"Failed to parse level/moon weight value: {ex}");
						}
						continue;
					}
					dictionary.Add(array2[0], num);
				}
			}
			Enemies.RegisterEnemy(val, Config.BurerSpawnWeight.Value, (LevelTypes)1, (SpawnType)0, val2, val3);
			Enemies.RemoveEnemyFromLevels(val, (LevelTypes)1, (string[])null);
			Enemies.RegisterEnemy(val, (SpawnType)0, new Dictionary<LevelTypes, int> { [val4] = Config.BurerSpawnWeight.Value }, dictionary, val2, val3);
			InitializeNetworkBehaviours();
			harmony.PatchAll();
		}

		private static void InitializeNetworkBehaviours()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
}
namespace TelepathicObject.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}