Decompiled source of EeveeFrenzy v1.0.2

plugins/EeveeFrenzy/EeveeFrenzy.dll

Decompiled a week ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
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.Configuration;
using BepInEx.Logging;
using Dawn;
using Dawn.Utils;
using Dusk;
using EeveeFrenzy.NetcodePatcher;
using EeveeFrenzy.src.Content.Enemies;
using EeveeFrenzy.src.Content.Items;
using EeveeFrenzy.src.Patches;
using EeveeFrenzy.src.Util;
using EeveeFrenzy.src.Util.Extensions;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using On;
using Unity.Netcode;
using Unity.Netcode.Components;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
using UnityEngine.SceneManagement;

[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("EeveeFrenzy")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Mod that adds 7 eeveelutions as new enemies!!")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2+a9b4d185d57a97d3de6da79d569382c958528ad9")]
[assembly: AssemblyProduct("EeveeFrenzy")]
[assembly: AssemblyTitle("EeveeFrenzy")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace EeveeFrenzy
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "EeveeFrenzy";

		public const string PLUGIN_NAME = "EeveeFrenzy";

		public const string PLUGIN_VERSION = "1.0.2";
	}
	[GeneratedCode("DawnLib", "0.4.3")]
	public static class EeveeFrenzyEnemyKeys
	{
		public static NamespacedKey<DawnEnemyInfo> Espeon = NamespacedKey<DawnEnemyInfo>.From("eevee_frenzy", "espeon");

		public static NamespacedKey<DawnEnemyInfo> Flareon = NamespacedKey<DawnEnemyInfo>.From("eevee_frenzy", "flareon");

		public static NamespacedKey<DawnEnemyInfo> Glaceon = NamespacedKey<DawnEnemyInfo>.From("eevee_frenzy", "glaceon");

		public static NamespacedKey<DawnEnemyInfo> Jolteon = NamespacedKey<DawnEnemyInfo>.From("eevee_frenzy", "jolteon");

		public static NamespacedKey<DawnEnemyInfo> Leafeon = NamespacedKey<DawnEnemyInfo>.From("eevee_frenzy", "leafeon");

		public static NamespacedKey<DawnEnemyInfo> MechaSylveon = NamespacedKey<DawnEnemyInfo>.From("eevee_frenzy", "mechasylveon");

		public static NamespacedKey<DawnEnemyInfo> Umbreon = NamespacedKey<DawnEnemyInfo>.From("eevee_frenzy", "umbreon");

		public static NamespacedKey<DawnEnemyInfo> Vaporeon = NamespacedKey<DawnEnemyInfo>.From("eevee_frenzy", "vaporeon");

		public static NamespacedKey<DawnEnemyInfo>? GetByReflection(string name)
		{
			return (NamespacedKey<DawnEnemyInfo>)(typeof(EeveeFrenzyEnemyKeys).GetField(name)?.GetValue(null));
		}
	}
	[GeneratedCode("DawnLib", "0.4.3")]
	public static class EeveeFrenzyItemKeys
	{
		public static NamespacedKey<DawnItemInfo> ChildEevee = NamespacedKey<DawnItemInfo>.From("eevee_frenzy", "child_eevee");

		public static NamespacedKey<DawnItemInfo>? GetByReflection(string name)
		{
			return (NamespacedKey<DawnItemInfo>)(typeof(EeveeFrenzyItemKeys).GetField(name)?.GetValue(null));
		}
	}
}
namespace EeveeFrenzy.src
{
	public class EeveeFrenzyConfig
	{
		public ConfigEntry<bool> ConfigEnableExtendedLogging { get; private set; }

		public ConfigEntry<float> ConfigEverythingVolumeMultiplier { get; private set; }

		public EeveeFrenzyConfig(ConfigFile configFile)
		{
			configFile.SaveOnConfigSet = false;
			ConfigEnableExtendedLogging = configFile.Bind<bool>("Debug Options", "Debug Mode | Enable Extended Logging", false, "Whether extended logging is enabled.");
			ConfigEverythingVolumeMultiplier = configFile.Bind<float>("Eevee Frenzy", "Everything Volume Multiplier", 0.5f, "Volume multiplier for Eevee Frenzy.");
		}
	}
	[BepInPlugin("EeveeFrenzy", "EeveeFrenzy", "1.0.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal class MainAssets : AssetBundleLoader<MainAssets>
		{
			[LoadFromBundle("EeveeFrenzyUtils.prefab")]
			public GameObject UtilsPrefab { get; private set; }

			public MainAssets(AssetBundle bundle)
				: base(bundle)
			{
			}
		}

		internal static ManualLogSource Logger = null;

		internal static readonly Harmony _harmony = new Harmony("EeveeFrenzy");

		public static EeveeFrenzyConfig ModConfig { get; private set; } = null;


		public static DuskMod Mod { get; private set; } = null;


		internal static MainAssets Assets { get; private set; } = null;


		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			ModConfig = new EeveeFrenzyConfig(((BaseUnityPlugin)this).Config);
			DoorLockPatch.Init();
			_harmony.PatchAll(typeof(StartOfRoundPatch));
			AssetBundle val = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "eeveefrenzyassets");
			Assets = new MainAssets(val);
			Mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val);
			Mod.Logger = Logger;
			Mod.RegisterContentHandlers();
			Logger.LogInfo((object)"EeveeFrenzy v1.0.2 has loaded!");
		}

		internal static void ExtendedLogging(object text)
		{
			if (ModConfig.ConfigEnableExtendedLogging.Value)
			{
				Logger.LogInfo(text);
			}
		}
	}
}
namespace EeveeFrenzy.src.Util
{
	internal class EeveeFrenzyUtils : NetworkBehaviour
	{
		[CompilerGenerated]
		private sealed class <ForceRotationForABit>d__9 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public GameObject go;

			public Quaternion rotation;

			private float <duration>5__2;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <ForceRotationForABit>d__9(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<duration>5__2 = 0.25f;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (<duration>5__2 > 0f)
				{
					<duration>5__2 -= Time.deltaTime;
					go.transform.rotation = rotation;
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static Random random;

		internal static EeveeFrenzyUtils Instance { get; private set; }

		private void Awake()
		{
			Instance = this;
		}

		public NetworkObjectReference SpawnScrap(Item? item, Vector3 position, bool defaultRotation, int valueIncrease, Quaternion rotation = default(Quaternion))
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)StartOfRound.Instance == (Object)null || (Object)(object)item == (Object)null)
			{
				return default(NetworkObjectReference);
			}
			Transform val = null;
			if ((Object)(object)val == (Object)null)
			{
				val = StartOfRound.Instance.propsContainer;
			}
			Vector3 val2 = position;
			RaycastHit val3 = default(RaycastHit);
			if (Physics.Raycast(position + Vector3.up * 1f, Vector3.down, ref val3, 100f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
			{
				val2 = ((RaycastHit)(ref val3)).point + Vector3.up * item.verticalOffset;
			}
			GameObject val4 = Object.Instantiate<GameObject>(item.spawnPrefab, val2 + Vector3.up * 0.2f, Quaternion.identity, val);
			GrabbableObject component = val4.GetComponent<GrabbableObject>();
			NetworkObject networkObject = ((NetworkBehaviour)component).NetworkObject;
			component.fallTime = 0f;
			networkObject.Spawn(false);
			UpdateParentAndRotationsServerRpc(new NetworkObjectReference(val4), defaultRotation ? Quaternion.Euler(item.restingRotation) : rotation);
			int num = (int)((float)Random.Range(item.minValue, item.maxValue) * RoundManager.Instance.scrapValueMultiplier) + valueIncrease;
			ScanNodeProperties componentInChildren = val4.GetComponentInChildren<ScanNodeProperties>();
			if ((Object)(object)componentInChildren != (Object)null)
			{
				componentInChildren.scrapValue = num;
				componentInChildren.subText = $"Value: ${num}";
				component.scrapValue = num;
				UpdateScanNodeServerRpc(new NetworkObjectReference(networkObject), num);
			}
			return new NetworkObjectReference(val4);
		}

		[ServerRpc(RequireOwnership = false)]
		public void UpdateParentAndRotationsServerRpc(NetworkObjectReference go, Quaternion rotation)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1175290082u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref go, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1175290082u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					base.__rpc_exec_stage = (__RpcExecStage)0;
					UpdateParentAndRotationsClientRpc(go, rotation);
				}
			}
		}

		[ClientRpc]
		public void UpdateParentAndRotationsClientRpc(NetworkObjectReference go, Quaternion rotation)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: 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.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2595417688u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref go, default(ForNetworkSerializable));
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2595417688u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			base.__rpc_exec_stage = (__RpcExecStage)0;
			NetworkObject val3 = default(NetworkObject);
			((NetworkObjectReference)(ref go)).TryGet(ref val3, (NetworkManager)null);
			if ((Object)(object)val3 != (Object)null)
			{
				if (val3.AutoObjectParentSync && ((NetworkBehaviour)this).IsServer)
				{
					((Component)val3).transform.parent = StartOfRound.Instance.propsContainer;
				}
				else if (!val3.AutoObjectParentSync)
				{
					((Component)val3).transform.parent = StartOfRound.Instance.propsContainer;
				}
				Plugin.ExtendedLogging("This object just spawned: " + ((Object)((Component)val3).gameObject).name);
				((MonoBehaviour)this).StartCoroutine(ForceRotationForABit(((Component)val3).gameObject, rotation));
			}
		}

		[IteratorStateMachine(typeof(<ForceRotationForABit>d__9))]
		private IEnumerator ForceRotationForABit(GameObject go, Quaternion rotation)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <ForceRotationForABit>d__9(0)
			{
				go = go,
				rotation = rotation
			};
		}

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

		[ClientRpc]
		public void UpdateScanNodeClientRpc(NetworkObjectReference go, 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)
			//IL_00e9: 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.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3566988089u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref go, default(ForNetworkSerializable));
				BytePacker.WriteValueBitPacked(val2, value);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3566988089u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				NetworkObject val3 = default(NetworkObject);
				((NetworkObjectReference)(ref go)).TryGet(ref val3, (NetworkManager)null);
				GrabbableObject val4 = default(GrabbableObject);
				if ((Object)(object)val3 != (Object)null && ((Component)val3).gameObject.TryGetComponent<GrabbableObject>(ref val4))
				{
					val4.SetScrapValue(value);
					Plugin.ExtendedLogging($"Scrap Value: {value}");
				}
			}
		}

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

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(1175290082u, new RpcReceiveHandler(__rpc_handler_1175290082), "UpdateParentAndRotationsServerRpc");
			((NetworkBehaviour)this).__registerRpc(2595417688u, new RpcReceiveHandler(__rpc_handler_2595417688), "UpdateParentAndRotationsClientRpc");
			((NetworkBehaviour)this).__registerRpc(2639640965u, new RpcReceiveHandler(__rpc_handler_2639640965), "UpdateScanNodeServerRpc");
			((NetworkBehaviour)this).__registerRpc(3566988089u, new RpcReceiveHandler(__rpc_handler_3566988089), "UpdateScanNodeClientRpc");
			((NetworkBehaviour)this).__initializeRpcs();
		}

		private static void __rpc_handler_1175290082(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference go = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref go, default(ForNetworkSerializable));
				Quaternion rotation = default(Quaternion);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EeveeFrenzyUtils)(object)target).UpdateParentAndRotationsServerRpc(go, rotation);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2595417688(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference go = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref go, default(ForNetworkSerializable));
				Quaternion rotation = default(Quaternion);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EeveeFrenzyUtils)(object)target).UpdateParentAndRotationsClientRpc(go, rotation);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2639640965(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference go = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref go, default(ForNetworkSerializable));
				int value = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref value);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EeveeFrenzyUtils)(object)target).UpdateScanNodeServerRpc(go, value);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3566988089(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference go = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref go, default(ForNetworkSerializable));
				int value = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref value);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((EeveeFrenzyUtils)(object)target).UpdateScanNodeClientRpc(go, value);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "EeveeFrenzyUtils";
		}
	}
}
namespace EeveeFrenzy.src.Util.Extensions
{
	public static class NetworkObjectExtensions
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_0
		{
			public NetworkObject networkObject;

			internal bool <WaitUntilSpawned>b__0()
			{
				return networkObject.IsSpawned;
			}
		}

		[CompilerGenerated]
		private sealed class <RunActionAfterSpawned>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public NetworkObject networkObject;

			public Action action;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <RunActionAfterSpawned>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = networkObject.WaitUntilSpawned();
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					action();
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <WaitUntilSpawned>d__0 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public NetworkObject networkObject;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <WaitUntilSpawned>d__0(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitUntil((Func<bool>)new <>c__DisplayClass0_0
					{
						networkObject = networkObject
					}.<WaitUntilSpawned>b__0);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[IteratorStateMachine(typeof(<WaitUntilSpawned>d__0))]
		public static IEnumerator WaitUntilSpawned(this NetworkObject networkObject)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <WaitUntilSpawned>d__0(0)
			{
				networkObject = networkObject
			};
		}

		[IteratorStateMachine(typeof(<RunActionAfterSpawned>d__1))]
		private static IEnumerator RunActionAfterSpawned(NetworkObject networkObject, Action action)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <RunActionAfterSpawned>d__1(0)
			{
				networkObject = networkObject,
				action = action
			};
		}

		public static void OnSpawn(this NetworkObject networkObject, Action action)
		{
			((MonoBehaviour)networkObject).StartCoroutine(RunActionAfterSpawned(networkObject, action));
		}
	}
}
namespace EeveeFrenzy.src.Patches
{
	public static class DoorLockPatch
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnTriggerStay <0>__DoorLock_OnTriggerStay;
		}

		public static void Init()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__DoorLock_OnTriggerStay;
			if (obj == null)
			{
				hook_OnTriggerStay val = DoorLock_OnTriggerStay;
				<>O.<0>__DoorLock_OnTriggerStay = val;
				obj = (object)val;
			}
			DoorLock.OnTriggerStay += (hook_OnTriggerStay)obj;
		}

		private static void DoorLock_OnTriggerStay(orig_OnTriggerStay orig, DoorLock self, Collider other)
		{
			if (!((Object)(object)NetworkManager.Singleton == (Object)null) && ((NetworkBehaviour)self).IsServer && !self.isLocked && !self.isDoorOpened && ((Component)other).gameObject.layer == 19 && ((Object)((Component)other).gameObject).name == "DoorCollider")
			{
				self.enemyDoorMeter += Time.deltaTime * 0.5f;
				if (self.enemyDoorMeter > 1f)
				{
					self.enemyDoorMeter = 0f;
					((Component)self).gameObject.GetComponent<AnimatedObjectTrigger>().TriggerAnimationNonPlayer(false, true, false);
					self.OpenDoorAsEnemyServerRpc();
				}
			}
			orig.Invoke(self, other);
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal static class StartOfRoundPatch
	{
		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		public static void StartOfRound_Awake(ref StartOfRound __instance)
		{
			Plugin.ExtendedLogging("StartOfRound.Awake");
			((NetworkBehaviour)__instance).NetworkObject.OnSpawn(CreateNetworkManager);
		}

		private static void CreateNetworkManager()
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			if (((NetworkBehaviour)StartOfRound.Instance).IsServer || ((NetworkBehaviour)StartOfRound.Instance).IsHost)
			{
				if ((Object)(object)EeveeFrenzyUtils.Instance == (Object)null)
				{
					GameObject val = Object.Instantiate<GameObject>(Plugin.Assets.UtilsPrefab);
					SceneManager.MoveGameObjectToScene(val, ((Component)StartOfRound.Instance).gameObject.scene);
					val.GetComponent<NetworkObject>().Spawn(false);
					Scene scene = val.scene;
					Plugin.ExtendedLogging("Created EeveeFrenzyUtils. Scene is: '" + ((Scene)(ref scene)).name + "'");
				}
				else
				{
					Plugin.Logger.LogWarning((object)"EeveeFrenzyUtils already exists?");
				}
			}
		}
	}
}
namespace EeveeFrenzy.src.MiscScripts
{
	public class ChildHittableCollisionDetect : MonoBehaviour, IHittable
	{
		[SerializeField]
		private ChildEnemyAI _mainScript;

		public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return _mainScript.Hit(force, hitDirection, playerWhoHit, playHitSFX, hitID);
		}
	}
	public abstract class EFHittable : NetworkBehaviour
	{
		public abstract bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1);

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "EFHittable";
		}
	}
	public class HittableCollisionDetect : MonoBehaviour, IHittable
	{
		[SerializeField]
		private EFHittable _mainScript;

		public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return _mainScript.Hit(force, hitDirection, playerWhoHit, playHitSFX, hitID);
		}
	}
}
namespace EeveeFrenzy.src.Content.Items
{
	[RequireComponent(typeof(SmartAgentNavigator))]
	public class ChildEnemyAI : GrabbableObject
	{
		public enum FriendState
		{
			Neutral,
			Friendly,
			Tamed
		}

		public enum State
		{
			Spawning,
			Wandering,
			FollowingPlayer,
			Scared,
			Dancing,
			Grabbed
		}

		[CompilerGenerated]
		private sealed class <ChildGrabbableCooldown>d__48 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ParentEnemyAI _parentEevee;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <ChildGrabbableCooldown>d__48(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					_parentEevee.canGrabChild = true;
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <StopSittingTimer>d__53 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ChildEnemyAI <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <StopSittingTimer>d__53(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Expected O, but got Unknown
				int num = <>1__state;
				ChildEnemyAI childEnemyAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(1.5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					childEnemyAI.animator.SetBool(isSittingAnimation, false);
					childEnemyAI.isSitting = false;
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <SwitchToStateAfterDelay>d__77 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public float delay;

			public ChildEnemyAI <>4__this;

			public State state;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <SwitchToStateAfterDelay>d__77(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Expected O, but got Unknown
				int num = <>1__state;
				ChildEnemyAI childEnemyAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(delay);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if (((NetworkBehaviour)childEnemyAI).IsServer)
					{
						childEnemyAI.HandleStateAnimationSpeedChangesServerRpc((int)state);
					}
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <WaitUntilLeavingMoon>d__64 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ChildEnemyAI <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <WaitUntilLeavingMoon>d__64(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Expected O, but got Unknown
				int num = <>1__state;
				ChildEnemyAI childEnemyAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitUntil((Func<bool>)(() => StartOfRound.Instance.shipIsLeaving || StartOfRound.Instance.inShipPhase));
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if (childEnemyAI.friendEeveeState == FriendState.Friendly)
					{
						childEnemyAI.SwitchFriendShipStateServerRpc(2);
					}
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public NavMeshAgent agent;

		public Animator animator;

		public NetworkAnimator networkAnimator;

		public SmartAgentNavigator smartAgentNavigator;

		public float rangeOfDetection = 20f;

		[Header("Sound and Audio")]
		public AudioSource eeveeSource;

		public AudioClip spawnSound;

		public AudioClip[] hitSounds = Array.Empty<AudioClip>();

		public AudioClip[] idleSounds = Array.Empty<AudioClip>();

		public AudioClip[] idleHappySounds = Array.Empty<AudioClip>();

		public AudioClip[] scaredSounds = Array.Empty<AudioClip>();

		public AudioClip[] footstepSounds = Array.Empty<AudioClip>();

		[HideInInspector]
		public ParentEnemyAI? parentEevee;

		[HideInInspector]
		public NetworkVariable<int> health = new NetworkVariable<int>(4, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		[HideInInspector]
		public bool mommyAlive = true;

		[HideInInspector]
		public float[] friendShipMeterGoals = new float[3] { 0f, 20f, 50f };

		private float idleTimer;

		private float idleHappyTimer;

		private Dictionary<PlayerControllerB, float> friendShipMeterPlayers = new Dictionary<PlayerControllerB, float>();

		private List<Vector3> scaryPositionsList = new List<Vector3>();

		private float scaredTimer = 10f;

		private bool isScared;

		private bool isRunning;

		private bool isSitting;

		private float sittingTimer = 20f;

		private float observationCheckTimer = 2f;

		private PlayerControllerB? nearbyPlayer;

		private static readonly int isChildDeadAnimation = Animator.StringToHash("isChildDead");

		private static readonly int childGrabbedAnimation = Animator.StringToHash("childGrabbed");

		private static readonly int isWalkingAnimation = Animator.StringToHash("isWalking");

		private static readonly int isGoofyAnimation = Animator.StringToHash("isGoofy");

		private static readonly int isRunningAnimation = Animator.StringToHash("isRunning");

		private static readonly int isScaredAnimation = Animator.StringToHash("isScared");

		private static readonly int isSittingAnimation = Animator.StringToHash("isSitting");

		private static readonly int isDancingAnimation = Animator.StringToHash("isDancing");

		private static readonly int doIdleGestureAnimation = Animator.StringToHash("doIdleGesture");

		private static readonly int doSitGesture1Animation = Animator.StringToHash("doSitGesture1");

		private static readonly int doSitGesture2Animation = Animator.StringToHash("doSitGesture2");

		private static readonly int RunSpeedFloat = Animator.StringToHash("RunSpeed");

		private Coroutine? grabbingRoutine;

		private State eeveeState;

		private FriendState friendEeveeState;

		public override void OnNetworkSpawn()
		{
			((NetworkBehaviour)this).OnNetworkSpawn();
			AudioSource obj = eeveeSource;
			obj.volume *= Plugin.ModConfig.ConfigEverythingVolumeMultiplier.Value;
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val in allPlayerScripts)
			{
				if (!friendShipMeterPlayers.ContainsKey(val))
				{
					Plugin.ExtendedLogging("Adding player " + ((Object)val).name + " to friendShipMeterPlayers");
					friendShipMeterPlayers.TryAdd(val, 0f);
				}
			}
		}

		public override void Start()
		{
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).Start();
			eeveeSource.PlayOneShot(spawnSound);
			base.fallTime = 0f;
			smartAgentNavigator.OnUseEntranceTeleport.AddListener((UnityAction<bool>)OnUseEntranceTeleport);
			if ((Object)(object)parentEevee != (Object)null)
			{
				smartAgentNavigator.SetAllValues(((EnemyAI)parentEevee).isOutside);
				base.isInFactory = !((EnemyAI)parentEevee).isOutside;
				if (((NetworkBehaviour)this).IsServer)
				{
					HandleStateAnimationSpeedChanges(State.Spawning);
				}
				return;
			}
			if (((NetworkBehaviour)this).IsServer)
			{
				animator.SetBool(isSittingAnimation, true);
			}
			isSitting = true;
			smartAgentNavigator.SetAllValues(true);
			base.isInFactory = false;
			friendEeveeState = FriendState.Tamed;
			((Behaviour)agent).enabled = false;
			((Behaviour)smartAgentNavigator).enabled = false;
			Transform transform = ((Component)this).transform;
			Bounds bounds = StartOfRound.Instance.shipBounds.bounds;
			transform.position = ((Bounds)(ref bounds)).center;
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			HandleStateAnimationSpeedChangesServerRpc(5);
		}

		public override void DiscardItem()
		{
			((GrabbableObject)this).DiscardItem();
			if ((Object)(object)parentEevee == (Object)null || StartOfRound.Instance.shipIsLeaving)
			{
				if (((NetworkBehaviour)this).IsServer)
				{
					animator.SetBool(isSittingAnimation, true);
				}
				isSitting = true;
				return;
			}
			parentEevee.canGrabChild = false;
			if (grabbingRoutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(grabbingRoutine);
				grabbingRoutine = null;
			}
			grabbingRoutine = ((MonoBehaviour)this).StartCoroutine(ChildGrabbableCooldown(parentEevee));
			if (!parentEevee.holdingChild)
			{
				if (isScared)
				{
					HandleStateAnimationSpeedChangesServerRpc(3);
				}
				else
				{
					HandleStateAnimationSpeedChangesServerRpc(1);
				}
			}
		}

		[IteratorStateMachine(typeof(<ChildGrabbableCooldown>d__48))]
		private IEnumerator ChildGrabbableCooldown(ParentEnemyAI _parentEevee)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <ChildGrabbableCooldown>d__48(0)
			{
				_parentEevee = _parentEevee
			};
		}

		private void BaseUpdate()
		{
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			if (base.currentUseCooldown >= 0f)
			{
				base.currentUseCooldown -= Time.deltaTime;
			}
			if (((NetworkBehaviour)this).IsOwner)
			{
				if (base.isBeingUsed && base.itemProperties.requiresBattery)
				{
					if (base.insertedBattery.charge > 0f)
					{
						if (!base.itemProperties.itemIsTrigger)
						{
							Battery insertedBattery = base.insertedBattery;
							insertedBattery.charge -= Time.deltaTime / base.itemProperties.batteryUsage;
						}
					}
					else if (!base.insertedBattery.empty)
					{
						base.insertedBattery.empty = true;
						if (base.isBeingUsed)
						{
							Plugin.ExtendedLogging("Use up batteries local");
							base.isBeingUsed = false;
							((GrabbableObject)this).UseUpBatteries();
							base.isSendingItemRPC++;
							((GrabbableObject)this).UseUpItemBatteriesServerRpc();
						}
					}
				}
				if (!base.wasOwnerLastFrame)
				{
					base.wasOwnerLastFrame = true;
				}
			}
			else if (base.wasOwnerLastFrame)
			{
				base.wasOwnerLastFrame = false;
			}
			if (!base.isHeld && (Object)(object)base.parentObject == (Object)null)
			{
				if (base.fallTime >= 1f)
				{
					if (!base.reachedFloorTarget)
					{
						if (!base.hasHitGround)
						{
							((GrabbableObject)this).PlayDropSFX();
							((GrabbableObject)this).OnHitGround();
						}
						base.reachedFloorTarget = true;
						if (base.floorYRot == -1)
						{
							((Component)this).transform.rotation = Quaternion.Euler(base.itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, base.itemProperties.restingRotation.z);
						}
						else
						{
							((Component)this).transform.rotation = Quaternion.Euler(base.itemProperties.restingRotation.x, (float)(base.floorYRot + base.itemProperties.floorYOffset) + 90f, base.itemProperties.restingRotation.z);
						}
					}
					((Component)this).transform.localPosition = base.targetFloorPosition;
				}
				else
				{
					base.reachedFloorTarget = false;
					if (((Component)this).transform.localPosition.y - base.targetFloorPosition.y < 0.05f && !base.hasHitGround)
					{
						((GrabbableObject)this).PlayDropSFX();
						((GrabbableObject)this).OnHitGround();
					}
				}
			}
			else if (base.isHeld || base.isHeldByEnemy)
			{
				base.reachedFloorTarget = false;
			}
		}

		public override void Update()
		{
			//IL_0031: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: 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)
			if ((Object)(object)parentEevee == (Object)null || ((EnemyAI)parentEevee).isEnemyDead || StartOfRound.Instance.shipIsLeaving)
			{
				Bounds bounds = StartOfRound.Instance.shipBounds.bounds;
				if (((Bounds)(ref bounds)).Contains(((Component)this).transform.position))
				{
					((Behaviour)agent).enabled = false;
					smartAgentNavigator.StopSearchRoutine();
					((Behaviour)smartAgentNavigator).enabled = false;
				}
			}
			if (!((Behaviour)agent).enabled && !((Behaviour)smartAgentNavigator).enabled)
			{
				((GrabbableObject)this).Update();
				return;
			}
			BaseUpdate();
			if ((Object)(object)nearbyPlayer != (Object)null && (nearbyPlayer.isPlayerDead || !nearbyPlayer.isPlayerControlled || (nearbyPlayer.isInHangarShipRoom && (Object)(object)base.playerHeldBy != (Object)(object)nearbyPlayer)))
			{
				nearbyPlayer = null;
			}
			if ((Object)(object)base.playerHeldBy != (Object)null && base.isHeld)
			{
				friendShipMeterPlayers[base.playerHeldBy] += Time.deltaTime * 2f;
			}
			else
			{
				PlayerControllerB[] array = friendShipMeterPlayers.Keys.ToArray();
				foreach (PlayerControllerB val in array)
				{
					if (!((Object)(object)val == (Object)null) && !val.isPlayerDead && val.isPlayerControlled)
					{
						if (Vector3.Distance(((Component)val).transform.position, ((Component)this).transform.position) <= 10f)
						{
							friendShipMeterPlayers[val] += Time.deltaTime * 0.25f;
						}
						else if (!(friendShipMeterPlayers[val] <= 0f))
						{
							friendShipMeterPlayers[val] -= Time.deltaTime * 0.25f;
						}
					}
				}
			}
			if (((NetworkBehaviour)this).IsServer)
			{
				DoHostSideUpdate();
			}
		}

		private float GetCurrentMultiplierBoost()
		{
			if (isSitting)
			{
				return 0f;
			}
			if (isScared)
			{
				return 2f;
			}
			if (isRunning)
			{
				return 2f;
			}
			return 1f;
		}

		private void DoHostSideUpdate()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (((Behaviour)agent).enabled)
			{
				Animator obj = animator;
				int runSpeedFloat = RunSpeedFloat;
				Vector3 velocity = agent.velocity;
				obj.SetFloat(runSpeedFloat, ((Vector3)(ref velocity)).magnitude / 2f);
				agent.speed = 4f * GetCurrentMultiplierBoost();
			}
			switch (eeveeState)
			{
			case State.Spawning:
				DoSpawning();
				break;
			case State.Wandering:
				DoWandering();
				break;
			case State.FollowingPlayer:
				DoFollowingPlayer();
				break;
			case State.Scared:
				DoScared();
				break;
			case State.Dancing:
				DoDancing();
				break;
			}
			HandleFriendShipMeter();
			if (!base.isHeldByEnemy && !base.isHeld && !isSitting && sittingTimer <= 0f)
			{
				animator.SetBool(isSittingAnimation, true);
				isSitting = true;
				sittingTimer = Random.Range(20, 30);
				if (Random.Range(0, 2) == 0)
				{
					networkAnimator.SetTrigger(doSitGesture1Animation, true);
				}
				else
				{
					networkAnimator.SetTrigger(doSitGesture2Animation, true);
				}
				((MonoBehaviour)this).StartCoroutine(StopSittingTimer());
			}
		}

		[IteratorStateMachine(typeof(<StopSittingTimer>d__53))]
		private IEnumerator StopSittingTimer()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <StopSittingTimer>d__53(0)
			{
				<>4__this = this
			};
		}

		private void DoSpawning()
		{
		}

		private void DoWandering()
		{
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			if (!isSitting)
			{
				sittingTimer -= Time.deltaTime;
			}
			observationCheckTimer -= Time.deltaTime;
			idleTimer -= Time.deltaTime;
			if (idleTimer <= 0f)
			{
				idleTimer = 4f;
				eeveeSource.PlayOneShot(idleSounds[Random.Range(0, idleSounds.Length)]);
			}
			if (observationCheckTimer > 0f)
			{
				return;
			}
			observationCheckTimer = 2f;
			PlayerControllerB val = DetectNearbyPlayer();
			if ((Object)(object)val != (Object)null)
			{
				SetTargetPlayerServerRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, val));
				HandleStateAnimationSpeedChanges(State.FollowingPlayer);
			}
			foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
			{
				if (!(spawnedEnemy is ParentEnemyAI) && LineOfSightAvailable(((Component)spawnedEnemy).transform))
				{
					BecomeScared(new List<Vector3> { ((Component)spawnedEnemy).transform.position });
					HandleStateAnimationSpeedChanges(State.Scared);
				}
			}
		}

		private void DoFollowingPlayer()
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)nearbyPlayer == (Object)null)
			{
				SetTargetPlayerServerRpc(-1);
				HandleStateAnimationSpeedChanges(State.Wandering);
				return;
			}
			idleHappyTimer -= Time.deltaTime;
			if (idleHappyTimer <= 0f)
			{
				idleHappyTimer = 4f;
				eeveeSource.PlayOneShot(idleHappySounds[Random.Range(0, idleHappySounds.Length)]);
			}
			if ((Object)(object)parentEevee == (Object)null || friendEeveeState != 0)
			{
				smartAgentNavigator.DoPathingToDestination(((Component)nearbyPlayer).transform.position);
			}
			else if (Vector3.Distance(((Component)this).transform.position, parentEevee.spawnPosition) <= 25f)
			{
				smartAgentNavigator.DoPathingToDestination(((Component)nearbyPlayer).transform.position);
			}
			else
			{
				nearbyPlayer = null;
			}
		}

		public void BecomeScared(List<Vector3> scaryPositions)
		{
			scaryPositionsList.Clear();
			scaryPositionsList.AddRange(scaryPositions);
			HandleStateAnimationSpeedChanges(State.Scared);
		}

		private void DoScared()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: 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_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: 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)
			List<Vector3> list = new List<Vector3>(scaryPositionsList);
			Vector3 val = Vector3.zero;
			if (list.Count > 0)
			{
				Vector3 val2 = Vector3.zero;
				foreach (Vector3 item in list)
				{
					Vector3 val3 = val2;
					Vector3 val4 = ((Component)this).transform.position - item;
					val2 = val3 + ((Vector3)(ref val4)).normalized;
				}
				val = ((Component)this).transform.position + val2 * 10f;
				NavMeshHit val5 = default(NavMeshHit);
				if (NavMesh.SamplePosition(val, ref val5, 10f, -1))
				{
					val = ((NavMeshHit)(ref val5)).position;
				}
			}
			scaredTimer -= Time.deltaTime;
			if (scaredTimer <= 0f)
			{
				scaredTimer = 10f;
				HandleStateAnimationSpeedChanges(State.Wandering);
			}
			agent.SetDestination(val);
		}

		private void DoDancing()
		{
		}

		private void HandleFriendShipMeter()
		{
			switch (friendEeveeState)
			{
			case FriendState.Neutral:
				DoNeutralFriendShip();
				break;
			case FriendState.Friendly:
				DoFriendlyFriendShip();
				break;
			case FriendState.Tamed:
				DoTamedFriendShip();
				break;
			}
		}

		private void DoNeutralFriendShip()
		{
			if (!((Object)(object)nearbyPlayer == (Object)null) && friendShipMeterPlayers[nearbyPlayer] >= friendShipMeterGoals[1])
			{
				SwitchFriendShipStateServerRpc(1);
				((MonoBehaviour)this).StartCoroutine(WaitUntilLeavingMoon());
			}
		}

		private void DoFriendlyFriendShip()
		{
		}

		private void DoTamedFriendShip()
		{
		}

		[IteratorStateMachine(typeof(<WaitUntilLeavingMoon>d__64))]
		private IEnumerator WaitUntilLeavingMoon()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <WaitUntilLeavingMoon>d__64(0)
			{
				<>4__this = this
			};
		}

		private PlayerControllerB? DetectNearbyPlayer()
		{
			if (base.isHeld && (Object)(object)base.playerHeldBy != (Object)null)
			{
				nearbyPlayer = base.playerHeldBy;
				return nearbyPlayer;
			}
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val in allPlayerScripts)
			{
				if (LineOfSightAvailable(((Component)val).transform))
				{
					nearbyPlayer = val;
					return nearbyPlayer;
				}
			}
			return null;
		}

		private bool LineOfSightAvailable(Transform PlayerOrEnemy)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: 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: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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)
			float num = Vector3.Distance(PlayerOrEnemy.position, ((Component)this).transform.position);
			if (num >= rangeOfDetection)
			{
				return false;
			}
			Vector3 position = PlayerOrEnemy.position;
			Vector3 val = PlayerOrEnemy.position - ((Component)this).transform.position;
			if (Physics.Raycast(position, ((Vector3)(ref val)).normalized, num, StartOfRound.Instance.collidersAndRoomMaskAndDefault | LayerMask.GetMask(new string[2] { "Terrain", "InteractableObject" }), (QueryTriggerInteraction)1))
			{
				return false;
			}
			return true;
		}

		[ServerRpc(RequireOwnership = false)]
		public void HandleStateAnimationSpeedChangesServerRpc(int state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(253582352u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, state);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 253582352u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					HandleStateAnimationSpeedChanges((State)state);
				}
			}
		}

		public void DisableOrEnableAllCollidersAndAgent(bool enable)
		{
			((Behaviour)agent).enabled = enable;
		}

		public void HandleStateAnimationSpeedChanges(State state)
		{
			Plugin.ExtendedLogging($"HandleStateAnimationSpeedChanges for CHILD {state}");
			SwitchStateClientRpc((int)state);
			switch (state)
			{
			case State.Spawning:
				SetAnimatorBools(isWalking: false, isRunning: false, isScared: false, isDancing: false, isGrabbed: false);
				break;
			case State.Wandering:
				SetAnimatorBools(isWalking: true, isRunning: false, isScared: false, isDancing: false, isGrabbed: false);
				break;
			case State.FollowingPlayer:
				SetAnimatorBools(isWalking: true, isRunning: true, isScared: false, isDancing: false, isGrabbed: false);
				break;
			case State.Scared:
				SetAnimatorBools(animator.GetBool(isWalkingAnimation), isRunning, isScared: true, isDancing: false, base.isHeld);
				break;
			case State.Dancing:
				SetAnimatorBools(isWalking: false, isRunning: false, isScared: false, isDancing: true, isGrabbed: false);
				break;
			case State.Grabbed:
				SetAnimatorBools(isWalking: false, isRunning: false, isScared, isDancing: false, isGrabbed: true);
				break;
			}
		}

		private void SetAnimatorBools(bool isWalking, bool isRunning, bool isScared, bool isDancing, bool isGrabbed)
		{
			Plugin.ExtendedLogging($"Setting animator bools for child: isWalking: {isWalking}, isRunning: {isRunning}, isScared: {isScared}, isDancing: {isDancing}, isGrabbed: {isGrabbed}");
			animator.SetBool(isWalkingAnimation, isWalking);
			animator.SetBool(isRunningAnimation, isRunning);
			this.isRunning = isRunning;
			animator.SetBool(isScaredAnimation, isScared);
			this.isScared = isScared;
			animator.SetBool(isDancingAnimation, isDancing);
			animator.SetBool(childGrabbedAnimation, isGrabbed);
			animator.SetBool(isSittingAnimation, false);
			isSitting = false;
		}

		[ServerRpc(RequireOwnership = false)]
		private void SwitchFriendShipStateServerRpc(int state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2168788941u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, state);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2168788941u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SwitchFriendShipStateClientRpc(state);
				}
			}
		}

		[ClientRpc]
		private void SwitchFriendShipStateClientRpc(int state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(600034779u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, state);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 600034779u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SwitchFriendShipState(state);
				}
			}
		}

		private void SwitchFriendShipState(int state)
		{
			friendEeveeState = (FriendState)state;
		}

		[ServerRpc(RequireOwnership = false)]
		private void SwitchStateServerRpc(int state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3359701319u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, state);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3359701319u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SwitchStateClientRpc(state);
				}
			}
		}

		[ClientRpc]
		private void SwitchStateClientRpc(int state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1320076591u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, state);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1320076591u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SwitchState(state);
				}
			}
		}

		private void SwitchState(int state)
		{
			if (state != -1)
			{
				smartAgentNavigator.StopSearchRoutine();
				if (!animator.GetBool(isChildDeadAnimation))
				{
					DisableOrEnableAllCollidersAndAgent(enable: true);
				}
				switch (state)
				{
				case 0:
					HandleStateSpawningChange();
					break;
				case 1:
					HandleStateWanderingChange();
					break;
				case 2:
					HandleStateFollowingPlayerChange();
					break;
				case 3:
					HandleStateScaredChange();
					break;
				case 4:
					HandleStateDancingChange();
					break;
				case 5:
					HandleStateGrabbedChange();
					break;
				}
				eeveeState = (State)state;
			}
		}

		[IteratorStateMachine(typeof(<SwitchToStateAfterDelay>d__77))]
		private IEnumerator SwitchToStateAfterDelay(State state, float delay)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <SwitchToStateAfterDelay>d__77(0)
			{
				<>4__this = this,
				state = state,
				delay = delay
			};
		}

		private void HandleStateSpawningChange()
		{
			((MonoBehaviour)this).StartCoroutine(SwitchToStateAfterDelay(State.Wandering, 2f));
		}

		private void HandleStateWanderingChange()
		{
			if (((NetworkBehaviour)this).IsServer)
			{
				smartAgentNavigator.StartSearchRoutine(40f);
			}
		}

		private void HandleStateFollowingPlayerChange()
		{
		}

		private void HandleStateScaredChange()
		{
			eeveeSource.PlayOneShot(scaredSounds[Random.Range(0, scaredSounds.Length)]);
		}

		private void HandleStateDancingChange()
		{
		}

		private void HandleStateGrabbedChange()
		{
			DisableOrEnableAllCollidersAndAgent(enable: false);
		}

		public void OnUseEntranceTeleport(bool setOutside)
		{
			((GrabbableObject)this).EnableItemMeshes(true);
		}

		public void OnEnterOrExitElevator(bool enteredElevator)
		{
		}

		public bool Hit(int force, Vector3 hitDirection, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			DoHitStuffServerRpc();
			return true;
		}

		[ServerRpc(RequireOwnership = false)]
		private void DoHitStuffServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1535226684u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1535226684u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				NetworkVariable<int> obj = health;
				int value = obj.Value;
				obj.Value = value - 1;
				if (health.Value <= 0)
				{
					animator.SetBool(isChildDeadAnimation, true);
				}
				DoHitStuffClientRpc();
			}
		}

		[ClientRpc]
		public void DoHitStuffClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3803450722u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3803450722u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				eeveeSource.PlayOneShot(hitSounds[Random.Range(0, hitSounds.Length)]);
				if (health.Value <= 0)
				{
					smartAgentNavigator.OnUseEntranceTeleport.RemoveListener((UnityAction<bool>)OnUseEntranceTeleport);
					smartAgentNavigator.StopSearchRoutine();
					((Behaviour)smartAgentNavigator).enabled = false;
					((Behaviour)agent).enabled = false;
					base.grabbable = false;
					base.grabbableToEnemies = true;
					Object.Destroy((Object)(object)((Component)this).GetComponent<ChildEnemyAI>());
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void SetTargetPlayerServerRpc(int playerToFollowIndex)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2604986217u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerToFollowIndex);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2604986217u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SetTargetPlayerClientRpc(playerToFollowIndex);
				}
			}
		}

		[ClientRpc]
		private void SetTargetPlayerClientRpc(int playerToFollowIndex)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2213999646u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerToFollowIndex);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2213999646u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (playerToFollowIndex == -1)
				{
					nearbyPlayer = null;
				}
				else
				{
					nearbyPlayer = StartOfRound.Instance.allPlayerScripts[playerToFollowIndex];
				}
			}
		}

		public void PlayFootstepSoundAnimEvent()
		{
			eeveeSource.PlayOneShot(footstepSounds[Random.Range(0, footstepSounds.Length)], 0.5f);
		}

		protected override void __initializeVariables()
		{
			if (health == null)
			{
				throw new Exception("ChildEnemyAI.health cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)health).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)health, "health");
			((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)health);
			((GrabbableObject)this).__initializeVariables();
		}

		protected override void __initializeRpcs()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			((NetworkBehaviour)this).__registerRpc(253582352u, new RpcReceiveHandler(__rpc_handler_253582352), "HandleStateAnimationSpeedChangesServerRpc");
			((NetworkBehaviour)this).__registerRpc(2168788941u, new RpcReceiveHandler(__rpc_handler_2168788941), "SwitchFriendShipStateServerRpc");
			((NetworkBehaviour)this).__registerRpc(600034779u, new RpcReceiveHandler(__rpc_handler_600034779), "SwitchFriendShipStateClientRpc");
			((NetworkBehaviour)this).__registerRpc(3359701319u, new RpcReceiveHandler(__rpc_handler_3359701319), "SwitchStateServerRpc");
			((NetworkBehaviour)this).__registerRpc(1320076591u, new RpcReceiveHandler(__rpc_handler_1320076591), "SwitchStateClientRpc");
			((NetworkBehaviour)this).__registerRpc(1535226684u, new RpcReceiveHandler(__rpc_handler_1535226684), "DoHitStuffServerRpc");
			((NetworkBehaviour)this).__registerRpc(3803450722u, new RpcReceiveHandler(__rpc_handler_3803450722), "DoHitStuffClientRpc");
			((NetworkBehaviour)this).__registerRpc(2604986217u, new RpcReceiveHandler(__rpc_handler_2604986217), "SetTargetPlayerServerRpc");
			((NetworkBehaviour)this).__registerRpc(2213999646u, new RpcReceiveHandler(__rpc_handler_2213999646), "SetTargetPlayerClientRpc");
			((GrabbableObject)this).__initializeRpcs();
		}

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

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

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

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

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

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

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

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "ChildEnemyAI";
		}
	}
}
namespace EeveeFrenzy.src.Content.Enemies
{
	public class EnemyHandler : ContentHandler<EnemyHandler>
	{
		public DefaultBundle? defaultBundle;

		public EnemyHandler(DuskMod mod)
			: base(mod)
		{
			((ContentHandler)this).RegisterContent<DefaultBundle>("eeveelutionassets", ref defaultBundle, false);
		}
	}
	[RequireComponent(typeof(SmartAgentNavigator))]
	public abstract class EeveeFrenzyEnemyAI : EnemyAI
	{
		[NonSerialized]
		public EnemyAI? targetEnemy;

		public SmartAgentNavigator smartAgentNavigator;

		public override void Start()
		{
			((EnemyAI)this).Start();
			AudioSource creatureVoice = base.creatureVoice;
			creatureVoice.volume *= Plugin.ModConfig.ConfigEverythingVolumeMultiplier.Value;
			AudioSource creatureSFX = base.creatureSFX;
			creatureSFX.volume *= Plugin.ModConfig.ConfigEverythingVolumeMultiplier.Value;
			smartAgentNavigator.OnUseEntranceTeleport.AddListener((UnityAction<bool>)((EnemyAI)this).SetEnemyOutside);
			smartAgentNavigator.SetAllValues(base.isOutside);
			Plugin.ExtendedLogging(base.enemyType.enemyName + " Spawned.");
			GrabEnemyRarity(base.enemyType.enemyName);
		}

		public void GrabEnemyRarity(string enemyName)
		{
			string enemyName2 = enemyName;
			SpawnableEnemyWithRarity val = RoundManager.Instance.currentLevel.OutsideEnemies.OfType<SpawnableEnemyWithRarity>().FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName.Equals(enemyName2))) ?? RoundManager.Instance.currentLevel.DaytimeEnemies.OfType<SpawnableEnemyWithRarity>().FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName.Equals(enemyName2)));
			if (val == null)
			{
				val = RoundManager.Instance.currentLevel.Enemies.OfType<SpawnableEnemyWithRarity>().FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName.Equals(enemyName2)));
			}
			if (val != null)
			{
				Plugin.ExtendedLogging(enemyName2 + " has Rarity: " + val.rarity);
			}
			else
			{
				Plugin.Logger.LogWarning((object)"Enemy not found.");
			}
		}

		[ClientRpc]
		public void SetFloatAnimationClientRpc(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_011a: 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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(710183066u, 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, 710183066u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				SetFloatAnimationOnLocalClient(name, value);
			}
		}

		public void SetFloatAnimationOnLocalClient(string name, float value)
		{
			Plugin.ExtendedLogging(name + " " + value);
			base.creatureAnimator.SetFloat(name, value);
		}

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

		public void SetBoolAnimationOnLocalClient(int intName, bool active)
		{
			base.creatureAnimator.SetBool(intName, active);
		}

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

		[ClientRpc]
		public void TriggerAnimationClientRpc(string triggerName)
		{
			//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