Decompiled source of JPOGStegosaurus v1.0.3

plugins/JPOGStegosaurus/JPOGStegosaurus.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using JPOGStegosaurus.Configuration;
using JPOGStegosaurus.NetcodePatcher;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("JPOGStegosaurus")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.3.0")]
[assembly: AssemblyInformationalVersion("1.0.3+555170ee7ee36af5ae8958ef251fce8a20733088")]
[assembly: AssemblyProduct("JPOGStegosaurus")]
[assembly: AssemblyTitle("JPOGStegosaurus")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.3.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.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 JPOGStegosaurus
{
	internal class JPOGStegosaurusAI : EnemyAI, IVisibleThreat
	{
		private enum State
		{
			Roaming,
			AttackEnemy,
			ChasingTarget,
			RunningAway,
			Stunned,
			SpecialAttack,
			Idling
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass130_0
		{
			public PlayerControllerB killPlayer;

			public float startTime;

			internal bool <KillPlayer>b__0()
			{
				if (!((Object)(object)killPlayer.deadBody != (Object)null))
				{
					return Time.timeSinceLevelLoad - startTime > 2f;
				}
				return true;
			}
		}

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

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					jPOGStegosaurusAI.DoAnimationClientRpc("tailFrontalAttack");
					<>2__current = (object)new WaitForSeconds(5.7f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					jPOGStegosaurusAI.inSpecialTailAttack = false;
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				if (num != 0)
				{
					if (num != 1)
					{
						return false;
					}
					<>1__state = -1;
				}
				else
				{
					<>1__state = -1;
					if (jPOGStegosaurusAI.CheckIfInAttackAnimation())
					{
						goto IL_0067;
					}
					jPOGStegosaurusAI.inSpecialTailAttack = true;
					((MonoBehaviour)jPOGStegosaurusAI).StartCoroutine(jPOGStegosaurusAI.BeginSpecialTailAnimation());
				}
				if (jPOGStegosaurusAI.inSpecialTailAttack)
				{
					jPOGStegosaurusAI.CheckIfTailAttackHitPlayersClientRpc();
					jPOGStegosaurusAI.CheckIfTailAttackHitEntitiesClientRpc();
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				goto IL_0067;
				IL_0067:
				((Component)jPOGStegosaurusAI).transform.rotation = Quaternion.Euler(0f, 0f, 0f);
				jPOGStegosaurusAI.readyToChaseFromSpecialAttack = 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 <BeginSpecialTailAttackOnEntity>d__102 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					((EnemyAI)jPOGStegosaurusAI).agent.speed = 0f;
					jPOGStegosaurusAI.SetWalkingAnimtionServerRpc(((EnemyAI)jPOGStegosaurusAI).agent.speed);
					if (!jPOGStegosaurusAI.CheckIfInAttackAnimation())
					{
						jPOGStegosaurusAI.inSpecialTailAttack = true;
						((MonoBehaviour)jPOGStegosaurusAI).StartCoroutine(jPOGStegosaurusAI.BeginSpecialTailAnimation());
						<>2__current = (object)new WaitForSeconds(5.5f);
						<>1__state = 1;
						return true;
					}
					break;
				case 1:
					<>1__state = -1;
					((EnemyAI)jPOGStegosaurusAI).agent.speed = 3f;
					jPOGStegosaurusAI.SetWalkingAnimtionServerRpc(((EnemyAI)jPOGStegosaurusAI).agent.speed);
					break;
				}
				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 <BeginStompAnimation>d__105 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					jPOGStegosaurusAI.DoAnimationClientRpc("stompAttack");
					<>2__current = (object)new WaitForSeconds(2.2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					jPOGStegosaurusAI.inStompAttack = false;
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (!jPOGStegosaurusAI.CheckIfInAttackAnimation())
					{
						jPOGStegosaurusAI.inStompAttack = true;
						((MonoBehaviour)jPOGStegosaurusAI).StartCoroutine(jPOGStegosaurusAI.BeginStompAnimation());
						<>2__current = (object)new WaitForSeconds(2f);
						<>1__state = 1;
						return true;
					}
					break;
				case 1:
					<>1__state = -1;
					goto IL_0084;
				case 2:
					{
						<>1__state = -1;
						goto IL_0084;
					}
					IL_0084:
					if (jPOGStegosaurusAI.inStompAttack)
					{
						jPOGStegosaurusAI.CheckIfStompAttackHitPlayersClientRpc();
						<>2__current = null;
						<>1__state = 2;
						return true;
					}
					if ((Object)(object)jPOGStegosaurusAI.targetEntiy != (Object)null)
					{
						jPOGStegosaurusAI.targetEntiy.HitEnemy(5, (PlayerControllerB)null, true, -1);
						jPOGStegosaurusAI.targetEntiy = null;
					}
					break;
				}
				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 <BeginStunAnimation>d__61 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					jPOGStegosaurusAI.DoAnimationClientRpc("stunEnemy");
					<>2__current = (object)new WaitForSeconds(2.1f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					jPOGStegosaurusAI.inStunAnimation = false;
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (!jPOGStegosaurusAI.CheckIfInAttackAnimation())
					{
						jPOGStegosaurusAI.inTailAttack = true;
						((MonoBehaviour)jPOGStegosaurusAI).StartCoroutine(jPOGStegosaurusAI.BeginTailAttackAnimation());
						<>2__current = (object)new WaitForSeconds(0.3f);
						<>1__state = 1;
						return true;
					}
					break;
				case 1:
					<>1__state = -1;
					goto IL_0084;
				case 2:
					{
						<>1__state = -1;
						goto IL_0084;
					}
					IL_0084:
					if (jPOGStegosaurusAI.inTailAttack)
					{
						jPOGStegosaurusAI.CheckIfTailAttackHitPlayersClientRpc();
						<>2__current = null;
						<>1__state = 2;
						return true;
					}
					break;
				}
				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 <BeginTailAttackAnimation>d__107 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					jPOGStegosaurusAI.DoAnimationClientRpc("tailAttack");
					<>2__current = (object)new WaitForSeconds(2.8f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					jPOGStegosaurusAI.inTailAttack = false;
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public int playerId;

			public JPOGStegosaurusAI <>4__this;

			public CauseOfDeath causeOfDeath;

			private <>c__DisplayClass130_0 <>8__1;

			private Quaternion <rotateTo>5__2;

			private Quaternion <rotateFrom>5__3;

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

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

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

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

			private bool MoveNext()
			{
				//IL_013b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0142: Invalid comparison between Unknown and I4
				//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0171: Unknown result type (might be due to invalid IL or missing references)
				//IL_0176: Unknown result type (might be due to invalid IL or missing references)
				//IL_0180: Unknown result type (might be due to invalid IL or missing references)
				//IL_0185: Unknown result type (might be due to invalid IL or missing references)
				//IL_019a: Unknown result type (might be due to invalid IL or missing references)
				//IL_019f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b5: 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_00f0: Expected O, but got Unknown
				//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>8__1 = new <>c__DisplayClass130_0();
					<>8__1.killPlayer = StartOfRound.Instance.allPlayerScripts[playerId];
					if ((Object)(object)<>8__1.killPlayer == (Object)null || <>8__1.killPlayer.isPlayerDead)
					{
						return false;
					}
					if (!((EnemyAI)jPOGStegosaurusAI).isEnemyDead)
					{
						if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)<>8__1.killPlayer)
						{
							<>8__1.killPlayer.KillPlayer(Vector3.zero, true, causeOfDeath, 0, default(Vector3));
						}
						<>8__1.startTime = Time.timeSinceLevelLoad;
						<>2__current = (object)new WaitUntil((Func<bool>)(() => (Object)(object)<>8__1.killPlayer.deadBody != (Object)null || Time.timeSinceLevelLoad - <>8__1.startTime > 2f));
						<>1__state = 1;
						return true;
					}
					break;
				case 1:
					<>1__state = -1;
					if ((Object)(object)<>8__1.killPlayer.deadBody == (Object)null)
					{
						<>8__1.killPlayer.inAnimationWithEnemy = null;
						return false;
					}
					if ((int)<>8__1.killPlayer.deadBody.causeOfDeath == 14)
					{
						jPOGStegosaurusAI.PinBodyToSpikeServerRpc(playerId);
					}
					<>8__1.startTime = Time.timeSinceLevelLoad;
					<rotateTo>5__2 = Quaternion.Euler(new Vector3(0f, RoundManager.Instance.YRotationThatFacesTheFarthestFromPosition(((Component)jPOGStegosaurusAI).transform.position + Vector3.up * 0.6f, 25f, 6), 0f));
					<rotateFrom>5__3 = ((Component)jPOGStegosaurusAI).transform.rotation;
					goto IL_0202;
				case 2:
					{
						<>1__state = -1;
						if (((NetworkBehaviour)jPOGStegosaurusAI).IsOwner)
						{
							((Component)jPOGStegosaurusAI).transform.rotation = Quaternion.RotateTowards(<rotateFrom>5__3, <rotateTo>5__2, 60f * Time.deltaTime);
						}
						goto IL_0202;
					}
					IL_0202:
					if (Time.timeSinceLevelLoad - <>8__1.startTime < 2f)
					{
						<>2__current = null;
						<>1__state = 2;
						return true;
					}
					break;
				}
				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 <PlayScratchIdle>d__119 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					jPOGStegosaurusAI.DoAnimationClientRpc("scratch");
					<>2__current = (object)new WaitForSeconds(4.5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					jPOGStegosaurusAI.inRandomIdleAnimation = false;
					jPOGStegosaurusAI.isDoneIdling = 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 <PlayStretchIdle>d__120 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					jPOGStegosaurusAI.DoAnimationClientRpc("stretch");
					<>2__current = (object)new WaitForSeconds(4.1f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					jPOGStegosaurusAI.inRandomIdleAnimation = false;
					jPOGStegosaurusAI.isDoneIdling = 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 <PlayTailShowIdle>d__118 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					jPOGStegosaurusAI.DoAnimationClientRpc("tailShow");
					<>2__current = (object)new WaitForSeconds(3.8f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					jPOGStegosaurusAI.inRandomIdleAnimation = false;
					jPOGStegosaurusAI.isDoneIdling = 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 <RoamingStateCoroutine>d__121 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(jPOGStegosaurusAI.timeToIdle);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					((EnemyAI)jPOGStegosaurusAI).SwitchToBehaviourClientRpc(6);
					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 <SwingAttack>d__80 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: 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_0064: Expected O, but got Unknown
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					((EnemyAI)jPOGStegosaurusAI).SwitchToBehaviourClientRpc(1);
					jPOGStegosaurusAI.StalkPos = ((Component)((EnemyAI)jPOGStegosaurusAI).targetPlayer).transform.position;
					((EnemyAI)jPOGStegosaurusAI).SetDestinationToPosition(jPOGStegosaurusAI.StalkPos, false);
					<>2__current = (object)new WaitForSeconds(0.5f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if (((EnemyAI)jPOGStegosaurusAI).isEnemyDead)
					{
						return false;
					}
					jPOGStegosaurusAI.DoAnimationClientRpc("swingAttack");
					<>2__current = (object)new WaitForSeconds(0.35f);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					jPOGStegosaurusAI.SwingAttackHitClientRpc();
					if (((EnemyAI)jPOGStegosaurusAI).currentBehaviourStateIndex != 1)
					{
						return false;
					}
					((EnemyAI)jPOGStegosaurusAI).SwitchToBehaviourClientRpc(1);
					return false;
				}
			}

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

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

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

			private object <>2__current;

			public JPOGStegosaurusAI <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Expected O, but got Unknown
				int num = <>1__state;
				JPOGStegosaurusAI jPOGStegosaurusAI = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (!((EnemyAI)jPOGStegosaurusAI).isEnemyDead)
				{
					jPOGStegosaurusAI.CheckForPlayersInAggroAreaServerRpc();
					jPOGStegosaurusAI.CheckForPlayersInAttackAreaBackServerRpc();
					jPOGStegosaurusAI.CheckForPlayersInAttackAreaFrontServerRpc();
					<>2__current = (object)new WaitForSeconds(1f);
					<>1__state = 1;
					return true;
				}
				return false;
			}

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

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

		public Transform turnCompass;

		public Transform aggroArea;

		private List<DeadBodyInfo> spikedBodies = new List<DeadBodyInfo>();

		public AudioSource tailSFX;

		public Transform tailSpike1;

		public Transform tailSpike2;

		public Transform tailSpike3;

		public Transform tailSpike4;

		public Transform tailHitBox;

		public Transform stompHitbox;

		public Transform attackAreaFront;

		public Transform attackAreaBack;

		private float timeSinceHittingLocalPlayer;

		private float timeSinceNewRandPos;

		private Vector3 positionRandomness;

		private Vector3 StalkPos;

		private Random enemyRandom;

		private bool isDeadAnimationDone;

		private float irritationLevel;

		private float irritationMaxLevel;

		private float irritationIncrementAmount;

		private float irritationDecrementAmount;

		private float irritationDecrementinterval;

		private float lastIrritationDecreaseTime;

		private State previousState = State.Idling;

		private bool inRandomIdleAnimation;

		private bool isDoneIdling;

		private float timeToIdle = 30f;

		private bool inTailAttack;

		private List<int> tailHitPlayerIds = new List<int>();

		private List<int> stompHitPlayerIds = new List<int>();

		private float lastIrritationIncrementTime;

		private float irritationIncrementInterval;

		private bool inStompAttack;

		private float roamingStartTime;

		private float movementCheckInterval = 5f;

		private Vector3 lastPosition;

		private float movingThreshold = 0.1f;

		private bool inStunAnimation;

		private bool inSpecialTailAttack;

		private float stopChaseHeight = 7f;

		private bool isStunned;

		private bool readyToChaseFromSpecialAttack;

		private Quaternion originalRotation;

		private bool specialAttackCanHitPlayer;

		private bool specialAttackHasHitPlayer;

		private EnemyAI? targetEntiy;

		ThreatType IVisibleThreat.type => (ThreatType)3;

		int IVisibleThreat.SendSpecialBehaviour(int id)
		{
			return 0;
		}

		int IVisibleThreat.GetThreatLevel(Vector3 seenByPosition)
		{
			int num = 0;
			num = ((base.enemyHP >= 2) ? 5 : 3);
			if (base.creatureAnimator.GetBool("StartedChase"))
			{
				num += 3;
			}
			return num;
		}

		int IVisibleThreat.GetInterestLevel()
		{
			return 0;
		}

		Transform IVisibleThreat.GetThreatLookTransform()
		{
			return base.eye;
		}

		Transform IVisibleThreat.GetThreatTransform()
		{
			return ((Component)this).transform;
		}

		Vector3 IVisibleThreat.GetThreatVelocity()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			if (((NetworkBehaviour)this).IsOwner)
			{
				return base.agent.velocity;
			}
			return Vector3.zero;
		}

		float IVisibleThreat.GetVisibility()
		{
			if (base.isEnemyDead)
			{
				return 0f;
			}
			if (base.creatureAnimator.GetBool("StartedChase"))
			{
				return 1f;
			}
			return 0.75f;
		}

		[Conditional("DEBUG")]
		private void LogIfDebugBuild(string text)
		{
			Plugin.Logger.LogInfo((object)text);
		}

		public override void Start()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			AssignConfigVariables();
			((EnemyAI)this).Start();
			((MonoBehaviour)this).StartCoroutine(checkAggroAndAttackAreas());
			timeSinceHittingLocalPlayer = 0f;
			timeSinceNewRandPos = 0f;
			positionRandomness = new Vector3(0f, 0f, 0f);
			enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex);
			isDeadAnimationDone = false;
			((EnemyAI)this).SwitchToBehaviourServerRpc(0);
			((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
		}

		public override void Update()
		{
			((EnemyAI)this).Update();
			if (base.isEnemyDead)
			{
				if (!isDeadAnimationDone)
				{
					isDeadAnimationDone = true;
					base.creatureVoice.Stop();
					base.creatureVoice.PlayOneShot(base.dieSFX);
				}
			}
			else if (base.enemyHP > 0 || base.isEnemyDead)
			{
				timeSinceHittingLocalPlayer += Time.deltaTime;
				timeSinceNewRandPos += Time.deltaTime;
				int currentBehaviourStateIndex = base.currentBehaviourStateIndex;
				if (timeSinceNewRandPos >= movementCheckInterval && !inStunAnimation)
				{
					timeSinceNewRandPos = 0f;
					CheckMovementServerRpc();
				}
				if ((Object)(object)base.targetPlayer != (Object)null && (currentBehaviourStateIndex == 1 || currentBehaviourStateIndex == 2 || currentBehaviourStateIndex == 4 || currentBehaviourStateIndex == 5))
				{
					LookAtTargetServerRpc();
				}
				if (base.stunNormalizedTimer > 0f)
				{
					isStunned = true;
				}
				else
				{
					isStunned = false;
				}
			}
		}

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

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

		[ServerRpc(RequireOwnership = false)]
		private void CheckMovementServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: 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_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(680955357u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 680955357u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				Vector3 position = ((Component)this).transform.position;
				if (Vector3.Distance(position, lastPosition) < movingThreshold)
				{
					((EnemyAI)this).StopSearch(base.currentSearch, true);
					((EnemyAI)this).StartSearch(position, (AISearchRoutine)null);
				}
				lastPosition = position;
			}
		}

		public override void DoAIInterval()
		{
			//IL_00cd: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).DoAIInterval();
			if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead)
			{
				return;
			}
			switch (base.currentBehaviourStateIndex)
			{
			case 0:
				StateChangeHelperServerRpc(State.Roaming);
				if (irritationLevel == irritationMaxLevel)
				{
					((EnemyAI)this).SwitchToBehaviourServerRpc(2);
				}
				break;
			case 1:
				StateChangeHelperServerRpc(State.AttackEnemy);
				if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 20f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)))
				{
					((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
					((EnemyAI)this).SwitchToBehaviourClientRpc(0);
				}
				break;
			case 2:
				StateChangeHelperServerRpc(State.ChasingTarget);
				ChasePlayerServerRpc();
				if ((Object)(object)base.targetPlayer == (Object)null)
				{
					irritationLevel = irritationMaxLevel / 100f * 20f;
					((EnemyAI)this).SwitchToBehaviourClientRpc(0);
				}
				else if (irritationLevel >= 20f)
				{
					DecreaseIrritationServerRpc();
				}
				else if (irritationLevel < irritationMaxLevel / 100f * 20f)
				{
					((EnemyAI)this).SwitchToBehaviourClientRpc(0);
				}
				break;
			case 3:
				StateChangeHelperServerRpc(State.RunningAway);
				break;
			case 6:
				StateChangeHelperServerRpc(State.Idling);
				if (!inRandomIdleAnimation)
				{
					PlayRandomIdleAnimationClientRpc();
				}
				if (isDoneIdling)
				{
					isDoneIdling = false;
					if (irritationLevel == irritationMaxLevel)
					{
						((EnemyAI)this).SwitchToBehaviourServerRpc(2);
					}
					else
					{
						((EnemyAI)this).SwitchToBehaviourServerRpc(0);
					}
				}
				break;
			case 4:
				StateChangeHelperServerRpc(State.Stunned);
				if (!isStunned)
				{
					if ((Object)(object)base.targetPlayer != (Object)null)
					{
						((EnemyAI)this).SwitchToBehaviourServerRpc(2);
						break;
					}
					irritationLevel = irritationMaxLevel / 100f * 50f;
					((EnemyAI)this).SwitchToBehaviourServerRpc(0);
				}
				else if (isStunned && !inStunAnimation)
				{
					PlayStunnedAnimationServerRpc();
				}
				break;
			case 5:
				StateChangeHelperServerRpc(State.SpecialAttack);
				if (!specialAttackCanHitPlayer)
				{
					((EnemyAI)this).SwitchToBehaviourServerRpc(2);
				}
				else if (readyToChaseFromSpecialAttack)
				{
					if (specialAttackHasHitPlayer)
					{
						readyToChaseFromSpecialAttack = false;
						specialAttackHasHitPlayer = false;
						irritationLevel = irritationMaxLevel / 100f * 40f;
						specialAttackCanHitPlayer = false;
						((EnemyAI)this).SwitchToBehaviourServerRpc(0);
					}
					else if ((Object)(object)base.targetPlayer != (Object)null)
					{
						readyToChaseFromSpecialAttack = false;
						specialAttackHasHitPlayer = false;
						specialAttackCanHitPlayer = false;
						((EnemyAI)this).SwitchToBehaviourServerRpc(2);
					}
					else
					{
						irritationLevel = irritationMaxLevel / 100f * 40f;
						specialAttackCanHitPlayer = false;
						((EnemyAI)this).SwitchToBehaviourServerRpc(0);
					}
				}
				else if (!CheckIfInAttackAnimation() && (Object)(object)base.targetPlayer != (Object)null)
				{
					LookAtTargetServerRpc();
					PerformSpecialTailAttackServerRpc();
				}
				break;
			}
		}

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

		private void CheckIfSpecialAttackCanHitPlayer()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)base.targetPlayer == (Object)null))
			{
				float num = Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position);
				if (num <= 10f)
				{
					specialAttackCanHitPlayer = true;
				}
				else
				{
					specialAttackCanHitPlayer = false;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void ChasePlayerServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: 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(2766208683u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2766208683u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			bool flag = false;
			if ((Object)(object)base.targetPlayer != (Object)null && !CheckIfPlayerIsTargetable(base.targetPlayer))
			{
				base.targetPlayer = null;
			}
			if ((Object)(object)base.targetPlayer == (Object)null)
			{
				flag = ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 100f);
				if ((Object)(object)base.targetPlayer != (Object)null && (!flag || !CheckIfPlayerIsTargetable(base.targetPlayer)))
				{
					base.targetPlayer = null;
				}
			}
			if ((Object)(object)base.targetPlayer != (Object)null)
			{
				ChasePlayerClientRpc(((Component)base.targetPlayer).transform.position);
			}
			else if (!flag || (Object)(object)base.targetPlayer == (Object)null)
			{
				irritationLevel = irritationMaxLevel / 100f * 20f;
			}
		}

		[ClientRpc]
		private void ChasePlayerClientRpc(Vector3 targetPosition)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2890294529u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetPosition);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2890294529u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					((EnemyAI)this).SetDestinationToPosition(targetPosition, false);
				}
			}
		}

		private bool CheckIfPlayerIsTargetable(PlayerControllerB player)
		{
			bool result = false;
			if ((Object)(object)player != (Object)null)
			{
				result = ((!player.isInHangarShipRoom && !player.isClimbingLadder && !player.isPlayerDead) ? true : false);
			}
			return result;
		}

		private bool CheckHeightDifference()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			bool result = false;
			if ((Object)(object)base.targetPlayer != (Object)null)
			{
				float num = Mathf.Abs(((Component)this).transform.position.y - ((Component)base.targetPlayer).transform.position.y);
				if (num < stopChaseHeight)
				{
					result = true;
				}
			}
			return result;
		}

		private bool FoundClosestPlayerInRange(float range, float senseRange)
		{
			//IL_0049: 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)
			((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f);
			if ((Object)(object)base.targetPlayer == (Object)null)
			{
				((EnemyAI)this).TargetClosestPlayer(1.5f, false, 70f);
				range = senseRange;
			}
			if ((Object)(object)base.targetPlayer != (Object)null)
			{
				return Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range;
			}
			return false;
		}

		private bool TargetClosestPlayerInAnyCase()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			base.mostOptimalDistance = 2000f;
			base.targetPlayer = null;
			for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++)
			{
				base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position);
				if (base.tempDist < base.mostOptimalDistance)
				{
					base.mostOptimalDistance = base.tempDist;
					base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i];
				}
			}
			if ((Object)(object)base.targetPlayer == (Object)null)
			{
				return false;
			}
			return true;
		}

		private void StickingInFrontOfPlayer()
		{
			//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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//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_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)base.targetPlayer == (Object)null) && ((NetworkBehaviour)this).IsOwner && timeSinceNewRandPos > 0.7f)
			{
				timeSinceNewRandPos = 0f;
				if (enemyRandom.Next(0, 5) == 0)
				{
					((MonoBehaviour)this).StartCoroutine(SwingAttack());
				}
				else
				{
					positionRandomness = new Vector3((float)enemyRandom.Next(-2, 2), 0f, (float)enemyRandom.Next(-2, 2));
					StalkPos = ((Component)base.targetPlayer).transform.position - Vector3.Scale(new Vector3(-5f, 0f, -5f), ((Component)base.targetPlayer).transform.forward) + positionRandomness;
				}
				((EnemyAI)this).SetDestinationToPosition(StalkPos, false);
			}
		}

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

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

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

		private void CheckForEntitiesInAggroRange()
		{
			//IL_006e: 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)
			if ((Object)(object)targetEntiy != (Object)null || base.currentBehaviourStateIndex != 0)
			{
				return;
			}
			foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
			{
				if (!((Object)base.enemyType).name.Equals(((Object)spawnedEnemy.enemyType).name) && !spawnedEnemy.isEnemyDead && spawnedEnemy.enemyType.canDie)
				{
					float num = Vector3.Distance(((Component)spawnedEnemy).transform.position, ((Component)this).transform.position);
					if (num <= 10f)
					{
						targetEntiy = spawnedEnemy;
						LookAtTargetEntityServerRpc();
						((EnemyAI)this).SwitchToBehaviourServerRpc(5);
					}
				}
			}
		}

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

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

		private void LookAtTargetEntity()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)targetEntiy != (Object)null)
			{
				turnCompass.LookAt(((Component)targetEntiy).transform.position);
			}
		}

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

		public override void OnCollideWithPlayer(Collider other)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			if (!(timeSinceHittingLocalPlayer < 1f))
			{
				PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false);
				if ((Object)(object)val != (Object)null)
				{
					timeSinceHittingLocalPlayer = 0f;
					val.DamagePlayer(20, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
				}
			}
		}

		public override void OnCollideWithEnemy(Collider other, EnemyAI collidedEnemy)
		{
			if (!base.isEnemyDead && !((Object)(object)collidedEnemy == (Object)null) && !collidedEnemy.isEnemyDead && collidedEnemy.enemyType.canDie)
			{
				((EnemyAI)this).OnCollideWithEnemy(other, collidedEnemy);
				if ((Object)(object)collidedEnemy.enemyType != (Object)(object)base.enemyType && !base.inSpecialAnimation && !inStompAttack && !inSpecialTailAttack)
				{
					targetEntiy = collidedEnemy;
					LookAtTargetEntityServerRpc();
					((MonoBehaviour)this).StartCoroutine(BeginStompAttack());
				}
			}
		}

		public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
			if (base.isEnemyDead)
			{
				return;
			}
			base.enemyHP -= force;
			if (((NetworkBehaviour)this).IsOwner)
			{
				if (base.enemyHP <= 0 && !base.isEnemyDead)
				{
					((MonoBehaviour)this).StopCoroutine(checkAggroAndAttackAreas());
					base.agent.speed = 0f;
					SetWalkingAnimtionClientRpc(base.agent.speed);
					SetWalkingAnimtionServerRpc(base.agent.speed);
					DoAnimationClientRpc("stopTail");
					((MonoBehaviour)this).StopCoroutine(base.searchCoroutine);
					((EnemyAI)this).KillEnemyOnOwnerClient(false);
				}
				else if ((Object)(object)playerWhoHit != (Object)null && base.currentBehaviourStateIndex != 2)
				{
					irritationLevel = irritationMaxLevel;
					base.targetPlayer = playerWhoHit;
					((EnemyAI)this).SwitchToBehaviourServerRpc(5);
				}
			}
		}

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

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

		[ClientRpc]
		public void LookAtTargetClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: 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_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(251069385u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 251069385u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && (Object)(object)base.targetPlayer != (Object)null)
				{
					Vector3 position = ((Component)base.targetPlayer.gameplayCamera).transform.position;
					Vector3 val3 = position - ((Component)this).transform.position;
					val3.y = 0f;
					Quaternion val4 = Quaternion.LookRotation(val3);
					((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, val4, 4f * Time.deltaTime);
					turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position);
				}
			}
		}

		public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1f, PlayerControllerB? setStunnedByPlayer = null)
		{
			((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer);
			((EnemyAI)this).SwitchToBehaviourServerRpc(4);
			if ((Object)(object)setStunnedByPlayer != (Object)null)
			{
				irritationLevel = irritationMaxLevel;
				base.targetPlayer = setStunnedByPlayer;
			}
		}

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

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

		private void CheckForPlayersInAggroArea()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			int num = 8;
			Collider[] array = Physics.OverlapBox(aggroArea.position, aggroArea.localScale, Quaternion.identity, num);
			if (array.Length == 0)
			{
				return;
			}
			Collider[] array2 = array;
			foreach (Collider val in array2)
			{
				PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false);
				if ((Object)(object)val2 != (Object)null && irritationLevel != irritationMaxLevel)
				{
					IncreaseIrritationServerRpc();
					if (irritationLevel == irritationMaxLevel)
					{
						base.targetPlayer = val2;
						break;
					}
				}
			}
		}

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

		private bool CheckForPlayersInAttackAreaFront()
		{
			//IL_000a: 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)
			bool result = false;
			int num = 8;
			Collider[] array = Physics.OverlapBox(attackAreaFront.position, attackAreaFront.localScale, Quaternion.identity, num);
			if (array.Length != 0)
			{
				Collider[] array2 = array;
				foreach (Collider val in array2)
				{
					PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false);
					if ((Object)(object)val2 != (Object)null && irritationLevel != irritationMaxLevel)
					{
						IncreaseIrritationServerRpc();
					}
				}
				result = true;
			}
			return result;
		}

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

		private bool CheckForPlayersInAttackAreaBack()
		{
			//IL_000a: 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)
			bool result = false;
			int num = 8;
			Collider[] array = Physics.OverlapBox(attackAreaBack.position, attackAreaBack.localScale, Quaternion.identity, num);
			if (array.Length != 0)
			{
				Collider[] array2 = array;
				foreach (Collider val in array2)
				{
					PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false);
					if ((Object)(object)val2 != (Object)null && irritationLevel != irritationMaxLevel)
					{
						IncreaseIrritationServerRpc();
					}
				}
				result = true;
			}
			return result;
		}

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

		[ClientRpc]
		private void KillPlayersByStompClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2825601160u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2825601160u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || stompHitPlayerIds.Count <= 0)
			{
				return;
			}
			foreach (int stompHitPlayerId in stompHitPlayerIds)
			{
				((MonoBehaviour)this).StartCoroutine(KillPlayer(stompHitPlayerId, (CauseOfDeath)8));
			}
			stompHitPlayerIds.Clear();
		}

		private bool CheckIfStompAttackHitPlayers()
		{
			//IL_000a: 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)
			bool result = false;
			int num = 8;
			Collider[] array = Physics.OverlapBox(stompHitbox.position, stompHitbox.localScale, Quaternion.identity, num);
			if (array.Length != 0)
			{
				Collider[] array2 = array;
				foreach (Collider val in array2)
				{
					PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false);
					if ((Object)(object)val2 != (Object)null && CheckIfPlayerIsTargetable(val2))
					{
						int num2 = (int)val2.actualClientId;
						if (!stompHitPlayerIds.Contains((int)val2.playerClientId))
						{
							stompHitPlayerIds.Add((int)val2.playerClientId);
							result = true;
						}
					}
				}
			}
			return result;
		}

		private bool CheckIfInAttackAnimation()
		{
			bool result = true;
			if (!inSpecialTailAttack && !inStompAttack && !inTailAttack)
			{
				result = false;
			}
			return result;
		}

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

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

		private void CheckIfTailAttackHitEntities()
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
			{
				if (!((Object)base.enemyType).name.Equals(((Object)spawnedEnemy.enemyType).name) && !spawnedEnemy.isEnemyDead && !spawnedEnemy.enemyType.canDie)
				{
					float num = Vector3.Distance(((Component)spawnedEnemy).transform.position, ((Component)tailSpike1).transform.position);
					if (num < 5f)
					{
						DamageEntity(spawnedEnemy);
					}
				}
			}
		}

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

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

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

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

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

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

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

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

		private bool CheckIfTailAttackHitPlayers()
		{
			//IL_000a: 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)
			bool result = false;
			int num = 8;
			Collider[] array = Physics.OverlapBox(tailHitBox.position, tailHitBox.localScale, Quaternion.identity, num);
			if (array.Length != 0)
			{
				Collider[] array2 = array;
				foreach (Collider val in array2)
				{
					PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false);
					if ((Object)(object)val2 != (Object)null && CheckIfPlayerIsTargetable(val2))
					{
						int num2 = (int)val2.actualClientId;
						if (!tailHitPlayerIds.Contains((int)val2.playerClientId))
						{
							tailHitPlayerIds.Add((int)val2.playerClientId);
							result = true;
						}
					}
				}
			}
			return result;
		}

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

		[ServerRpc(RequireOwnership = false)]
		private void IncreaseIrritationServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(224280285u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 224280285u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				int currentBehaviourStateIndex = base.currentBehaviourStateIndex;
				if (Time.time - lastIrritationIncrementTime >= irritationIncrementInterval && currentBehaviourStateIndex != 2)
				{
					irritationLevel = Mathf.Clamp(irritationLevel + irritationIncrementAmount, 0f, irritationMaxLevel);
					lastIrritationIncrementTime = Time.time;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void DecreaseIrritationServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2611162217u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2611162217u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && Time.time - lastIrritationDecreaseTime >= irritationDecrementinterval)
				{
					irritationLevel = Mathf.Clamp(irritationLevel - irritationDecrementinterval, 0f, irritationMaxLevel);
					lastIrritationDecreaseTime = Time.time;
				}
			}
		}

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

		[ClientRpc]
		public void SwingAttackHitClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: 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_00d3: 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_0120: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2213681325u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2213681325u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			int num = 8;
			Collider[] array = Physics.OverlapBox(attackAreaFront.position, attackAreaFront.localScale, Quaternion.identity, num);
			if (array.Length == 0)
			{
				return;
			}
			Collider[] array2 = array;
			foreach (Collider val3 in array2)
			{
				PlayerControllerB val4 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val3, false, false);
				if ((Object)(object)val4 != (Object)null)
				{
					timeSinceHittingLocalPlayer = 0f;
					val4.DamagePlayer(40, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
				}
			}
		}

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