Decompiled source of MoreLethalCompany v1.0.11

BepInEx/plugins/MoreLethalCompany.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using Dissonance.Config;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MoreLethalCompany.EvilClone.Behaviour;
using MoreLethalCompany.EvilClone.State;
using MoreLethalCompany.Modules;
using MoreLethalCompany.NetcodePatcher;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Networking;

[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("MoreLethalCompany")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Adds more monster types to Lethal Company")]
[assembly: AssemblyFileVersion("1.0.11.0")]
[assembly: AssemblyInformationalVersion("1.0.11")]
[assembly: AssemblyProduct("MoreLethalCompany")]
[assembly: AssemblyTitle("MoreLethalCompany")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.11.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 MoreLethalCompany
{
	[BepInPlugin("MoreLethalCompany", "MoreLethalCompany", "1.0.11")]
	public class Plugin : BaseUnityPlugin
	{
		public static AssetBundle MainAssets;

		public static ManualLogSource Logger;

		public static List<CustomEnemy> CustomEnemies;

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

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

		public static GameObject MaskedEnemyRef;

		public static GameObject MimicVoiceRecorderRef;

		public static AudioClip ShipTeleporterBeamAudioClip;

		public static bool HasMoreEmotes = false;

		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Expected O, but got Unknown
			Harmony val = new Harmony("MoreLethalCompany");
			NetcodePatcher();
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin MoreLethalCompany is loaded!");
			Logger.LogInfo((object)"Made possible by: Evaisa's NetcodePatcher - Special Thanks!");
			if ((Object)(object)MainAssets == (Object)null)
			{
				MainAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "modassets"));
				Logger.LogInfo((object)"Loaded asset bundle");
			}
			ShipTeleporterBeamAudioClip = MainAssets.LoadAsset<AudioClip>("ShipTeleporterBeam");
			if ((Object)(object)ShipTeleporterBeamAudioClip == (Object)null)
			{
				LogDebug("Failed to load ShipTeleporterBeam audio");
			}
			HasMoreEmotes = GetHasMoreEmotes();
			RegisterEnemies();
			SetupAndLoadMimicVoiceRecorder();
			val.Patch((MethodBase)typeof(StartOfRound).GetMethod("Start", BindingFlags.Instance | BindingFlags.NonPublic), (HarmonyMethod)null, new HarmonyMethod(typeof(Plugin).GetMethod("StartOfRoundStartPostfix")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}

		public static void LogDebug(string msg)
		{
		}

		private static void NetcodePatcher()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			for (int i = 0; i < types.Length; i++)
			{
				MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				foreach (MethodInfo methodInfo in methods)
				{
					if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}

		private bool GetHasMoreEmotes()
		{
			foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
			{
				if (pluginInfo.Value.Metadata.GUID.Equals("MoreEmotes"))
				{
					return true;
				}
			}
			return false;
		}

		private void RegisterEnemies()
		{
			EnemyAdder.Start();
			CustomEnemies = new List<CustomEnemy> { CustomEnemy.Create("EvilClone", MainAssets.LoadAsset<EnemyType>("Assets/Mod/EvilClone.asset"), 38, ExclusionLevels.LevelTypes.CompanyBuildingLevel, null, MainAssets.LoadAsset<TerminalNode>("Assets/Mod/EvilCloneFile.asset")) };
			EnemyAdder.RegisterEnemies(CustomEnemies);
		}

		private void SetupAndLoadMimicVoiceRecorder()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_002e: Expected O, but got Unknown
			LogDebug("Creating MimicVoiceRecorder Game Object");
			GameObject val = new GameObject("MimicVoiceRecorder");
			val.AddComponent<MimicVoiceRecorder>();
			((Object)val).hideFlags = (HideFlags)61;
			MimicVoiceRecorderRef = val;
			Object.DontDestroyOnLoad((Object)val);
		}

		public static void StartOfRoundStartPostfix(StartOfRound __instance)
		{
			MimicVoiceRecorder component = MimicVoiceRecorderRef.GetComponent<MimicVoiceRecorder>();
			if ((Object)(object)component != (Object)null)
			{
				LogDebug("Clearing voice clips for next level!");
				component.ClearVoiceClipList();
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "MoreLethalCompany";

		public const string PLUGIN_NAME = "MoreLethalCompany";

		public const string PLUGIN_VERSION = "1.0.11";
	}
}
namespace MoreLethalCompany.Modules
{
	public class CustomEnemy
	{
		public string Name;

		public EnemyType EnemyType;

		public int Rarity;

		public ExclusionLevels.LevelTypes LevelFlags;

		public TerminalKeyword InfoKeyword;

		public TerminalNode InfoNode;

		public bool Enabled = true;

		public CustomEnemy(string name, EnemyType enemyType, int rarity, ExclusionLevels.LevelTypes levelFlags, TerminalKeyword infoKeyword, TerminalNode infoNode)
		{
			Name = name;
			EnemyType = enemyType;
			Rarity = rarity;
			LevelFlags = levelFlags;
			InfoKeyword = infoKeyword;
			InfoNode = infoNode;
		}

		public static CustomEnemy Create(string name, EnemyType enemyPath, int rarity, ExclusionLevels.LevelTypes levelFlags, TerminalKeyword infoKeyword, TerminalNode infoNode, bool enabled = true)
		{
			return new CustomEnemy(name, enemyPath, rarity, levelFlags, infoKeyword, infoNode)
			{
				Enabled = enabled
			};
		}
	}
	internal class EnemyAdder
	{
		private static readonly List<CustomEnemy> EnemyList = new List<CustomEnemy>();

		private static readonly List<GameObject> NetworkPrefabs = new List<GameObject>();

		public static void Start()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: 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_004d: Expected O, but got Unknown
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Expected O, but got Unknown
			Plugin.LogDebug("Starting Enemy addition patches...");
			Harmony val = new Harmony("MoreLethalCompany");
			val.Patch((MethodBase)typeof(StartOfRound).GetMethod("Awake", BindingFlags.Instance | BindingFlags.NonPublic), (HarmonyMethod)null, new HarmonyMethod(typeof(EnemyAdder).GetMethod("PatchStartOfRoundAwakePostfix")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			val.Patch((MethodBase)typeof(GameNetworkManager).GetMethod("Start", BindingFlags.Instance | BindingFlags.NonPublic), (HarmonyMethod)null, new HarmonyMethod(typeof(EnemyAdder).GetMethod("PatchGameNetworkManagerPostfix")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}

		public static void PatchStartOfRoundAwakePostfix(StartOfRound __instance)
		{
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Expected O, but got Unknown
			Plugin.LogDebug(" ------------- Start of Round Awake called! ------------- ");
			foreach (Item items in __instance.allItemsList.itemsList)
			{
				if (new string[4] { "Cog1", "Airhorn", "ClownHorn", "Shovel" }.Contains(((Object)items).name))
				{
					Plugin.ItemPrefabs.Add(((Object)items).name, items.spawnPrefab);
				}
			}
			SelectableLevel[] levels = __instance.levels;
			foreach (SelectableLevel val in levels)
			{
				Plugin.LogDebug("Found level: " + ((Object)val).name + " (risk level): " + val.riskLevel);
				foreach (CustomEnemy enemy in EnemyList)
				{
					if (Enum.IsDefined(typeof(ExclusionLevels.LevelTypes), ((Object)val).name))
					{
						ExclusionLevels.LevelTypes levelTypes = (ExclusionLevels.LevelTypes)Enum.Parse(typeof(ExclusionLevels.LevelTypes), ((Object)val).name);
						if (enemy.LevelFlags.HasFlag(levelTypes))
						{
							continue;
						}
					}
					SpawnableEnemyWithRarity item = new SpawnableEnemyWithRarity
					{
						enemyType = enemy.EnemyType,
						rarity = enemy.Rarity
					};
					val.Enemies.Insert(0, item);
					Plugin.LogDebug($"Added {enemy.Name} to {((Object)val).name} with rarity {enemy.Rarity} and SpawnType [Default]");
				}
			}
		}

		public static void PatchGameNetworkManagerPostfix(GameNetworkManager __instance)
		{
			Plugin.LogDebug(" ------------- GameNetworkManager Start called! ------------- ");
			foreach (GameObject networkPrefab in NetworkPrefabs)
			{
				((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(networkPrefab);
			}
		}

		public static void RegisterEnemies(List<CustomEnemy> enemies)
		{
			foreach (CustomEnemy enemy in enemies)
			{
				if (enemy.Enabled && !EnemyList.Contains(enemy))
				{
					Plugin.LogDebug("Regisering enemy: " + enemy.Name);
					EnemyList.Add(enemy);
					NetworkPrefabs.Add(enemy.EnemyType.enemyPrefab);
					Plugin.Prefabs.Add(enemy.Name, enemy.EnemyType.enemyPrefab);
					Plugin.LogDebug($"Enemy prefab is null: {(Object)(object)enemy.EnemyType.enemyPrefab == (Object)null}");
				}
			}
		}
	}
	public class ExclusionLevels
	{
		[Flags]
		public enum LevelTypes
		{
			None = 0,
			ExperimentationLevel = 1,
			AssuranceLevel = 2,
			VowLevel = 4,
			OffenseLevel = 8,
			MarchLevel = 0x10,
			RendLevel = 0x20,
			DineLevel = 0x40,
			TitanLevel = 0x80,
			CompanyBuildingLevel = 0x100,
			All = 0xFF
		}
	}
	public class Utilities
	{
		public static void DestroyChildWithNameBFS(GameObject parent, string name, bool justDeactivate = false)
		{
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			if ((Object)(object)parent == (Object)null)
			{
				return;
			}
			Queue<Transform> queue = new Queue<Transform>();
			queue.Enqueue(parent.transform);
			while (queue.Count > 0)
			{
				Transform val = queue.Dequeue();
				if ((Object)(object)val == (Object)null || ((object)val).Equals((object?)null))
				{
					continue;
				}
				if (((Object)val).name == name)
				{
					if (justDeactivate)
					{
						((Component)val).gameObject.SetActive(false);
						continue;
					}
					((Component)val).gameObject.SetActive(false);
					Object.Destroy((Object)(object)((Component)val).gameObject);
					continue;
				}
				foreach (Transform item2 in val)
				{
					Transform item = item2;
					queue.Enqueue(item);
				}
			}
		}

		public static GameObject RecursiveCopy(GameObject source)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(((Object)source).name);
			val.transform.localPosition = source.transform.localPosition;
			val.transform.localRotation = source.transform.localRotation;
			val.transform.localScale = source.transform.localScale;
			foreach (Transform item in source.transform)
			{
				RecursiveCopy(((Component)item).gameObject).transform.parent = val.transform;
			}
			return val;
		}

		public static GameObject FindChild(Transform parent, string childName)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			foreach (Transform item in parent)
			{
				Transform val = item;
				if (((Object)val).name == childName)
				{
					return ((Component)val).gameObject;
				}
				GameObject val2 = FindChild(val, childName);
				if ((Object)(object)val2 != (Object)null)
				{
					return val2;
				}
			}
			return null;
		}
	}
}
namespace MoreLethalCompany.EvilClone
{
	internal class CustomPlayerAnimationEvents : MonoBehaviour
	{
		public EvilCloneAI evilCloneAI;

		public void PlayFootstepServer()
		{
			evilCloneAI.PlayFootstepServer();
		}

		public void PlayFootstepLocal()
		{
			evilCloneAI.PlayFootstepLocal();
		}

		public void LimpForward()
		{
			evilCloneAI.LimpAnimationSpeed();
		}
	}
	public class EvilCloneAI : EnemyAI
	{
		private readonly List<Transform> IgnoredNodes = new List<Transform>();

		private bool SendingGrabOrDropRPC;

		private EvilCloneStateManager StateManager;

		public int MaxEnemyHp = 4;

		public AISearchRoutine SearchForItems = new AISearchRoutine();

		public AISearchRoutine SearchForPlayer = new AISearchRoutine();

		public Vector3 NestPosition;

		public AudioSource MovementAudio;

		public readonly List<GameObject> GrabbableObjectsInMap = new List<GameObject>();

		public GrabbableObject TargetItem;

		public GrabbableObject CurrentlyHeldItem;

		public Transform ItemHolder;

		public GameObject cloneScavengerModel;

		public void Awake()
		{
			Plugin.LogDebug("---------------------------- EvilClone AWAKENED ---");
			SetupPlayerModel();
			base.enemyType.canSeeThroughFog = false;
			base.enemyHP = MaxEnemyHp;
			Plugin.LogDebug("Setting up State Machine");
			StateManager = ((Component)this).gameObject.AddComponent<EvilCloneStateManager>();
			StateManager.SetEvilCloneAI(this);
		}

		public override void Start()
		{
			((EnemyAI)this).Start();
			CurrentlyHeldItem = null;
			base.debugEnemyAI = false;
			base.openDoorSpeedMultiplier = 1.5f;
			MovementAudio = GetMovementAudioSource();
			ChooseNestPosition();
			RefreshGrabbableObjectsInMapList();
		}

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

		public override void Update()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Update();
			if (base.ventAnimationFinished && !((Object)(object)base.creatureAnimator == (Object)null))
			{
				_ = base.serverPosition;
			}
		}

		public override void KillEnemy(bool destroy = false)
		{
			if ((Object)(object)((NetworkBehaviour)this).NetworkManager != (Object)null && ((NetworkBehaviour)this).OwnerClientId == ((NetworkBehaviour)this).NetworkManager.LocalClientId)
			{
				StateManager.DropItemsNotShovelServerRpc();
			}
			((EnemyAI)this).KillEnemy(true);
		}

		public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false)
		{
			((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX);
			base.enemyHP -= force;
			base.stunNormalizedTimer = 0.5f;
			if ((Object)(object)((NetworkBehaviour)this).NetworkManager != (Object)null && ((NetworkBehaviour)this).OwnerClientId == ((NetworkBehaviour)this).NetworkManager.LocalClientId)
			{
				StateManager.SetTriggerServerRpc("HitEnemy");
			}
			if (base.enemyHP <= 0)
			{
				((EnemyAI)this).KillEnemyOnOwnerClient(false);
			}
			else
			{
				StateManager.OnHit(force, playerWhoHit, playHitSFX);
			}
		}

		public override void OnCollideWithPlayer(Collider other)
		{
			((EnemyAI)this).OnCollideWithPlayer(other);
			StateManager.OnCollide(other);
		}

		public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			StateManager.DetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID);
		}

		public void SetupPlayerModel()
		{
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Expected O, but got Unknown
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_0478: Unknown result type (might be due to invalid IL or missing references)
			//IL_0487: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			Plugin.LogDebug("Using Player: " + localPlayerController.playerUsername);
			GameObject gameObject = ((Component)((Component)localPlayerController).gameObject.transform.Find("ScavengerModel")).gameObject;
			if ((Object)(object)gameObject == (Object)null)
			{
				Plugin.LogDebug("ScavengerModel not found.");
				return;
			}
			cloneScavengerModel = Object.Instantiate<GameObject>(gameObject);
			cloneScavengerModel.transform.parent = ((Component)this).transform;
			Utilities.DestroyChildWithNameBFS(cloneScavengerModel, "ScavengerModelArmsOnly", justDeactivate: true);
			Utilities.DestroyChildWithNameBFS(cloneScavengerModel, "CameraContainer", justDeactivate: true);
			ChangePlayertoEnemyTags(cloneScavengerModel, new List<string>(2) { "Player", "PlayerBody" });
			GameObject val = Utilities.FindChild(cloneScavengerModel.gameObject.transform, "spine.004");
			if ((Object)(object)val != (Object)null)
			{
				GameObject val2 = new GameObject();
				val2.transform.parent = val.transform;
				val2.transform.localPosition = new Vector3(0f, 0.125f, 0.09f);
				val2.transform.eulerAngles = new Vector3(1.6233f, 357.1414f, 0f);
				base.eye = val2.transform;
			}
			ItemHolder = Utilities.FindChild(cloneScavengerModel.gameObject.transform, "ServerItemHolder").transform;
			Rigidbody component = ((Component)localPlayerController).gameObject.GetComponent<Rigidbody>();
			if ((Object)(object)component != (Object)null)
			{
				Rigidbody val3 = cloneScavengerModel.GetComponent<Rigidbody>();
				if ((Object)(object)val3 == (Object)null)
				{
					val3 = cloneScavengerModel.AddComponent<Rigidbody>();
				}
				val3.mass = component.mass;
				val3.drag = component.drag;
				val3.angularDrag = component.angularDrag;
				val3.useGravity = component.useGravity;
				val3.isKinematic = component.isKinematic;
				val3.interpolation = component.interpolation;
				val3.collisionDetectionMode = component.collisionDetectionMode;
				val3.constraints = component.constraints;
			}
			((Object)cloneScavengerModel).name = "ScavengerModel";
			cloneScavengerModel.tag = "Enemy";
			cloneScavengerModel.layer = LayerMask.NameToLayer("Enemies");
			cloneScavengerModel.gameObject.transform.position = ((Component)this).gameObject.transform.position;
			cloneScavengerModel.gameObject.transform.rotation = ((Component)this).gameObject.transform.rotation;
			cloneScavengerModel.gameObject.transform.localScale = gameObject.gameObject.transform.localScale;
			BoxCollider obj = cloneScavengerModel.gameObject.AddComponent<BoxCollider>();
			((Collider)obj).enabled = true;
			obj.center = new Vector3(0f, 0.6553f, 0.0915f);
			obj.size = new Vector3(0.4277f, 1.2703f, 0.5841f);
			((Collider)obj).contactOffset = 0.01f;
			((Collider)obj).isTrigger = true;
			EnemyAICollisionDetect obj2 = cloneScavengerModel.gameObject.AddComponent<EnemyAICollisionDetect>();
			obj2.mainScript = (EnemyAI)(object)this;
			((Behaviour)obj2).enabled = true;
			Transform obj3 = cloneScavengerModel.transform.Find("LOD1");
			((Component)obj3).gameObject.SetActive(false);
			Object.Destroy((Object)(object)((Component)obj3).gameObject);
			Transform obj4 = Object.Instantiate<Transform>(cloneScavengerModel.transform.Find("LOD2"));
			((Object)obj4).name = "LOD1";
			obj4.parent = cloneScavengerModel.transform;
			GameObject gameObject2 = ((Component)((Component)this).transform.Find("Cube")).gameObject;
			if ((Object)(object)gameObject2 != (Object)null)
			{
				gameObject2.SetActive(false);
				Object.Destroy((Object)(object)gameObject2);
			}
			NavMeshAgent component2 = ((Component)((Component)this).transform).GetComponent<NavMeshAgent>();
			if ((Object)(object)component2 != (Object)null)
			{
				component2.height = 2f;
				component2.acceleration = 20f;
				component2.angularSpeed = 250f;
			}
			GameObject obj5 = Object.Instantiate<GameObject>(((Component)((Component)localPlayerController).gameObject.transform.Find("Audios")).gameObject);
			((Object)obj5).name = "Audios";
			obj5.transform.parent = ((Component)this).gameObject.transform;
			obj5.transform.position = ((Component)this).gameObject.transform.position;
			AudioSource[] componentsInChildren = ((Component)obj5.transform).GetComponentsInChildren<AudioSource>();
			foreach (AudioSource obj6 in componentsInChildren)
			{
				((Component)obj6).transform.position = ((Component)this).gameObject.transform.position;
				((Component)obj6).transform.localPosition = Vector3.zero;
			}
			base.creatureVoice = ((Component)this).gameObject.GetComponent<AudioSource>();
			base.creatureAnimator = ((Component)cloneScavengerModel.transform.Find("metarig")).GetComponent<Animator>();
			PlayerAnimationEvents component3 = ((Component)cloneScavengerModel.transform.Find("metarig")).gameObject.GetComponent<PlayerAnimationEvents>();
			if ((Object)(object)component3 != (Object)null)
			{
				Object.Destroy((Object)(object)component3);
			}
			((Component)cloneScavengerModel.transform.Find("metarig")).gameObject.AddComponent<CustomPlayerAnimationEvents>().evilCloneAI = this;
			((Behaviour)((Component)this).gameObject.AddComponent<ShovelBehaviour>()).enabled = true;
			base.thisNetworkObject = ((Component)this).gameObject.GetComponent<NetworkObject>();
			Plugin.LogDebug("Done setting up Player model");
		}

		private void ChangePlayertoEnemyTags(GameObject obj, List<string> tags)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			if (tags.Contains(obj.tag))
			{
				obj.tag = "Enemy";
			}
			foreach (Transform item in obj.transform)
			{
				Transform val = item;
				ChangePlayertoEnemyTags(((Component)val).gameObject, tags);
			}
		}

		private AudioSource GetMovementAudioSource()
		{
			GameObject gameObject = ((Component)((Component)this).gameObject.transform.Find("Audios")).gameObject;
			if ((Object)(object)gameObject == (Object)null)
			{
				return null;
			}
			GameObject gameObject2 = ((Component)gameObject.transform.Find("MovementAudio")).gameObject;
			if ((Object)(object)gameObject2 == (Object)null)
			{
				return null;
			}
			return gameObject2.GetComponent<AudioSource>();
		}

		public void RefreshGrabbableObjectsInMapList()
		{
			GrabbableObjectsInMap.Clear();
			GrabbableObject[] array = Object.FindObjectsOfType<GrabbableObject>();
			for (int i = 0; i < array.Length; i++)
			{
				if (array[i].grabbableToEnemies)
				{
					GrabbableObjectsInMap.Add(((Component)array[i]).gameObject);
				}
			}
		}

		public int GetStandingSurfaceIndex()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(((Component)this).transform.position + Vector3.up, -Vector3.up);
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(val, ref val2, 6f, StartOfRound.Instance.walkableSurfacesMask, (QueryTriggerInteraction)1))
			{
				for (int i = 0; i < StartOfRound.Instance.footstepSurfaces.Length; i++)
				{
					if (((Component)((RaycastHit)(ref val2)).collider).CompareTag(StartOfRound.Instance.footstepSurfaces[i].surfaceTag))
					{
						return i;
					}
				}
				return 0;
			}
			Debug.DrawRay(((Ray)(ref val)).origin, ((Ray)(ref val)).direction, Color.white, 0.3f);
			return 0;
		}

		public void PlayVoiceClip(AudioClip clip)
		{
			if (!((Object)(object)clip == (Object)null) && !base.isEnemyDead)
			{
				base.creatureVoice.PlayOneShot(clip);
			}
		}

		public void PlayFootstepLocal()
		{
			PlayFootstepSound();
		}

		public void PlayFootstepServer()
		{
			PlayFootstepSound();
		}

		public void PlayFootstepSound()
		{
			int standingSurfaceIndex = GetStandingSurfaceIndex();
			int num = Random.Range(0, StartOfRound.Instance.footstepSurfaces[standingSurfaceIndex].clips.Length);
			MovementAudio.pitch = Random.Range(0.93f, 1.07f);
			float num2 = 0.75f;
			if (StateManager.Sprinting)
			{
				num2 = 0.95f;
			}
			MovementAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[standingSurfaceIndex].clips[num], num2);
			WalkieTalkie.TransmitOneShotAudio(MovementAudio, StartOfRound.Instance.footstepSurfaces[standingSurfaceIndex].clips[num], num2);
		}

		public void LimpAnimationSpeed()
		{
			if (((NetworkBehaviour)this).IsOwner)
			{
				StateManager.LimpMultiplier = 0.75f;
			}
		}

		private void ChooseNestPosition()
		{
			//IL_002a: 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)
			if (!((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).OwnerClientId == ((NetworkBehaviour)this).NetworkManager.LocalClientId)
			{
				NestPosition = ((EnemyAI)this).ChooseClosestNodeToPosition(((Component)this).transform.position, true, 2).position;
				SyncNestPositionServerRpc(NestPosition);
			}
		}

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

		[ClientRpc]
		private void SyncNestPositionClientRpc(Vector3 newNestPosition)
		{
			//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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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)
			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(608729205u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref newNestPosition);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 608729205u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					NestPosition = newNestPosition;
				}
			}
		}

		public void ChooseClosestNodeToPlayer()
		{
			//IL_002d: 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_0060: 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_0086: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.targetNode == (Object)null)
			{
				base.targetNode = base.allAINodes[0].transform;
			}
			Transform val = ((EnemyAI)this).ChooseClosestNodeToPosition(((Component)base.targetPlayer).transform.position, true, 0);
			if ((Object)(object)val != (Object)null)
			{
				base.targetNode = val;
			}
			float num = Vector3.Distance(((Component)base.targetPlayer).transform.position, ((Component)this).transform.position);
			if (num - base.mostOptimalDistance < 0.1f && (!((EnemyAI)this).PathIsIntersectedByLineOfSight(((Component)base.targetPlayer).transform.position, true, true) || num < 3f))
			{
				if (base.pathDistance > 10f && !IgnoredNodes.Contains(base.targetNode) && IgnoredNodes.Count < 4)
				{
					IgnoredNodes.Add(base.targetNode);
				}
				base.movingTowardsTargetPlayer = true;
			}
			else
			{
				((EnemyAI)this).SetDestinationToPosition(base.targetNode.position, false);
			}
		}

		protected override string __getTypeName()
		{
			return "EvilCloneAI";
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_EvilCloneAI()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(2601982635u, new RpcReceiveHandler(__rpc_handler_2601982635));
			NetworkManager.__rpc_func_table.Add(608729205u, new RpcReceiveHandler(__rpc_handler_608729205));
		}

		private static void __rpc_handler_2601982635(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				Vector3 newNestPosition = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newNestPosition);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EvilCloneAI)(object)target).SyncNestPositionServerRpc(newNestPosition);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_608729205(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0036: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 newNestPosition = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newNestPosition);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((EvilCloneAI)(object)target).SyncNestPositionClientRpc(newNestPosition);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "EvilCloneAI";
		}
	}
}
namespace MoreLethalCompany.EvilClone.State
{
	internal class AngerState : BaseEvilCloneState
	{
		private const float StickinessMax = 10f;

		private float StickinessTimer;

		public override void EnterState(EvilCloneStateManager context)
		{
			Plugin.LogDebug("Entering Anger State");
			StickinessTimer = 0f;
		}

		public override void ExitState(EvilCloneStateManager context)
		{
			Plugin.LogDebug("Exiting Anger State");
			context.SetNotMovingServerRpc();
		}

		public override void OnCollide(EvilCloneStateManager context, Collider collider)
		{
			PlayerControllerB val = context.MeetsModifiedStandardPlayerCollisionConditions(context, collider);
			if ((Object)(object)val != (Object)null)
			{
				TeleportOutPlayerAndSelf(context, val);
				context.SwitchState(context.MurderState);
			}
		}

		public override void OnDetectNoise(EvilCloneStateManager context, Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0)
		{
		}

		public override void PeriodicUpdate(EvilCloneStateManager context)
		{
		}

		public override void UpdateState(EvilCloneStateManager context)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			if (Vector3.Distance(((Component)context.EvilClone).transform.position, ((Component)context.TargetPlayer).transform.position) > 0.5f)
			{
				context.LookAtPositionServerRpc(((Component)context.TargetPlayer.gameplayCamera).transform.position);
				((EnemyAI)context.EvilClone).SetDestinationToPosition(((Component)context.TargetPlayer).transform.position, true);
				context.SprintServerRpc();
			}
			if (!Object.op_Implicit((Object)(object)((EnemyAI)context.EvilClone).CheckLineOfSight(new List<GameObject> { ((Component)context.TargetPlayer).gameObject }, 45f, 60, -1f)))
			{
				StickinessTimer += Time.deltaTime;
				if (StickinessTimer > 10f)
				{
					Plugin.LogDebug("EvilCloneAI Lost target in chase");
					context.SwitchState(context.PatrolState);
				}
			}
			else
			{
				StickinessTimer = 0f;
			}
		}

		public void TeleportOutPlayerAndSelf(EvilCloneStateManager context, PlayerControllerB playerControllerB)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: 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)
			Vector3 position = RoundManager.Instance.insideAINodes[Random.Range(0, RoundManager.Instance.insideAINodes.Length)].transform.position;
			position = RoundManager.Instance.GetRandomNavMeshPositionInRadiusSpherical(position, 10f, default(NavMeshHit));
			context.TeleportPlayerOutServerRpc((int)playerControllerB.playerClientId, position);
			context.TeleportSelfOutServerRpc(position);
		}
	}
	internal abstract class BaseEvilCloneState
	{
		public abstract void EnterState(EvilCloneStateManager context);

		public abstract void ExitState(EvilCloneStateManager context);

		public abstract void OnCollide(EvilCloneStateManager context, Collider collider);

		public abstract void OnDetectNoise(EvilCloneStateManager context, Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0);

		public abstract void PeriodicUpdate(EvilCloneStateManager context);

		public abstract void UpdateState(EvilCloneStateManager context);
	}
	internal class EmoteState : BaseEvilCloneState
	{
		private int successChecks;

		public override void EnterState(EvilCloneStateManager context)
		{
			Plugin.LogDebug("Entering Emote State");
			successChecks = 0;
			context.SetAnimatorVarServerRpc("animationSpeed", 1f);
			if (Plugin.HasMoreEmotes)
			{
				context.SetAnimatorVarServerRpc("emoteNumber", 6);
			}
			else
			{
				context.SetAnimatorVarServerRpc("emoteNumber", 1);
			}
			context.SetAnimatorLayerWeightServerRpc(((EnemyAI)context.EvilClone).creatureAnimator.GetLayerIndex("EmotesNoArms"), 1f);
		}

		public override void ExitState(EvilCloneStateManager context)
		{
			Plugin.LogDebug("Exiting Emote State");
			context.SetAnimatorLayerWeightServerRpc(((EnemyAI)context.EvilClone).creatureAnimator.GetLayerIndex("EmotesNoArms"), 0f);
		}

		public override void OnCollide(EvilCloneStateManager context, Collider collider)
		{
		}

		public override void OnDetectNoise(EvilCloneStateManager context, Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0)
		{
		}

		public override void PeriodicUpdate(EvilCloneStateManager context)
		{
			successChecks++;
			if (successChecks >= 6)
			{
				context.SwitchState(context.PreviousState);
			}
		}

		public override void UpdateState(EvilCloneStateManager context)
		{
		}
	}
	internal class EvilCloneStateManager : NetworkBehaviour
	{
		public EvilCloneAI EvilClone;

		public BaseEvilCloneState PreviousState;

		public BaseEvilCloneState currentState;

		public TestState TestState = new TestState();

		public PatrolState PatrolState = new PatrolState();

		public EmoteState EmoteState = new EmoteState();

		public GrabItemState GrabItemState = new GrabItemState();

		public PlayerFoundState PlayerFoundState = new PlayerFoundState();

		public AngerState AngerState = new AngerState();

		public MurderState MurderState = new MurderState();

		public readonly List<GameObject> IgnoringGrabbableObjects = new List<GameObject>();

		public GameObject PotentialGrabItem;

		public PlayerControllerB TargetPlayer;

		public GrabbableObject[] ItemSlots = (GrabbableObject[])(object)new GrabbableObject[2];

		public bool IsInHittingAnimation;

		public bool InReturnToNestMode;

		public bool InChase;

		public float AngeredTimer;

		public float LimpMultiplier = 1f;

		public float StaminaTimer = 6f;

		public bool Sprinting;

		public float TurnSpeedMultiplier = 11f;

		private float CheckTimer = float.MaxValue;

		private float CheckInterval = 1f;

		public void SetEvilCloneAI(EvilCloneAI evilCloneAI)
		{
			EvilClone = evilCloneAI;
		}

		private void Start()
		{
			if (!((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).OwnerClientId == ((NetworkBehaviour)this).NetworkManager.LocalClientId)
			{
				SpawnEvilCloneItemServerRpc();
				SwitchState(PatrolState);
			}
		}

		private void Update()
		{
			if (!((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).OwnerClientId == ((NetworkBehaviour)this).NetworkManager.LocalClientId && !((EnemyAI)EvilClone).isEnemyDead)
			{
				if (!Sprinting)
				{
					StaminaTimer = Mathf.Min(6f, StaminaTimer + Time.deltaTime);
				}
				else
				{
					StaminaTimer = Mathf.Max(0f, StaminaTimer - Time.deltaTime);
				}
				CheckTimer += Time.deltaTime;
				if (CheckTimer >= CheckInterval)
				{
					CheckTimer = 0f;
					currentState.PeriodicUpdate(this);
				}
				currentState.UpdateState(this);
			}
		}

		public void OnHit(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false)
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).OwnerClientId == ((NetworkBehaviour)this).NetworkManager.LocalClientId && (Object)(object)playerWhoHit != (Object)null && currentState != AngerState && currentState != MurderState)
			{
				TargetPlayer = playerWhoHit;
				LookAtPositionServerRpc(((Component)playerWhoHit).transform.position);
				SwitchState(AngerState);
			}
		}

		public void OnCollide(Collider collider)
		{
			if (!((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).OwnerClientId == ((NetworkBehaviour)this).NetworkManager.LocalClientId)
			{
				currentState.OnCollide(this, collider);
			}
		}

		public void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0)
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).OwnerClientId == ((NetworkBehaviour)this).NetworkManager.LocalClientId && ((NetworkBehaviour)this).IsOwner && !((EnemyAI)EvilClone).isEnemyDead && !((EnemyAI)EvilClone).inSpecialAnimation)
			{
				currentState.OnDetectNoise(this, noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID);
			}
		}

		public void SwitchState(BaseEvilCloneState newState)
		{
			if (!((Object)(object)((NetworkBehaviour)this).NetworkManager == (Object)null) && ((NetworkBehaviour)this).OwnerClientId == ((NetworkBehaviour)this).NetworkManager.LocalClientId)
			{
				if (currentState != null)
				{
					currentState.ExitState(this);
				}
				PreviousState = currentState;
				currentState = newState;
				currentState.EnterState(this);
				CheckTimer = float.MaxValue;
			}
		}

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

		[ClientRpc]
		public void SetNotMovingClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3955064587u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3955064587u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Sprinting = false;
					((EnemyAI)EvilClone).agent.speed = 0f;
					((EnemyAI)EvilClone).creatureAnimator.SetBool("Walking", false);
					((EnemyAI)EvilClone).creatureAnimator.SetBool("Sprinting", false);
				}
			}
		}

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

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

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

		[ClientRpc]
		public void SetSprintingClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2533204455u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2533204455u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Sprinting = true;
					((EnemyAI)EvilClone).agent.speed = 8.5f;
					((EnemyAI)EvilClone).creatureAnimator.SetBool("Walking", true);
					((EnemyAI)EvilClone).creatureAnimator.SetBool("Sprinting", true);
					((EnemyAI)EvilClone).creatureAnimator.SetLayerWeight(((EnemyAI)EvilClone).creatureAnimator.GetLayerIndex("EmotesNoArms"), 0f);
				}
			}
		}

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

		[ClientRpc]
		public void SetWalkingClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1262343147u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1262343147u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Sprinting = false;
					((EnemyAI)EvilClone).agent.speed = 5f;
					((EnemyAI)EvilClone).creatureAnimator.SetBool("Walking", true);
					((EnemyAI)EvilClone).creatureAnimator.SetBool("Sprinting", false);
					((EnemyAI)EvilClone).creatureAnimator.SetLayerWeight(((EnemyAI)EvilClone).creatureAnimator.GetLayerIndex("EmotesNoArms"), 0f);
				}
			}
		}

		public bool NearingMaxStamina()
		{
			return StaminaTimer >= 5f;
		}

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

		[ClientRpc]
		public void LookAtPositionClientRpc(Vector3 lookAt)
		{
			//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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: 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_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1449572362u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref lookAt);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1449572362u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				RoundManager.Instance.tempTransform.position = ((Component)EvilClone).transform.position;
				RoundManager.Instance.tempTransform.LookAt(lookAt);
				((Component)EvilClone).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, RoundManager.Instance.tempTransform.rotation, TurnSpeedMultiplier * Time.deltaTime);
				((Component)EvilClone).transform.eulerAngles = new Vector3(0f, ((Component)this).transform.eulerAngles.y, 0f);
				Transform obj = EvilClone.cloneScavengerModel.transform.Find("metarig").Find("CameraContainer").Find("MainCamera");
				if ((Object)(object)obj == (Object)null)
				{
					Debug.Log((object)"Can't find MainCamera");
				}
				((Component)obj).transform.LookAt(lookAt);
			}
		}

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

		[ClientRpc]
		public void SyncSpeedClientRpc(float speed)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(480862931u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speed, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 480862931u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					((EnemyAI)EvilClone).agent.speed = speed;
				}
			}
		}

		[ServerRpc]
		public void SyncItemValueServerRpc(NetworkObjectReference objectRef, int value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Invalid comparison between Unknown and I4
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1676770105u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref objectRef, default(ForNetworkSerializable));
				BytePacker.WriteValueBitPacked(val2, value);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1676770105u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				SyncItemValueClientRpc(objectRef, value);
			}
		}

		[ClientRpc]
		public void SyncItemValueClientRpc(NetworkObjectReference objectRef, int value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3177195569u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref objectRef, default(ForNetworkSerializable));
				BytePacker.WriteValueBitPacked(val2, value);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3177195569u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				NetworkObject item = default(NetworkObject);
				if (((NetworkObjectReference)(ref objectRef)).TryGet(ref item, (NetworkManager)null))
				{
					SyncItemValue(item, value);
				}
				else
				{
					Plugin.Logger.LogError((object)"Failed to get network object from network object reference (SyncItemValueClientRpc)");
				}
			}
		}

		public void SyncItemValue(NetworkObject item, int value)
		{
			if (!((Object)(object)item == (Object)null))
			{
				GrabbableObject component = ((Component)item).GetComponent<GrabbableObject>();
				if ((Object)(object)component != (Object)null)
				{
					component.SetScrapValue(value);
				}
			}
		}

		[ServerRpc]
		public void SpawnEvilCloneShovelServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Invalid comparison between Unknown and I4
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(537917426u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 537917426u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				NetworkObject component = Object.Instantiate<GameObject>(Plugin.ItemPrefabs["Shovel"], ((Component)EvilClone).gameObject.transform.position, Quaternion.identity).GetComponent<NetworkObject>();
				component.Spawn(false);
				SpawnEvilCloneItemClientRpc(NetworkObjectReference.op_Implicit(component));
			}
		}

		[ServerRpc]
		public void SpawnEvilCloneItemServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3333648224u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3333648224u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				Debug.Log((object)"TEST 0");
				NetworkObject val3 = null;
				if (Random.Range(1, 10) <= 8)
				{
					val3 = ((Random.Range(1, 10) > 5) ? Object.Instantiate<GameObject>(Plugin.ItemPrefabs["ClownHorn"], ((Component)EvilClone).gameObject.transform.position, Quaternion.identity).GetComponent<NetworkObject>() : Object.Instantiate<GameObject>(Plugin.ItemPrefabs["Airhorn"], ((Component)EvilClone).gameObject.transform.position, Quaternion.identity).GetComponent<NetworkObject>());
				}
				if (Object.op_Implicit((Object)(object)val3))
				{
					Debug.Log((object)"TEST 1");
					val3.Spawn(false);
					Debug.Log((object)"TEST 2");
					SpawnEvilCloneItemClientRpc(NetworkObjectReference.op_Implicit(val3));
					Debug.Log((object)"TEST 3");
				}
			}
		}

		[ClientRpc]
		public void SpawnEvilCloneItemClientRpc(NetworkObjectReference objectRef)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1992916852u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref objectRef, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1992916852u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				NetworkObject val3 = default(NetworkObject);
				if (((NetworkObjectReference)(ref objectRef)).TryGet(ref val3, (NetworkManager)null))
				{
					GrabbableObject component = ((Component)val3).gameObject.GetComponent<GrabbableObject>();
					SyncItemValueServerRpc(NetworkObjectReference.op_Implicit(val3), (int)((float)RoundManager.Instance.AnomalyRandom.Next(component.itemProperties.minValue, component.itemProperties.maxValue) * RoundManager.Instance.scrapValueMultiplier));
					GrabItem(val3);
				}
				else
				{
					Plugin.Logger.LogError((object)"Failed to get network object from network object reference (SpawnEvilCloneItemClientRpc)");
				}
			}
		}

		public void SwitchToShovelServerDelegate()
		{
			for (int i = 0; i < ItemSlots.Length; i++)
			{
				if ((Object)(object)ItemSlots[i] != (Object)null && ItemSlots[i].itemProperties.itemName == "Shovel")
				{
					SwitchItemSlotServerRpc(i);
					return;
				}
			}
			SpawnEvilCloneShovelServerRpc();
		}

		[ServerRpc]
		public void ResetTriggerServerRpc(string trigger)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2445187561u, val, (RpcDelivery)0);
				bool flag = trigger != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(trigger, false);
				}
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2445187561u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ResetTriggerClientRpc(trigger);
			}
		}

		[ClientRpc]
		public void ResetTriggerClientRpc(string trigger)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3179262834u, val, (RpcDelivery)0);
				bool flag = trigger != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(trigger, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3179262834u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				((EnemyAI)EvilClone).creatureAnimator.ResetTrigger(trigger);
			}
		}

		[ServerRpc]
		public void SetTriggerServerRpc(string trigger)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1768556225u, val, (RpcDelivery)0);
				bool flag = trigger != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(trigger, false);
				}
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1768556225u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				SetTriggerClientRpc(trigger);
			}
		}

		[ClientRpc]
		public void SetTriggerClientRpc(string trigger)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2243649986u, val, (RpcDelivery)0);
				bool flag = trigger != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(trigger, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2243649986u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				((EnemyAI)EvilClone).creatureAnimator.SetTrigger(trigger);
			}
		}

		[ServerRpc]
		public void ResetAndSetTriggerServerRpc(string trigger)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1685180195u, val, (RpcDelivery)0);
				bool flag = trigger != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(trigger, false);
				}
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1685180195u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ResetAndSetTriggerClientRpc(trigger);
			}
		}

		[ClientRpc]
		public void ResetAndSetTriggerClientRpc(string trigger)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1954508458u, val, (RpcDelivery)0);
				bool flag = trigger != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(trigger, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1954508458u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				((EnemyAI)EvilClone).creatureAnimator.ResetTrigger(trigger);
				((EnemyAI)EvilClone).creatureAnimator.SetTrigger(trigger);
			}
		}

		[ServerRpc]
		public void SetAnimatorLayerWeightServerRpc(int index, float value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3735115031u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, index);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3735115031u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				SetAnimatorLayerWeightClientRpc(index, value);
			}
		}

		[ClientRpc]
		public void SetAnimatorLayerWeightClientRpc(int index, float value)
		{
			//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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2792128066u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, index);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2792128066u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					((EnemyAI)EvilClone).creatureAnimator.SetLayerWeight(index, value);
				}
			}
		}

		[ServerRpc]
		public void SetAnimatorVarServerRpc(string name, float value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3822605970u, val, (RpcDelivery)0);
				bool flag = name != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(name, false);
				}
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3822605970u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				SetAnimatorVarClientRpc(name, value);
			}
		}

		[ClientRpc]
		public void SetAnimatorVarClientRpc(string name, float value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2128482819u, val, (RpcDelivery)0);
				bool flag = name != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(name, false);
				}
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2128482819u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				((EnemyAI)EvilClone).creatureAnimator.SetFloat(name, value);
			}
		}

		[ServerRpc]
		public void SetAnimatorVarServerRpc(string name, int value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			/