Decompiled source of PandoraEnemy v0.0.1

BepInEx/plugins/PandoraEnemy/com.github.xuuxiaolan.pandoraenemy.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
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.Logging;
using CodeRebirthLib;
using CodeRebirthLib.AssetManagement;
using CodeRebirthLib.ContentManagement;
using CodeRebirthLib.Extensions;
using CodeRebirthLib.Util.INetworkSerializables;
using CodeRebirthLib.Util.Pathfinding;
using GameNetcodeStuff;
using IL.GameNetcodeStuff;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On;
using On.GameNetcodeStuff;
using PandoraEnemy.Content.Enemies;
using PandoraEnemy.Patches;
using Unity.Netcode;
using Unity.Netcode.Components;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using com.github.xuuxiaolan.pandoraenemy.NetcodePatcher;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("EasyTextEffects")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: AssemblyCompany("com.github.xuuxiaolan.pandoraenemy")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyInformationalVersion("0.0.1+10c78aa5ce042f9f6a67bae58f752956f043e00d")]
[assembly: AssemblyProduct("PandoraEnemy")]
[assembly: AssemblyTitle("com.github.xuuxiaolan.pandoraenemy")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.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 PandoraEnemy
{
	public class PandoraAdditionalPlayerData : MonoBehaviour
	{
		private static Dictionary<PlayerControllerB, PandoraAdditionalPlayerData> _playerData = new Dictionary<PlayerControllerB, PandoraAdditionalPlayerData>();

		public float OverrideSinkingValue;

		public PandoraEnemyAI inAnimationWithPandora;

		public static PandoraAdditionalPlayerData GetOrCreate(PlayerControllerB player)
		{
			if (_playerData.TryGetValue(player, out PandoraAdditionalPlayerData value))
			{
				return value;
			}
			value = ((Component)player).gameObject.AddComponent<PandoraAdditionalPlayerData>();
			_playerData[player] = value;
			return value;
		}
	}
	[BepInPlugin("com.github.xuuxiaolan.pandoraenemy", "PandoraEnemy", "0.0.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class PandoraEnemy : BaseUnityPlugin
	{
		internal static ManualLogSource Logger { get; private set; }

		public static CRMod Mod { get; private set; }

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			NetcodePatcher();
			AssetBundle val = CRLib.LoadBundle(Assembly.GetExecutingAssembly(), "pandoracontentassets");
			Mod = CRLib.RegisterMod((BaseUnityPlugin)(object)this, val);
			Mod.Logger = Logger;
			SinkingPatches.Init();
			SpacebarMinigamePatches.Init();
			Mod.RegisterContentHandlers();
			Logger.LogInfo((object)"com.github.xuuxiaolan.pandoraenemy v0.0.1 has loaded!");
		}

		private void NetcodePatcher()
		{
			IEnumerable<Type> loadableTypes = AssemblyExtensions.GetLoadableTypes(Assembly.GetExecutingAssembly());
			foreach (Type item in loadableTypes)
			{
				if (item.IsNested)
				{
					continue;
				}
				MethodInfo[] methods = item.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array = methods;
				foreach (MethodInfo methodInfo in array)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "com.github.xuuxiaolan.pandoraenemy";

		public const string PLUGIN_NAME = "PandoraEnemy";

		public const string PLUGIN_VERSION = "0.0.1";
	}
}
namespace PandoraEnemy.Patches
{
	internal static class SinkingPatches
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__OverrideSinkingValue;

			public static hook_Awake <1>__AddAdditionalPlayerData;

			public static hook_PlayerIsTargetable <2>__NotTargetableWhenInAnimationWithPandora;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_DamagePlayerFromOtherClientClientRpc <>9__0_0;

			public static Func<Instruction, bool> <>9__3_0;

			public static Func<Instruction, bool> <>9__3_1;

			public static Func<Instruction, bool> <>9__3_2;

			public static Func<Instruction, bool> <>9__3_3;

			public static Func<Instruction, bool> <>9__3_4;

			public static Func<Instruction, bool> <>9__3_5;

			public static Func<Instruction, bool> <>9__3_6;

			public static Action<PlayerControllerB> <>9__3_7;

			internal void <Init>b__0_0(orig_DamagePlayerFromOtherClientClientRpc orig, PlayerControllerB self, int amount, Vector3 direction, int hit, int healthAmount)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				if ((int)((NetworkBehaviour)self).__rpc_exec_stage != 2)
				{
					orig.Invoke(self, amount, direction, hit, healthAmount);
					return;
				}
				PandoraEnemy.Logger.LogDebug((object)("PullPlayerOutOfGroundPound " + self.playerUsername));
				PandoraAdditionalPlayerData orCreate = PandoraAdditionalPlayerData.GetOrCreate(self);
				if (Object.op_Implicit((Object)(object)orCreate.inAnimationWithPandora))
				{
					orCreate.inAnimationWithPandora.PlayerIsHitInGroundPound(self);
					return;
				}
				PandoraEnemy.Logger.LogDebug((object)"not pandora");
				orig.Invoke(self, amount, direction, hit, healthAmount);
			}

			internal bool <OverrideSinkingValue>b__3_0(Instruction i)
			{
				return ILPatternMatchingExt.MatchLdarg(i, 0);
			}

			internal bool <OverrideSinkingValue>b__3_1(Instruction i)
			{
				return ILPatternMatchingExt.MatchLdfld<PlayerControllerB>(i, "sinkingValue");
			}

			internal bool <OverrideSinkingValue>b__3_2(Instruction i)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(i, ref num);
			}

			internal bool <OverrideSinkingValue>b__3_3(Instruction i)
			{
				ILLabel val = default(ILLabel);
				return ILPatternMatchingExt.MatchBgt(i, ref val);
			}

			internal bool <OverrideSinkingValue>b__3_4(Instruction i)
			{
				return ILPatternMatchingExt.MatchLdarg(i, 0);
			}

			internal bool <OverrideSinkingValue>b__3_5(Instruction i)
			{
				return ILPatternMatchingExt.MatchLdfld<PlayerControllerB>(i, "isUnderwater");
			}

			internal bool <OverrideSinkingValue>b__3_6(Instruction i)
			{
				ILLabel val = default(ILLabel);
				return ILPatternMatchingExt.MatchBrfalse(i, ref val);
			}

			internal void <OverrideSinkingValue>b__3_7(PlayerControllerB self)
			{
				float overrideSinkingValue = PandoraAdditionalPlayerData.GetOrCreate(self).OverrideSinkingValue;
				if (overrideSinkingValue != 0f)
				{
					self.sinkingValue = overrideSinkingValue;
				}
			}
		}

		internal 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
			//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_003b: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected O, but got Unknown
			object obj = <>O.<0>__OverrideSinkingValue;
			if (obj == null)
			{
				Manipulator val = OverrideSinkingValue;
				<>O.<0>__OverrideSinkingValue = val;
				obj = (object)val;
			}
			PlayerControllerB.Update += (Manipulator)obj;
			object obj2 = <>O.<1>__AddAdditionalPlayerData;
			if (obj2 == null)
			{
				hook_Awake val2 = AddAdditionalPlayerData;
				<>O.<1>__AddAdditionalPlayerData = val2;
				obj2 = (object)val2;
			}
			PlayerControllerB.Awake += (hook_Awake)obj2;
			object obj3 = <>c.<>9__0_0;
			if (obj3 == null)
			{
				hook_DamagePlayerFromOtherClientClientRpc val3 = delegate(orig_DamagePlayerFromOtherClientClientRpc orig, PlayerControllerB self, int amount, Vector3 direction, int hit, int healthAmount)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0007: Invalid comparison between Unknown and I4
					//IL_000c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0065: Unknown result type (might be due to invalid IL or missing references)
					if ((int)((NetworkBehaviour)self).__rpc_exec_stage != 2)
					{
						orig.Invoke(self, amount, direction, hit, healthAmount);
					}
					else
					{
						PandoraEnemy.Logger.LogDebug((object)("PullPlayerOutOfGroundPound " + self.playerUsername));
						PandoraAdditionalPlayerData orCreate = PandoraAdditionalPlayerData.GetOrCreate(self);
						if (Object.op_Implicit((Object)(object)orCreate.inAnimationWithPandora))
						{
							orCreate.inAnimationWithPandora.PlayerIsHitInGroundPound(self);
						}
						else
						{
							PandoraEnemy.Logger.LogDebug((object)"not pandora");
							orig.Invoke(self, amount, direction, hit, healthAmount);
						}
					}
				};
				<>c.<>9__0_0 = val3;
				obj3 = (object)val3;
			}
			PlayerControllerB.DamagePlayerFromOtherClientClientRpc += (hook_DamagePlayerFromOtherClientClientRpc)obj3;
			object obj4 = <>O.<2>__NotTargetableWhenInAnimationWithPandora;
			if (obj4 == null)
			{
				hook_PlayerIsTargetable val4 = NotTargetableWhenInAnimationWithPandora;
				<>O.<2>__NotTargetableWhenInAnimationWithPandora = val4;
				obj4 = (object)val4;
			}
			EnemyAI.PlayerIsTargetable += (hook_PlayerIsTargetable)obj4;
		}

		private static bool NotTargetableWhenInAnimationWithPandora(orig_PlayerIsTargetable orig, EnemyAI self, PlayerControllerB playerscript, bool cannotbeinship, bool overrideinsidefactorycheck)
		{
			PandoraAdditionalPlayerData orCreate = PandoraAdditionalPlayerData.GetOrCreate(playerscript);
			if (orig.Invoke(self, playerscript, cannotbeinship, overrideinsidefactorycheck))
			{
				return !Object.op_Implicit((Object)(object)orCreate.inAnimationWithPandora);
			}
			return false;
		}

		private static void AddAdditionalPlayerData(orig_Awake orig, PlayerControllerB self)
		{
			orig.Invoke(self);
		}

		private static void OverrideSinkingValue(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			float num = default(float);
			ILLabel val3 = default(ILLabel);
			ILLabel val2 = default(ILLabel);
			val.GotoNext(new Func<Instruction, bool>[7]
			{
				(Instruction i) => ILPatternMatchingExt.MatchLdarg(i, 0),
				(Instruction i) => ILPatternMatchingExt.MatchLdfld<PlayerControllerB>(i, "sinkingValue"),
				(Instruction i) => ILPatternMatchingExt.MatchLdcR4(i, ref num),
				(Instruction i) => ILPatternMatchingExt.MatchBgt(i, ref val3),
				(Instruction i) => ILPatternMatchingExt.MatchLdarg(i, 0),
				(Instruction i) => ILPatternMatchingExt.MatchLdfld<PlayerControllerB>(i, "isUnderwater"),
				(Instruction i) => ILPatternMatchingExt.MatchBrfalse(i, ref val2)
			});
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Action<PlayerControllerB>>((Action<PlayerControllerB>)delegate(PlayerControllerB self)
			{
				float overrideSinkingValue = PandoraAdditionalPlayerData.GetOrCreate(self).OverrideSinkingValue;
				if (overrideSinkingValue != 0f)
				{
					self.sinkingValue = overrideSinkingValue;
				}
			});
		}
	}
	internal static class SpacebarMinigamePatches
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Jump_performed <0>__JumpPeformed;
		}

		internal 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>__JumpPeformed;
			if (obj == null)
			{
				hook_Jump_performed val = JumpPeformed;
				<>O.<0>__JumpPeformed = val;
				obj = (object)val;
			}
			PlayerControllerB.Jump_performed += (hook_Jump_performed)obj;
		}

		private static void JumpPeformed(orig_Jump_performed orig, PlayerControllerB self, CallbackContext context)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			if (((NetworkBehaviour)self).IsOwner && self.isPlayerControlled)
			{
				PandoraAdditionalPlayerData orCreate = PandoraAdditionalPlayerData.GetOrCreate(self);
				if (Object.op_Implicit((Object)(object)orCreate.inAnimationWithPandora))
				{
					orCreate.inAnimationWithPandora.LocalPlayerPerformsJump();
					return;
				}
			}
			orig.Invoke(self, context);
		}
	}
}
namespace PandoraEnemy.Content
{
	public class PandoraContentHandler : ContentHandler<PandoraContentHandler>
	{
		public PandoraContentHandler(CRMod mod)
			: base(mod)
		{
			DefaultBundle val = default(DefaultBundle);
			((ContentHandler)this).RegisterContent<DefaultBundle>("pandoraassets", ref val, false);
		}
	}
}
namespace PandoraEnemy.Content.Enemies
{
	[RequireComponent(typeof(AudioSource))]
	public class HeartbeatAudioHandler : MonoBehaviour
	{
		[SerializeField]
		private float _baseTimer = 15f;

		[SerializeField]
		private float _volumeLerpRate = 14f;

		[SerializeField]
		private List<AudioClip> _clips = new List<AudioClip>();

		private float _currentInterval;

		private float _currentTime;

		private float _targetVolume;

		private float _targetInterval;

		private AudioSource _source;

		private Random _random = new Random();

		internal bool IsRunning { get; set; } = true;


		public void Focus()
		{
			_targetVolume = 1f;
		}

		public void Unfocus()
		{
			_targetVolume = 0f;
		}

		public void SetInterval(float interval)
		{
			_targetInterval = interval;
		}

		private void Start()
		{
			_source = ((Component)this).GetComponent<AudioSource>();
			_currentInterval = _baseTimer;
			if (_clips.Count == 0)
			{
				_clips.Add(_source.clip);
			}
		}

		private void Update()
		{
			if (IsRunning)
			{
				_currentTime += Time.deltaTime;
				_currentInterval = Mathf.Lerp(_currentInterval, _targetInterval, Time.deltaTime * _volumeLerpRate);
				_source.volume = Mathf.Lerp(_source.volume, _targetVolume, Time.deltaTime * _volumeLerpRate);
				if (_currentTime >= _currentInterval)
				{
					PandoraEnemy.Logger.LogDebug((object)"play heartbeat audio");
					_currentTime = 0f;
					_source.PlayOneShot(RandomExtensions.NextItem<AudioClip>(_random, (IList<AudioClip>)_clips));
				}
			}
		}
	}
	[RequireComponent(typeof(SmartAgentNavigator))]
	[RequireComponent(typeof(Animator))]
	[RequireComponent(typeof(NetworkAnimator))]
	[RequireComponent(typeof(NetworkTransform))]
	[RequireComponent(typeof(Collider))]
	public class PandoraBaseEnemyAI : EnemyAI
	{
		internal PlayerControllerB? previousTargetPlayer;

		[Header("Required Components")]
		[SerializeField]
		internal NetworkAnimator creatureNetworkAnimator;

		[SerializeField]
		internal SmartAgentNavigator smartAgentNavigator;

		[Header("Inherited Fields")]
		[SerializeField]
		private AudioClip[] _hitBodySounds = Array.Empty<AudioClip>();

		[SerializeField]
		private AudioClip _spawnSound;

		internal Random _enemyRandom = new Random();

		private static int _randomNumberForRandomThings;

		public override void Start()
		{
			((EnemyAI)this).Start();
			_enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + 69 + _randomNumberForRandomThings);
			_randomNumberForRandomThings++;
			if ((Object)(object)_spawnSound != (Object)null)
			{
				base.creatureVoice.PlayOneShot(_spawnSound);
			}
			smartAgentNavigator.OnUseEntranceTeleport.AddListener((UnityAction<bool>)((EnemyAI)this).SetEnemyOutside);
			smartAgentNavigator.SetAllValues(base.isOutside);
		}

		public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
			if (!base.isEnemyDead && playHitSFX && _hitBodySounds.Length != 0)
			{
				base.creatureSFX.PlayOneShot(_hitBodySounds[_enemyRandom.Next(_hitBodySounds.Length)]);
			}
		}

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

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

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "PandoraBaseEnemyAI";
		}
	}
	public class PandoraEnemyAI : PandoraBaseEnemyAI
	{
		public enum PandoraState
		{
			Idle,
			Attacking,
			Chasing,
			Death
		}

		public enum NextAttack
		{
			GroundPound,
			TeleportRandomly,
			TeleportOrSwapPlayers
		}

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

			private object <>2__current;

			public PandoraEnemyAI <>4__this;

			private float <timeElapsed>5__2;

			private bool <gotRidOfExtras>5__3;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_009e: Expected O, but got Unknown
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0104: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_0240: Unknown result type (might be due to invalid IL or missing references)
				//IL_024c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0252: Unknown result type (might be due to invalid IL or missing references)
				//IL_0254: Unknown result type (might be due to invalid IL or missing references)
				//IL_0265: Unknown result type (might be due to invalid IL or missing references)
				//IL_016a: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				PandoraEnemyAI pandoraEnemyAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (((NetworkBehaviour)pandoraEnemyAI).IsOwner)
					{
						pandoraEnemyAI._currentState.Value = PandoraState.Death;
					}
					if (((NetworkBehaviour)pandoraEnemyAI).IsServer)
					{
						((EnemyAI)pandoraEnemyAI).creatureAnimator.SetBool(IsDeadAnimation, true);
					}
					((Component)pandoraEnemyAI._deathParticleSystem).transform.SetParent((Transform)null, true);
					((Component)pandoraEnemyAI._deathParticleSystem).transform.position = ((Component)pandoraEnemyAI).transform.position;
					pandoraEnemyAI._deathParticleSystem.Play();
					<>2__current = (object)new WaitForSeconds(1.5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<timeElapsed>5__2 = 0f;
					<gotRidOfExtras>5__3 = false;
					break;
				case 2:
					<>1__state = -1;
					break;
				}
				if (<timeElapsed>5__2 < 6f)
				{
					foreach (Material deathMaterial in pandoraEnemyAI._deathMaterials)
					{
						Color color = deathMaterial.GetColor("_DissolvePos");
						color.g += Time.deltaTime / 2f;
						deathMaterial.SetColor("_DissolvePos", color);
					}
					<timeElapsed>5__2 += Time.deltaTime;
					if (!<gotRidOfExtras>5__3 && <timeElapsed>5__2 >= 2.5f)
					{
						foreach (Material extraMaterial in pandoraEnemyAI._extraMaterials)
						{
							extraMaterial.SetColor("_BaseColor", Color.clear);
						}
					}
					<>2__current = null;
					<>1__state = 2;
					return true;
				}
				foreach (Material deathMaterial2 in pandoraEnemyAI._deathMaterials)
				{
					Color color2 = deathMaterial2.GetColor("_DissolvePos");
					color2.g = 1f;
					deathMaterial2.SetColor("_DissolvePos", color2);
				}
				((EnemyAI)pandoraEnemyAI).EnableEnemyMesh(false, true);
				((EnemyAI)pandoraEnemyAI).creatureVoice.PlayOneShot(((EnemyAI)pandoraEnemyAI).dieSFX);
				if (!((NetworkBehaviour)pandoraEnemyAI).IsServer)
				{
					return false;
				}
				RoundManager.Instance.SpawnEnemyGameObject(RoundManager.Instance.GetRandomNavMeshPositionInRadiusSpherical(((Component)pandoraEnemyAI).transform.position, 100f, default(NavMeshHit)), -1f, -1, ((EnemyAI)pandoraEnemyAI).enemyType);
				((NetworkBehaviour)pandoraEnemyAI).NetworkObject.Despawn(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 <DoGroundPoundSinking>d__39 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public PlayerControllerB player;

			public PandoraEnemyAI <>4__this;

			public float duration;

			public float waitDuration;

			private float <t>5__2;

			private PandoraAdditionalPlayerData <playerData>5__3;

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

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

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

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

			private bool MoveNext()
			{
				//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bd: Expected O, but got Unknown
				//IL_014c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0156: Unknown result type (might be due to invalid IL or missing references)
				//IL_015c: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				PandoraEnemyAI pandoraEnemyAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<t>5__2 = 0f;
					<playerData>5__3 = PandoraAdditionalPlayerData.GetOrCreate(player);
					<playerData>5__3.inAnimationWithPandora = pandoraEnemyAI;
					goto IL_009e;
				case 1:
					<>1__state = -1;
					<playerData>5__3.OverrideSinkingValue = <t>5__2 / duration * 0.5f;
					goto IL_009e;
				case 2:
					<>1__state = -1;
					<t>5__2 = 0f;
					break;
				case 3:
					{
						<>1__state = -1;
						<playerData>5__3.OverrideSinkingValue = <t>5__2 / duration * 0.5f + 0.5f;
						break;
					}
					IL_009e:
					if (<t>5__2 < duration)
					{
						<t>5__2 += Time.deltaTime;
						<>2__current = null;
						<>1__state = 1;
						return true;
					}
					<>2__current = (object)new WaitForSeconds(waitDuration);
					<>1__state = 2;
					return true;
				}
				if (<t>5__2 < duration)
				{
					<t>5__2 += Time.deltaTime;
					<>2__current = null;
					<>1__state = 3;
					return true;
				}
				if (((NetworkBehaviour)player).IsOwner)
				{
					GameNetworkManager.Instance.localPlayerController.KillPlayer(Vector3.zero, false, (CauseOfDeath)5, 0, default(Vector3));
					if (pandoraEnemyAI._mashMinigameCoroutine != null)
					{
						((MonoBehaviour)pandoraEnemyAI).StopCoroutine(pandoraEnemyAI._mashMinigameCoroutine);
						pandoraEnemyAI._mashMinigameCoroutine = null;
					}
				}
				<playerData>5__3.inAnimationWithPandora = null;
				<playerData>5__3.OverrideSinkingValue = 0f;
				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 <DoHeartbeatAudioFocusCheck>d__28 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public float interval;

			public PandoraEnemyAI <>4__this;

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

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

			[DebuggerHidden]
			public <DoHeartbeatAudioFocusCheck>d__28(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
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				PandoraEnemyAI pandoraEnemyAI = <>4__this;
				if (num != 0)
				{
					if (num != 1)
					{
						return false;
					}
					<>1__state = -1;
					float num2 = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)pandoraEnemyAI).transform.position);
					if (num2 < pandoraEnemyAI._startHeartbeatDistance && pandoraEnemyAI.CanSeePlayer(GameNetworkManager.Instance.localPlayerController))
					{
						pandoraEnemyAI._heartbeatAudio.Focus();
						pandoraEnemyAI._heartbeatAudio.IsRunning = true;
					}
					else
					{
						pandoraEnemyAI._heartbeatAudio.Unfocus();
						pandoraEnemyAI._heartbeatAudio.IsRunning = false;
					}
				}
				else
				{
					<>1__state = -1;
				}
				<>2__current = (object)new WaitForSeconds(interval);
				<>1__state = 1;
				return true;
			}

			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 <DoSpaceMashMinigame>d__58 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public PandoraEnemyAI <>4__this;

			public int requiredJumps;

			private PlayerControllerB <localPlayer>5__2;

			private PandoraAdditionalPlayerData <playerData>5__3;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<localPlayer>5__2 = null;
				<playerData>5__3 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				int num = <>1__state;
				PandoraEnemyAI pandoraEnemyAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<localPlayer>5__2 = GameNetworkManager.Instance.localPlayerController;
					<playerData>5__3 = PandoraAdditionalPlayerData.GetOrCreate(<localPlayer>5__2);
					<playerData>5__3.inAnimationWithPandora = pandoraEnemyAI;
					pandoraEnemyAI._currentJumpsThisMinigame = 0;
					<localPlayer>5__2.disableMoveInput = true;
					PandoraEnemy.Logger.LogDebug((object)$"started space mash minigame. requiredJumps = {requiredJumps}");
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (pandoraEnemyAI._currentJumpsThisMinigame < requiredJumps)
				{
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				PandoraEnemy.Logger.LogDebug((object)"broke out!");
				<localPlayer>5__2.disableMoveInput = false;
				<playerData>5__3.OverrideSinkingValue = 0f;
				<playerData>5__3.inAnimationWithPandora = null;
				pandoraEnemyAI._mashMinigameCoroutine = null;
				if (pandoraEnemyAI._sinkingCoroutine != null)
				{
					((MonoBehaviour)pandoraEnemyAI).StopCoroutine(pandoraEnemyAI._sinkingCoroutine);
					pandoraEnemyAI._sinkingCoroutine = null;
				}
				pandoraEnemyAI.PlayerBeatMashMinigameServerRPC(PlayerControllerReference.op_Implicit(<localPlayer>5__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();
			}
		}

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

			private object <>2__current;

			public float interval;

			public PandoraEnemyAI <>4__this;

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

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

			[DebuggerHidden]
			public <DoStaringCheck>d__27(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
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0117: Unknown result type (might be due to invalid IL or missing references)
				//IL_0122: Unknown result type (might be due to invalid IL or missing references)
				//IL_0127: Unknown result type (might be due to invalid IL or missing references)
				//IL_012c: Unknown result type (might be due to invalid IL or missing references)
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0147: Unknown result type (might be due to invalid IL or missing references)
				//IL_014d: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				PandoraEnemyAI pandoraEnemyAI = <>4__this;
				if (num != 0)
				{
					if (num != 1)
					{
						return false;
					}
					<>1__state = -1;
					PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
					if (!localPlayerController.isPlayerDead)
					{
						if (localPlayerController.HasLineOfSightToPosition(((EnemyAI)pandoraEnemyAI).eye.position, 30f, 60, -1f))
						{
							pandoraEnemyAI._stareTimer += interval;
						}
						else
						{
							pandoraEnemyAI._stareTimer -= interval;
						}
						if (pandoraEnemyAI._stareTimer < 0f)
						{
							pandoraEnemyAI._stareTimer = 0f;
						}
						float num2 = pandoraEnemyAI._stareTimer / 15f;
						float num3 = 0.35f;
						float num4 = 2.5f;
						float num5 = Mathf.Clamp01(num2);
						num5 = Mathf.SmoothStep(0f, 1f, num5);
						num5 *= num5;
						pandoraEnemyAI._heartbeatAudio.SetInterval(Mathf.Lerp(num4, num3, num5));
						if (num2 >= 1f)
						{
							Vector3 val = ((Component)localPlayerController).transform.position - ((Component)pandoraEnemyAI).transform.position;
							val.y = 0f;
							localPlayerController.KillPlayer(((Vector3)(ref val)).normalized, true, (CauseOfDeath)0, 0, default(Vector3));
							if (pandoraEnemyAI._mashMinigameCoroutine != null)
							{
								((MonoBehaviour)pandoraEnemyAI).StopCoroutine(pandoraEnemyAI._mashMinigameCoroutine);
								pandoraEnemyAI._mashMinigameCoroutine = null;
							}
							pandoraEnemyAI._stareTimer = 0f;
						}
						if (pandoraEnemyAI._stareTimer > 10f && pandoraEnemyAI._timeSinceLastFearFromStaring > 30f)
						{
							pandoraEnemyAI._timeSinceLastFearFromStaring = 0f;
							localPlayerController.JumpToFearLevel(0.5f, true);
						}
					}
				}
				else
				{
					<>1__state = -1;
				}
				<>2__current = (object)new WaitForSeconds(interval);
				<>1__state = 1;
				return true;
			}

			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 <TeleportAndWanderingRoutine>d__43 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public PandoraEnemyAI <>4__this;

			private Vector3 <randomNavmeshPosition>5__2;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Expected O, but got Unknown
				//IL_008d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: 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_012b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d6: Expected O, but got Unknown
				int num = <>1__state;
				PandoraEnemyAI CS$<>8__locals0 = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					CS$<>8__locals0.smartAgentNavigator.StartSearchRoutine(50f);
					<>2__current = (object)new WaitForSeconds(Random.Range(30f, 60f));
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					Vector3 position = RoundManager.Instance.insideAINodes[Random.Range(0, RoundManager.Instance.insideAINodes.Length)].transform.position;
					<randomNavmeshPosition>5__2 = RoundManager.Instance.GetRandomNavMeshPositionInRadius(position, 3f, default(NavMeshHit));
					if (CS$<>8__locals0._currentState.Value != 0)
					{
						<>2__current = (object)new WaitUntil((Func<bool>)(() => CS$<>8__locals0._currentState.Value == PandoraState.Idle));
						<>1__state = 2;
						return true;
					}
					goto IL_00fd;
				}
				case 2:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					goto IL_00fd;
				case 4:
					{
						<>1__state = -1;
						CS$<>8__locals0._TeleportAndWanderingRoutine = ((MonoBehaviour)CS$<>8__locals0).StartCoroutine(CS$<>8__locals0.TeleportAndWanderingRoutine());
						return false;
					}
					IL_00fd:
					CS$<>8__locals0.smartAgentNavigator.StopSearchRoutine();
					CS$<>8__locals0.smartAgentNavigator.StopAgent();
					((Component)CS$<>8__locals0).transform.position = <randomNavmeshPosition>5__2;
					((EnemyAI)CS$<>8__locals0).agent.Warp(<randomNavmeshPosition>5__2);
					<>2__current = null;
					<>1__state = 4;
					return true;
				}
			}

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

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

		[SerializeField]
		private AnimationClip _deathAnimation;

		[SerializeField]
		private HeartbeatAudioHandler _heartbeatAudio;

		[SerializeField]
		private ParticleSystem _deathParticleSystem;

		[SerializeField]
		private float _startHeartbeatDistance = 15f;

		private Coroutine? _TeleportAndWanderingRoutine;

		private List<PlayerControllerB> _playersSeenOverLifetime = new List<PlayerControllerB>();

		private NextAttack _nextAttack;

		private static readonly int IsDeadAnimation = Animator.StringToHash("IsDead");

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

		private static readonly int RandomIdleAnimation = Animator.StringToHash("randomIdle");

		private static readonly int ArmsRaisedAnimation = Animator.StringToHash("armsRaised");

		private NetworkVariable<PandoraState> _currentState = new NetworkVariable<PandoraState>(PandoraState.Idle, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1);

		private float _giveUpTimer;

		private float _stareTimer;

		private float _timeSinceLastFearFromStaring = 999f;

		private float _timeSinceLastAttack = 999f;

		private int _currentJumpsThisMinigame;

		private List<Material> _deathMaterials = new List<Material>();

		private List<Material> _extraMaterials = new List<Material>();

		private Coroutine _sinkingCoroutine;

		private Coroutine _heartbeatCheckCoroutine;

		private Coroutine _mashMinigameCoroutine;

		private List<PlayerControllerB> _playersTrappedThisAttack = new List<PlayerControllerB>();

		[SerializeField]
		private float _minTeleportSeparation = 25f;

		[SerializeField]
		private int _teleportAttempts = 30;

		private readonly HashSet<ulong> _teleportTrappedClientIds = new HashSet<ulong>();

		public override void Start()
		{
			base.Start();
			SkinnedMeshRenderer[] skinnedMeshRenderers = ((EnemyAI)this).skinnedMeshRenderers;
			foreach (SkinnedMeshRenderer val in skinnedMeshRenderers)
			{
				Material[] materials = ((Renderer)val).materials;
				foreach (Material val2 in materials)
				{
					if (val2.HasProperty("_DissolvePos"))
					{
						_deathMaterials.Add(val2);
					}
					else
					{
						_extraMaterials.Add(val2);
					}
				}
			}
			_TeleportAndWanderingRoutine = ((MonoBehaviour)this).StartCoroutine(TeleportAndWanderingRoutine());
			_heartbeatCheckCoroutine = ((MonoBehaviour)this).StartCoroutine(DoHeartbeatAudioFocusCheck());
			((MonoBehaviour)this).StartCoroutine(DoStaringCheck());
			_giveUpTimer = RandomExtensions.NextFloat(_enemyRandom, 25f, 35f);
		}

		public override void Update()
		{
			((EnemyAI)this).Update();
			if (_heartbeatAudio.IsRunning && GameNetworkManager.Instance.localPlayerController.isPlayerDead)
			{
				_heartbeatAudio.IsRunning = false;
			}
			_timeSinceLastFearFromStaring += Time.deltaTime;
		}

		[IteratorStateMachine(typeof(<DoStaringCheck>d__27))]
		private IEnumerator DoStaringCheck(float interval = 0.1f)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DoStaringCheck>d__27(0)
			{
				<>4__this = this,
				interval = interval
			};
		}

		[IteratorStateMachine(typeof(<DoHeartbeatAudioFocusCheck>d__28))]
		private IEnumerator DoHeartbeatAudioFocusCheck(float interval = 2f)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DoHeartbeatAudioFocusCheck>d__28(0)
			{
				<>4__this = this,
				interval = interval
			};
		}

		public override void DoAIInterval()
		{
			//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)
			((EnemyAI)this).DoAIInterval();
			if (StartOfRound.Instance.allPlayersDead || ((EnemyAI)this).isEnemyDead)
			{
				return;
			}
			if (((NetworkBehaviour)this).IsHost)
			{
				Animator creatureAnimator = ((EnemyAI)this).creatureAnimator;
				int runSpeedAnimation = RunSpeedAnimation;
				Vector3 velocity = ((EnemyAI)this).agent.velocity;
				creatureAnimator.SetFloat(runSpeedAnimation, ((Vector3)(ref velocity)).magnitude / 3f);
			}
			_timeSinceLastAttack += ((EnemyAI)this).AIIntervalTime;
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val in allPlayerScripts)
			{
				if (!((Object)(object)val == (Object)null) && !val.isPlayerDead && val.isPlayerControlled && !_playersSeenOverLifetime.Contains(val) && CanSeePlayer(val))
				{
					_playersSeenOverLifetime.Add(val);
					HUDManager.Instance.DisplayTip("Pandora", "Pandora sees player: " + val.playerUsername + " for the first time", false, false, "LC_Tip1");
				}
			}
			switch (_currentState.Value)
			{
			case PandoraState.Idle:
				DoIdle();
				break;
			case PandoraState.Attacking:
				DoAttacking();
				break;
			case PandoraState.Chasing:
				DoChasing();
				break;
			case PandoraState.Death:
				DoDeath();
				break;
			}
		}

		private bool CanSeePlayer(PlayerControllerB player)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			float num = Vector3.Distance(((EnemyAI)this).eye.position, ((Component)player.gameplayCamera).transform.position);
			if (num > 20f)
			{
				return false;
			}
			Vector3 val = ((Component)player.gameplayCamera).transform.position - ((EnemyAI)this).eye.position;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			RaycastHit val2 = default(RaycastHit);
			return !Physics.Raycast(((EnemyAI)this).eye.position, normalized, ref val2, num, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1);
		}

		private void DoIdle()
		{
			_giveUpTimer -= ((EnemyAI)this).AIIntervalTime;
			if (_giveUpTimer < 0f)
			{
				TeleportAndResetSearchRoutine();
				_giveUpTimer = RandomExtensions.NextFloat(_enemyRandom, 25f, 35f);
			}
			else if (TryGetClosestChaseTarget(out ((EnemyAI)this).targetPlayer))
			{
				_currentState.Value = PandoraState.Chasing;
				_timeSinceLastAttack = 30f;
				ChooseNextAttack();
				smartAgentNavigator.StopSearchRoutine();
				smartAgentNavigator.StopAgent();
				_giveUpTimer = RandomExtensions.NextFloat(_enemyRandom, 25f, 35f);
				HUDManager.Instance.DisplayTip("Pandora", "Pandora begins chasing player: " + ((EnemyAI)this).targetPlayer.playerUsername, false, false, "LC_Tip1");
			}
		}

		private bool TryPickFarTeleport(PlayerControllerB player, out Vector3 pos, out float yRot)
		{
			//IL_0001: 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_001a: 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_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			pos = default(Vector3);
			yRot = player.targetYRot;
			Vector3 position = ((Component)player).transform.position;
			for (int i = 0; i < _teleportAttempts; i++)
			{
				Vector3 position2 = RoundManager.Instance.insideAINodes[_enemyRandom.Next(0, RoundManager.Instance.insideAINodes.Length)].transform.position;
				Vector3 randomNavMeshPositionInBoxPredictable = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(position2, 10f, default(NavMeshHit), _enemyRandom, -1, 1f);
				if (!(Vector3.Distance(randomNavMeshPositionInBoxPredictable, position) < _minTeleportSeparation) && !(Vector3.Distance(randomNavMeshPositionInBoxPredictable, ((Component)this).transform.position) < 10f))
				{
					pos = randomNavMeshPositionInBoxPredictable;
					return true;
				}
			}
			pos = RoundManager.Instance.GetRandomNavMeshPositionInRadiusSpherical(position, 60f, default(NavMeshHit));
			return true;
		}

		private bool TryGetClosestChaseTarget([NotNullWhen(true)] out PlayerControllerB? player)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			player = null;
			float num = 99999f;
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val in allPlayerScripts)
			{
				if (!((Object)(object)val == (Object)null) && !val.isPlayerDead && val.isPlayerControlled && CanSeePlayer(val))
				{
					float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position);
					if (!(num2 > num))
					{
						player = val;
						num = num2;
					}
				}
			}
			return Object.op_Implicit((Object)(object)player);
		}

		private void DoChasing()
		{
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			_giveUpTimer -= ((EnemyAI)this).AIIntervalTime;
			if (_giveUpTimer < 0f)
			{
				_currentState.Value = PandoraState.Idle;
				TeleportAndResetSearchRoutine();
				_giveUpTimer = RandomExtensions.NextFloat(_enemyRandom, 25f, 35f);
				return;
			}
			if (TryGetClosestChaseTarget(out PlayerControllerB player) && (Object)(object)player != (Object)(object)((EnemyAI)this).targetPlayer)
			{
				((EnemyAI)this).targetPlayer = player;
				_giveUpTimer = RandomExtensions.NextFloat(_enemyRandom, 25f, 35f);
				HUDManager.Instance.DisplayTip("Pandora", "Pandora swapped to chasing player: " + ((EnemyAI)this).targetPlayer.playerUsername, false, false, "LC_Tip1");
			}
			if (CanSeePlayer(((EnemyAI)this).targetPlayer))
			{
				_giveUpTimer = RandomExtensions.NextFloat(_enemyRandom, 25f, 35f);
			}
			smartAgentNavigator.DoPathingToDestination(((Component)((EnemyAI)this).targetPlayer).transform.position);
			float num = Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position);
			float num2 = ((_nextAttack == NextAttack.GroundPound) ? 2f : 4f);
			if (num < num2 && _timeSinceLastAttack >= 30f)
			{
				_currentState.Value = PandoraState.Attacking;
				_playersTrappedThisAttack.Clear();
				PandoraEnemy.Logger.LogDebug((object)"beginning attack animation");
				smartAgentNavigator.StopAgent();
				creatureNetworkAnimator.SetTrigger(ArmsRaisedAnimation, true);
				if (_nextAttack == NextAttack.GroundPound)
				{
					BeginSinkingClientRPC(PlayerControllerReference.op_Implicit(((EnemyAI)this).targetPlayer));
					return;
				}
				List<PlayerControllerB> playersNearby = GetPlayersNearby();
				TrapPlayersForTeleportAttack(playersNearby);
			}
		}

		private void ChooseNextAttack()
		{
			List<NextAttack> list = new List<NextAttack>(2)
			{
				NextAttack.TeleportRandomly,
				NextAttack.GroundPound
			};
			if (TeleportAndSwapIsValid())
			{
				list.Add(NextAttack.TeleportOrSwapPlayers);
			}
			_nextAttack = RandomExtensions.NextItem<NextAttack>(_enemyRandom, (IList<NextAttack>)list);
			PandoraEnemy.Logger.LogDebug((object)$"out of {list.Count} possible attack(s). chose attack: {_nextAttack}");
		}

		private void DoAttacking()
		{
			if (_nextAttack == NextAttack.GroundPound)
			{
				return;
			}
			foreach (PlayerControllerB item in GetPlayersNearby())
			{
				if (!_playersTrappedThisAttack.Contains(item))
				{
					_playersTrappedThisAttack.Add(item);
					_teleportTrappedClientIds.Add(item.actualClientId);
					SetTeleportTrappedClientRPC(PlayerControllerReference.op_Implicit(item), trapped: true);
				}
			}
		}

		[IteratorStateMachine(typeof(<DoGroundPoundSinking>d__39))]
		private IEnumerator DoGroundPoundSinking(PlayerControllerB player, float duration = 2f, float waitDuration = 5f)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DoGroundPoundSinking>d__39(0)
			{
				<>4__this = this,
				player = player,
				duration = duration,
				waitDuration = waitDuration
			};
		}

		public void PlayerIsHitInGroundPound(PlayerControllerB player)
		{
			if (_nextAttack == NextAttack.GroundPound)
			{
				PandoraEnemy.Logger.LogDebug((object)("player " + player.playerUsername + " was hit while in animation. cancelling sinking"));
				PandoraAdditionalPlayerData orCreate = PandoraAdditionalPlayerData.GetOrCreate(player);
				orCreate.OverrideSinkingValue = 0f;
				orCreate.inAnimationWithPandora = null;
				player.disableMoveInput = false;
				((MonoBehaviour)this).StopCoroutine(_sinkingCoroutine);
				_sinkingCoroutine = null;
				if (_mashMinigameCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(_mashMinigameCoroutine);
					_mashMinigameCoroutine = null;
				}
			}
		}

		private List<PlayerControllerB> GetPlayersNearby(float radius = 10f)
		{
			return StartOfRound.Instance.allPlayerScripts.Where((PlayerControllerB player) => !player.isPlayerDead && player.isPlayerControlled && Vector3.Distance(((Component)player).transform.position, ((Component)this).transform.position) <= radius).ToList();
		}

		private void DoDeath()
		{
		}

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

		public void FinishAttack()
		{
			if (!((NetworkBehaviour)this).IsOwner)
			{
				return;
			}
			PandoraEnemy.Logger.LogDebug((object)"finishAttack()");
			List<PlayerControllerB> playersNearby = GetPlayersNearby();
			_giveUpTimer = RandomExtensions.NextFloat(_enemyRandom, 25f, 35f);
			_currentState.Value = PandoraState.Idle;
			_timeSinceLastAttack = 0f;
			if (playersNearby.Count == 0)
			{
				TeleportAndResetSearchRoutine();
				return;
			}
			switch (_nextAttack)
			{
			case NextAttack.TeleportRandomly:
				PerformRandomTeleport(playersNearby);
				break;
			case NextAttack.TeleportOrSwapPlayers:
				PerformSwapTeleport(playersNearby);
				break;
			default:
				throw new ArgumentOutOfRangeException();
			case NextAttack.GroundPound:
				break;
			}
			if (_nextAttack != 0)
			{
				UntrapPlayersAfterTeleportAttack();
			}
			TeleportAndResetSearchRoutine();
		}

		public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			if (_currentState.Value == PandoraState.Attacking)
			{
				return;
			}
			base.HitEnemy(force, playerWhoHit, playHitSFX, hitID);
			if (!((EnemyAI)this).isEnemyDead)
			{
				((EnemyAI)this).enemyHP = ((EnemyAI)this).enemyHP - force;
				if (((EnemyAI)this).enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner)
				{
					((EnemyAI)this).KillEnemyOnOwnerClient(false);
				}
			}
		}

		public override void KillEnemy(bool destroy = false)
		{
			((EnemyAI)this).KillEnemy(destroy);
			((MonoBehaviour)this).StopAllCoroutines();
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			PandoraAdditionalPlayerData orCreate = PandoraAdditionalPlayerData.GetOrCreate(localPlayerController);
			localPlayerController.disableMoveInput = false;
			orCreate.OverrideSinkingValue = 0f;
			orCreate.inAnimationWithPandora = null;
			((MonoBehaviour)this).StartCoroutine(DoDeathStuffAfterDeath());
			smartAgentNavigator.StopSearchRoutine();
			smartAgentNavigator.StopAgent();
		}

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

		private void TeleportAndResetSearchRoutine()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			smartAgentNavigator.StopSearchRoutine();
			smartAgentNavigator.StopAgent();
			Vector3 position = RoundManager.Instance.insideAINodes[Random.Range(0, RoundManager.Instance.insideAINodes.Length)].transform.position;
			bool flag = false;
			while (!flag)
			{
				bool flag2 = true;
				PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
				foreach (PlayerControllerB val in allPlayerScripts)
				{
					if (!val.isPlayerDead && val.isPlayerControlled && val.isInsideFactory && Vector3.Distance(position, ((Component)val).transform.position) < 8f)
					{
						flag2 = false;
						break;
					}
				}
				if (flag2)
				{
					flag = true;
				}
				else
				{
					position = RoundManager.Instance.insideAINodes[Random.Range(0, RoundManager.Instance.insideAINodes.Length)].transform.position;
				}
			}
			((EnemyAI)this).agent.Warp(position);
			PandoraEnemy.Logger.LogDebug((object)"pandora teleports away");
			smartAgentNavigator.StartSearchRoutine(50f);
		}

		private bool TeleportAndSwapIsValid()
		{
			return _playersSeenOverLifetime.Select((PlayerControllerB it) => !it.isPlayerDead && it.isPlayerControlled).Count() >= 2;
		}

		private void PerformRandomTeleport(List<PlayerControllerB> players)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			foreach (PlayerControllerB player in players)
			{
				if (TryPickFarTeleport(player, out var pos, out var yRot))
				{
					TeleportPlayerServerRPC(PlayerControllerReference.op_Implicit(player), pos, yRot);
				}
			}
		}

		private void PerformSwapTeleport(List<PlayerControllerB> players)
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			if (_playersSeenOverLifetime.Count((PlayerControllerB it) => !it.isPlayerDead && it.isPlayerControlled) < 2)
			{
				return;
			}
			List<PlayerControllerB> list = _playersSeenOverLifetime.Where((PlayerControllerB it) => !it.isPlayerDead && it.isPlayerControlled).ToList();
			List<(PlayerControllerB, Vector3, float)> list2 = new List<(PlayerControllerB, Vector3, float)>();
			foreach (PlayerControllerB player in players)
			{
				PlayerControllerB val;
				do
				{
					val = RandomExtensions.NextItem<PlayerControllerB>(_enemyRandom, (IList<PlayerControllerB>)list);
				}
				while ((Object)(object)val == (Object)(object)player || Vector3.Distance(((Component)val).transform.position, ((Component)player).transform.position) < _minTeleportSeparation);
				PandoraEnemy.Logger.LogDebug((object)("Swapping " + player.playerUsername + " with " + val.playerUsername));
				list.Remove(val);
				list2.Add((player, ((Component)val).transform.position, val.targetYRot));
				if (!players.Contains(val))
				{
					list2.Add((val, ((Component)player).transform.position, player.targetYRot));
				}
			}
			foreach (var (val2, position, yRot) in list2)
			{
				TeleportPlayerServerRPC(PlayerControllerReference.op_Implicit(val2), position, yRot);
			}
		}

		[ServerRpc]
		private void TeleportPlayerServerRPC(PlayerControllerReference player, Vector3 position, float yRot)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Invalid comparison between Unknown and I4
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2838982378u, val, (RpcDelivery)0);
				bool flag = player != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<PlayerControllerReference>(ref player, default(ForNetworkSerializable));
				}
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref yRot, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2838982378u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				TeleportPlayerClientRPC(player, position, yRot);
			}
		}

		[ClientRpc]
		private void TeleportPlayerClientRPC(PlayerControllerReference playerRef, Vector3 position, float yRot)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: 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_0134: 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)
			//IL_00db: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: 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(163295284u, val, (RpcDelivery)0);
				bool flag = playerRef != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref yRot, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 163295284u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			PlayerControllerB val3 = PlayerControllerReference.op_Implicit(playerRef);
			PandoraAdditionalPlayerData orCreate = PandoraAdditionalPlayerData.GetOrCreate(val3);
			if ((Object)(object)val3 == (Object)(object)GameNetworkManager.Instance.localPlayerController)
			{
				if (_mashMinigameCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(_mashMinigameCoroutine);
					_mashMinigameCoroutine = null;
				}
				val3.disableMoveInput = false;
			}
			val3.velocityLastFrame = Vector3.zero;
			val3.averageVelocity = 0f;
			val3.TeleportPlayer(position, true, yRot, false, true);
			orCreate.inAnimationWithPandora = null;
		}

		[ClientRpc]
		private void BeginSinkingClientRPC(PlayerControllerReference playerRef)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: 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_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			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(445249911u, val, (RpcDelivery)0);
				bool flag = playerRef != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 445249911u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				PlayerControllerB val3 = PlayerControllerReference.op_Implicit(playerRef);
				_sinkingCoroutine = ((MonoBehaviour)this).StartCoroutine(DoGroundPoundSinking(PlayerControllerReference.op_Implicit(playerRef)));
				if ((Object)(object)val3 == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					_mashMinigameCoroutine = ((MonoBehaviour)this).StartCoroutine(DoSpaceMashMinigame(30));
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void PlayerBeatMashMinigameServerRPC(PlayerControllerReference playerRef)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: 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_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			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(2924807977u, val, (RpcDelivery)0);
				bool flag = playerRef != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2924807977u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				PlayerBeatMashMinigameClientRPC(playerRef);
			}
		}

		[ClientRpc]
		private void PlayerBeatMashMinigameClientRPC(PlayerControllerReference playerRef)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: 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_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			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(2622230991u, val, (RpcDelivery)0);
				bool flag = playerRef != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2622230991u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			PlayerControllerB val3 = PlayerControllerReference.op_Implicit(playerRef);
			if (!((Object)(object)val3 == (Object)(object)GameNetworkManager.Instance.localPlayerController))
			{
				PandoraAdditionalPlayerData orCreate = PandoraAdditionalPlayerData.GetOrCreate(val3);
				orCreate.OverrideSinkingValue = 0f;
				orCreate.inAnimationWithPandora = null;
				if (_sinkingCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(_sinkingCoroutine);
					_sinkingCoroutine = null;
				}
			}
		}

		[ClientRpc]
		private void BeginMashMinigameClientRPC(PlayerControllerReference playerRef, int requiredJumps)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: 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_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			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(1267405687u, val, (RpcDelivery)0);
				bool flag = playerRef != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				BytePacker.WriteValueBitPacked(val2, requiredJumps);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1267405687u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				PlayerControllerB val3 = PlayerControllerReference.op_Implicit(playerRef);
				if (!((Object)(object)val3 != (Object)(object)GameNetworkManager.Instance.localPlayerController))
				{
					_mashMinigameCoroutine = ((MonoBehaviour)this).StartCoroutine(DoSpaceMashMinigame(requiredJumps));
				}
			}
		}

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

		internal void LocalPlayerPerformsJump()
		{
			_currentJumpsThisMinigame++;
		}

		[ClientRpc]
		private void SetTeleportTrappedClientRPC(PlayerControllerReference playerRef, bool trapped)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: 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_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: 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(2124096682u, val, (RpcDelivery)0);
				bool flag = playerRef != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref trapped, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2124096682u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
			PlayerControllerB val3 = PlayerControllerReference.op_Implicit(playerRef);
			if (!((Object)(object)val3 == (Object)null))
			{
				PandoraAdditionalPlayerData orCreate = PandoraAdditionalPlayerData.GetOrCreate(val3);
				if (trapped)
				{
					orCreate.inAnimationWithPandora = this;
					val3.disableMoveInput = true;
					val3.velocityLastFrame = Vector3.zero;
					val3.averageVelocity = 0f;
				}
				else
				{
					orCreate.inAnimationWithPandora = null;
					val3.disableMoveInput = false;
				}
			}
		}

		private void TrapPlayersForTeleportAttack(List<PlayerControllerB> players)
		{
			_teleportTrappedClientIds.Clear();
			foreach (PlayerControllerB player in players)
			{
				if (!((Object)(object)player == (Object)null) && !player.isPlayerDead && player.isPlayerControlled)
				{
					_teleportTrappedClientIds.Add(player.actualClientId);
					SetTeleportTrappedClientRPC(PlayerControllerReference.op_Implicit(player), trapped: true);
				}
			}
		}

		private void UntrapPlayersAfterTeleportAttack()
		{
			foreach (ulong clientId in _teleportTrappedClientIds)
			{
				PlayerControllerB val = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => (Object)(object)x != (Object)null && x.actualClientId == clientId));
				if ((Object)(object)val != (Object)null)
				{
					SetTeleportTrappedClientRPC(PlayerControllerReference.op_Implicit(val), trapped: false);
				}
			}
			_teleportTrappedClientIds.Clear();
		}

		protected override void __initializeVariables()
		{
			if (_currentState == null)
			{
				throw new Exception("PandoraEnemyAI._currentState cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)_currentState).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)_currentState, "_currentState");
			((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)_currentState);
			base.__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
			((NetworkBehaviour)this).__registerRpc(2838982378u, new RpcReceiveHandler(__rpc_handler_2838982378), "TeleportPlayerServerRPC");
			((NetworkBehaviour)this).__registerRpc(163295284u, new RpcReceiveHandler(__rpc_handler_163295284), "TeleportPlayerClientRPC");
			((NetworkBehaviour)this).__registerRpc(445249911u, new RpcReceiveHandler(__rpc_handler_445249911), "BeginSinkingClientRPC");
			((NetworkBehaviour)this).__registerRpc(2924807977u, new RpcReceiveHandler(__rpc_handler_2924807977), "PlayerBeatMashMinigameServerRPC");
			((NetworkBehaviour)this).__registerRpc(2622230991u, new RpcReceiveHandler(__rpc_handler_2622230991), "PlayerBeatMashMinigameClientRPC");
			((NetworkBehaviour)this).__registerRpc(1267405687u, new RpcReceiveHandler(__rpc_handler_1267405687), "BeginMashMinigameClientRPC");
			((NetworkBehaviour)this).__registerRpc(2124096682u, new RpcReceiveHandler(__rpc_handler_2124096682), "SetTeleportTrappedClientRPC");
			base.__initializeRpcs();
		}

		private static void __rpc_handler_2838982378(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
				return;
			}
			bool flag = default(bool);
			((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
			PlayerControllerReference player = null;
			if (flag)
			{
				((FastBufferReader)(ref reader)).ReadValueSafe<PlayerControllerReference>(ref player, default(ForNetworkSerializable));
			}
			Vector3 position = default(Vector3);
			((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
			float yRot = default(float);
			((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref yRot, default(ForPrimitives));
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((PandoraEnemyAI)(object)target).TeleportPlayerServerRPC(player, position, yRot);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}

		private static void __rpc_handler_163295284(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_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				PlayerControllerReference playerRef = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				float yRot = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref yRot, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PandoraEnemyAI)(object)target).TeleportPlayerClientRPC(playerRef, position, yRot);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_445249911(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_006e: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				PlayerControllerReference playerRef = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PandoraEnemyAI)(object)target).BeginSinkingClientRPC(playerRef);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2924807977(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_006e: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				PlayerControllerReference playerRef = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PandoraEnemyAI)(object)target).PlayerBeatMashMinigameServerRPC(playerRef);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2622230991(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_006e: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				PlayerControllerReference playerRef = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PandoraEnemyAI)(object)target).PlayerBeatMashMinigameClientRPC(playerRef);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1267405687(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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				PlayerControllerReference playerRef = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				int requiredJumps = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref requiredJumps);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PandoraEnemyAI)(object)target).BeginMashMinigameClientRPC(playerRef, requiredJumps);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2124096682(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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				PlayerControllerReference playerRef = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe<PlayerControllerReference>(ref playerRef, default(ForNetworkSerializable));
				}
				bool trapped = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref trapped, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PandoraEnemyAI)(object)target).SetTeleportTrappedClientRPC(playerRef, trapped);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		protected internal override string __getTypeName()
		{
			return "PandoraEnemyAI";
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace __GEN
{
	internal class NetworkVariableSerializationHelper
	{
		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeSerialization()
		{
			NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<PandoraEnemyAI.PandoraState>();
			NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedValueEquals<PandoraEnemyAI.PandoraState>();
		}
	}
}
namespace com.github.xuuxiaolan.pandoraenemy.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}