Decompiled source of LCTarotCard v1.1.1

LCTarrotCard.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using JetBrains.Annotations;
using LCTarrotCard.Cards;
using LCTarrotCard.Config;
using LCTarrotCard.Items;
using LCTarrotCard.NetcodePatcher;
using LCTarrotCard.Patches;
using LCTarrotCard.Ressource;
using LCTarrotCard.Util;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("LCTarrotCard")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LCTarrotCard")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9457633A-7E87-4BDB-8892-B9C127F9C677")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.3.0")]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace LCTarrotCard
{
	[HarmonyPatch]
	public class Networker : NetworkBehaviour
	{
		public static bool AllowExtraLife;

		private static GameObject _networkPrefab;

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

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

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

		public static Networker Instance { get; private set; }

		[ServerRpc(RequireOwnership = false)]
		public void KillPlayerServerRpc(int playerId, Vector3 velocity, CauseOfDeath causeOfDeath)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3834687756u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref velocity);
					((FastBufferWriter)(ref val2)).WriteValueSafe<CauseOfDeath>(ref causeOfDeath, default(ForEnums));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3834687756u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					KillPlayerClientRpc(playerId, velocity, causeOfDeath);
				}
			}
		}

		[ClientRpc]
		public void KillPlayerClientRpc(int playerId, Vector3 velocity, CauseOfDeath causeOfDeath)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(458956284u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref velocity);
				((FastBufferWriter)(ref val2)).WriteValueSafe<CauseOfDeath>(ref causeOfDeath, default(ForEnums));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 458956284u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				PlayerControllerB obj = StartOfRound.Instance.allPlayerScripts[playerId];
				if (obj != null)
				{
					obj.KillPlayer(velocity, true, causeOfDeath, 0, default(Vector3));
				}
			}
		}

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

		[ClientRpc]
		public void SetShipDoorStateClientRpc(bool opened)
		{
			//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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3853642043u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref opened, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3853642043u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			HangarShipDoor[] array = Object.FindObjectsOfType<HangarShipDoor>();
			foreach (HangarShipDoor val3 in array)
			{
				if (opened)
				{
					val3.SetDoorOpen();
					val3.doorPower = 0f;
				}
				else
				{
					val3.SetDoorClosed();
					val3.doorPower = 100f;
				}
				val3.shipDoorsAnimator.SetBool(Closed, !opened);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void OpenOrCloseRandomDoorServerRpc(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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3893186342u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3893186342u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					OpenOrCloseRandomDoorClientRpc(playerId, new Random().Next());
				}
			}
		}

		[ClientRpc]
		public void OpenOrCloseRandomDoorClientRpc(int playerId, int rngSeed)
		{
			//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)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4244542400u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				BytePacker.WriteValueBitPacked(val2, rngSeed);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4244542400u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			Random random = new Random(rngSeed);
			DoorLock[] array = Object.FindObjectsOfType<DoorLock>();
			foreach (DoorLock val3 in array)
			{
				if (random.Next(0, 2) == 0)
				{
					val3.OpenOrCloseDoor(StartOfRound.Instance.allPlayerScripts[playerId]);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void BreakerOffServerRpc()
		{
			//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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(964378104u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 964378104u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					BreakerOffClientRpc();
				}
			}
		}

		[ClientRpc]
		public void BreakerOffClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3070260538u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3070260538u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				RoundManager.Instance.SwitchPower(false);
				BreakerBox[] array = Object.FindObjectsOfType<BreakerBox>();
				BreakerBox[] array2 = array;
				foreach (BreakerBox val3 in array2)
				{
					val3.SetSwitchesOff();
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void AgroCoilheadOrSpawnServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3486020106u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3486020106u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			SpringManAI[] array = Object.FindObjectsOfType<SpringManAI>();
			int num = 0;
			SpringManAI[] array2 = array;
			foreach (SpringManAI val3 in array2)
			{
				if (!((EnemyAI)val3).isEnemyDead && ((NetworkBehaviour)val3).IsSpawned)
				{
					num++;
					((EnemyAI)val3).SwitchToBehaviourState(1);
				}
				if (num >= 2)
				{
					return;
				}
			}
			SpawnCoilheadServerRpc();
		}

		[ServerRpc(RequireOwnership = false)]
		public void SpawnCoilheadServerRpc()
		{
			//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_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(866308243u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 866308243u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				Transform randomSpawnLocation = Helper.GetRandomSpawnLocation();
				if ((Object)(object)randomSpawnLocation == (Object)null)
				{
					PluginLogger.Error("No spawn location found");
					return;
				}
				Vector3 position = randomSpawnLocation.position;
				GameObject val3 = Object.Instantiate<GameObject>(Helper.Enemies.SpringMan.enemyPrefab, position, Quaternion.identity);
				val3.GetComponentInChildren<NetworkObject>().Spawn(true);
				RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)val3.GetComponent<SpringManAI>());
				((EnemyAI)val3.GetComponent<SpringManAI>()).SetEnemyOutside(false);
				((EnemyAI)val3.GetComponent<SpringManAI>()).SwitchToBehaviourState(1);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void PopOrSpawnJesterServerRpc(float popDelay)
		{
			//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)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(900698346u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref popDelay, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 900698346u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			bool flag = false;
			foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
			{
				JesterAI val3 = (JesterAI)(object)((spawnedEnemy is JesterAI) ? spawnedEnemy : null);
				if (val3 != null && !((EnemyAI)val3).isEnemyDead)
				{
					if (((EnemyAI)val3).currentBehaviourStateIndex == 2)
					{
						return;
					}
					flag = true;
				}
			}
			if (!flag)
			{
				Transform randomSpawnLocation = Helper.GetRandomSpawnLocation();
				if ((Object)(object)randomSpawnLocation == (Object)null)
				{
					PluginLogger.Error("No spawn location found");
					return;
				}
				Vector3 position = randomSpawnLocation.position;
				GameObject val4 = Object.Instantiate<GameObject>(Helper.Enemies.Jester.enemyPrefab, position, Quaternion.identity);
				val4.GetComponentInChildren<NetworkObject>().Spawn(true);
				RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)val4.GetComponent<JesterAI>());
				((EnemyAI)val4.GetComponent<JesterAI>()).SetEnemyOutside(false);
				((EnemyAI)val4.GetComponent<JesterAI>()).SwitchToBehaviourState(1);
			}
			((MonoBehaviour)this).StartCoroutine(PopDelay(popDelay));
		}

		private static IEnumerator PopDelay(float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			PluginLogger.Debug("Popping jesters");
			foreach (EnemyAI enemy in RoundManager.Instance.SpawnedEnemies)
			{
				JesterAI jester = (JesterAI)(object)((enemy is JesterAI) ? enemy : null);
				if (jester != null && !((EnemyAI)jester).isEnemyDead)
				{
					((EnemyAI)jester).SwitchToBehaviourState(2);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SpawnGiantOrDogServerRpc(int amount)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(6427069u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, amount);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 6427069u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			for (int i = 0; i < amount; i++)
			{
				Transform randomSpawnLocation = Helper.GetRandomSpawnLocation(inside: false);
				if (!((Object)(object)randomSpawnLocation == (Object)null))
				{
					Vector3 position = randomSpawnLocation.position;
					if (Random.Range(0, 2) == 0)
					{
						PluginLogger.Debug("Spawn giant");
						GameObject val3 = Object.Instantiate<GameObject>(Helper.Enemies.ForestGiant.enemyPrefab, position, Quaternion.identity);
						val3.GetComponentInChildren<NetworkObject>().Spawn(true);
						RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)val3.GetComponent<ForestGiantAI>());
						((EnemyAI)val3.GetComponent<ForestGiantAI>()).SetEnemyOutside(true);
					}
					else
					{
						PluginLogger.Debug("Spawn dog");
						GameObject val4 = Object.Instantiate<GameObject>(Helper.Enemies.MouthDog.enemyPrefab, position, Quaternion.identity);
						val4.GetComponentInChildren<NetworkObject>().Spawn(true);
						RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)val4.GetComponent<MouthDogAI>());
						((EnemyAI)val4.GetComponent<MouthDogAI>()).SetEnemyOutside(true);
					}
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void TeleportRandomEntityServerRpc(Vector3 position, bool inside)
		{
			//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_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1980060841u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref inside, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1980060841u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			bool inside2 = inside;
			List<EnemyAI> spawnedEnemies = RoundManager.Instance.SpawnedEnemies;
			Helper.Shuffle(spawnedEnemies);
			using IEnumerator<EnemyAI> enumerator = spawnedEnemies.Where((EnemyAI enemy) => !enemy.isEnemyDead && enemy.isOutside == !inside2 && ((NetworkBehaviour)enemy).IsSpawned).GetEnumerator();
			if (enumerator.MoveNext())
			{
				EnemyAI current = enumerator.Current;
				PluginLogger.Debug("Enemy is outside ? " + current.isOutside + " player inside ? " + inside2);
				string enemyName = current.enemyType.enemyName;
				Vector3 val3 = position;
				PluginLogger.Debug("Tp " + enemyName + " to " + ((object)(Vector3)(ref val3)).ToString());
				TeleportEnemy(current, position);
			}
		}

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

		[ClientRpc]
		public void GhostBreatheClientRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1597565073u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1597565073u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					AudioSource.PlayClipAtPoint(Assets.GhostBreathe, position, 4f);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void TeleportEnemyAwayServerRpc()
		{
			//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_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3427511879u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3427511879u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			List<EnemyAI> spawnedEnemies = RoundManager.Instance.SpawnedEnemies;
			foreach (EnemyAI item in spawnedEnemies)
			{
				Vector3 position = item.ChooseFarthestNodeFromPosition(((Component)item).transform.position, false, 0, false, 50, false).position;
				TeleportEnemy(item, position);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void TeleportPlayerServerRpc(int playerId, Vector3 position, bool inside = true, bool insideShip = false)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_010e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1409835055u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref inside, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref insideShip, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1409835055u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					TeleportPlayerClientRpc(playerId, position, inside, insideShip);
				}
			}
		}

		[ClientRpc]
		public void TeleportPlayerClientRpc(int playerId, Vector3 position, bool inside = true, bool insideShip = false)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: 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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3340935527u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref inside, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref insideShip, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3340935527u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
			val3.StopSinkingServerRpc();
			if (Object.op_Implicit((Object)(object)val3.currentTriggerInAnimationWith))
			{
				val3.currentTriggerInAnimationWith.CancelAnimationExternally();
			}
			val3.inSpecialInteractAnimation = false;
			val3.isClimbingLadder = false;
			val3.isInElevator = insideShip;
			val3.isInHangarShipRoom = insideShip;
			val3.isInsideFactory = inside;
			val3.averageVelocity = 0f;
			val3.velocityLastFrame = Vector3.zero;
			val3.TeleportPlayer(position, false, 0f, false, true);
			val3.beamOutParticle.Play();
			if (playerId == (int)GameNetworkManager.Instance.localPlayerController.playerClientId)
			{
				HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
			}
			if (Object.op_Implicit((Object)(object)Object.FindObjectOfType<AudioReverbPresets>()))
			{
				if (val3.isInsideFactory)
				{
					Object.FindObjectOfType<AudioReverbPresets>().audioPresets[2].ChangeAudioReverbForPlayer(val3);
				}
				else
				{
					Object.FindObjectOfType<AudioReverbPresets>().audioPresets[3].ChangeAudioReverbForPlayer(val3);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SetPlayerHealthServerRpc(int playerId, int health)
		{
			//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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2066064276u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					BytePacker.WriteValueBitPacked(val2, health);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2066064276u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					SetPlayerHealthClientRpc(playerId, health);
				}
			}
		}

		[ClientRpc]
		public void SetPlayerHealthClientRpc(int playerId, int health)
		{
			//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)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3250666723u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				BytePacker.WriteValueBitPacked(val2, health);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3250666723u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			if (health <= 0)
			{
				health = 1;
			}
			PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
			int health2 = val3.health;
			val3.health = health;
			if (((NetworkBehaviour)val3).IsOwner)
			{
				HUDManager.Instance.UpdateHealthUI(health, health2 > health);
				if (health <= 20 && !val3.criticallyInjured)
				{
					HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
					val3.MakeCriticallyInjured(true);
				}
				else if (val3.criticallyInjured && health > 20)
				{
					val3.MakeCriticallyInjured(false);
				}
			}
			if (health2 > health)
			{
				return;
			}
			if (((NetworkBehaviour)val3).IsOwner)
			{
				((MonoBehaviour)this).StartCoroutine(SetPlayerUI(val3, health <= 20));
				((UnityEvent)StartOfRound.Instance.LocalPlayerDamagedEvent).Invoke();
				val3.takingFallDamage = false;
				if (val3.inSpecialInteractAnimation && !val3.twoHandedAnimation)
				{
					val3.playerBodyAnimator.SetTrigger(Damage);
				}
				val3.specialAnimationWeight = 1f;
				val3.PlayQuickSpecialAnimation(0.7f);
			}
			PlayerStats obj = val3.playersManager.gameStats.allPlayerStats[val3.playerClientId];
			obj.damageTaken += health2 - health;
			val3.timeSinceTakingDamage = Time.realtimeSinceStartup;
		}

		[ServerRpc(RequireOwnership = false)]
		public void DamagePlayerServerRpc(int playerId, int damage, Vector3 velocity, CauseOfDeath causeOfDeath)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3843812035u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					BytePacker.WriteValueBitPacked(val2, damage);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref velocity);
					((FastBufferWriter)(ref val2)).WriteValueSafe<CauseOfDeath>(ref causeOfDeath, default(ForEnums));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3843812035u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					DamagePlayerClientRpc(playerId, damage, velocity, causeOfDeath);
				}
			}
		}

		[ClientRpc]
		public void DamagePlayerClientRpc(int playerId, int damage, Vector3 velocity, CauseOfDeath causeOfDeath)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2442547416u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					BytePacker.WriteValueBitPacked(val2, damage);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref velocity);
					((FastBufferWriter)(ref val2)).WriteValueSafe<CauseOfDeath>(ref causeOfDeath, default(ForEnums));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2442547416u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
					val3.DamagePlayer(damage, true, true, causeOfDeath, 0, false, velocity);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void MultiplyInventoryValueServerRpc(int playerId, float multiplier)
		{
			//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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2278377068u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref multiplier, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2278377068u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					MultiplyInventoryValueClientRpc(playerId, multiplier);
				}
			}
		}

		[ClientRpc]
		public void MultiplyInventoryValueClientRpc(int playerId, float multiplier)
		{
			//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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1897849939u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref multiplier, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1897849939u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || StartOfRound.Instance.allPlayerScripts.Length <= playerId || !StartOfRound.Instance.allPlayerScripts[playerId].isPlayerControlled)
			{
				return;
			}
			GrabbableObject[] itemSlots = StartOfRound.Instance.allPlayerScripts[playerId].ItemSlots;
			foreach (GrabbableObject val3 in itemSlots)
			{
				if ((Object)(object)val3 != (Object)null && ((Behaviour)val3).enabled && val3.itemProperties.isScrap && val3.scrapValue > 0)
				{
					val3.SetScrapValue((int)((float)val3.scrapValue * multiplier));
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void MultiplyRandomScrapValueServerRpc(float multiplier)
		{
			//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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2149202328u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref multiplier, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2149202328u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					MultiplyRandomScrapValueClientRpc(multiplier, new Random().Next());
				}
			}
		}

		[ClientRpc]
		public void MultiplyRandomScrapValueClientRpc(float multiplier, int randomSeed)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1951809462u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref multiplier, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, randomSeed);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1951809462u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			Random random = new Random(randomSeed);
			GrabbableObject[] array = Object.FindObjectsOfType<GrabbableObject>();
			GrabbableObject[] array2 = array;
			foreach (GrabbableObject val3 in array2)
			{
				if ((Object)(object)val3 != (Object)null && ((Behaviour)val3).enabled && val3.itemProperties.isScrap && val3.scrapValue > 0 && random.Next(0, 5) == 0)
				{
					val3.SetScrapValue((int)((float)val3.scrapValue * multiplier));
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void RevivePlayerServerRpc(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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2243418972u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2243418972u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					RevivePlayerClientRpc(playerId);
				}
			}
		}

		[ClientRpc]
		public void RevivePlayerClientRpc(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)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2685453368u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2685453368u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
			if (!val3.isPlayerDead && !val3.isPlayerControlled)
			{
				return;
			}
			val3.ResetPlayerBloodObjects(true);
			val3.isClimbingLadder = false;
			val3.clampLooking = false;
			val3.inVehicleAnimation = false;
			val3.disableMoveInput = false;
			val3.ResetZAndXRotation();
			((Collider)val3.thisController).enabled = true;
			val3.health = 100;
			val3.hasBeenCriticallyInjured = false;
			val3.disableLookInput = false;
			val3.disableInteract = false;
			if (val3.isPlayerDead)
			{
				val3.isPlayerDead = false;
				val3.isPlayerControlled = true;
				val3.isInElevator = true;
				val3.isInHangarShipRoom = true;
				val3.isInsideFactory = false;
				val3.parentedToElevatorLastFrame = false;
				val3.overrideGameOverSpectatePivot = null;
				StartOfRound.Instance.SetPlayerObjectExtrapolate(false);
				val3.TeleportPlayer(StartOfRound.Instance.playerSpawnPositions[0].position, false, 0f, false, true);
				val3.setPositionOfDeadPlayer = false;
				val3.DisablePlayerModel(StartOfRound.Instance.allPlayerObjects[playerId], true, true);
				((Behaviour)val3.helmetLight).enabled = false;
				val3.Crouch(false);
				val3.criticallyInjured = false;
				if (Object.op_Implicit((Object)(object)val3.playerBodyAnimator))
				{
					val3.playerBodyAnimator.SetBool(Limp, false);
				}
				val3.bleedingHeavily = false;
				val3.activatingItem = false;
				val3.twoHanded = false;
				val3.inShockingMinigame = false;
				val3.inSpecialInteractAnimation = false;
				val3.freeRotationInInteractAnimation = false;
				val3.disableSyncInAnimation = false;
				val3.inAnimationWithEnemy = null;
				val3.holdingWalkieTalkie = false;
				val3.speakingToWalkieTalkie = false;
				val3.isSinking = false;
				val3.isUnderwater = false;
				val3.sinkingValue = 0f;
				val3.statusEffectAudio.Stop();
				val3.DisableJetpackControlsLocally();
				val3.health = 100;
				val3.mapRadarDotAnimator.SetBool("dead", false);
				val3.externalForceAutoFade = Vector3.zero;
				if (((NetworkBehaviour)val3).IsOwner)
				{
					HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", false);
					val3.hasBegunSpectating = false;
					HUDManager.Instance.RemoveSpectateUI();
					HUDManager.Instance.gameOverAnimator.SetTrigger("revive");
					val3.hinderedMultiplier = 1f;
					val3.isMovementHindered = 0;
					val3.sourcesCausingSinking = 0;
					val3.reverbPreset = StartOfRound.Instance.shipReverb;
				}
			}
			if (((NetworkBehaviour)val3).IsOwner)
			{
				SoundManager.Instance.earsRingingTimer = 0f;
				val3.bleedingHeavily = false;
				val3.criticallyInjured = false;
				val3.playerBodyAnimator.SetBool(Limp, false);
				val3.health = 100;
				HUDManager.Instance.UpdateHealthUI(100, false);
				val3.spectatedPlayerScript = null;
				((Behaviour)HUDManager.Instance.audioListenerLowPass).enabled = false;
				StartOfRound.Instance.SetSpectateCameraToGameOverMode(false, val3);
				((MonoBehaviour)this).StartCoroutine(SetPlayerUI(val3));
			}
			val3.voiceMuffledByEnemy = false;
			SoundManager.Instance.playerVoicePitchTargets[playerId] = 1f;
			SoundManager.Instance.SetPlayerPitch(1f, playerId);
			if (Object.op_Implicit((Object)(object)val3.currentVoiceChatIngameSettings))
			{
				if (!Object.op_Implicit((Object)(object)val3.currentVoiceChatIngameSettings.voiceAudio))
				{
					val3.currentVoiceChatIngameSettings.InitializeComponents();
				}
				if (!Object.op_Implicit((Object)(object)val3.currentVoiceChatIngameSettings.voiceAudio))
				{
					return;
				}
				((Component)val3.currentVoiceChatIngameSettings.voiceAudio).GetComponent<OccludeAudio>().overridingLowPass = false;
			}
			RagdollGrabbableObject[] array = Object.FindObjectsOfType<RagdollGrabbableObject>();
			RagdollGrabbableObject[] array2 = array;
			foreach (RagdollGrabbableObject val4 in array2)
			{
				if (val4.ragdoll.playerObjectId != playerId)
				{
					continue;
				}
				if (!((GrabbableObject)val4).isHeld)
				{
					if (((NetworkBehaviour)this).IsServer)
					{
						if (((NetworkBehaviour)val4).NetworkObject.IsSpawned)
						{
							((NetworkBehaviour)val4).NetworkObject.Despawn(true);
						}
						else
						{
							Object.Destroy((Object)(object)((Component)val4).gameObject);
						}
					}
				}
				else if (Object.op_Implicit((Object)(object)((GrabbableObject)val4).playerHeldBy))
				{
					((GrabbableObject)val4).playerHeldBy.DropAllHeldItems(true, false);
				}
			}
			DeadBodyInfo[] array3 = Object.FindObjectsOfType<DeadBodyInfo>();
			DeadBodyInfo[] array4 = array3;
			foreach (DeadBodyInfo val5 in array4)
			{
				if (val5.playerObjectId == playerId)
				{
					Object.Destroy((Object)(object)((Component)val5).gameObject);
				}
			}
			StartOfRound instance = StartOfRound.Instance;
			instance.livingPlayers++;
			StartOfRound.Instance.allPlayersDead = false;
			StartOfRound.Instance.UpdatePlayerVoiceEffects();
		}

		[ServerRpc(RequireOwnership = false)]
		public void AllowExtraLifeServerRpc()
		{
			//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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1979062494u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1979062494u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					AllowExtraLifeClientRpc(allow: true);
				}
			}
		}

		[ClientRpc]
		public void AllowExtraLifeClientRpc(bool allow)
		{
			//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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1996833951u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref allow, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1996833951u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					AllowExtraLife = allow;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ExtraLifeServerRpc(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)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2363699914u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2363699914u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && AllowExtraLife)
				{
					PluginLogger.Debug("extra life " + StartOfRound.Instance.allPlayerScripts[playerId].playerUsername);
					AllowExtraLifeClientRpc(allow: false);
					TeleportPlayerServerRpc(playerId, StartOfRound.Instance.playerSpawnPositions[0].position, inside: false, insideShip: true);
					ExtraLifeClientRpc(playerId);
				}
			}
		}

		[ClientRpc]
		public void ExtraLifeClientRpc(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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3667127957u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3667127957u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
				val3.health = 100;
				val3.isPlayerDead = false;
				val3.MakeCriticallyInjured(false);
				if (((NetworkBehaviour)val3).IsOwner)
				{
					((MonoBehaviour)this).StartCoroutine(SetPlayerUI(val3));
					HUDManager.Instance.UpdateHealthUI(100, false);
				}
				if (((NetworkBehaviour)StartOfRound.Instance.allPlayerScripts[playerId]).IsOwner)
				{
					HUDManager.Instance.DisplayTip("Extra life", "Thanks to the high priestess card, you are given an extra chance to live", false, false, "LC_Tip1");
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void LittleGirlChaseServerRpc(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)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2042389035u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2042389035u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			DressGirlAI val3 = null;
			foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
			{
				DressGirlAI val4 = (DressGirlAI)(object)((spawnedEnemy is DressGirlAI) ? spawnedEnemy : null);
				if (val4 == null || ((EnemyAI)val4).isEnemyDead || !((NetworkBehaviour)val4).IsSpawned)
				{
					continue;
				}
				val3 = val4;
				break;
			}
			if ((Object)(object)val3 == (Object)null)
			{
				Transform randomSpawnLocation = Helper.GetRandomSpawnLocation();
				if ((Object)(object)randomSpawnLocation == (Object)null)
				{
					PluginLogger.Error("No spawn location found");
					return;
				}
				Vector3 position = randomSpawnLocation.position;
				GameObject val5 = Object.Instantiate<GameObject>(Helper.Enemies.DressGirl.enemyPrefab, position, Quaternion.identity);
				val5.GetComponentInChildren<NetworkObject>().Spawn(true);
				RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)val5.GetComponent<DressGirlAI>());
				((EnemyAI)val5.GetComponent<DressGirlAI>()).SetEnemyOutside(false);
				val3 = val5.GetComponent<DressGirlAI>();
			}
			val3.hauntingPlayer = StartOfRound.Instance.allPlayerScripts[playerId];
			((MonoBehaviour)this).StartCoroutine(DelaySetGirlProperties(playerId, val3));
		}

		private IEnumerator DelaySetGirlProperties(int playerId, DressGirlAI dressGirl)
		{
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)((EnemyAI)dressGirl).agent != (Object)null));
			LittleGirlChaseClientRpc(playerId, ((NetworkBehaviour)dressGirl).NetworkObjectId);
		}

		[ClientRpc]
		public void LittleGirlChaseClientRpc(int playerId, ulong networkId)
		{
			//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)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: 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_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2969223326u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				BytePacker.WriteValueBitPacked(val2, networkId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2969223326u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			ulong networkId2 = networkId;
			if (playerId != (int)GameNetworkManager.Instance.localPlayerController.playerClientId)
			{
				return;
			}
			EnemyAI? obj = ((IEnumerable<EnemyAI>)RoundManager.Instance.SpawnedEnemies).FirstOrDefault((Func<EnemyAI, bool>)((EnemyAI enemy) => ((NetworkBehaviour)enemy).NetworkObjectId == networkId2));
			DressGirlAI val3 = (DressGirlAI)(object)((obj is DressGirlAI) ? obj : null);
			if ((Object)(object)val3 == (Object)null)
			{
				return;
			}
			PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId];
			if ((int)GameNetworkManager.Instance.localPlayerController.playerClientId == playerId)
			{
				Vector3 position = ((Component)val4).transform.position + ((Component)val4).transform.forward * 5f;
				if (((NetworkBehaviour)val3).OwnerClientId != GameNetworkManager.Instance.localPlayerController.actualClientId)
				{
					((EnemyAI)val3).ChangeOwnershipOfEnemy(GameNetworkManager.Instance.localPlayerController.actualClientId);
				}
				TeleportEnemy((EnemyAI)(object)val3, position);
				((EnemyAI)val3).EnableEnemyMesh(true, true);
				((EnemyAI)val3).SwitchToBehaviourStateOnLocalClient(1);
				val3.staringInHaunt = false;
				val3.disappearingFromStare = false;
				((EnemyAI)val3).agent.speed = 5.25f;
				((EnemyAI)val3).creatureAnimator.SetBool("Walk", true);
				val3.timer = 0f;
				((EnemyAI)val3).SetMovingTowardsTargetPlayer(val4);
				((EnemyAI)val3).moveTowardsDestination = true;
				((EnemyAI)val3).creatureVoice.volume = 1f;
				((EnemyAI)val3).creatureVoice.clip = val3.breathingSFX;
				((EnemyAI)val3).creatureVoice.Play();
				val3.SFXVolumeLerpTo = 1f;
				((EnemyAI)val3).creatureSFX.volume = 1f;
				if (!DressGirlAIPatch.ChaseTimes.ContainsKey(((NetworkBehaviour)val3).NetworkObjectId))
				{
					DressGirlAIPatch.ChaseTimes.Add(((NetworkBehaviour)val3).NetworkObjectId, Time.time);
				}
			}
			val3.hauntingPlayer = val4;
			if (!DressGirlAIPatch.ChasingGirls.ContainsKey(((NetworkBehaviour)val3).NetworkObjectId))
			{
				DressGirlAIPatch.ChasingGirls.Add(((NetworkBehaviour)val3).NetworkObjectId, playerId);
			}
		}

		private static IEnumerator SetPlayerUI(PlayerControllerB player, bool critical = false)
		{
			yield return (object)new WaitForFixedUpdate();
			HUDManager.Instance.UpdateHealthUI(player.health, false);
			player.MakeCriticallyInjured(critical);
		}

		[ServerRpc(RequireOwnership = false)]
		public void AgroBrackenOrSpawnServerRpc(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)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(587640117u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 587640117u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost) || !StartOfRound.Instance.allPlayerScripts[playerId].isPlayerControlled)
			{
				return;
			}
			FlowermanAI val3 = null;
			foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
			{
				FlowermanAI val4 = (FlowermanAI)(object)((spawnedEnemy is FlowermanAI) ? spawnedEnemy : null);
				if (val4 == null || ((EnemyAI)val4).isEnemyDead || !((NetworkBehaviour)val4).IsSpawned)
				{
					continue;
				}
				val3 = val4;
				break;
			}
			if ((Object)(object)val3 == (Object)null)
			{
				Transform randomSpawnLocation = Helper.GetRandomSpawnLocation();
				if ((Object)(object)randomSpawnLocation == (Object)null)
				{
					PluginLogger.Error("No spawn location found");
					return;
				}
				Vector3 position = randomSpawnLocation.position;
				GameObject val5 = Object.Instantiate<GameObject>(Helper.Enemies.FlowerMan.enemyPrefab, position, Quaternion.identity);
				val5.GetComponentInChildren<NetworkObject>().Spawn(true);
				RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)val5.GetComponent<FlowermanAI>());
				((EnemyAI)val5.GetComponent<FlowermanAI>()).SetEnemyOutside(false);
				val3 = val5.GetComponent<FlowermanAI>();
				((EnemyAI)val3).SyncPositionToClients();
			}
			SyncBrackenPropertiesClientRpc(playerId, ((NetworkBehaviour)val3).NetworkObjectId);
		}

		[ClientRpc]
		public void SyncBrackenPropertiesClientRpc(int playerId, ulong networkId)
		{
			//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)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(997310661u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				BytePacker.WriteValueBitPacked(val2, networkId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 997310661u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			ulong networkId2 = networkId;
			EnemyAI? obj = ((IEnumerable<EnemyAI>)RoundManager.Instance.SpawnedEnemies).FirstOrDefault((Func<EnemyAI, bool>)((EnemyAI enemy) => ((NetworkBehaviour)enemy).NetworkObjectId == networkId2));
			FlowermanAI val3 = (FlowermanAI)(object)((obj is FlowermanAI) ? obj : null);
			if (!((Object)(object)val3 == (Object)null))
			{
				if (!FlowermanAIPatch.AngryBrackens.ContainsKey(((NetworkBehaviour)val3).NetworkObjectId))
				{
					FlowermanAIPatch.AngryBrackens.Add(((NetworkBehaviour)val3).NetworkObjectId, new KeyValuePair<int, float>(playerId, Time.time));
				}
				((MonoBehaviour)this).StartCoroutine(SetBrackenProperties(val3, playerId));
			}
		}

		private IEnumerator SetBrackenProperties(FlowermanAI bracken, int playerId)
		{
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)((EnemyAI)bracken).agent != (Object)null));
			((EnemyAI)bracken).SwitchToBehaviourState(2);
			((EnemyAI)bracken).targetPlayer = StartOfRound.Instance.allPlayerScripts[playerId];
			bracken.angerMeter = 2.5f;
		}

		[ServerRpc(RequireOwnership = false)]
		public void DogChaseOrSpawnServerRpc(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)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(619641325u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 619641325u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost) || !StartOfRound.Instance.allPlayerScripts[playerId].isPlayerControlled)
			{
				return;
			}
			MouthDogAI val3 = null;
			foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
			{
				MouthDogAI val4 = (MouthDogAI)(object)((spawnedEnemy is MouthDogAI) ? spawnedEnemy : null);
				if (val4 == null || ((EnemyAI)val4).isEnemyDead || !((NetworkBehaviour)val4).IsSpawned)
				{
					continue;
				}
				val3 = val4;
				break;
			}
			if ((Object)(object)val3 == (Object)null)
			{
				Transform randomSpawnLocation = Helper.GetRandomSpawnLocation(inside: false);
				if ((Object)(object)randomSpawnLocation == (Object)null)
				{
					PluginLogger.Error("No spawn location found");
					return;
				}
				Vector3 position = randomSpawnLocation.position;
				GameObject val5 = Object.Instantiate<GameObject>(Helper.Enemies.MouthDog.enemyPrefab, position, Quaternion.identity);
				val5.GetComponentInChildren<NetworkObject>().Spawn(true);
				RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)val5.GetComponent<MouthDogAI>());
				((EnemyAI)val5.GetComponent<MouthDogAI>()).SetEnemyOutside(false);
				val3 = val5.GetComponent<MouthDogAI>();
				((EnemyAI)val3).SyncPositionToClients();
			}
			SyncDogPropertiesClientRpc(playerId, ((NetworkBehaviour)val3).NetworkObjectId);
		}

		[ClientRpc]
		public void SyncDogPropertiesClientRpc(int playerId, ulong networkId)
		{
			//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)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1416483757u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				BytePacker.WriteValueBitPacked(val2, networkId);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1416483757u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			ulong networkId2 = networkId;
			EnemyAI? obj = ((IEnumerable<EnemyAI>)RoundManager.Instance.SpawnedEnemies).FirstOrDefault((Func<EnemyAI, bool>)((EnemyAI enemy) => ((NetworkBehaviour)enemy).NetworkObjectId == networkId2));
			MouthDogAI val3 = (MouthDogAI)(object)((obj is MouthDogAI) ? obj : null);
			if (!((Object)(object)val3 == (Object)null))
			{
				if (!MouthDogAIPatch.ChasingDogs.ContainsKey(((NetworkBehaviour)val3).NetworkObjectId))
				{
					MouthDogAIPatch.ChasingDogs.Add(((NetworkBehaviour)val3).NetworkObjectId, playerId);
				}
				((MonoBehaviour)this).StartCoroutine(SetDogProperties(val3, StartOfRound.Instance.allPlayerScripts[playerId]));
			}
		}

		private IEnumerator SetDogProperties(MouthDogAI dog, PlayerControllerB player)
		{
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)((EnemyAI)dog).agent != (Object)null));
			dog.ReactToOtherDogHowl(((Component)player).transform.position);
		}

		[ServerRpc(RequireOwnership = false)]
		public void SetDogPathServerRpc(ulong dogId, int targetedPlayer)
		{
			//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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(153040076u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, dogId);
					BytePacker.WriteValueBitPacked(val2, targetedPlayer);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 153040076u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					SetDogPathClientRpc(dogId, targetedPlayer);
				}
			}
		}

		[ClientRpc]
		public void SetDogPathClientRpc(ulong dogId, int targetedPlayer)
		{
			//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)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3082485029u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, dogId);
				BytePacker.WriteValueBitPacked(val2, targetedPlayer);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3082485029u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			ulong dogId2 = dogId;
			PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[targetedPlayer];
			if (val3.isPlayerControlled)
			{
				EnemyAI? obj = ((IEnumerable<EnemyAI>)RoundManager.Instance.SpawnedEnemies).FirstOrDefault((Func<EnemyAI, bool>)((EnemyAI enemy) => ((NetworkBehaviour)enemy).NetworkObjectId == dogId2));
				MouthDogAI val4 = (MouthDogAI)(object)((obj is MouthDogAI) ? obj : null);
				if (!((Object)(object)val4 == (Object)null))
				{
					val4.ReactToOtherDogHowl(((Component)val3).transform.position);
					val4.suspicionLevel = 12;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ShipLeaveEarlyServerRpc()
		{
			//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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(625178223u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 625178223u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ShipLeaveEarlyClientRpc();
				}
			}
		}

		[ClientRpc]
		public void ShipLeaveEarlyClientRpc()
		{
			//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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(955694953u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 955694953u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					TimeOfDay.Instance.votesForShipToLeaveEarly = StartOfRound.Instance.connectedPlayersAmount + 1 - StartOfRound.Instance.livingPlayers;
					TimeOfDay.Instance.SetShipLeaveEarlyServerRpc();
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void GiantChasePlayerOrSpawnServerRpc(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)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(395535226u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 395535226u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerId];
			if (!val3.isPlayerControlled)
			{
				return;
			}
			ForestGiantAI val4 = null;
			foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
			{
				ForestGiantAI val5 = (ForestGiantAI)(object)((spawnedEnemy is ForestGiantAI) ? spawnedEnemy : null);
				if (val5 == null || ((EnemyAI)val5).isEnemyDead || !((NetworkBehaviour)val5).IsSpawned)
				{
					continue;
				}
				val4 = val5;
				break;
			}
			if ((Object)(object)val4 == (Object)null)
			{
				Transform randomSpawnLocation = Helper.GetRandomSpawnLocation(inside: false);
				if ((Object)(object)randomSpawnLocation == (Object)null)
				{
					PluginLogger.Error("No spawn location found");
					return;
				}
				Vector3 position = randomSpawnLocation.position;
				GameObject val6 = Object.Instantiate<GameObject>(Helper.Enemies.ForestGiant.enemyPrefab, position, Quaternion.identity);
				val6.GetComponentInChildren<NetworkObject>().Spawn(true);
				RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)val6.GetComponent<ForestGiantAI>());
				((EnemyAI)val6.GetComponent<ForestGiantAI>()).SetEnemyOutside(false);
				val4 = val6.GetComponent<ForestGiantAI>();
				((EnemyAI)val4).SyncPositionToClients();
			}
			GiantSetPropertiesClientRpc(playerId, ((NetworkBehaviour)val4).NetworkObjectId);
		}

		[ClientRpc]
		public void GiantSetPropertiesClientRpc(int playerId, ulong networkId)
		{