Decompiled source of SCP966 v1.1.4

plugins/Scp966/ProjectSCP.SCP966.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalBestiary.Modules;
using Microsoft.CodeAnalysis;
using ProjectSCP.SCP966.NetcodePatcher;
using SCP1507.Configurations;
using SCP966;
using SCP966.Ai;
using SCP966.SCP966Manager;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ProjectSCP.SCP966")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.1.4.0")]
[assembly: AssemblyInformationalVersion("1.1.4+45ad91928e7a61d04667a71f3358bcdb16ae6de8")]
[assembly: AssemblyProduct("SCP966")]
[assembly: AssemblyTitle("ProjectSCP.SCP966")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.4.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedINetworkSerializable<NetworkBehaviourReference>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<NetworkBehaviourReference>();
	}
}
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;
		}
	}
}
[HarmonyPatch(typeof(HUDManager))]
internal class ScanPatch
{
	[HarmonyPatch("PingScan_performed")]
	[HarmonyPostfix]
	private static void PostFix(CallbackContext context)
	{
		if ((Object)(object)Scp966Manager.Instance != (Object)null)
		{
			Scp966Manager.Instance.StartScanOnAllInstances();
		}
	}
}
namespace SCP1507.Configurations
{
	[Serializable]
	public class Config : SyncedInstance<Config>
	{
		public ConfigEntry<float> TIME_YOU_SEE_MONSTER { get; private set; }

		public ConfigEntry<int> RARITY { get; private set; }

		public Config(ConfigFile cfg)
		{
			InitInstance(this);
			TIME_YOU_SEE_MONSTER = cfg.Bind<float>("Visibility", "Time you see the monster", 0.2f, "The amount of time you will see SCP 966 upon scan. It should not be higher than 1.2");
			RARITY = cfg.Bind<int>("Spawning", "Rarity", 30, "The rarity of SCp 966 on all the moons");
		}

		public static void RequestSync()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (!SyncedInstance<Config>.IsClient)
			{
				return;
			}
			FastBufferWriter val = default(FastBufferWriter);
			((FastBufferWriter)(ref val))..ctor(SyncedInstance<Config>.IntSize, (Allocator)2, -1);
			try
			{
				SyncedInstance<Config>.MessageManager.SendNamedMessage("Xilef992SCP966_OnRequestConfigSync", 0uL, val, (NetworkDelivery)3);
			}
			finally
			{
				((IDisposable)(FastBufferWriter)(ref val)).Dispose();
			}
		}

		public static void OnRequestSync(ulong clientId, FastBufferReader _)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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)
			if (!SyncedInstance<Config>.IsHost)
			{
				return;
			}
			Plugin.Logger.LogInfo((object)$"Config sync request received from client: {clientId}");
			byte[] array = SyncedInstance<Config>.SerializeToBytes(SyncedInstance<Config>.Instance);
			int num = array.Length;
			FastBufferWriter val = default(FastBufferWriter);
			((FastBufferWriter)(ref val))..ctor(num + SyncedInstance<Config>.IntSize, (Allocator)2, -1);
			try
			{
				((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref num, default(ForPrimitives));
				((FastBufferWriter)(ref val)).WriteBytesSafe(array, -1, 0);
				SyncedInstance<Config>.MessageManager.SendNamedMessage("Xilef992SCP966_OnReceiveConfigSync", clientId, val, (NetworkDelivery)3);
			}
			catch (Exception arg)
			{
				Plugin.Logger.LogInfo((object)$"Error occurred syncing config with client: {clientId}\n{arg}");
			}
			finally
			{
				((IDisposable)(FastBufferWriter)(ref val)).Dispose();
			}
		}

		public static void OnReceiveSync(ulong _, FastBufferReader reader)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			if (!((FastBufferReader)(ref reader)).TryBeginRead(SyncedInstance<Config>.IntSize))
			{
				Plugin.Logger.LogError((object)"Config sync error: Could not begin reading buffer.");
				return;
			}
			int num = default(int);
			((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref num, default(ForPrimitives));
			if (!((FastBufferReader)(ref reader)).TryBeginRead(num))
			{
				Plugin.Logger.LogError((object)"Config sync error: Host could not sync.");
				return;
			}
			byte[] data = new byte[num];
			((FastBufferReader)(ref reader)).ReadBytesSafe(ref data, num, 0);
			SyncedInstance<Config>.SyncInstance(data);
			Plugin.Logger.LogInfo((object)"Successfully synced config with host.");
		}
	}
	public static class ConfigurationsPatch
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static HandleNamedMessageDelegate <0>__OnRequestSync;

			public static HandleNamedMessageDelegate <1>__OnReceiveSync;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		public static void InitializeLocalPlayer()
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			if (((NetworkBehaviour)RoundManager.Instance).IsHost)
			{
				CustomMessagingManager messageManager = SyncedInstance<Config>.MessageManager;
				object obj = <>O.<0>__OnRequestSync;
				if (obj == null)
				{
					HandleNamedMessageDelegate val = Config.OnRequestSync;
					<>O.<0>__OnRequestSync = val;
					obj = (object)val;
				}
				messageManager.RegisterNamedMessageHandler("SCP966_OnRequestConfigSync", (HandleNamedMessageDelegate)obj);
				SyncedInstance<Config>.Synced = true;
				return;
			}
			SyncedInstance<Config>.Synced = false;
			CustomMessagingManager messageManager2 = SyncedInstance<Config>.MessageManager;
			object obj2 = <>O.<1>__OnReceiveSync;
			if (obj2 == null)
			{
				HandleNamedMessageDelegate val2 = Config.OnReceiveSync;
				<>O.<1>__OnReceiveSync = val2;
				obj2 = (object)val2;
			}
			messageManager2.RegisterNamedMessageHandler("SCP966_OnReceiveConfigSync", (HandleNamedMessageDelegate)obj2);
			Config.RequestSync();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(GameNetworkManager), "StartDisconnect")]
		public static void PlayerLeave()
		{
			SyncedInstance<Config>.RevertSync();
		}
	}
	public class SyncedInstance<T>
	{
		[NonSerialized]
		protected static int IntSize = 4;

		internal static CustomMessagingManager MessageManager => NetworkManager.Singleton.CustomMessagingManager;

		internal static bool IsClient => NetworkManager.Singleton.IsClient;

		internal static bool IsHost => NetworkManager.Singleton.IsHost;

		public static T Default { get; private set; }

		public static T Instance { get; private set; }

		public static bool Synced { get; internal set; }

		protected void InitInstance(T instance)
		{
			Default = instance;
			Instance = instance;
			IntSize = 4;
		}

		internal static void SyncInstance(byte[] data)
		{
			Instance = DeserializeFromBytes(data);
			Synced = true;
		}

		internal static void RevertSync()
		{
			Instance = Default;
			Synced = false;
		}

		public static byte[] SerializeToBytes(T val)
		{
			BinaryFormatter binaryFormatter = new BinaryFormatter();
			using MemoryStream memoryStream = new MemoryStream();
			try
			{
				binaryFormatter.Serialize(memoryStream, val);
				return memoryStream.ToArray();
			}
			catch (Exception arg)
			{
				Debug.Log((object)$"Error serializing instance: {arg}");
				return null;
			}
		}

		public static T DeserializeFromBytes(byte[] data)
		{
			BinaryFormatter binaryFormatter = new BinaryFormatter();
			using MemoryStream serializationStream = new MemoryStream(data);
			try
			{
				return (T)binaryFormatter.Deserialize(serializationStream);
			}
			catch (Exception arg)
			{
				Debug.Log((object)$"Error deserializing instance: {arg}");
				return default(T);
			}
		}
	}
}
namespace SCP966
{
	[BepInPlugin("ProjectSCP.SCP966", "SCP966", "1.1.4")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger;

		public static AssetBundle? ModAssets;

		private readonly Harmony harmony = new Harmony("ProjectSCP.SCP966");

		public static Config Config { get; internal set; }

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Config = new Config(((BaseUnityPlugin)this).Config);
			InitializeNetworkBehaviours();
			string path = "scp966modassets";
			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>("SCP966Enemy");
			TerminalNode val2 = ModAssets.LoadAsset<TerminalNode>("SCP966TN");
			TerminalKeyword val3 = ModAssets.LoadAsset<TerminalKeyword>("SCP966TK");
			Dictionary<LevelTypes, int> dictionary = new Dictionary<LevelTypes, int>
			{
				{
					(LevelTypes)4,
					40
				},
				{
					(LevelTypes)(-1),
					Config.RARITY.Value
				},
				{
					(LevelTypes)1024,
					20
				}
			};
			Dictionary<string, int> dictionary2 = new Dictionary<string, int>();
			NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab);
			Enemies.RegisterEnemy(val, dictionary, dictionary2, val2, val3);
			harmony.PatchAll(typeof(ConfigurationsPatch));
			harmony.PatchAll(typeof(ScanPatch));
			Logger.LogInfo((object)"Plugin ProjectSCP.SCP966 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);
					}
				}
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "ProjectSCP.SCP966";

		public const string PLUGIN_NAME = "SCP966";

		public const string PLUGIN_VERSION = "1.1.4";
	}
}
namespace SCP966.SCP966Manager
{
	public class Scp966Manager : MonoBehaviour
	{
		private static Scp966Manager _instance;

		private List<Scp966> _allScp966Instances = new List<Scp966>();

		public static Scp966Manager Instance => _instance;

		private void Awake()
		{
			if ((Object)(object)_instance != (Object)null && (Object)(object)_instance != (Object)(object)this)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			else
			{
				_instance = this;
			}
		}

		public void RegisterScp966Instance(Scp966 instance)
		{
			_allScp966Instances.Add(instance);
		}

		public void UnregisterScp966Instance(Scp966 instance)
		{
			_allScp966Instances.Remove(instance);
		}

		public void StartScanOnAllInstances()
		{
			foreach (Scp966 allScp966Instance in _allScp966Instances)
			{
				allScp966Instance.StartScanCoroutine();
			}
		}
	}
}
namespace SCP966.Ai
{
	public class AnimatorCallIn : MonoBehaviour
	{
		public Scp966 scpScript;

		public void Attack()
		{
			scpScript.SwingAttackHitClientRpc();
		}
	}
	public class Scp966 : EnemyAI
	{
		public SkinnedMeshRenderer mesh;

		public Transform lookAt;

		public Transform defaultLookAt;

		public Transform AttackArea;

		[Header("Damage Attacks")]
		public int firstAttack;

		public int secondAttack;

		public int thirdAttack;

		private int currentDamage;

		public float attackCooldown;

		private float attackCooldownBeheader;

		private float? previousNightVisionValue;

		[Header("Audio")]
		public AudioClip[] echoes;

		public AudioClip[] idles;

		private Coroutine passiveSound;

		private float waitTimer;

		private bool justStopedMoving = true;

		private bool weightModifiedLocal;

		private bool gettingScanned;

		private bool canScan = true;

		private Coroutine killCoroutine;

		[NonSerialized]
		private NetworkVariable<NetworkBehaviourReference> _playerNetVar = new NetworkVariable<NetworkBehaviourReference>(default(NetworkBehaviourReference), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		[NonSerialized]
		public bool isVisibleForLocalPlayer;

		private PlayerControllerB localPlayer;

		private GameObject foundNightVision;

		private Transform batteryTransform;

		private Transform barTransform;

		public PlayerControllerB Scp966TargetPlayer
		{
			get
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				return (PlayerControllerB)NetworkBehaviourReference.op_Implicit(_playerNetVar.Value);
			}
			set
			{
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)value == (Object)null)
				{
					_playerNetVar.Value = NetworkBehaviourReference.op_Implicit((NetworkBehaviour)null);
				}
				else
				{
					_playerNetVar.Value = new NetworkBehaviourReference((NetworkBehaviour)(object)value);
				}
			}
		}

		public override void Start()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			((EnemyAI)this).Start();
			localPlayer = RoundManager.Instance.playersManager.localPlayerController;
			((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
			attackCooldownBeheader = attackCooldown;
			if (((NetworkBehaviour)this).IsHost)
			{
				passiveSound = ((MonoBehaviour)this).StartCoroutine(IdlePlay());
			}
			if ((Object)(object)Scp966Manager.Instance == (Object)null)
			{
				GameObject val = new GameObject("Scp966Manager");
				val.AddComponent<Scp966Manager>();
			}
			Scp966Manager.Instance.RegisterScp966Instance(this);
		}

		private void LateUpdate()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			CheckIfLocalPlayerHasNightVision();
			if ((Object)(object)Scp966TargetPlayer != (Object)null)
			{
				lookAt.position = Scp966TargetPlayer.playerEye.position;
			}
			else
			{
				lookAt.position = defaultLookAt.position;
			}
			attackCooldown -= Time.deltaTime;
		}

		public override void DoAIInterval()
		{
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).DoAIInterval();
			switch (base.currentBehaviourStateIndex)
			{
			case 0:
				DoAnimationClientRpc("Walking", value: true);
				base.agent.autoBraking = true;
				base.agent.speed = 5f;
				base.agent.stoppingDistance = 1f;
				if (Object.op_Implicit((Object)(object)((EnemyAI)this).CheckLineOfSightForPlayer(45f, 60, 3)))
				{
					((EnemyAI)this).StopSearch(base.currentSearch, true);
					Scp966TargetPlayer = ((EnemyAI)this).CheckLineOfSightForPlayer(45f, 60, -1);
					((EnemyAI)this).SwitchToBehaviourClientRpc(1);
				}
				break;
			case 1:
				base.agent.stoppingDistance = 8f;
				base.agent.speed = 5f;
				base.agent.autoBraking = true;
				if (!Scp966TargetPlayer.isInsideFactory || Scp966TargetPlayer.isPlayerDead || Vector3.Distance(((Component)this).transform.position, ((Component)Scp966TargetPlayer).transform.position) > 25f)
				{
					base.agent.ResetPath();
					((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
					((EnemyAI)this).SwitchToBehaviourClientRpc(0);
					SetWeightPlayerClientRpc(Scp966TargetPlayer.playerClientId, 0f);
					Scp966TargetPlayer = null;
					break;
				}
				((EnemyAI)this).SetDestinationToPosition(((Component)Scp966TargetPlayer).transform.position, false);
				if (Vector3.Distance(((Component)this).transform.position, ((Component)Scp966TargetPlayer).transform.position) < base.agent.stoppingDistance)
				{
					DoAnimationClientRpc("Walking", value: false);
					if (justStopedMoving)
					{
						switch (RandomNumberGenerator.GetInt32(3))
						{
						case 0:
							MonsterLogger("WE ARE doing nothing");
							break;
						case 1:
							MonsterLogger("WE ARE SCREAMING");
							DoAnimationClientRpc("Scream");
							PlayScreamClientRpc(RandomNumberGenerator.GetInt32(echoes.Length));
							break;
						case 2:
							MonsterLogger("Staring");
							DoAnimationClientRpc("Stare");
							break;
						}
					}
					justStopedMoving = false;
				}
				else
				{
					justStopedMoving = true;
					DoAnimationClientRpc("Walking", value: true);
				}
				if (!Scp966TargetPlayer.isPlayerDead)
				{
					SetWeightPlayerClientRpc(Scp966TargetPlayer.playerClientId, 1f);
					CheckIfTargetHasLowStamClientRpc(Scp966TargetPlayer.playerClientId);
				}
				break;
			case 2:
				base.agent.stoppingDistance = 0f;
				base.agent.speed = 5f;
				base.agent.acceleration = 12f;
				base.agent.autoBraking = false;
				DoAnimationClientRpc("Walking", value: true);
				if (!Scp966TargetPlayer.isInsideFactory || Scp966TargetPlayer.isPlayerDead || Vector3.Distance(((Component)this).transform.position, ((Component)Scp966TargetPlayer).transform.position) > 25f)
				{
					base.agent.ResetPath();
					((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
					((EnemyAI)this).SwitchToBehaviourClientRpc(0);
					SetWeightPlayerClientRpc(Scp966TargetPlayer.playerClientId, 0f);
					Scp966TargetPlayer = null;
					break;
				}
				((EnemyAI)this).SetDestinationToPosition(((Component)Scp966TargetPlayer).transform.position, false);
				if (Vector3.Distance(((Component)this).transform.position, ((Component)Scp966TargetPlayer).transform.position) < 1.2f && attackCooldown <= 0.27f)
				{
					DoAnimationClientRpc("Attack");
					switch (base.creatureAnimator.GetInteger("AttackNumber"))
					{
					case 0:
						SetCurrentDamageClientRpc(firstAttack, 1);
						break;
					case 1:
						SetCurrentDamageClientRpc(secondAttack, 2);
						break;
					case 2:
						SetCurrentDamageClientRpc(thirdAttack, 0);
						break;
					default:
						MonsterLogger("We are outside of possible attack array!", pleaseReport: true);
						break;
					}
				}
				if (!Scp966TargetPlayer.isPlayerDead)
				{
					SetWeightPlayerClientRpc(Scp966TargetPlayer.playerClientId, 1f);
					CheckIfTargetHasLowStamClientRpc(Scp966TargetPlayer.playerClientId);
				}
				break;
			default:
				MonsterLogger("Behaviour State was changed to an non real one", pleaseReport: true);
				break;
			}
		}

		private void EnableMesh()
		{
			isVisibleForLocalPlayer = true;
			if ((Object)(object)mesh == (Object)null)
			{
				mesh = ((Component)this).GetComponent<SkinnedMeshRenderer>();
			}
			((Renderer)mesh).enabled = true;
		}

		private void DisableMesh()
		{
			isVisibleForLocalPlayer = false;
			if ((Object)(object)mesh == (Object)null)
			{
				mesh = ((Component)this).GetComponent<SkinnedMeshRenderer>();
			}
			((Renderer)mesh).enabled = false;
		}

		private void CheckIfLocalPlayerHasNightVision()
		{
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			if (gettingScanned)
			{
				return;
			}
			if ((Object)(object)foundNightVision == (Object)null)
			{
				foundNightVision = GameObject.Find("nightVision(Clone)");
				if ((Object)(object)foundNightVision != (Object)null)
				{
					batteryTransform = foundNightVision.transform.Find("Battery");
					if ((Object)(object)batteryTransform != (Object)null)
					{
						barTransform = batteryTransform.Find("Bar");
					}
				}
			}
			if ((Object)(object)foundNightVision != (Object)null && (Object)(object)batteryTransform != (Object)null && (Object)(object)barTransform != (Object)null)
			{
				GameObject gameObject = ((Component)batteryTransform).gameObject;
				if (gameObject.activeSelf)
				{
					float x = barTransform.localScale.x;
					if (previousNightVisionValue.HasValue)
					{
						if (x < previousNightVisionValue.Value)
						{
							EnableMesh();
						}
						else
						{
							DisableMesh();
						}
						previousNightVisionValue = x;
					}
					else
					{
						MonsterLogger("There was no value for previousNightVisionValue");
						previousNightVisionValue = x;
					}
				}
				else
				{
					DisableMesh();
				}
			}
			else
			{
				DisableMesh();
			}
		}

		public void StartScanCoroutine()
		{
			if (canScan)
			{
				canScan = false;
				gettingScanned = true;
				((MonoBehaviour)this).StartCoroutine(ScanCoroutine());
			}
		}

		private IEnumerator ScanCoroutine()
		{
			EnableMesh();
			yield return (object)new WaitForSeconds(0f + Plugin.Config.TIME_YOU_SEE_MONSTER.Value);
			DisableMesh();
			gettingScanned = false;
			yield return (object)new WaitForSeconds(1.2f - Plugin.Config.TIME_YOU_SEE_MONSTER.Value);
			canScan = true;
		}

		public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
		{
			((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
			SendIfTargetHasLowStamServerRpc();
			if (base.isEnemyDead)
			{
				return;
			}
			base.enemyHP -= force;
			if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0 && !base.isEnemyDead)
			{
				if (base.searchCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(base.searchCoroutine);
				}
				((EnemyAI)this).KillEnemyOnOwnerClient(false);
				((MonoBehaviour)this).StopCoroutine(passiveSound);
				SetWeightPlayerClientRpc(Scp966TargetPlayer.playerClientId, 0f);
			}
		}

		private IEnumerator IdlePlay()
		{
			while (!base.isEnemyDead)
			{
				yield return (object)new WaitForSeconds(waitTimer);
				PlayOnShotIdleClientRpc(RandomNumberGenerator.GetInt32(idles.Length));
				waitTimer = 5 + RandomNumberGenerator.GetInt32(20);
			}
		}

		[ClientRpc]
		public void PlayOnShotIdleClientRpc(int x)
		{
			//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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(594416341u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, x);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 594416341u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.creatureVoice.PlayOneShot(idles[x]);
				}
			}
		}

		[ClientRpc]
		public void SwingAttackHitClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			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(3731458306u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3731458306u, 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)
			{
				Collider[] array2 = array;
				foreach (Collider val3 in array2)
				{
					PlayerControllerB val4 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val3, false, false);
					if ((Object)(object)val4 != (Object)null)
					{
						base.creatureSFX.Play();
						MonsterLogger(val4.health.ToString());
						killCoroutine = ((MonoBehaviour)this).StartCoroutine(killPlayer(val4));
					}
				}
			}
			attackCooldown = attackCooldownBeheader;
		}

		private IEnumerator killPlayer(PlayerControllerB playerControllerB)
		{
			yield return (object)new WaitForSeconds(0.3f);
			((MonoBehaviour)this).StopCoroutine(killCoroutine);
			playerControllerB.DamagePlayer(currentDamage, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
			if (playerControllerB.health <= currentDamage)
			{
				SetWeightPlayerClientRpc(Scp966TargetPlayer.playerClientId, 0f);
			}
		}

		[ClientRpc]
		public void PlayScreamClientRpc(int x)
		{
			//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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1177901251u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, x);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1177901251u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					base.creatureVoice.PlayOneShot(echoes[x]);
				}
			}
		}

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

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

		[ClientRpc]
		public void SetCurrentDamageClientRpc(int x, int animation)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			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(388176069u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, x);
					BytePacker.WriteValueBitPacked(val2, animation);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 388176069u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					currentDamage = x;
					base.creatureAnimator.SetInteger("AttackNumber", animation);
				}
			}
		}

		[ClientRpc]
		public void SetWeightPlayerClientRpc(ulong clientId, float weight)
		{
			//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(3591909219u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, clientId);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref weight, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3591909219u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || RoundManager.Instance.playersManager.localPlayerController.playerClientId != clientId)
			{
				return;
			}
			if (weight == 0f)
			{
				PlayerControllerB localPlayerController = RoundManager.Instance.playersManager.localPlayerController;
				float num = 0f;
				GrabbableObject[] itemSlots = localPlayerController.ItemSlots;
				foreach (GrabbableObject val3 in itemSlots)
				{
					if (!((Object)(object)val3 == (Object)null) && !((Object)(object)((Component)val3).gameObject.GetComponent<GrabbableObject>() == (Object)null))
					{
						num += ((Component)val3).gameObject.GetComponent<GrabbableObject>().itemProperties.weight;
					}
				}
				localPlayerController.carryWeight = 1f + num;
			}
			else
			{
				if (weight != 1f)
				{
					return;
				}
				PlayerControllerB localPlayerController2 = RoundManager.Instance.playersManager.localPlayerController;
				float num2 = 0f;
				GrabbableObject[] itemSlots2 = localPlayerController2.ItemSlots;
				foreach (GrabbableObject val4 in itemSlots2)
				{
					if (!((Object)(object)val4 == (Object)null) && !((Object)(object)((Component)val4).gameObject.GetComponent<GrabbableObject>() == (Object)null))
					{
						num2 += ((Component)val4).gameObject.GetComponent<GrabbableObject>().itemProperties.weight;
					}
				}
				localPlayerController2.carryWeight = 1f + num2 + 0.5f;
			}
		}

		[ClientRpc]
		public void CheckIfTargetHasLowStamClientRpc(ulong clientId)
		{
			//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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2762657010u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, clientId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2762657010u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && (Object)(object)RoundManager.Instance.playersManager.localPlayerController == (Object)(object)Scp966TargetPlayer && Scp966TargetPlayer.sprintMeter <= 0.3f)
				{
					SendIfTargetHasLowStamServerRpc();
				}
			}
		}

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

		private void MonsterLogger(string x, bool pleaseReport = false)
		{
			Debug.Log((object)("[SCP966SleepKiller][SCP966 - AI CLASS][" + (pleaseReport ? "This Error should be reported with the context of the error" : "NO NEED REPORT") + "] :: " + x));
		}

		public override void OnDestroy()
		{
			((EnemyAI)this).OnDestroy();
			Scp966Manager.Instance.UnregisterScp966Instance(this);
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Scp966()
		{
			//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
			NetworkManager.__rpc_func_table.Add(594416341u, new RpcReceiveHandler(__rpc_handler_594416341));
			NetworkManager.__rpc_func_table.Add(3731458306u, new RpcReceiveHandler(__rpc_handler_3731458306));
			NetworkManager.__rpc_func_table.Add(1177901251u, new RpcReceiveHandler(__rpc_handler_1177901251));
			NetworkManager.__rpc_func_table.Add(2020107260u, new RpcReceiveHandler(__rpc_handler_2020107260));
			NetworkManager.__rpc_func_table.Add(1148248770u, new RpcReceiveHandler(__rpc_handler_1148248770));
			NetworkManager.__rpc_func_table.Add(388176069u, new RpcReceiveHandler(__rpc_handler_388176069));
			NetworkManager.__rpc_func_table.Add(3591909219u, new RpcReceiveHandler(__rpc_handler_3591909219));
			NetworkManager.__rpc_func_table.Add(2762657010u, new RpcReceiveHandler(__rpc_handler_2762657010));
			NetworkManager.__rpc_func_table.Add(2218761627u, new RpcReceiveHandler(__rpc_handler_2218761627));
		}

		private static void __rpc_handler_594416341(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 x = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref x);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Scp966)(object)target).PlayOnShotIdleClientRpc(x);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3731458306(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;
				((Scp966)(object)target).SwingAttackHitClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1177901251(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 x = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref x);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Scp966)(object)target).PlayScreamClientRpc(x);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2020107260(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 animationName = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Scp966)(object)target).DoAnimationClientRpc(animationName);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1148248770(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_0067: 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_009a: 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 animationName = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref animationName, false);
				}
				bool value = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref value, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Scp966)(object)target).DoAnimationClientRpc(animationName, value);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_388176069(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: 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)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int x = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref x);
				int animation = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref animation);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Scp966)(object)target).SetCurrentDamageClientRpc(x, animation);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3591909219(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)
			{
				ulong clientId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref clientId);
				float weight = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref weight, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Scp966)(object)target).SetWeightPlayerClientRpc(clientId, weight);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2762657010(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)
			{
				ulong clientId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref clientId);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Scp966)(object)target).CheckIfTargetHasLowStamClientRpc(clientId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		protected internal override string __getTypeName()
		{
			return "Scp966";
		}
	}
	public enum State
	{
		Searching,
		Tiering,
		Chasing
	}
}
namespace ProjectSCP.SCP966.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}