Decompiled source of Peepers v1.0.3

Peepers.dll

Decompiled 5 months ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using GameNetcodeStuff;
using HarmonyLib;
using LCPeeper.Properties;
using Microsoft.CodeAnalysis;
using Peepers.NetcodePatcher;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Audio;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Peepers")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Adds a new non-lethal monster to the game with unique mechanics and interactions.")]
[assembly: AssemblyFileVersion("1.0.3.0")]
[assembly: AssemblyInformationalVersion("1.0.3")]
[assembly: AssemblyProduct("Peepers")]
[assembly: AssemblyTitle("Peepers")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.3.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LCPeeper
{
	[BepInPlugin("x753.Peepers", "Peepers", "1.0.3")]
	public class Peeper : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(GameNetworkManager))]
		internal class GameNetworkManagerPatch
		{
			[HarmonyPatch("Start")]
			[HarmonyPostfix]
			private static void StartPatch()
			{
				((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>().AddNetworkPrefab(PeeperPrefab);
			}
		}

		private const string modGUID = "x753.Peepers";

		private const string modName = "Peepers";

		private const string modVersion = "1.0.3";

		private readonly Harmony harmony = new Harmony("x753.Peepers");

		private static Peeper Instance;

		public static GameObject PeeperPrefab;

		public static EnemyType PeeperType;

		public static TerminalNode PeeperFile;

		public static int PeeperCreatureID = 0;

		public static List<PeeperAI> PeeperList = new List<PeeperAI>();

		public static List<string> ignoreEnemies = new List<string> { "Peeper", "Manticoil", "Docile Locust Bees", "Girl", "Tulip Snake" };

		public static Dictionary<string, float> PeeperSpawnChances = new Dictionary<string, float>();

		public static int PeeperMinGroupSize;

		public static int PeeperMaxGroupSize;

		public static float PeeperWeight;

		private void Awake()
		{
			AssetBundle val = AssetBundle.LoadFromMemory(Resources.peeper);
			PeeperPrefab = val.LoadAsset<GameObject>("Assets/PeeperPrefab.prefab");
			PeeperType = val.LoadAsset<EnemyType>("Assets/PeeperType.asset");
			PeeperFile = val.LoadAsset<TerminalNode>("Assets/PeeperFile.asset");
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Peepers is loaded!");
			string value = ((BaseUnityPlugin)this).Config.Bind<string>("Spawn Rate", "Hourly Spawn Chance", "All:5,Titan:0,Embrion:0", "Comma-separated list of moons and numbers that determines the % chance of a group of peepers spawning every hour. The keyword 'All' will determine the spawn chance for all moons not listed").Value;
			string[] array = value.Split(',');
			string[] array2 = array;
			foreach (string text in array2)
			{
				string[] array3 = text.Split(':');
				if (array3.Length == 2)
				{
					string text2 = array3[0].ToLower();
					if (float.TryParse(array3[1], out var result))
					{
						PeeperSpawnChances.Add(text2, result);
					}
					else
					{
						Debug.Log((object)("Peepers config has an invalid float value for " + text2));
					}
				}
			}
			PeeperMinGroupSize = ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Minimum Peeper Group Size", 2, "The minimum number of peepers in a single group").Value;
			PeeperMaxGroupSize = ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Maximum Peeper Group Size", 4, "The maximum number of peepers in a single group").Value;
			PeeperWeight = ((BaseUnityPlugin)this).Config.Bind<float>("Peeper Settings", "Peeper Weight (lb)", 8f, "The weight of a single peeper in pounds.").Value / 105f;
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array4 = types;
			foreach (Type type in array4)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array5 = methods;
				foreach (MethodInfo methodInfo in array5)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
	[HarmonyPatch(typeof(Terminal))]
	internal class TerminalPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void StartPatch(Terminal __instance)
		{
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			Terminal val = Object.FindObjectOfType<Terminal>();
			if (!Object.op_Implicit((Object)(object)val.enemyFiles.Find((TerminalNode node) => node.creatureName == "Peepers")))
			{
				Peeper.PeeperCreatureID = val.enemyFiles.Count;
				Peeper.PeeperFile.creatureFileID = Peeper.PeeperCreatureID;
				val.enemyFiles.Add(Peeper.PeeperFile);
				TerminalKeyword val2 = val.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info");
				TerminalKeyword val3 = ScriptableObject.CreateInstance<TerminalKeyword>();
				val3.word = "peepers";
				val3.isVerb = false;
				val3.defaultVerb = val2;
				List<CompatibleNoun> list = val2.compatibleNouns.ToList();
				list.Add(new CompatibleNoun
				{
					noun = val3,
					result = Peeper.PeeperFile
				});
				val2.compatibleNouns = list.ToArray();
				List<TerminalKeyword> list2 = val.terminalNodes.allKeywords.ToList();
				list2.Add(val3);
				val.terminalNodes.allKeywords = list2.ToArray();
			}
		}
	}
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerPatch
	{
		[HarmonyPatch("AdvanceHourAndSpawnNewBatchOfEnemies")]
		[HarmonyPrefix]
		private static void AdvanceHourAndSpawnNewBatchOfEnemiesPatch(RoundManager __instance)
		{
			//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_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: 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)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			if (!Peeper.PeeperSpawnChances.TryGetValue(((Object)StartOfRound.Instance.currentLevel).name.ToLower().Replace("level", ""), out var value) && !Peeper.PeeperSpawnChances.TryGetValue("all", out value))
			{
				value = 0f;
			}
			float num = Random.Range(0f, 100f);
			if (num > value)
			{
				return;
			}
			GameObject[] array = GameObject.FindGameObjectsWithTag("OutsideAINode");
			Vector3 position = array[__instance.AnomalyRandom.Next(0, array.Length)].transform.position;
			position = __instance.GetRandomNavMeshPositionInRadius(position, 4f, default(NavMeshHit));
			int num2 = 0;
			bool flag = false;
			for (int i = 0; i < array.Length - 1; i++)
			{
				for (int j = 0; j < __instance.spawnDenialPoints.Length; j++)
				{
					flag = true;
					if (Vector3.Distance(position, __instance.spawnDenialPoints[j].transform.position) < 8f)
					{
						num2 = (num2 + 1) % array.Length;
						position = array[num2].transform.position;
						position = __instance.GetRandomNavMeshPositionInRadius(position, 4f, default(NavMeshHit));
						flag = false;
						break;
					}
				}
				if (flag)
				{
					break;
				}
			}
			int num3 = Random.Range(Peeper.PeeperMinGroupSize, Peeper.PeeperMaxGroupSize);
			for (int k = 0; k <= num3; k++)
			{
				RoundManager.Instance.SpawnEnemyGameObject(position, 0f, -1, Peeper.PeeperType);
				EnemyType peeperType = Peeper.PeeperType;
				peeperType.numberSpawned++;
				RoundManager instance = RoundManager.Instance;
				instance.currentDaytimeEnemyPower += 1f;
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		private static void AwakePatch(ref StartOfRound __instance)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Expected O, but got Unknown
			SelectableLevel[] levels = __instance.levels;
			foreach (SelectableLevel val in levels)
			{
				if (!val.DaytimeEnemies.Any((SpawnableEnemyWithRarity e) => (Object)(object)e.enemyType == (Object)(object)Peeper.PeeperType))
				{
					int rarity = 0;
					val.DaytimeEnemies.Add(new SpawnableEnemyWithRarity
					{
						enemyType = Peeper.PeeperType,
						rarity = rarity
					});
					break;
				}
			}
		}

		[HarmonyPatch("EndOfGame")]
		[HarmonyPrefix]
		private static void EndOfGamePatch(StartOfRound __instance, int bodiesInsured = 0, int connectedPlayersOnServer = 0, int scrapCollected = 0)
		{
			foreach (PeeperAI peeper in Peeper.PeeperList)
			{
				if (peeper.isAttached && (Object)(object)peeper.attachedPlayer != (Object)null && !peeper.attachedPlayer.isPlayerDead)
				{
					peeper.IsWeighted = false;
				}
			}
			Peeper.PeeperList = new List<PeeperAI>();
			PeeperAI.UsedAttachTargets = new List<Transform>();
		}
	}
	[HarmonyPatch(typeof(StunGrenadeItem))]
	internal class StunGrenadeItemPatch
	{
		[HarmonyPatch("StunExplosion")]
		[HarmonyPostfix]
		private static void StunExplosion(StunGrenadeItem __instance, Vector3 explosionPosition, bool affectAudio, float flashSeverityMultiplier, float enemyStunTime, float flashSeverityDistanceRolloff = 1f, bool isHeldItem = false, PlayerControllerB playerHeldBy = null, PlayerControllerB playerThrownBy = null, float addToFlashSeverity = 0f)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: 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_0060: 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_0075: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			if (!(Vector3.Distance(((Component)localPlayerController).transform.position, explosionPosition) < 16f) || (Vector3.Distance(((Component)localPlayerController).transform.position, explosionPosition) > 5f && (!isHeldItem || !((Object)(object)playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)) && Physics.Linecast(explosionPosition + Vector3.up * 0.5f, ((Component)localPlayerController.gameplayCamera).transform.position, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)))
			{
				return;
			}
			List<PeeperAI> list = new List<PeeperAI>(Peeper.PeeperList);
			foreach (PeeperAI item in list)
			{
				if ((Object)(object)item.attachedPlayer == (Object)(object)localPlayerController && ((NetworkBehaviour)item).IsOwner)
				{
					((EnemyAI)item).KillEnemyOnOwnerClient(false);
				}
			}
		}
	}
	[HarmonyPatch(typeof(SpringManAI))]
	internal class SpringManAIPatcher
	{
		[HarmonyPrefix]
		[HarmonyPatch("DoAIInterval")]
		private static void DoAllIntervalPrefix(ref SpringManAI __instance)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			if (PeeperAI.HasLineOfSightToPeeper(((Component)__instance).transform.position))
			{
				((EnemyAI)__instance).currentBehaviourStateIndex = 1;
			}
		}

		[HarmonyTranspiler]
		[HarmonyPatch("Update")]
		private static IEnumerable<CodeInstruction> Update_Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Expected O, but got Unknown
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: 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_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Expected O, but got Unknown
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			MethodInfo method = typeof(PeeperAI).GetMethod("HasLineOfSightToPeeper", BindingFlags.Static | BindingFlags.Public);
			MethodInfo method2 = typeof(SpringManAI).GetMethod("get_transform");
			MethodInfo method3 = typeof(Transform).GetMethod("get_position");
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 1; i < list.Count; i++)
			{
				if (!(list[i - 1].opcode != OpCodes.Ldc_I4_0) && !(list[i].opcode != OpCodes.Stloc_1))
				{
					list.Insert(i, new CodeInstruction(OpCodes.Or, (object)null));
					list.Insert(i, new CodeInstruction(OpCodes.Call, (object)method));
					list.Insert(i, new CodeInstruction(OpCodes.Callvirt, (object)method3));
					list.Insert(i, new CodeInstruction(OpCodes.Call, (object)method2));
					list.Insert(i, new CodeInstruction(OpCodes.Ldarg_0, (object)null));
					break;
				}
			}
			return list;
		}
	}
	[HarmonyPatch(typeof(SprayPaintItem))]
	internal class SprayPaintItemPatch
	{
		private static FieldInfo SprayMatIndex = typeof(SprayPaintItem).GetField("sprayCanMatsIndex", BindingFlags.Instance | BindingFlags.NonPublic);

		[HarmonyPatch("SprayPaintClientRpc")]
		[HarmonyPrefix]
		private static void SprayPaintClientRpcPatch(SprayPaintItem __instance, Vector3 sprayPos, Vector3 sprayRot)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Ray val = default(Ray);
				((Ray)(ref val))..ctor(sprayPos, sprayRot);
				RaycastHit val2 = default(RaycastHit);
				if (!Physics.Raycast(val, ref val2, 4f, 524288, (QueryTriggerInteraction)2) || !((Object)(object)((RaycastHit)(ref val2)).collider != (Object)null) || !(((Object)((RaycastHit)(ref val2)).collider).name == "PeeperSprayCollider"))
				{
					return;
				}
				PeeperAI component = ((Component)((Component)((RaycastHit)(ref val2)).collider).transform.parent.parent.parent.parent.parent.parent.parent).GetComponent<PeeperAI>();
				if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)component.attachedPlayer))
				{
					((Renderer)component.peeperMesh).materials[0].color = __instance.sprayCanMats[(int)SprayMatIndex.GetValue(__instance)].color;
					if (component.isAttached)
					{
						component.EjectFromPlayerServerRpc(component.attachedPlayer.actualClientId);
					}
				}
			}
			catch (Exception)
			{
			}
		}
	}
	[HarmonyPatch(typeof(FlashlightItem))]
	internal class FlashlightItemPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void UpdatePatch(FlashlightItem __instance)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			if (!((NetworkBehaviour)__instance).IsOwner || __instance.flashlightTypeID != 2 || !((GrabbableObject)__instance).isBeingUsed)
			{
				return;
			}
			Transform transform = ((Component)__instance.flashlightBulb).transform;
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(transform.position, transform.forward);
			RaycastHit[] array = Physics.RaycastAll(val, 32f, 1 << LayerMask.NameToLayer("ScanNode"));
			RaycastHit[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				RaycastHit val2 = array2[i];
				if (!(((Object)((RaycastHit)(ref val2)).collider).name == "PeeperScanNode"))
				{
					continue;
				}
				float num = Vector3.Angle(-((Ray)(ref val)).direction, ((RaycastHit)(ref val2)).transform.forward);
				if (num < 55f)
				{
					PeeperAI component = ((Component)((RaycastHit)(ref val2)).transform.parent.parent.parent.parent.parent.parent.parent).GetComponent<PeeperAI>();
					if ((Object)(object)component.attachedPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController)
					{
						break;
					}
					if (((NetworkBehaviour)component).IsOwner)
					{
						((EnemyAI)component).KillEnemyOnOwnerClient(false);
					}
					else
					{
						component.KillEnemyNetworked();
					}
				}
			}
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("KillPlayer")]
		[HarmonyPrefix]
		private static void KillPlayerPatch(PlayerControllerB __instance, Vector3 bodyVelocity, bool spawnBody = true, CauseOfDeath causeOfDeath = 0, int deathAnimation = 0)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Invalid comparison between Unknown and I4
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Invalid comparison between Unknown and I4
			List<PeeperAI> list = new List<PeeperAI>(Peeper.PeeperList);
			foreach (PeeperAI item in list)
			{
				if ((Object)(object)item.attachedPlayer == (Object)(object)__instance && ((NetworkBehaviour)item).IsOwner)
				{
					if ((int)causeOfDeath == 11 || (int)causeOfDeath == 3)
					{
						((EnemyAI)item).KillEnemyOnOwnerClient(false);
					}
					else
					{
						item.EjectFromPlayerServerRpc(__instance.playerClientId);
					}
				}
			}
		}

		[HarmonyPatch("DamagePlayer")]
		[HarmonyPrefix]
		private static void DamagePlayerPatch(PlayerControllerB __instance, int damageNumber, bool hasDamageSFX = true, bool callRPC = true, CauseOfDeath causeOfDeath = 0, int deathAnimation = 0, bool fallDamage = false, Vector3 force = default(Vector3))
		{
			List<PeeperAI> list = new List<PeeperAI>(Peeper.PeeperList);
			foreach (PeeperAI item in list)
			{
				if ((Object)(object)item.attachedPlayer == (Object)(object)__instance)
				{
					item.EjectFromPlayerServerRpc(__instance.playerClientId);
				}
			}
		}

		[HarmonyPatch("IShockableWithGun.ShockWithGun")]
		[HarmonyPrefix]
		private static void DamagePlayerPatch(PlayerControllerB __instance, PlayerControllerB shockedByPlayer)
		{
			List<PeeperAI> list = new List<PeeperAI>(Peeper.PeeperList);
			foreach (PeeperAI item in list)
			{
				if ((Object)(object)item.attachedPlayer == (Object)(object)__instance && ((NetworkBehaviour)item).IsOwner)
				{
					((EnemyAI)item).KillEnemyOnOwnerClient(false);
				}
			}
		}

		[HarmonyPatch("DropAllHeldItems")]
		[HarmonyPostfix]
		private static void DamagePlayerDropAllHeldItemsPatch(PlayerControllerB __instance, bool itemsFall = true, bool disconnecting = false)
		{
			if (__instance.carryWeight != 1f || __instance.isPlayerDead)
			{
				return;
			}
			List<PeeperAI> list = new List<PeeperAI>(Peeper.PeeperList);
			foreach (PeeperAI item in list)
			{
				if ((Object)(object)item.attachedPlayer == (Object)(object)__instance && item.isAttached && !((EnemyAI)item).isEnemyDead)
				{
					__instance.carryWeight += Peeper.PeeperWeight;
				}
			}
		}
	}
	public class PeeperAI : EnemyAI
	{
		[Header("General")]
		public GameObject creatureModel;

		public SkinnedMeshRenderer peeperMesh;

		public ScanNodeProperties scanNode;

		[Header("AI and Pathfinding")]
		public AISearchRoutine searchForPlayers;

		public float maxSearchAndRoamRadius = 100f;

		public float searchPrecisionValue = 5f;

		private int sightRange = 30;

		[Header("Constraints and Transforms")]
		public Transform attachTargetTransform;

		public static List<Transform> UsedAttachTargets = new List<Transform>();

		public Vector3 attachTargetTranslationOffset;

		public Vector3 attachTargetRotationOffset;

		public Transform eyeTransform;

		public Transform eyeOriginalTransform;

		public bool isAttached;

		public PlayerControllerB attachedPlayer;

		[Header("Colliders and Physics")]
		public SphereCollider attachCollider;

		public SphereCollider physicsCollider;

		public SphereCollider hitboxCollider;

		public Rigidbody physicsRigidbody;

		[Header("State Handling and Sync")]
		public float stateTimer;

		public float stateTimer2;

		public int stateCounter;

		[Header("Audio")]
		public AudioSource AttachSFXSource;

		public AudioClip walkSFX;

		public AudioClip runSFX;

		public AudioClip[] spotSFX;

		public AudioClip[] jumpSFX;

		public AudioClip[] attachSFX;

		public AudioClip[] deathSFX;

		public AudioClip[] ejectSFX;

		public AudioClip[] zapSFX;

		public AudioClip[] whisperSFX;

		public static float NextWhisperTime;

		[Header("Materials")]
		public Material baseMat;

		public Material paintedMat;

		public Material deadMat;

		public ParticleSystem deathParticles;

		[Header("Ragdoll")]
		private bool ragdollFrozen;

		public Rigidbody[] ragdollRigidbodies;

		public Collider[] ragdollColliders;

		private Vector3 agentLocalVelocity;

		private Vector3 previousPosition;

		private float velX;

		private float velZ;

		private float velXZ;

		private float footstepTimer;

		private Vector3 deathDirection = Vector3.zero;

		private float blinkTimer;

		private float blinkInterval;

		private bool isWeightedInternal;

		public bool IsWeighted
		{
			get
			{
				return isWeightedInternal;
			}
			set
			{
				if (value && !isWeightedInternal)
				{
					PlayerControllerB obj = attachedPlayer;
					obj.carryWeight += Peeper.PeeperWeight;
				}
				else if (!value && isWeightedInternal)
				{
					PlayerControllerB obj2 = attachedPlayer;
					obj2.carryWeight += 0f - Peeper.PeeperWeight;
					if (attachedPlayer.carryWeight < 1f)
					{
						attachedPlayer.carryWeight = 1f;
					}
				}
				isWeightedInternal = value;
			}
		}

		public override void Start()
		{
			((EnemyAI)this).Start();
			searchForPlayers.searchWidth = maxSearchAndRoamRadius;
			searchForPlayers.searchPrecision = searchPrecisionValue;
			Peeper.PeeperList.Add(this);
			AudioMixer diageticMixer = SoundManager.Instance.diageticMixer;
			base.creatureVoice.outputAudioMixerGroup = diageticMixer.FindMatchingGroups("SFX")[0];
			base.creatureSFX.outputAudioMixerGroup = diageticMixer.FindMatchingGroups("SFX")[0];
			AttachSFXSource.outputAudioMixerGroup = diageticMixer.FindMatchingGroups("SFX")[0];
			scanNode.creatureScanID = Peeper.PeeperCreatureID;
			SwitchBehaviourState(2);
		}

		public override void DoAIInterval()
		{
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			if (base.inSpecialAnimation)
			{
				return;
			}
			((EnemyAI)this).DoAIInterval();
			if (StartOfRound.Instance.livingPlayers == 0 || base.isEnemyDead)
			{
				return;
			}
			if (base.currentBehaviourStateIndex != 0)
			{
				if (searchForPlayers.inProgress)
				{
					((EnemyAI)this).StopSearch(searchForPlayers, true);
					base.movingTowardsTargetPlayer = true;
				}
			}
			else if (!searchForPlayers.inProgress)
			{
				((EnemyAI)this).StartSearch(((Component)this).transform.position, searchForPlayers);
			}
		}

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

		private void CalculateAnimationDirection()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			agentLocalVelocity = ((Component)this).transform.InverseTransformDirection(Vector3.ClampMagnitude(((Component)this).transform.position - previousPosition, 1f) / (Time.deltaTime * 2f));
			velX = Mathf.Lerp(velX, agentLocalVelocity.x, 5f * Time.deltaTime);
			velZ = Mathf.Lerp(velZ, 0f - agentLocalVelocity.z, 5f * Time.deltaTime);
			previousPosition = ((Component)this).transform.position;
			velXZ = Mathf.Sqrt(velX * velX + velZ * velZ);
			base.creatureAnimator.SetFloat("Speed", velXZ);
			float num = ((base.currentBehaviourStateIndex != 1 && base.currentBehaviourStateIndex != 5) ? 0.3335f : 0.3f);
			footstepTimer += Time.deltaTime;
			if (footstepTimer < num)
			{
				return;
			}
			footstepTimer = 0f;
			if ((double)velXZ > 0.15)
			{
				if (base.currentBehaviourStateIndex == 1)
				{
					PlayCreatureSFX(2);
				}
				else
				{
					PlayCreatureSFX(1);
				}
			}
		}

		private void PutCreatureOnGround()
		{
			//IL_0006: 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_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			if (!(base.agent.velocity.y > 5f))
			{
				base.creatureAnimator.SetBool("Grounded", true);
				base.creatureAnimator.SetBool("Jump", false);
				Ray val = default(Ray);
				((Ray)(ref val))..ctor(((Component)this).transform.position + Vector3.up, Vector3.down);
				RaycastHit val2 = default(RaycastHit);
				if (Physics.Raycast(val, ref val2, 2f, LayerMask.GetMask(new string[2] { "Room", "Colliders" }), (QueryTriggerInteraction)1))
				{
					creatureModel.transform.localPosition = new Vector3(0f, 0f - ((RaycastHit)(ref val2)).distance + 1f, 0f);
				}
			}
		}

		public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).HitEnemy(force, playerWhoHit, false, -1);
			base.enemyHP -= force;
			if ((Object)(object)playerWhoHit != (Object)null)
			{
				Vector3 val = ((Component)this).transform.position - ((Component)playerWhoHit).transform.position;
				deathDirection = ((Vector3)(ref val)).normalized;
			}
			if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner)
			{
				((EnemyAI)this).KillEnemyOnOwnerClient(false);
			}
		}

		public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1f, PlayerControllerB setStunnedByPlayer = null)
		{
			base.enemyHP--;
			if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner)
			{
				((EnemyAI)this).KillEnemyOnOwnerClient(false);
			}
		}

		public void KillEnemyNetworked()
		{
			if (((NetworkBehaviour)this).IsServer)
			{
				KillEnemyClientRpc();
			}
			else
			{
				KillEnemyServerRpc();
			}
		}

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

		[ClientRpc]
		public void KillEnemyClientRpc()
		{
			//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(2756874777u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2756874777u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					((EnemyAI)this).KillEnemy(false);
				}
			}
		}

		public override void KillEnemy(bool destroy = false)
		{
			//IL_004e: 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)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: 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_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).KillEnemy(false);
			base.creatureVoice.Stop();
			base.creatureSFX.Stop();
			PlayCreatureSFX(5);
			SwitchBehaviourState(7);
			base.isEnemyDead = true;
			Peeper.PeeperList.Remove(this);
			creatureModel.transform.localPosition = Vector3.zero;
			if (isAttached && (Object)(object)attachedPlayer != (Object)null)
			{
				EjectFromPlayer(attachedPlayer);
			}
			Color color = ((Renderer)peeperMesh).material.color;
			((Renderer)peeperMesh).materials = (Material[])(object)new Material[1] { deadMat };
			((Renderer)peeperMesh).materials[0].color = color;
			deathParticles.Play();
			((Behaviour)base.creatureAnimator).enabled = false;
			physicsRigidbody.isKinematic = true;
			Rigidbody[] array = ragdollRigidbodies;
			foreach (Rigidbody val in array)
			{
				val.isKinematic = false;
				if (deathDirection != Vector3.zero)
				{
					val.AddForce(15f * deathDirection, (ForceMode)1);
				}
			}
			Collider[] array2 = ragdollColliders;
			foreach (Collider val2 in array2)
			{
				val2.enabled = true;
			}
			peeperMesh.SetBlendShapeWeight(0, 0f);
			peeperMesh.SetBlendShapeWeight(1, 350f);
		}

		public void SwitchBehaviourState(int state)
		{
			SwitchBehaviourStateLocally(state);
			SwitchBehaviourStateServerRpc(state);
		}

		[ServerRpc(RequireOwnership = false)]
		public void SwitchBehaviourStateServerRpc(int state)
		{
			//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(316864934u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, state);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 316864934u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					SwitchBehaviourStateClientRpc(state);
				}
			}
		}

		[ClientRpc]
		public void SwitchBehaviourStateClientRpc(int state)
		{
			//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(4022924503u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, state);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4022924503u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					SwitchBehaviourStateLocally(state);
				}
			}
		}

		public void SwitchBehaviourStateLocally(int state)
		{
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0604: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0731: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e4: Unknown result type (might be due to invalid IL or missing references)
			stateTimer = 0f;
			stateTimer2 = 0f;
			stateCounter = 0;
			switch (state)
			{
			case 0:
				base.targetPlayer = null;
				base.movingTowardsTargetPlayer = false;
				base.agent.speed = 2f;
				base.creatureAnimator.SetBool("Jump", false);
				base.creatureAnimator.SetBool("Attached", false);
				base.creatureAnimator.SetBool("Dead", false);
				base.inSpecialAnimation = false;
				((Behaviour)base.agent).enabled = true;
				base.enemyType.canBeStunned = true;
				((Collider)attachCollider).enabled = true;
				((Collider)physicsCollider).enabled = false;
				physicsRigidbody.isKinematic = true;
				((Collider)hitboxCollider).enabled = true;
				hitboxCollider.radius = 0.5f;
				hitboxCollider.center = new Vector3(0f, 0.5f, 0f);
				break;
			case 1:
				base.agent.speed = 6f;
				base.creatureAnimator.SetBool("Jump", false);
				base.creatureAnimator.SetBool("Attached", false);
				base.creatureAnimator.SetBool("Dead", false);
				base.inSpecialAnimation = false;
				((Behaviour)base.agent).enabled = true;
				base.enemyType.canBeStunned = true;
				((Collider)attachCollider).enabled = true;
				((Collider)physicsCollider).enabled = false;
				physicsRigidbody.isKinematic = true;
				((Collider)hitboxCollider).enabled = true;
				hitboxCollider.radius = 0.5f;
				hitboxCollider.center = new Vector3(0f, 0.5f, 0f);
				break;
			case 2:
				base.targetPlayer = null;
				base.movingTowardsTargetPlayer = false;
				base.agent.speed = 0f;
				base.creatureAnimator.SetBool("Jump", false);
				base.creatureAnimator.SetBool("Attached", false);
				base.creatureAnimator.SetBool("Dead", false);
				base.creatureAnimator.SetBool("Grounded", true);
				base.inSpecialAnimation = false;
				((Behaviour)base.agent).enabled = true;
				base.enemyType.canBeStunned = true;
				((Collider)attachCollider).enabled = true;
				((Collider)physicsCollider).enabled = false;
				physicsRigidbody.isKinematic = true;
				((Collider)hitboxCollider).enabled = true;
				hitboxCollider.radius = 0.5f;
				hitboxCollider.center = new Vector3(0f, 0.5f, 0f);
				break;
			case 3:
			{
				base.agent.speed = 0f;
				creatureModel.transform.localPosition = Vector3.zero;
				base.creatureAnimator.SetBool("Jump", true);
				base.creatureAnimator.SetBool("Attached", false);
				base.creatureAnimator.SetBool("Dead", false);
				base.creatureAnimator.SetBool("Grounded", false);
				base.inSpecialAnimation = true;
				((Behaviour)base.agent).enabled = false;
				base.enemyType.canBeStunned = true;
				((Collider)attachCollider).enabled = true;
				((Collider)physicsCollider).enabled = true;
				physicsRigidbody.isKinematic = false;
				((Collider)hitboxCollider).enabled = true;
				hitboxCollider.radius = 2f;
				hitboxCollider.center = Vector3.zero;
				SphereCollider obj3 = physicsCollider;
				((Collider)obj3).includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(((Collider)obj3).includeLayers) & -524289);
				SphereCollider obj4 = physicsCollider;
				((Collider)obj4).excludeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(((Collider)obj4).excludeLayers) | 0x80000);
				break;
			}
			case 4:
				base.targetPlayer = null;
				base.movingTowardsTargetPlayer = false;
				creatureModel.transform.localPosition = Vector3.zero;
				base.agent.speed = 0f;
				base.creatureAnimator.SetBool("Jump", true);
				base.creatureAnimator.SetBool("Attached", true);
				base.creatureAnimator.SetBool("Dead", false);
				base.creatureAnimator.SetBool("Grounded", false);
				base.inSpecialAnimation = true;
				((Behaviour)base.agent).enabled = false;
				base.enemyType.canBeStunned = false;
				((Collider)attachCollider).enabled = false;
				((Collider)physicsCollider).enabled = false;
				physicsRigidbody.isKinematic = true;
				((Collider)hitboxCollider).enabled = false;
				hitboxCollider.radius = 0.5f;
				hitboxCollider.center = Vector3.zero;
				NextWhisperTime = Time.time + 10f;
				break;
			case 5:
				base.targetPlayer = null;
				base.movingTowardsTargetPlayer = false;
				base.agent.speed = 0f;
				base.creatureAnimator.SetBool("Jump", false);
				base.creatureAnimator.SetBool("Attached", false);
				base.creatureAnimator.SetBool("Dead", false);
				base.creatureAnimator.SetBool("Grounded", true);
				base.inSpecialAnimation = false;
				((Behaviour)base.agent).enabled = true;
				base.enemyType.canBeStunned = true;
				((Collider)attachCollider).enabled = true;
				((Collider)physicsCollider).enabled = false;
				physicsRigidbody.isKinematic = true;
				((Collider)hitboxCollider).enabled = true;
				hitboxCollider.radius = 0.5f;
				hitboxCollider.center = new Vector3(0f, 0.5f, 0f);
				break;
			case 6:
			{
				stateTimer = Random.Range(0f, 1f);
				base.targetPlayer = null;
				base.movingTowardsTargetPlayer = false;
				base.agent.speed = 0f;
				creatureModel.transform.localPosition = Vector3.zero;
				base.creatureAnimator.SetBool("Jump", true);
				base.creatureAnimator.SetBool("Attached", false);
				base.creatureAnimator.SetBool("Dead", false);
				base.creatureAnimator.SetBool("Grounded", false);
				base.inSpecialAnimation = true;
				((Behaviour)base.agent).enabled = false;
				base.enemyType.canBeStunned = true;
				((Collider)attachCollider).enabled = false;
				((Collider)physicsCollider).enabled = true;
				physicsRigidbody.isKinematic = false;
				((Collider)hitboxCollider).enabled = true;
				hitboxCollider.radius = 0.5f;
				hitboxCollider.center = Vector3.zero;
				SphereCollider obj = physicsCollider;
				((Collider)obj).includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(((Collider)obj).includeLayers) | 0x80000);
				SphereCollider obj2 = physicsCollider;
				((Collider)obj2).excludeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(((Collider)obj2).excludeLayers) & -524289);
				break;
			}
			case 7:
				base.targetPlayer = null;
				base.movingTowardsTargetPlayer = false;
				base.agent.speed = 0f;
				creatureModel.transform.localPosition = Vector3.zero;
				base.creatureAnimator.SetBool("Jump", false);
				base.creatureAnimator.SetBool("Attached", false);
				base.creatureAnimator.SetBool("Dead", true);
				base.creatureAnimator.SetBool("Grounded", false);
				base.inSpecialAnimation = true;
				((Behaviour)base.agent).enabled = false;
				base.enemyType.canBeStunned = false;
				((Collider)attachCollider).enabled = false;
				((Collider)physicsCollider).enabled = false;
				physicsRigidbody.isKinematic = true;
				((Collider)hitboxCollider).enabled = false;
				hitboxCollider.radius = 0.5f;
				hitboxCollider.center = Vector3.zero;
				break;
			}
			((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(state);
		}

		private void LateUpdate()
		{
			//IL_0020: 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_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: 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_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: 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)
			if (base.isEnemyDead)
			{
				return;
			}
			if (isAttached)
			{
				((Component)this).transform.position = attachTargetTransform.position;
				((Component)this).transform.rotation = attachTargetTransform.rotation;
				((Component)this).transform.Rotate(attachTargetRotationOffset);
				((Component)this).transform.Translate(0f, 0f, attachTargetTranslationOffset.z, (Space)1);
				((Component)this).transform.Translate(0f, attachTargetTranslationOffset.y, 0f, attachTargetTransform);
			}
			int currentBehaviourStateIndex = base.currentBehaviourStateIndex;
			if (currentBehaviourStateIndex == 4)
			{
				blinkTimer += Time.deltaTime;
				if (blinkTimer > blinkInterval)
				{
					base.creatureAnimator.SetTrigger("Blink");
					blinkInterval = Random.Range(2f, 12f);
					blinkTimer = 0f;
				}
			}
			if (base.isEnemyDead || (Object)(object)attachedPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController)
			{
				return;
			}
			PlayerControllerB val = null;
			float num = 7f;
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val2 in allPlayerScripts)
			{
				if (!((Object)(object)val2 == (Object)(object)attachedPlayer))
				{
					float num2 = Vector3.Distance(eyeTransform.position, ((Component)val2.gameplayCamera).transform.position);
					Vector3 val3 = ((Component)val2).transform.position - eyeTransform.position;
					float num3 = Vector3.Angle(eyeOriginalTransform.forward, val3);
					if (num2 < num && num3 < 70f)
					{
						val = val2;
						num = num2;
					}
				}
			}
			if ((Object)(object)val != (Object)null)
			{
				Transform transform = ((Component)val.gameplayCamera).transform;
				float num4 = Vector3.Distance(eyeTransform.position, transform.position);
				if (num4 < 7f)
				{
					Vector3 val4 = transform.position - eyeTransform.position;
					Quaternion val5 = Quaternion.LookRotation(val4, eyeTransform.up);
					Quaternion val6 = Quaternion.RotateTowards(eyeOriginalTransform.rotation, val5, 40f);
					float num5 = Quaternion.Angle(val5, eyeOriginalTransform.rotation);
					if (num5 < 90f)
					{
						eyeTransform.rotation = Quaternion.RotateTowards(eyeTransform.rotation, val6, 120f * Time.deltaTime);
						return;
					}
				}
			}
			eyeTransform.rotation = Quaternion.RotateTowards(eyeTransform.rotation, eyeOriginalTransform.rotation, 20f * Time.deltaTime);
		}

		public override void Update()
		{
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: 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_0403: Unknown result type (might be due to invalid IL or missing references)
			//IL_0414: Unknown result type (might be due to invalid IL or missing references)
			//IL_0424: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_061f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0661: 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)
			((EnemyAI)this).Update();
			if (base.isEnemyDead)
			{
				base.currentBehaviourStateIndex = 7;
			}
			else if (base.currentBehaviourStateIndex == 0 || base.currentBehaviourStateIndex == 1 || base.currentBehaviourStateIndex == 5)
			{
				CalculateAnimationDirection();
			}
			if (base.currentBehaviourStateIndex == 0)
			{
				PutCreatureOnGround();
				if (!((NetworkBehaviour)this).IsOwner)
				{
					return;
				}
				stateTimer += Time.deltaTime;
				if (!(stateTimer < 0.15f))
				{
					stateTimer = 0f;
					PlayerControllerB val = ((EnemyAI)this).CheckLineOfSightForClosestPlayer(70f, sightRange, 3, 0f);
					if (!((Object)(object)val == (Object)null) && !(Vector3.Distance(base.eye.position, ((Component)val.gameplayCamera).transform.position) > (float)sightRange))
					{
						PlayCreatureSFXServerRpc(0);
						BeginChasingPlayerServerRpc((int)val.playerClientId);
						SwitchBehaviourState(1);
					}
				}
			}
			else if (base.currentBehaviourStateIndex == 1)
			{
				PutCreatureOnGround();
				if (!((NetworkBehaviour)this).IsOwner)
				{
					return;
				}
				if (stateTimer2 < 0.5f)
				{
					stateTimer2 += Time.deltaTime;
					return;
				}
				if ((Object)(object)base.targetPlayer != (Object)null && Vector3.Distance(((Component)base.targetPlayer.playerGlobalHead).transform.position, base.eye.position) < 8f)
				{
					Vector3 val2 = ((Component)base.targetPlayer.playerGlobalHead).transform.position - base.eye.position;
					val2.y = 0f;
					Vector3 forward = base.eye.forward;
					forward.y = 0f;
					if (Vector3.Angle(forward, val2) < 15f)
					{
						PlayCreatureSFXServerRpc(3);
						SwitchBehaviourState(3);
						JumpAtPlayerServerRpc(base.targetPlayer.playerClientId);
						return;
					}
				}
				stateTimer += Time.deltaTime;
				if (stateTimer < 0.15f)
				{
					return;
				}
				stateTimer = 0f;
				PlayerControllerB val3 = ((EnemyAI)this).CheckLineOfSightForClosestPlayer(70f, sightRange, 3, 0f);
				if ((Object)(object)val3 == (Object)null || Vector3.Distance(base.eye.position, ((Component)val3.gameplayCamera).transform.position) > (float)sightRange)
				{
					stateCounter++;
					if (stateCounter >= 8)
					{
						stateCounter = 0;
						SwitchBehaviourState(0);
					}
				}
				else if ((Object)(object)val3 != (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					BeginChasingPlayerServerRpc((int)val3.playerClientId);
				}
			}
			else if (base.currentBehaviourStateIndex == 2)
			{
				PutCreatureOnGround();
				if (!((NetworkBehaviour)this).IsOwner)
				{
					return;
				}
				stateTimer += Time.deltaTime;
				if (stateTimer > 5.5f)
				{
					stateTimer = 0f;
					if ((Object)(object)base.targetPlayer != (Object)null)
					{
						SwitchBehaviourState(1);
					}
					else
					{
						SwitchBehaviourState(0);
					}
				}
				stateTimer2 += Time.deltaTime;
				if (!(stateTimer2 < 0.5f))
				{
					stateTimer2 = 0f;
					PlayerControllerB val4 = ((EnemyAI)this).CheckLineOfSightForClosestPlayer(70f, sightRange, 3, 0f);
					if (!((Object)(object)val4 == (Object)null) && !(Vector3.Distance(base.eye.position, ((Component)val4.gameplayCamera).transform.position) > (float)sightRange))
					{
						BeginChasingPlayerServerRpc((int)val4.playerClientId);
					}
				}
			}
			else if (base.currentBehaviourStateIndex == 3)
			{
				if (!((NetworkBehaviour)this).IsOwner)
				{
					((Component)this).transform.position = base.serverPosition;
					return;
				}
				((EnemyAI)this).SyncPositionToClients();
				if (stateCounter == 0)
				{
					stateTimer += Time.deltaTime;
					if (stateTimer > 2.5f)
					{
						hitboxCollider.radius = 0.5f;
						SphereCollider obj = physicsCollider;
						((Collider)obj).includeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(((Collider)obj).includeLayers) | 0x80000);
						SphereCollider obj2 = physicsCollider;
						((Collider)obj2).excludeLayers = LayerMask.op_Implicit(LayerMask.op_Implicit(((Collider)obj2).excludeLayers) & -524289);
						stateCounter = 1;
					}
				}
				stateTimer2 += Time.deltaTime;
				if (!(stateTimer2 < 5f))
				{
					stateTimer2 = 0f;
					PlayCreatureSFXServerRpc(0, 0.5f);
					SwitchBehaviourState(5);
				}
			}
			else if (base.currentBehaviourStateIndex == 4)
			{
				if (((NetworkBehaviour)this).IsOwner)
				{
					((EnemyAI)this).SyncPositionToClients();
				}
				stateTimer += Time.deltaTime;
				if (stateTimer < 1f)
				{
					return;
				}
				stateTimer = 0f;
				if (Time.time < NextWhisperTime)
				{
					return;
				}
				Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 16f, LayerMask.GetMask(new string[1] { "Enemies" }), (QueryTriggerInteraction)2);
				Collider[] array2 = array;
				foreach (Collider val5 in array2)
				{
					if (((Object)((Component)val5).gameObject).name == "MimicFrameCollider")
					{
						PlayCreatureSFXServerRpc(7);
						NextWhisperTime = Time.time + Random.Range(5f, 10f);
						return;
					}
					EnemyAI componentInParent = ((Component)val5).gameObject.GetComponentInParent<EnemyAI>();
					if ((Object)(object)componentInParent != (Object)null && !Peeper.ignoreEnemies.Contains(componentInParent.enemyType.enemyName))
					{
						PlayCreatureSFXServerRpc(7);
						NextWhisperTime = Time.time + Random.Range(8f, 16f);
						return;
					}
				}
				NextWhisperTime = Time.time + 1f;
			}
			else if (base.currentBehaviourStateIndex == 5)
			{
				PutCreatureOnGround();
				if (((NetworkBehaviour)this).IsOwner)
				{
					stateTimer += Time.deltaTime;
					if (!(stateTimer < 1.2f))
					{
						stateTimer = 0f;
						SwitchBehaviourState(0);
					}
				}
			}
			else if (base.currentBehaviourStateIndex == 6)
			{
				if (!((NetworkBehaviour)this).IsOwner)
				{
					((Component)this).transform.position = base.serverPosition;
					return;
				}
				((EnemyAI)this).SyncPositionToClients();
				stateTimer += Time.deltaTime;
				if (!(stateTimer < 5f))
				{
					stateTimer = 4.5f;
					Vector3 velocity = physicsRigidbody.velocity;
					if (!(((Vector3)(ref velocity)).sqrMagnitude > 10f))
					{
						PlayCreatureSFXServerRpc(0, 0.5f);
						SwitchBehaviourState(5);
					}
				}
			}
			else
			{
				if (base.currentBehaviourStateIndex != 7 || ragdollFrozen)
				{
					return;
				}
				stateTimer += Time.deltaTime;
				if (!(stateTimer < 15f))
				{
					stateTimer = 0f;
					Rigidbody[] array3 = ragdollRigidbodies;
					foreach (Rigidbody val6 in array3)
					{
						val6.isKinematic = true;
						ragdollFrozen = true;
					}
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void JumpAtPlayerServerRpc(ulong 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(3297439372u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerObjectId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3297439372u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					JumpAtPlayerClientRpc(playerObjectId);
				}
			}
		}

		[ClientRpc]
		public void JumpAtPlayerClientRpc(ulong 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(3646752176u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerObjectId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3646752176u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					JumpAtPlayer(StartOfRound.Instance.allPlayerScripts[(int)(IntPtr)checked((long)playerObjectId)]);
				}
			}
		}

		private void JumpAtPlayer(PlayerControllerB playerScript)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: 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)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: 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_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			if (!base.isEnemyDead && !isAttached)
			{
				base.agent.speed = 0f;
				creatureModel.transform.localPosition = Vector3.zero;
				base.creatureAnimator.SetBool("Jump", true);
				base.creatureAnimator.SetBool("Attached", false);
				base.creatureAnimator.SetBool("Dead", false);
				isAttached = false;
				base.inSpecialAnimation = true;
				((Behaviour)base.agent).enabled = false;
				base.enemyType.canBeStunned = true;
				((Collider)attachCollider).enabled = true;
				((Collider)physicsCollider).enabled = true;
				physicsRigidbody.isKinematic = false;
				((Collider)hitboxCollider).enabled = true;
				hitboxCollider.radius = 2f;
				Vector3 val = ((Component)playerScript.playerGlobalHead).transform.position;
				if ((Object)(object)base.targetPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					val += base.targetPlayer.thisController.velocity / 5f;
				}
				else if (base.targetPlayer.timeSincePlayerMoving < 0.25f)
				{
					val += Vector3.Normalize((base.targetPlayer.serverPlayerPosition - base.targetPlayer.oldPlayerPosition) * 100f);
				}
				Rigidbody obj = physicsRigidbody;
				Vector3 val2 = val - ((Component)this).transform.position + Vector3.up;
				obj.velocity = 33f * ((Vector3)(ref val2)).normalized;
				base.creatureAnimator.SetBool("Grounded", false);
			}
		}

		[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(2492932585u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerObjectId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2492932585u, 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(3529258009u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerObjectId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3529258009u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					BeginChasingPlayer(playerObjectId);
				}
			}
		}

		public void BeginChasingPlayer(int playerObjectId)
		{
			PlayerControllerB val = (base.targetPlayer = StartOfRound.Instance.allPlayerScripts[playerObjectId]);
			if (((NetworkBehaviour)this).OwnerClientId != val.actualClientId)
			{
				((EnemyAI)this).ChangeOwnershipOfEnemy(val.actualClientId);
			}
			((EnemyAI)this).SetMovingTowardsTargetPlayer(val);
		}

		[ServerRpc(RequireOwnership = false)]
		public void PlayCreatureSFXServerRpc(int index, float volume = 1f)
		{
			//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_0071: 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)
			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(1656237277u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, index);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref volume, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1656237277u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					PlayCreatureSFXClientRpc(index, volume);
				}
			}
		}

		[ClientRpc]
		public void PlayCreatureSFXClientRpc(int index, float volume = 1f)
		{
			//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_0071: 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)
			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(2720121576u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, index);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref volume, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2720121576u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					PlayCreatureSFX(index, volume);
				}
			}
		}

		private void PlayCreatureSFX(int index, float volume = 1f)
		{
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			base.creatureVoice.pitch = Random.Range(0.8f, 1.1f);
			AttachSFXSource.pitch = Random.Range(0.9f, 1.05f);
			switch (index)
			{
			case 0:
			{
				AudioClip val = spotSFX[Random.Range(0, spotSFX.Length)];
				base.creatureVoice.PlayOneShot(val, volume);
				WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, val, volume);
				break;
			}
			case 1:
				base.creatureSFX.PlayOneShot(walkSFX, volume * 0.22f);
				WalkieTalkie.TransmitOneShotAudio(base.creatureSFX, walkSFX, volume * 0.22f);
				break;
			case 2:
				base.creatureSFX.PlayOneShot(runSFX, volume * 0.25f);
				WalkieTalkie.TransmitOneShotAudio(base.creatureSFX, runSFX, volume * 0.25f);
				break;
			case 3:
			{
				AudioClip val = jumpSFX[Random.Range(0, jumpSFX.Length)];
				base.creatureVoice.PlayOneShot(val, volume);
				WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, val, volume);
				break;
			}
			case 4:
			{
				AudioClip val = attachSFX[0];
				AttachSFXSource.PlayOneShot(val, volume);
				WalkieTalkie.TransmitOneShotAudio(AttachSFXSource, val, volume);
				break;
			}
			case 5:
			{
				AudioClip val = deathSFX[Random.Range(0, deathSFX.Length)];
				base.creatureVoice.PlayOneShot(val, volume);
				WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, val, volume);
				break;
			}
			case 6:
			{
				AudioClip val = ejectSFX[Random.Range(0, ejectSFX.Length)];
				base.creatureVoice.PlayOneShot(val, volume);
				WalkieTalkie.TransmitOneShotAudio(base.creatureVoice, val, volume);
				break;
			}
			case 7:
			{
				AudioClip val = whisperSFX[Random.Range(0, whisperSFX.Length)];
				AttachSFXSource.PlayOneShot(val, volume);
				WalkieTalkie.TransmitOneShotAudio(AttachSFXSource, val, volume);
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 18f, 0.6f, 0, false, 0);
				break;
			}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void AttachToPlayerServerRpc(ulong 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(2592041692u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerObjectId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2592041692u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					AttachToPlayerClientRpc(playerObjectId);
				}
			}
		}

		[ClientRpc]
		public void AttachToPlayerClientRpc(ulong 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(4096406816u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerObjectId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4096406816u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					AttachToPlayerLocally(StartOfRound.Instance.allPlayerScripts[(int)(IntPtr)checked((long)playerObjectId)]);
				}
			}
		}

		private void AttachToPlayerLocally(PlayerControllerB playerScript)
		{
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_035b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_039f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0454: Unknown result type (might be due to invalid IL or missing references)
			//IL_0459: Unknown result type (might be due to invalid IL or missing references)
			//IL_047a: Unknown result type (might be due to invalid IL or missing references)
			//IL_047f: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			if (base.isEnemyDead || isAttached || playerScript.isPlayerDead)
			{
				return;
			}
			int num = 0;
			foreach (PeeperAI peeper in Peeper.PeeperList)
			{
				if ((Object)(object)peeper.attachedPlayer == (Object)(object)playerScript)
				{
					num++;
				}
			}
			if (num >= 10)
			{
				return;
			}
			isAttached = true;
			base.targetPlayer = playerScript;
			attachedPlayer = playerScript;
			if (!playerScript.isPlayerDead)
			{
				IsWeighted = true;
			}
			if ((Object)(object)playerScript == (Object)(object)GameNetworkManager.Instance.localPlayerController)
			{
				HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
			}
			((EnemyAI)this).ChangeOwnershipOfEnemy(playerScript.actualClientId);
			SwitchBehaviourStateLocally(4);
			PlayCreatureSFX(4);
			float num2 = 0f;
			float num3 = 0f;
			float num4 = 0f;
			Transform val = null;
			Random.InitState(base.thisEnemyIndex + StartOfRound.Instance.randomMapSeed);
			int num5 = Random.Range(0, 11);
			for (int i = 0; i < 10; i++)
			{
				if (num5 == 6)
				{
					num5++;
				}
				if (!UsedAttachTargets.Contains(attachedPlayer.bodyParts[num5]))
				{
					val = ((num5 != 0 || !((Object)(object)attachedPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController)) ? attachedPlayer.bodyParts[num5] : ((Component)attachedPlayer.gameplayCamera).transform);
					UsedAttachTargets.Add(val);
					attachTargetTransform = val;
					break;
				}
				num5 = ((num5 != 10) ? (num5 + 1) : 0);
			}
			if (!((Object)(object)val == (Object)null))
			{
				switch (num5)
				{
				case 0:
					num2 = Random.Range(-30f, -90f);
					num3 = Random.Range(80f, 280f);
					num4 = Random.Range(0f, 360f);
					attachTargetTranslationOffset = new Vector3(0f, 0.35f, 0.2f);
					break;
				case 1:
					num3 = Random.Range(60f, 160f);
					num4 = Random.Range(0f, 360f);
					attachTargetTranslationOffset = new Vector3(0f, 0f, 0.075f);
					break;
				case 2:
					num3 = Random.Range(-60f, -160f);
					num4 = Random.Range(0f, 360f);
					attachTargetTranslationOffset = new Vector3(0f, 0f, 0.075f);
					break;
				case 3:
					num3 = Random.Range(0f, 160f);
					num4 = Random.Range(0f, 360f);
					attachTargetTranslationOffset = new Vector3(0f, 0f, 0.2f);
					break;
				case 4:
					num3 = Random.Range(0f, -160f);
					num4 = Random.Range(0f, 360f);
					attachTargetTranslationOffset = new Vector3(0f, 0f, 0.2f);
					break;
				case 5:
					num3 = Random.Range(-30f, 30f);
					num4 = Random.Range(0f, 360f);
					attachTargetTranslationOffset = new Vector3(0f, 0f, 0.2f);
					break;
				case 7:
					num3 = Random.Range(0f, 160f);
					num4 = Random.Range(0f, 360f);
					attachTargetTranslationOffset = new Vector3(0f, 0f, 0.2f);
					break;
				case 8:
					num3 = Random.Range(0f, -160f);
					num4 = Random.Range(0f, 360f);
					attachTargetTranslationOffset = new Vector3(0f, 0f, 0.2f);
					break;
				case 9:
					num3 = Random.Range(160f, 280f);
					num4 = Random.Range(0f, 360f);
					attachTargetTranslationOffset = new Vector3(0f, 0f, 0.15f);
					break;
				case 10:
					num3 = Random.Range(-20f, 100f);
					num4 = Random.Range(0f, 360f);
					attachTargetTranslationOffset = new Vector3(0f, 0f, 0.15f);
					break;
				default:
					Debug.Log((object)("Peepers have encountered an error when attaching! Report it to the developer! Target Index: " + num5));
					break;
				}
				attachTargetRotationOffset = new Vector3(num2, num3, num4);
				creatureModel.transform.localPosition = Vector3.zero;
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void EjectFromPlayerServerRpc(ulong 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(1104444428u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerObjectId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1104444428u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					EjectFromPlayerClientRpc(playerObjectId);
				}
			}
		}

		[ClientRpc]
		public void EjectFromPlayerClientRpc(ulong 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(280628075u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerObjectId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 280628075u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					EjectFromPlayer(StartOfRound.Instance.allPlayerScripts[(int)(IntPtr)checked((long)playerObjectId)]);
				}
			}
		}

		public void EjectFromPlayer(PlayerControllerB playerScript)
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_0077: 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_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			if (isAttached)
			{
				isAttached = false;
				if (!playerScript.isPlayerDead)
				{
					IsWeighted = false;
				}
				attachedPlayer = null;
				UsedAttachTargets.Remove(attachTargetTransform);
				attachTargetTransform = null;
				if (!base.isEnemyDead)
				{
					SwitchBehaviourStateLocally(6);
				}
				Vector3 val = ((Component)playerScript).transform.position - ((Component)this).transform.position;
				val.y = 0f;
				val = ((Vector3)(ref val)).normalized;
				val.y = -1f;
				physicsRigidbody.AddForce(-10f * val, (ForceMode)1);
				PlayCreatureSFX(6);
			}
		}

		public static bool HasLineOfSightToPeeper(Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			foreach (PeeperAI peeper in Peeper.PeeperList)
			{
				if ((Object)(object)peeper != (Object)null)
				{
					Vector3 val = position - peeper.eyeTransform.position;
					float num = Vector3.Angle(peeper.eyeOriginalTransform.forward, val);
					if (Vector3.Distance(position, peeper.eyeTransform.position) < 10f && num < 90f && !Physics.Linecast(((Component)peeper.eyeTransform).transform.position, position, StartOfRound.Instance.collidersRoomDefaultAndFoliage, (QueryTriggerInteraction)1))
					{
						return true;
					}
				}
			}
			return false;
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_PeeperAI()
		{
			//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
			NetworkManager.__rpc_func_table.Add(1087886824u, new RpcReceiveHandler(__rpc_handler_1087886824));
			NetworkManager.__rpc_func_table.Add(2756874777u, new RpcReceiveHandler(__rpc_handler_2756874777));
			NetworkManager.__rpc_func_table.Add(316864934u, new RpcReceiveHandler(__rpc_handler_316864934));
			NetworkManager.__rpc_func_table.Add(4022924503u, new RpcReceiveHandler(__rpc_handler_4022924503));
			NetworkManager.__rpc_func_table.Add(3297439372u, new RpcReceiveHandler(__rpc_handler_3297439372));
			NetworkManager.__rpc_func_table.Add(3646752176u, new RpcReceiveHandler(__rpc_handler_3646752176));
			NetworkManager.__rpc_func_table.Add(2492932585u, new RpcReceiveHandler(__rpc_handler_2492932585));
			NetworkManager.__rpc_func_table.Add(3529258009u, new RpcReceiveHandler(__rpc_handler_3529258009));
			NetworkManager.__rpc_func_table.Add(1656237277u, new RpcReceiveHandler(__rpc_handler_1656237277));
			NetworkManager.__rpc_func_table.Add(2720121576u, new RpcReceiveHandler(__rpc_handler_2720121576));
			NetworkManager.__rpc_func_table.Add(2592041692u, new RpcReceiveHandler(__rpc_handler_2592041692));
			NetworkManager.__rpc_func_table.Add(4096406816u, new RpcReceiveHandler(__rpc_handler_4096406816));
			NetworkManager.__rpc_func_table.Add(1104444428u, new RpcReceiveHandler(__rpc_handler_1104444428));
			NetworkManager.__rpc_func_table.Add(280628075u, new RpcReceiveHandler(__rpc_handler_280628075));
		}

		private static void __rpc_handler_1087886824(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;
				((PeeperAI)(object)target).KillEnemyServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2756874777(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;
				((PeeperAI)(object)target).KillEnemyClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_316864934(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 state = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref state);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PeeperAI)(object)target).SwitchBehaviourStateServerRpc(state);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_4022924503(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 state = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref state);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PeeperAI)(object)target).SwitchBehaviourStateClientRpc(state);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3297439372(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)
			{
				ulong playerObjectId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerObjectId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PeeperAI)(object)target).JumpAtPlayerServerRpc(playerObjectId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3646752176(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)
			{
				ulong playerObjectId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerObjectId);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PeeperAI)(object)target).JumpAtPlayerClientRpc(playerObjectId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

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

		private static void __rpc_handler_1656237277(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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)
			{
				int index = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref index);
				float volume = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref volume, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PeeperAI)(object)target).PlayCreatureSFXServerRpc(index, volume);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2720121576(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due t