Decompiled source of HitchBloodsworth v0.0.4

ReavsStuff.HitchBloodsworth.dll

Decompiled 4 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HitchBloodsworth.Configuration;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using ReavsStuff.HitchBloodsworth.NetcodePatcher;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.VFX;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ReavsStuff.HitchBloodsworth")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.0.4.0")]
[assembly: AssemblyInformationalVersion("0.0.4")]
[assembly: AssemblyProduct("HitchBloodsworth")]
[assembly: AssemblyTitle("ReavsStuff.HitchBloodsworth")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.4.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 HitchBloodsworth
{
	public class HitchBloodsworthAI : HitchBloodsworthCalAI
	{
		public enum State
		{
			Idle,
			RoamSearch,
			Chasing,
			Attacking,
			Recharge,
			Death
		}

		private bool chasingPlayer;

		private float attackFuncTimer;

		private AISearchRoutine searchForPlayer;

		private bool lostPlayerInChase;

		private float lostPlayerInChaseTimer;

		private float timeSinceHittingLocalPlayer;

		public bool attackAudioClipTrue;

		public bool attackingDone = false;

		public bool isRecharging = false;

		public bool attackTriggerBool = false;

		public bool allowCollisionDamage = false;

		public bool attackMovement = false;

		public float chaseMaxSpeed = 12f;

		private bool attackingPlayer;

		private Vector3 lastPositionOfSeenPlayer;

		private Vector3 previousPosition;

		private float averageVelocity;

		private float velocityInterval;

		private float velocityAverageCount;

		private float lastChaseSpeed;

		private float lastChaseAcceleration;

		private static readonly Color hitchGlowColourRecharge = Color.blue;

		private static readonly Color hitchGlowColourRoaming = Color.green;

		private static readonly Color hitchGlowColourChasing = Color.yellow;

		private static readonly Color hitchGlowColourAttacking = Color.red;

		private AudioSource audioSource;

		private Light headLight;

		private List<Light> miscLights;

		private static readonly float agentAccelerationMinDefault = 10f;

		public float agentAccelerationCurrent;

		private static readonly float agentAngularMinDefault = 120f;

		public float agentAngularCurrent;

		private int observedState = -1;

		private Color currentHitchColour = hitchGlowColourRoaming;

		private float currentHitchColourIntensity = 0f;

		private bool shouldChangeHitchColour = true;

		private float currentColourChangeTimer = 0f;

		private float hitchVolume;

		private float hitchRoamSpeed;

		private float hitchChaseSpeed;

		private int hitchDamage;

		private int hitchHealth;

		private float hitchRecharge;

		private bool hitchInstakill = false;

		public GameObject[] glowingBodyParts;

		public Material[] glowingBodyPartsMaterial;

		[Header("Hitch")]
		public bool DebugToCamera = false;

		public AudioClip AudioClipRoaming;

		public AudioClip AudioClipChasing;

		public AudioClip AudioClipAttacking;

		public AudioClip AudioRechargeClank;

		private bool allowProcRechargeAudio;

		private float currentClipLength;

		private float maxClipLength;

		public Transform turnCompass = null;

		public Transform attackArea = null;

		public VisualEffect visualEffects;

		private static VFXExposedProperty keyVFXBeginTrigger;

		private static VFXExposedProperty keyVFXEndTrigger;

		private static readonly string keyVFXBeginTriggerName = "StartSparks";

		private static readonly string keyVFXEndTriggerName = "StopSparks";

		private float setAgentSpeed;

		private float setAgentAcceleration;

		private float SpeedAccelerationTime = 0f;

		private float debugTimer;

		private bool doVariablesForceChange;

		private bool doVariablesForceChangeProc;

		private List<ulong> hitPlayers = new List<ulong>();

		public void SetConfigValues()
		{
			hitchVolume = PluginConfig.HitchVolumeAdjustment.Value;
			hitchRoamSpeed = PluginConfig.HitchRoamSpeed.Value;
			hitchChaseSpeed = PluginConfig.HitchChaseSpeed.Value;
			hitchDamage = PluginConfig.HitchDamage.Value;
			hitchHealth = PluginConfig.HitchHealth.Value;
			hitchRecharge = PluginConfig.HitchRechargeDuration.Value;
			hitchInstakill = PluginConfig.HitchInstakill.Value;
		}

		public override void Start()
		{
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Expected O, but got Unknown
			base.Start();
			SetConfigValues();
			((EnemyAI)this).enemyHP = hitchHealth;
			audioSource = ((Component)this).GetComponent<AudioSource>();
			NavMeshAgent agent = ((EnemyAI)this).agent;
			timeSinceHittingLocalPlayer = 0f;
			((EnemyAI)this).agent.acceleration = 300f;
			((EnemyAI)this).agent.angularSpeed = 180f;
			chaseMaxSpeed = 12f;
			((EnemyAI)this).openDoorSpeedMultiplier = 100f;
			keyVFXBeginTrigger.name = keyVFXBeginTriggerName;
			keyVFXEndTrigger.name = keyVFXEndTriggerName;
			searchForPlayer = new AISearchRoutine();
			miscLights = new List<Light>();
			Light[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<Light>();
			Light[] array = componentsInChildren;
			foreach (Light val in array)
			{
				if (((Object)((Component)val).gameObject).name == "headLight")
				{
					headLight = val;
				}
				else if (((Object)((Component)val).gameObject).name == "miscLight")
				{
					miscLights.Add(val);
					((Behaviour)val).enabled = false;
				}
			}
			if (((EnemyAI)this).creatureVoice.isPlaying)
			{
				maxClipLength = ((EnemyAI)this).creatureVoice.clip.length;
			}
			headLight.intensity = 0f;
			((Behaviour)headLight).enabled = true;
			agentAccelerationCurrent = agentAccelerationMinDefault;
			agentAngularCurrent = agentAngularMinDefault;
			ControlHitchFunctionsServerRpc(hitchRoamSpeed, 1, startSearching: true, chasing: false);
		}

		public void StartAnimVFX()
		{
			AnimVFXServerRpc(onOff: true);
		}

		public void EndAnimVFX()
		{
			AnimVFXServerRpc(onOff: false);
		}

		[ServerRpc(RequireOwnership = false)]
		public void AnimVFXServerRpc(bool onOff)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1013190203u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref onOff, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1013190203u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					AnimVFXClientRpc(onOff);
				}
			}
		}

		[ClientRpc]
		public void AnimVFXClientRpc(bool onOff)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3116476706u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref onOff, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3116476706u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			if (onOff)
			{
				if (allowProcRechargeAudio)
				{
					float pitch = Random.Range(0.8f, 1.2f);
					PlaySoundClipServerRpc(0, pitch);
					allowProcRechargeAudio = false;
				}
				visualEffects.SendEvent(keyVFXBeginTrigger.name);
			}
			else
			{
				visualEffects.SendEvent(keyVFXEndTrigger.name);
				allowProcRechargeAudio = true;
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void PlaySoundClipServerRpc(int audioClipID, float pitch)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(270217634u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, audioClipID);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref pitch, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 270217634u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					PlaySoundClipClientRpc(audioClipID, pitch);
				}
			}
		}

		[ClientRpc]
		public void PlaySoundClipClientRpc(int audioClipID, float pitch)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2998526597u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, audioClipID);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref pitch, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2998526597u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				((EnemyAI)this).creatureVoice.pitch = pitch;
				switch (audioClipID)
				{
				case 0:
					((EnemyAI)this).creatureVoice.PlayOneShot(AudioRechargeClank, hitchVolume);
					break;
				case 1:
					((EnemyAI)this).creatureVoice.PlayOneShot(AudioClipAttacking, hitchVolume);
					break;
				}
			}
		}

		public void ObserveState()
		{
			if (observedState != ((EnemyAI)this).currentBehaviourStateIndex)
			{
				EndAnimVFX();
				switch (((EnemyAI)this).currentBehaviourStateIndex)
				{
				case 1:
					SpeedAccelerationTime = 0f;
					attackFuncTimer = 0f;
					attackMovement = false;
					attackTriggerBool = false;
					currentColourChangeTimer = 0f;
					AddTargetPlayerVelocityServerRpc(0f);
					shouldChangeHitchColour = true;
					((EnemyAI)this).creatureVoice.Stop();
					((EnemyAI)this).creatureVoice.clip = AudioClipRoaming;
					((EnemyAI)this).creatureVoice.loop = true;
					((EnemyAI)this).creatureVoice.volume = hitchVolume;
					((EnemyAI)this).creatureVoice.Play();
					attackingPlayer = false;
					allowCollisionDamage = false;
					doVariablesForceChange = false;
					doVariablesForceChangeProc = true;
					hitPlayers.Clear();
					break;
				case 2:
					SpeedAccelerationTime = 0f;
					attackFuncTimer = 0f;
					currentColourChangeTimer = 0f;
					attackMovement = false;
					attackTriggerBool = false;
					AddTargetPlayerVelocityServerRpc(1f);
					shouldChangeHitchColour = true;
					((EnemyAI)this).creatureVoice.Stop();
					((EnemyAI)this).creatureVoice.clip = AudioClipChasing;
					((EnemyAI)this).creatureVoice.loop = true;
					((EnemyAI)this).creatureVoice.volume = hitchVolume;
					((EnemyAI)this).creatureVoice.Play();
					attackingPlayer = false;
					allowCollisionDamage = false;
					doVariablesForceChange = false;
					doVariablesForceChangeProc = true;
					hitPlayers.Clear();
					break;
				case 3:
					SpeedAccelerationTime = 0f;
					attackAudioClipTrue = true;
					attackMovement = true;
					((EnemyAI)this).creatureVoice.Stop();
					((EnemyAI)this).creatureVoice.loop = false;
					attackFuncTimer = 0f;
					currentColourChangeTimer = 0f;
					shouldChangeHitchColour = true;
					AddTargetPlayerVelocityServerRpc(1f);
					attackingPlayer = true;
					allowCollisionDamage = true;
					doVariablesForceChange = true;
					doVariablesForceChangeProc = true;
					break;
				case 4:
					SpeedAccelerationTime = 0f;
					StartAnimVFX();
					attackAudioClipTrue = true;
					attackMovement = false;
					attackTriggerBool = false;
					((EnemyAI)this).creatureVoice.Stop();
					attackFuncTimer = 0f;
					currentColourChangeTimer = 0f;
					AddTargetPlayerVelocityServerRpc(0f);
					shouldChangeHitchColour = true;
					allowCollisionDamage = false;
					doVariablesForceChange = false;
					doVariablesForceChangeProc = true;
					hitPlayers.Clear();
					break;
				}
				observedState = ((EnemyAI)this).currentBehaviourStateIndex;
			}
		}

		public override void DoAIInterval()
		{
			((EnemyAI)this).DoAIInterval();
			if (!((EnemyAI)this).isEnemyDead && !StartOfRound.Instance.allPlayersDead && ((NetworkBehaviour)this).IsHost)
			{
				switch (((EnemyAI)this).currentBehaviourStateIndex)
				{
				case 1:
					DoRoamSearch();
					break;
				case 2:
					DoChasingPlayer();
					break;
				case 3:
					DoAttackPlayer();
					break;
				case 4:
					DoRecharge();
					break;
				case 0:
					break;
				}
			}
		}

		public void DoRoamSearch()
		{
			if (!chasingPlayer && !FoundTargetablePlayer())
			{
			}
		}

		public void DoChasingPlayer()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			if (!attackingPlayer && (Object)(object)((EnemyAI)this).targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) < 3f)
			{
				attackingPlayer = true;
				ControlHitchFunctionsServerRpc(8f, 3, startSearching: false, chasing: true);
			}
			if (lostPlayerInChase)
			{
				if (!searchForPlayer.inProgress)
				{
					((EnemyAI)this).movingTowardsTargetPlayer = false;
					((EnemyAI)this).SetDestinationToPosition(lastPositionOfSeenPlayer, false);
					((EnemyAI)this).StartSearch(lastPositionOfSeenPlayer, searchForPlayer);
				}
				if (FindNewTargetablePlayer())
				{
					lostPlayerInChase = false;
					lostPlayerInChaseTimer = 0f;
					return;
				}
				lostPlayerInChaseTimer += ((EnemyAI)this).AIIntervalTime;
				if (lostPlayerInChaseTimer >= 10f)
				{
					ControlHitchFunctionsServerRpc(hitchRoamSpeed, 1, startSearching: false, chasing: false);
					SetTargetServerRpc(-1);
				}
				return;
			}
			if (searchForPlayer.inProgress && !lostPlayerInChase)
			{
				((EnemyAI)this).StopSearch(searchForPlayer, true);
			}
			if (FoundCloserTargetablePlayer(2f) && (Object)(object)((EnemyAI)this).targetPlayer != (Object)null)
			{
				lostPlayerInChaseTimer = 0f;
				return;
			}
			if (NoPlayerVisible())
			{
				lostPlayerInChaseTimer += ((EnemyAI)this).AIIntervalTime;
				if (lostPlayerInChaseTimer > 2.5f)
				{
					((EnemyAI)this).movingTowardsTargetPlayer = false;
					lostPlayerInChase = true;
				}
			}
			if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && !lostPlayerInChase)
			{
				((EnemyAI)this).movingTowardsTargetPlayer = true;
				lastPositionOfSeenPlayer = ((Component)((EnemyAI)this).targetPlayer).transform.position;
			}
		}

		public void DoAttackPlayer()
		{
			if (attackingDone)
			{
				attackTriggerBool = false;
				attackMovement = false;
				((EnemyAI)this).movingTowardsTargetPlayer = false;
				ChangeSpeedExtraFuncServerRpc(0f, 0f);
				if (attackFuncTimer >= 0.2f)
				{
					isRecharging = true;
					attackFuncTimer = 0f;
					ControlHitchFunctionsServerRpc(0f, 4, startSearching: false, chasing: false);
				}
				attackFuncTimer += ((EnemyAI)this).AIIntervalTime;
			}
			else if (!attackingDone)
			{
				((EnemyAI)this).movingTowardsTargetPlayer = true;
			}
			if (attackTriggerBool)
			{
				AttackProcClientRpc();
				attackTriggerBool = false;
				allowCollisionDamage = false;
				doVariablesForceChange = false;
				((EnemyAI)this).addPlayerVelocityToDestination = 1.5f;
			}
			if (attackAudioClipTrue)
			{
				float pitch = Random.Range(0.9f, 1.1f);
				PlaySoundClipServerRpc(1, pitch);
				attackAudioClipTrue = false;
			}
		}

		public void DoRecharge()
		{
			if (!isRecharging)
			{
				if (attackFuncTimer >= 0.5f)
				{
					ControlHitchFunctionsServerRpc(0f, 1, startSearching: true, chasing: false);
				}
				attackFuncTimer += ((EnemyAI)this).AIIntervalTime;
				return;
			}
			if (attackFuncTimer >= hitchRecharge)
			{
				attackFuncTimer = 0f;
				isRecharging = false;
			}
			((EnemyAI)this).movingTowardsTargetPlayer = false;
			attackFuncTimer += ((EnemyAI)this).AIIntervalTime;
		}

		private bool FoundTargetablePlayer()
		{
			PlayerControllerB val = ((EnemyAI)this).CheckLineOfSightForClosestPlayer(90f, 40, 10, 5f);
			if ((Object)(object)val != (Object)null)
			{
				SetTargetServerRpc((int)val.actualClientId);
				ControlHitchFunctionsServerRpc(hitchChaseSpeed, 2, startSearching: false, chasing: true);
				((EnemyAI)this).movingTowardsTargetPlayer = true;
				return true;
			}
			return false;
		}

		private bool FoundCloserTargetablePlayer(float differenceDistance)
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((EnemyAI)this).targetPlayer == (Object)null)
			{
				return false;
			}
			PlayerControllerB val = ((EnemyAI)this).CheckLineOfSightForClosestPlayer(90f, 40, 10, 5f);
			if ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)((EnemyAI)this).targetPlayer && Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) - differenceDistance > Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position))
			{
				SetTargetServerRpc((int)val.actualClientId);
				return true;
			}
			return false;
		}

		private bool NoPlayerVisible()
		{
			PlayerControllerB closestPlayer = ((EnemyAI)this).GetClosestPlayer(true, false, false);
			if ((Object)(object)closestPlayer == (Object)null)
			{
				return true;
			}
			return false;
		}

		private bool FindNewTargetablePlayer()
		{
			PlayerControllerB val = ((EnemyAI)this).CheckLineOfSightForClosestPlayer(60f, 40, 10, 5f);
			if ((Object)(object)val != (Object)null)
			{
				SetTargetServerRpc((int)val.actualClientId);
				return true;
			}
			return false;
		}

		[ServerRpc(RequireOwnership = false)]
		public void CalculateColoursServerRpc(Color newColour, float newIntensity)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: 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(944716868u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref newColour);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref newIntensity, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 944716868u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					CalculateColoursClientRpc(newColour, newIntensity);
				}
			}
		}

		[ClientRpc]
		public void CalculateColoursClientRpc(Color newColour, float newIntensity)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: 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(1716694071u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref newColour);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref newIntensity, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1716694071u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			headLight.color = currentHitchColour;
			headLight.intensity = currentHitchColourIntensity;
			foreach (Light miscLight in miscLights)
			{
				miscLight.color = currentHitchColour;
				miscLight.intensity = currentHitchColourIntensity;
			}
			GameObject[] array = glowingBodyParts;
			foreach (GameObject val3 in array)
			{
				((Renderer)val3.GetComponent<SkinnedMeshRenderer>()).material.SetColor("_EmissiveColor", currentHitchColour);
			}
		}

		public void CalcColourFunc(Color newColour, float newIntensity)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: 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)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			currentHitchColour = Color.Lerp(currentHitchColour, newColour, 2f);
			currentHitchColourIntensity = Mathf.Lerp(currentHitchColourIntensity, newIntensity, 2f);
		}

		public void CalculateColours2()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			if (shouldChangeHitchColour)
			{
				currentColourChangeTimer += Time.deltaTime;
				switch (((EnemyAI)this).currentBehaviourStateIndex)
				{
				case 1:
					CalcColourFunc(hitchGlowColourRoaming, 500f);
					break;
				case 2:
					CalcColourFunc(hitchGlowColourChasing, 750f);
					break;
				case 3:
					CalcColourFunc(hitchGlowColourAttacking, 1000f);
					break;
				case 4:
					CalcColourFunc(hitchGlowColourAttacking, 50f);
					break;
				case 5:
					CalcColourFunc(Color.black, 15f);
					break;
				}
				if (currentColourChangeTimer > 3f)
				{
					shouldChangeHitchColour = false;
					currentColourChangeTimer = 0f;
				}
				CalculateColoursServerRpc(currentHitchColour, currentHitchColourIntensity);
			}
		}

		public void ClipPitch()
		{
			if (((EnemyAI)this).currentBehaviourStateIndex == 1 && ((EnemyAI)this).currentBehaviourStateIndex == 2 && currentClipLength >= maxClipLength && audioSource.isPlaying)
			{
				switch (((EnemyAI)this).currentBehaviourStateIndex)
				{
				case 1:
					((EnemyAI)this).creatureVoice.pitch = Random.Range(0.7f, 1.1f);
					break;
				case 2:
					((EnemyAI)this).creatureVoice.pitch = Random.Range(0.6f, 1.05f);
					break;
				}
				maxClipLength = ((EnemyAI)this).creatureVoice.clip.length;
				currentClipLength = 0f;
			}
		}

		public override void Update()
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Update();
			if (((EnemyAI)this).isEnemyDead || StartOfRound.Instance.allPlayersDead)
			{
				return;
			}
			CalculateColours2();
			CalculateAgentSpeed();
			ObserveState();
			ClipPitch();
			if (timeSinceHittingLocalPlayer > 0f)
			{
				attackAudioClipTrue = true;
				timeSinceHittingLocalPlayer -= Time.deltaTime;
			}
			if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)this).transform.position + Vector3.up * 0.25f, 50f, 25, 5f))
			{
				if (((EnemyAI)this).currentBehaviourStateIndex == 3)
				{
					GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(1f, 1f);
				}
				else if (((EnemyAI)this).currentBehaviourStateIndex == 2)
				{
					GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 1f);
				}
				else if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null)
				{
					GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 0.25f);
				}
				else
				{
					GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 0f);
				}
			}
			if (doVariablesForceChange)
			{
				((EnemyAI)this).updatePositionThreshold = 0.05f;
				((EnemyAI)this).AIIntervalTime = 0.05f;
				doVariablesForceChangeProc = false;
			}
			else if (!doVariablesForceChange && doVariablesForceChangeProc)
			{
				((EnemyAI)this).updatePositionThreshold = 0.4f;
				((EnemyAI)this).AIIntervalTime = 0.2f;
				doVariablesForceChangeProc = false;
			}
			if (!((Object)(object)((EnemyAI)this).targetPlayer == (Object)null) && attackingPlayer && !attackingDone && Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) < 4f && Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) > 1f)
			{
				turnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position);
				((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 12f * Time.deltaTime);
			}
		}

		public void CalculateAgentSpeed()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			if (((EnemyAI)this).currentBehaviourStateIndex == 5)
			{
				setAgentSpeed = 0f;
				setAgentAcceleration = 0f;
				return;
			}
			Vector3 val = ((Component)this).transform.position - previousPosition;
			float num = ((Vector3)(ref val)).magnitude / (Time.deltaTime / 1.4f);
			if (velocityInterval <= 0f)
			{
				velocityInterval = 0.05f;
				velocityAverageCount += 1f;
				if (velocityAverageCount > 5f)
				{
					averageVelocity += (num - averageVelocity) / 3f;
				}
				else
				{
					averageVelocity += num;
					if (velocityAverageCount == 2f)
					{
						averageVelocity /= velocityAverageCount;
					}
				}
			}
			else
			{
				velocityInterval -= Time.deltaTime;
			}
			previousPosition = ((Component)this).transform.position;
			if (((EnemyAI)this).currentBehaviourStateIndex == 0 || ((EnemyAI)this).currentBehaviourStateIndex == 4)
			{
				setAgentSpeed = 0f;
				setAgentAcceleration = 0f;
				((EnemyAI)this).agent.velocity = Vector3.zero;
			}
			else if (((EnemyAI)this).currentBehaviourStateIndex == 1)
			{
				setAgentSpeed = hitchRoamSpeed;
				setAgentAcceleration = 150f;
			}
			else if (((EnemyAI)this).currentBehaviourStateIndex == 2)
			{
				if (!attackMovement)
				{
					SpeedAccelerationTime += 0.5f * Time.deltaTime;
					setAgentSpeed = Mathf.Lerp(hitchChaseSpeed, chaseMaxSpeed, SpeedAccelerationTime);
					setAgentAcceleration = 300f;
				}
				else
				{
					setAgentSpeed = hitchChaseSpeed;
					setAgentAcceleration = 200f;
				}
				lastChaseSpeed = setAgentSpeed;
				lastChaseAcceleration = setAgentAcceleration;
			}
			else if (((EnemyAI)this).currentBehaviourStateIndex == 3)
			{
				if (attackMovement)
				{
					setAgentSpeed = lastChaseSpeed;
					setAgentAcceleration = lastChaseAcceleration;
				}
				else
				{
					setAgentSpeed = 0f;
					setAgentAcceleration = 0f;
					((EnemyAI)this).agent.velocity = Vector3.zero;
				}
				SpeedAccelerationTime = 0f;
			}
			ChangeSpeedExtraFuncServerRpc(setAgentSpeed, setAgentAcceleration);
			if (!((NetworkBehaviour)this).IsServer)
			{
				ChangeSpeedOnLocalClient(setAgentSpeed, setAgentAcceleration);
			}
		}

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

		public void AttackTriggerFunction()
		{
			attackTriggerBool = true;
		}

		public void AttackDoneAnimation()
		{
			attackingDone = true;
		}

		public void DeactiveReacharge()
		{
			isRecharging = false;
		}

		[ClientRpc]
		public void AttackProcClientRpc()
		{
			//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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			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(2589056342u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2589056342u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			int num = 8;
			Collider[] array = Physics.OverlapBox(attackArea.position, attackArea.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 && (val4.health >= 15 || !hitchInstakill) && !hitPlayers.Contains(val4.actualClientId))
				{
					val4.DamagePlayer(hitchDamage, false, true, (CauseOfDeath)6, 0, false, default(Vector3));
					hitPlayers.Add(val4.actualClientId);
				}
				else if ((Object)(object)val4 != (Object)null && (val4.health >= 15 || hitchInstakill) && !hitPlayers.Contains(val4.actualClientId))
				{
					val4.DropBlood(Vector3.forward, true, false);
					val4.DropBlood(Vector3.left, true, false);
					val4.DropBlood(Vector3.right, true, false);
					val4.DropBlood(Vector3.up, true, false);
					val4.DropBlood(Vector3.back, true, false);
					val4.DropBlood(Vector3.down, true, false);
					val4.KillPlayer(Vector3.zero, true, (CauseOfDeath)6, 1, default(Vector3));
					val4.DamagePlayer(100, false, true, (CauseOfDeath)6, 1, false, default(Vector3));
					val4.snapToServerPosition = false;
					val4.disableLookInput = false;
					attackTriggerBool = false;
					hitPlayers.Add(val4.actualClientId);
				}
			}
		}

		public override void OnCollideWithPlayer(Collider other)
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: 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)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).OnCollideWithPlayer(other);
			if (allowCollisionDamage)
			{
				PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false);
				if ((Object)(object)val != (Object)null && (val.health >= 15 || !hitchInstakill) && !hitPlayers.Contains(val.actualClientId))
				{
					val.DamagePlayer(hitchDamage, false, true, (CauseOfDeath)6, 0, false, default(Vector3));
					hitPlayers.Add(val.actualClientId);
				}
				else if ((Object)(object)val != (Object)null && (val.health >= 15 || hitchInstakill) && !hitPlayers.Contains(val.actualClientId))
				{
					val.DropBlood(Vector3.forward, true, false);
					val.DropBlood(Vector3.left, true, false);
					val.DropBlood(Vector3.right, true, false);
					val.DropBlood(Vector3.up, true, false);
					val.DropBlood(Vector3.back, true, false);
					val.DropBlood(Vector3.down, true, false);
					val.KillPlayer(Vector3.zero, true, (CauseOfDeath)6, 1, default(Vector3));
					val.DamagePlayer(100, false, true, (CauseOfDeath)6, 1, false, default(Vector3));
					val.snapToServerPosition = false;
					val.disableLookInput = false;
					attackTriggerBool = false;
					hitPlayers.Add(val.actualClientId);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void AddTargetPlayerVelocityServerRpc(float vel)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3750120225u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref vel, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3750120225u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					AddTargetPlayerVelocityClientRpc(vel);
				}
			}
		}

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

		public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			if (!((EnemyAI)this).isEnemyDead)
			{
				((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
				((EnemyAI)this).enemyHP = ((EnemyAI)this).enemyHP - force;
				averageVelocity = 0f;
				if (((EnemyAI)this).enemyHP <= 0 && !((EnemyAI)this).isEnemyDead && ((NetworkBehaviour)this).IsOwner)
				{
					((EnemyAI)this).KillEnemyOnOwnerClient(false);
				}
			}
		}

		public override void KillEnemy(bool destroy = false)
		{
			((EnemyAI)this).KillEnemy(destroy);
			ControlHitchFunctionsServerRpc(0f, 5, startSearching: false, chasing: false);
			if (((NetworkBehaviour)this).IsServer)
			{
				((EnemyAI)this).creatureAnimator.SetTrigger("KillEnemy");
			}
		}

		public void Footsteps()
		{
			((EnemyAI)this).creatureSFX.pitch = Random.Range(0.8f, 1.2f);
			((EnemyAI)this).creatureSFX.PlayOneShot(((EnemyAI)this).enemyType.audioClips[Random.Range(0, 2)]);
		}

		public void FootstepHeavy()
		{
			((EnemyAI)this).creatureSFX.pitch = Random.Range(0.7f, 1.1f);
			((EnemyAI)this).creatureSFX.PlayOneShot(((EnemyAI)this).enemyType.audioClips[3]);
		}

		[ServerRpc(RequireOwnership = false)]
		public void ChangeSpeedExtraFuncServerRpc(float speed, float acceleration)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: 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_00b2: 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(880072503u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speed, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref acceleration, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 880072503u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ChangeSpeedExtraFuncClientRpc(speed, acceleration);
					ChangeSpeedClientRpc(speed, acceleration);
				}
			}
		}

		[ClientRpc]
		public void ChangeSpeedExtraFuncClientRpc(float speed, float acceleration)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: 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_00b2: 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(1819056792u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speed, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref acceleration, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1819056792u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					ChangeSpeedOnLocalClient(speed, acceleration);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ControlHitchFunctionsServerRpc(float speed, int state, bool startSearching, bool chasing)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: 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_00da: 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(3143687579u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speed, default(ForPrimitives));
					BytePacker.WriteValueBitPacked(val2, state);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref startSearching, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref chasing, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3143687579u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ControlHitchFunctionsClientRpc(speed, state, startSearching, chasing);
				}
			}
		}

		[ClientRpc]
		public void ControlHitchFunctionsClientRpc(float speed, int state, bool startSearching, bool chasing)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: 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_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: 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(2056761624u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speed, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, state);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref startSearching, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref chasing, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2056761624u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			chasingPlayer = chasing;
			if (speed == 0f)
			{
				float num = speed;
			}
			switch (state)
			{
			case 0:
				attackFuncTimer = 0f;
				attackingDone = false;
				((EnemyAI)this).agent.velocity = Vector3.zero;
				TriggerAnimationOnLocalClient("IdlingT");
				break;
			case 1:
				attackFuncTimer = 0f;
				attackingDone = false;
				TriggerAnimationOnLocalClient("SearchingT");
				break;
			case 2:
				attackFuncTimer = 0f;
				attackingDone = false;
				TriggerAnimationOnLocalClient("ChasingT");
				break;
			case 3:
				attackFuncTimer = 0f;
				attackingDone = false;
				TriggerAnimationOnLocalClient("AttackingT");
				break;
			case 4:
				attackFuncTimer = 0f;
				attackingDone = true;
				((EnemyAI)this).agent.velocity = Vector3.zero;
				TriggerAnimationOnLocalClient("RechargeT");
				break;
			}
			((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(state);
			if (((NetworkBehaviour)this).IsHost)
			{
				if (startSearching)
				{
					((EnemyAI)this).StartSearch(((Component)this).transform.position, searchForPlayer);
				}
				else
				{
					((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true);
				}
			}
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_HitchBloodsworthAI()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1013190203u, new RpcReceiveHandler(__rpc_handler_1013190203));
			NetworkManager.__rpc_func_table.Add(3116476706u, new RpcReceiveHandler(__rpc_handler_3116476706));
			NetworkManager.__rpc_func_table.Add(270217634u, new RpcReceiveHandler(__rpc_handler_270217634));
			NetworkManager.__rpc_func_table.Add(2998526597u, new RpcReceiveHandler(__rpc_handler_2998526597));
			NetworkManager.__rpc_func_table.Add(944716868u, new RpcReceiveHandler(__rpc_handler_944716868));
			NetworkManager.__rpc_func_table.Add(1716694071u, new RpcReceiveHandler(__rpc_handler_1716694071));
			NetworkManager.__rpc_func_table.Add(2589056342u, new RpcReceiveHandler(__rpc_handler_2589056342));
			NetworkManager.__rpc_func_table.Add(3750120225u, new RpcReceiveHandler(__rpc_handler_3750120225));
			NetworkManager.__rpc_func_table.Add(1861603569u, new RpcReceiveHandler(__rpc_handler_1861603569));
			NetworkManager.__rpc_func_table.Add(880072503u, new RpcReceiveHandler(__rpc_handler_880072503));
			NetworkManager.__rpc_func_table.Add(1819056792u, new RpcReceiveHandler(__rpc_handler_1819056792));
			NetworkManager.__rpc_func_table.Add(3143687579u, new RpcReceiveHandler(__rpc_handler_3143687579));
			NetworkManager.__rpc_func_table.Add(2056761624u, new RpcReceiveHandler(__rpc_handler_2056761624));
		}

		private static void __rpc_handler_1013190203(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool onOff = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref onOff, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((HitchBloodsworthAI)(object)target).AnimVFXServerRpc(onOff);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3116476706(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool onOff = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref onOff, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((HitchBloodsworthAI)(object)target).AnimVFXClientRpc(onOff);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_270217634(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int audioClipID = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref audioClipID);
				float pitch = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref pitch, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((HitchBloodsworthAI)(object)target).PlaySoundClipServerRpc(audioClipID, pitch);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2998526597(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int audioClipID = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref audioClipID);
				float pitch = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref pitch, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((HitchBloodsworthAI)(object)target).PlaySoundClipClientRpc(audioClipID, pitch);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_944716868(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Color newColour = default(Color);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newColour);
				float newIntensity = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref newIntensity, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((HitchBloodsworthAI)(object)target).CalculateColoursServerRpc(newColour, newIntensity);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1716694071(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Color newColour = default(Color);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newColour);
				float newIntensity = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref newIntensity, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((HitchBloodsworthAI)(object)target).CalculateColoursClientRpc(newColour, newIntensity);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_3750120225(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float vel = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref vel, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((HitchBloodsworthAI)(object)target).AddTargetPlayerVelocityServerRpc(vel);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1861603569(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float vel = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref vel, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((HitchBloodsworthAI)(object)target).AddTargetPlayerVelocityClientRpc(vel);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_880072503(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float speed = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref speed, default(ForPrimitives));
				float acceleration = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref acceleration, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((HitchBloodsworthAI)(object)target).ChangeSpeedExtraFuncServerRpc(speed, acceleration);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1819056792(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float speed = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref speed, default(ForPrimitives));
				float acceleration = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref acceleration, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((HitchBloodsworthAI)(object)target).ChangeSpeedExtraFuncClientRpc(speed, acceleration);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3143687579(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float speed = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref speed, default(ForPrimitives));
				int state = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref state);
				bool startSearching = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref startSearching, default(ForPrimitives));
				bool chasing = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref chasing, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((HitchBloodsworthAI)(object)target).ControlHitchFunctionsServerRpc(speed, state, startSearching, chasing);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2056761624(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float speed = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref speed, default(ForPrimitives));
				int state = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref state);
				bool startSearching = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref startSearching, default(ForPrimitives));
				bool chasing = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref chasing, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((HitchBloodsworthAI)(object)target).ControlHitchFunctionsClientRpc(speed, state, startSearching, chasing);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "HitchBloodsworthAI";
		}
	}
	public abstract class HitchBloodsworthCalAI : EnemyAI
	{
		public override void Start()
		{
			((EnemyAI)this).Start();
		}

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

		[ServerRpc(RequireOwnership = false)]
		public void TriggerAnimationServerRpc(string animName)
		{
			//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 != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1438190747u, val, (RpcDelivery)0);
				bool flag = animName != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(animName, false);
				}
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1438190747u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				TriggerAnimationClientRpc(animName);
			}
		}

		[ClientRpc]
		public void TriggerAnimationClientRpc(string animName)
		{
			//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(1808551812u, val, (RpcDelivery)0);
				bool flag = animName != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(animName, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1808551812u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				TriggerAnimationOnLocalClient(animName);
			}
		}

		public void TriggerAnimationOnLocalClient(string animName)
		{
			base.creatureAnimator.SetTrigger(animName);
		}

		[ClientRpc]
		public void ChangeSpeedClientRpc(float speed, float acceleration)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: 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_00b2: 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(3182297060u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speed, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref acceleration, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3182297060u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					ChangeSpeedOnLocalClient(speed, acceleration);
				}
			}
		}

		public void ChangeSpeedOnLocalClient(float speed, float acceleration)
		{
			base.agent.speed = speed;
			base.agent.acceleration = acceleration;
		}

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

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

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_HitchBloodsworthCalAI()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1438190747u, new RpcReceiveHandler(__rpc_handler_1438190747));
			NetworkManager.__rpc_func_table.Add(1808551812u, new RpcReceiveHandler(__rpc_handler_1808551812));
			NetworkManager.__rpc_func_table.Add(3182297060u, new RpcReceiveHandler(__rpc_handler_3182297060));
			NetworkManager.__rpc_func_table.Add(1841759175u, new RpcReceiveHandler(__rpc_handler_1841759175));
			NetworkManager.__rpc_func_table.Add(2392667096u, new RpcReceiveHandler(__rpc_handler_2392667096));
		}

		private static void __rpc_handler_1438190747(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string animName = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref animName, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((HitchBloodsworthCalAI)(object)target).TriggerAnimationServerRpc(animName);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1808551812(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string animName = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref animName, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((HitchBloodsworthCalAI)(object)target).TriggerAnimationClientRpc(animName);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3182297060(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float speed = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref speed, default(ForPrimitives));
				float acceleration = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref acceleration, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((HitchBloodsworthCalAI)(object)target).ChangeSpeedClientRpc(speed, acceleration);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

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

		protected internal override string __getTypeName()
		{
			return "HitchBloodsworthCalAI";
		}
	}
	[BepInPlugin("ReavsStuff.HitchBloodsworth", "HitchBloodsworth", "0.0.4")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger;

		public static AssetBundle ModAssets;

		internal static PluginConfig BoundConfig { get; private set; }

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			BoundConfig = new PluginConfig(((BaseUnityPlugin)this).Config);
			InitializeNetworkBehaviours();
			string path = "HitchBloodsworth";
			ModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), path));
			if ((Object)(object)ModAssets == (Object)null)
			{
				Logger.LogError((object)"Failed to load custom assets.");
				return;
			}
			EnemyType val = ModAssets.LoadAsset<EnemyType>("HitchBloodsworth");
			TerminalNode val2 = ModAssets.LoadAsset<TerminalNode>("HitchBloodsworthTN");
			TerminalKeyword val3 = ModAssets.LoadAsset<TerminalKeyword>("HitchBloodsworthTK");
			NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab);
			Enemies.RegisterEnemy(val, BoundConfig.SpawnWeight.Value, (LevelTypes)(-1), val2, val3);
			Logger.LogInfo((object)"Plugin ReavsStuff.HitchBloodsworth is loaded!");
		}

		private static void InitializeNetworkBehaviours()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
	internal class Utilities
	{
		public static void ApplyLocalPlayerScreenshake(Vector3 position, float minDistance = 14f, float maxDistance = 25f, bool onlySmall = false)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, position);
			if (num < minDistance && !onlySmall)
			{
				HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
			}
			else if (num < maxDistance)
			{
				HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "ReavsStuff.HitchBloodsworth";

		public const string PLUGIN_NAME = "HitchBloodsworth";

		public const string PLUGIN_VERSION = "0.0.4";
	}
}
namespace HitchBloodsworth.Configuration
{
	public class PluginConfig
	{
		public ConfigEntry<int> SpawnWeight;

		public static ConfigEntry<float> HitchVolumeAdjustment;

		public static ConfigEntry<float> HitchRoamSpeed;

		public static ConfigEntry<float> HitchChaseSpeed;

		public static ConfigEntry<float> HitchRechargeDuration;

		public static ConfigEntry<int> HitchDamage;

		public static ConfigEntry<int> HitchHealth;

		public static ConfigEntry<bool> HitchInstakill;

		public PluginConfig(ConfigFile cfg)
		{
			SpawnWeight = cfg.Bind<int>("General", "Spawn weight", 20, "The spawn chance weight.\nGoes up from 0, lower is more rare, 100 and up is very common.");
			CreateIntCfgEntry(SpawnWeight);
			HitchVolumeAdjustment = cfg.Bind<float>("General", "Volume", 1f, "Adjust volume.\n1.0 = 100%, 0.0 = 0%");
			CreateFloatCfgEntry(HitchVolumeAdjustment, 0f, 1.25f);
			HitchDamage = cfg.Bind<int>("General", "Damage", 25, "How much damage he does.\nMin: 15    Max: 35");
			CreateIntCfgEntry(HitchDamage, 15, 35);
			HitchHealth = cfg.Bind<int>("General", "Health", 4, "How much health the doggy has.\nMin: 2    Max: 6");
			CreateIntCfgEntry(HitchHealth, 2, 6);
			HitchRechargeDuration = cfg.Bind<float>("General", "Recharge Rate", 1f, "How long it takes to for him to recharge.\nMin: 0.5   Max: 2");
			CreateFloatCfgEntry(HitchRechargeDuration, 0.5f, 2f);
			HitchRoamSpeed = cfg.Bind<float>("Speed Variables", "Roamspeed", 3f, "How fast the roam speed is.\nMin: 2     Max: 6");
			CreateFloatCfgEntry(HitchRoamSpeed, 2f, 6f);
			HitchChaseSpeed = cfg.Bind<float>("Speed Variables", "Chasespeed", 5f, "How fast the chase speed is.\nMin: 4     Max: 8");
			CreateFloatCfgEntry(HitchChaseSpeed, 4f, 8f);
			HitchInstakill = cfg.Bind<bool>("Misc", "Instakill", false, "If hitch should be allowed to oneshot\nNo");
			CreateBoolCfgEntry(HitchInstakill);
			ClearUnusedEntries(cfg);
		}

		private void CreateFloatCfgEntry(ConfigEntry<float> cfgEntry, float min = 0f, float max = 100f)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			FloatSliderOptions val = new FloatSliderOptions();
			((BaseRangeOptions<float>)(object)val).Min = min;
			((BaseRangeOptions<float>)(object)val).Max = max;
			((BaseOptions)val).RequiresRestart = false;
			FloatSliderConfigItem val2 = new FloatSliderConfigItem(cfgEntry, val);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2);
		}

		private void CreateIntCfgEntry(ConfigEntry<int> cfgEntry, int min = 0, int max = 100)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			IntSliderOptions val = new IntSliderOptions();
			((BaseRangeOptions<int>)(object)val).Min = min;
			((BaseRangeOptions<int>)(object)val).Max = max;
			((BaseOptions)val).RequiresRestart = false;
			IntSliderConfigItem val2 = new IntSliderConfigItem(cfgEntry, val);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2);
		}

		private void CreateBoolCfgEntry(ConfigEntry<bool> cfgEntry)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			BoolCheckBoxOptions val = new BoolCheckBoxOptions();
			((BaseOptions)val).RequiresRestart = false;
			BoolCheckBoxConfigItem val2 = new BoolCheckBoxConfigItem(cfgEntry, val);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2);
		}

		private void CreateStringCfgEntry(ConfigEntry<string> cfgEntry, bool requireRestart = false)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			TextInputFieldConfigItem val = new TextInputFieldConfigItem(cfgEntry, new TextInputFieldOptions
			{
				RequiresRestart = requireRestart
			});
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val);
		}

		private void ClearUnusedEntries(ConfigFile cfg)
		{
			PropertyInfo property = ((object)cfg).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic);
			Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(cfg, null);
			dictionary.Clear();
			cfg.Save();
		}
	}
}
namespace ReavsStuff.HitchBloodsworth.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}