Decompiled source of CrystalCluster v0.1.2

CrystalClusterMod.dll

Decompiled a month 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.Versioning;
using BepInEx;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using NetworkTestMod.CustomEffects;
using NetworkTestMod.Managers;
using NetworkTestMod.NetcodePatcher;
using NetworkTestMod.Utils;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using WeatherRegistry;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("NetworkTestMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NetworkTestMod")]
[assembly: AssemblyTitle("NetworkTestMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	public sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public string AssemblyName { get; }

		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
			AssemblyName = assemblyName;
		}
	}
	[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
	public sealed class NullableAttribute : Attribute
	{
		public byte[] Flags { get; }

		public NullableAttribute(byte[] flags)
		{
			Flags = flags;
		}

		public NullableAttribute(byte flag)
		{
			Flags = new byte[1] { flag };
		}
	}
	[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = false)]
	public sealed class NullableContextAttribute : Attribute
	{
		public byte Flag { get; }

		public NullableContextAttribute(byte flag)
		{
			Flag = flag;
		}
	}
}
namespace NetworkTestMod
{
	[BepInPlugin("hhunter.crystalcluster", "Crystal Cluster", "0.1.2")]
	public class Plugin : BaseUnityPlugin
	{
		private const string GUID = "hhunter.crystalcluster";

		private const string NAME = "Crystal Cluster";

		private const string VERSION = "0.1.2";

		private readonly Harmony harmony = new Harmony("hhunter.crystalcluster");

		public static Plugin instance;

		public GameObject netManagerPrefab;

		public static List<AudioClip> audioClips = new List<AudioClip>();

		private void LoadItemBehaviour(Item item, int behaviourId)
		{
			GrabbableObject val;
			switch (behaviourId)
			{
			default:
				return;
			case 1:
				val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Food>();
				break;
			case 2:
				val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<RedCrystal>();
				break;
			case 3:
				val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<PurpleCrystal>();
				break;
			case 7:
				val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<SmallGreen>();
				break;
			case 8:
				val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<SmallRed>();
				break;
			case 9:
				val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<SmallPurple>();
				break;
			case 4:
			case 5:
			case 6:
				return;
			}
			val.grabbable = true;
			val.isInFactory = true;
			val.grabbableToEnemies = true;
			val.itemProperties = item;
		}

		private void Awake()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
			instance = this;
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "crystalcluster");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			netManagerPrefab = val.LoadAsset<GameObject>("Assets/CrystalMod/CrystalNetworkManager.prefab");
			netManagerPrefab.AddComponent<CrystalManager>();
			Item val2 = val.LoadAsset<Item>("Assets/CrystalMod/CrystalClusterItem_Green.asset");
			Item val3 = val.LoadAsset<Item>("Assets/CrystalMod/CrystalClusterItem_red.asset");
			Item val4 = val.LoadAsset<Item>("Assets/CrystalMod/CrystalClusterItem_yellow.asset");
			Item val5 = val.LoadAsset<Item>("Assets/CrystalMod/CrystalClusterItem_purple.asset");
			Item val6 = val.LoadAsset<Item>("Assets/CrystalMod/CrystalClusterItem_Blue.asset");
			Item val7 = val.LoadAsset<Item>("Assets/CrystalMod/CrystalClusterItem.asset");
			Item val8 = val.LoadAsset<Item>("Assets/CrystalMod/GreenCrystal.asset");
			Item val9 = val.LoadAsset<Item>("Assets/CrystalMod/RedCrystal.asset");
			Item val10 = val.LoadAsset<Item>("Assets/CrystalMod/YellowCrystal.asset");
			Item val11 = val.LoadAsset<Item>("Assets/CrystalMod/PPurpleCrystal.asset");
			Item val12 = val.LoadAsset<Item>("Assets/CrystalMod/BlueCrystal.asset");
			audioClips.Add(val.LoadAsset<AudioClip>("Assets/CrystalMod/crack.wav"));
			LoadItemBehaviour(val2, 1);
			LoadItemBehaviour(val3, 2);
			LoadItemBehaviour(val5, 3);
			LoadItemBehaviour(val8, 7);
			LoadItemBehaviour(val9, 8);
			LoadItemBehaviour(val11, 9);
			NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val6.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val7.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val8.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val9.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val11.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val10.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val12.spawnPrefab);
			Utilities.FixMixerGroups(val2.spawnPrefab);
			Utilities.FixMixerGroups(val3.spawnPrefab);
			Utilities.FixMixerGroups(val5.spawnPrefab);
			Utilities.FixMixerGroups(val4.spawnPrefab);
			Utilities.FixMixerGroups(val7.spawnPrefab);
			Utilities.FixMixerGroups(val6.spawnPrefab);
			Utilities.FixMixerGroups(val8.spawnPrefab);
			Utilities.FixMixerGroups(val9.spawnPrefab);
			Utilities.FixMixerGroups(val10.spawnPrefab);
			Utilities.FixMixerGroups(val11.spawnPrefab);
			Utilities.FixMixerGroups(val12.spawnPrefab);
			Items.RegisterScrap(val2, 30, (LevelTypes)(-1));
			Items.RegisterScrap(val3, 30, (LevelTypes)(-1));
			Items.RegisterScrap(val5, 10, (LevelTypes)(-1));
			Items.RegisterScrap(val4, 10, (LevelTypes)(-1));
			Items.RegisterScrap(val7, 10, (LevelTypes)(-1));
			Items.RegisterScrap(val6, 10, (LevelTypes)(-1));
			Items.RegisterScrap(val8, 75, (LevelTypes)(-1));
			Items.RegisterScrap(val9, 75, (LevelTypes)(-1));
			Items.RegisterScrap(val10, 25, (LevelTypes)(-1));
			Items.RegisterScrap(val11, 25, (LevelTypes)(-1));
			Items.RegisterScrap(val12, 25, (LevelTypes)(-1));
			harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Patched CrystalCluster mod.\n  .     '     ,\r\n    _________\r\n _ /_|_____|_\\ _\r\n   '. \\   / .'\r\n     '.\\ /.'\r\n       '.'");
		}
	}
}
namespace NetworkTestMod.Utils
{
	internal class Effects
	{
		public enum DeathAnimation
		{
			Normal,
			NoHead1,
			Spring,
			Haunted,
			Mask1,
			Mask2,
			Fire,
			CutInHalf,
			NoHead2
		}

		public static int NbOfPlayers()
		{
			return StartOfRound.Instance.connectedPlayersAmount + 1;
		}

		public static List<PlayerControllerB> GetPlayers(bool includeDead = false, bool excludeOutsideFactory = false)
		{
			List<PlayerControllerB> list = StartOfRound.Instance.allPlayerScripts.ToList();
			List<PlayerControllerB> list2 = new List<PlayerControllerB>(list);
			foreach (PlayerControllerB item in list)
			{
				if (!((NetworkBehaviour)item).IsSpawned || !item.isPlayerControlled || (!includeDead && item.isPlayerDead) || (excludeOutsideFactory && !item.isInsideFactory))
				{
					list2.Remove(item);
				}
			}
			return list2;
		}

		public static List<EnemyAI> GetEnemies(bool includeDead = false, bool includeCanDie = false, bool excludeDaytime = false)
		{
			List<EnemyAI> list = Object.FindObjectsOfType<EnemyAI>().ToList();
			List<EnemyAI> list2 = new List<EnemyAI>(list);
			if (includeDead)
			{
				return list2;
			}
			foreach (EnemyAI item in list)
			{
				if (!((NetworkBehaviour)item).IsSpawned || item.isEnemyDead || (!includeCanDie && !item.enemyType.canDie) || (excludeDaytime && item.enemyType.isDaytimeEnemy))
				{
					list2.Remove(item);
				}
			}
			return list2;
		}

		public static void Damage(PlayerControllerB player, int damageNb, CauseOfDeath cause = 0, int animation = 0, bool criticalBlood = true)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			damageNb = ((player.health > 100 && damageNb == 100) ? 900 : damageNb);
			if (criticalBlood && player.health - damageNb <= 20)
			{
				player.bleedingHeavily = true;
			}
			player.DamagePlayer(damageNb, true, true, cause, animation, false, default(Vector3));
		}

		public static IEnumerator DamageHost(PlayerControllerB player, int damageNb, CauseOfDeath cause = 0, int animation = 0, bool criticalBlood = true)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			yield return (object)new WaitForEndOfFrame();
			Damage(player, damageNb, cause, animation, criticalBlood);
		}

		public static void Heal(ulong playerID, int health)
		{
			PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[(int)(IntPtr)checked((long)playerID)];
			val.health = ((val.health > 100) ? val.health : health);
			val.criticallyInjured = false;
			val.bleedingHeavily = false;
			val.playerBodyAnimator.SetBool("Limp", false);
		}

		public static void Teleportation(PlayerControllerB player, Vector3 position)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			player.averageVelocity = 0f;
			player.velocityLastFrame = Vector3.zero;
			player.TeleportPlayer(position, true, 0f, false, true);
			player.beamOutParticle.Play();
			HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
		}

		public static void SetPosFlags(ulong playerID, bool ship = false, bool exterior = false, bool interior = false)
		{
			PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[(int)(IntPtr)checked((long)playerID)];
			if (ship)
			{
				val.isInElevator = true;
				val.isInHangarShipRoom = true;
				val.isInsideFactory = false;
			}
			if (exterior)
			{
				val.isInElevator = false;
				val.isInHangarShipRoom = false;
				val.isInsideFactory = false;
			}
			if (interior)
			{
				val.isInElevator = false;
				val.isInHangarShipRoom = false;
				val.isInsideFactory = true;
			}
			GrabbableObject[] itemSlots = val.ItemSlots;
			foreach (GrabbableObject val2 in itemSlots)
			{
				if ((Object)(object)val2 != (Object)null)
				{
					val2.isInFactory = val.isInsideFactory;
					val2.isInElevator = val.isInElevator;
					val2.isInShipRoom = val.isInHangarShipRoom;
				}
			}
			if (GameNetworkManager.Instance.localPlayerController.playerClientId == val.playerClientId)
			{
				if (val.isInsideFactory)
				{
					TimeOfDay.Instance.DisableAllWeather(false);
				}
				else
				{
					ActivateWeatherEffect((LevelWeatherType)0);
				}
			}
		}

		public static void Explosion(Vector3 position, float range, int damage = 50, float physicsForce = 1f)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			Landmine.SpawnExplosion(position, true, range, range * 2.5f, damage, physicsForce, (GameObject)null, false);
		}

		public static void ExplosionLight(Vector3 position, float range, int damage = 10, float physicsForce = 1f)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			Landmine.SpawnExplosion(position, true, 0f, range, damage, physicsForce, (GameObject)null, false);
		}

		public static Vector3 GetClosestAINodePosition(GameObject[] nodes, Vector3 position)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			return nodes.OrderBy((GameObject x) => Vector3.Distance(position, x.transform.position)).ToArray()[0].transform.position;
		}

		public static void Knockback(Vector3 position, float range, int damage = 0, float physicsForce = 30f)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			Landmine.SpawnExplosion(position, false, 0f, range, damage, physicsForce, (GameObject)null, false);
		}

		public static void DropItem(Vector3 placingPosition = default(Vector3))
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			GameNetworkManager.Instance.localPlayerController.DiscardHeldObject(true, (NetworkObject)null, placingPosition, true);
		}

		public static void Audio(int audioID, float volume)
		{
			RoundManager.PlayRandomClip(HUDManager.Instance.UIAudio, (AudioClip[])(object)new AudioClip[1] { Plugin.audioClips[audioID] }, false, volume, 0, 1000);
		}

		public static void Audio(int audioID, Vector3 startPosition, float localVolume, float clientVolume, PlayerControllerB player)
		{
			//IL_0070: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)player != (Object)null && GameNetworkManager.Instance.localPlayerController.playerClientId == player.playerClientId)
			{
				Audio(audioID, localVolume);
			}
			else if ((Object)(object)player != (Object)null)
			{
				player.itemAudio.PlayOneShot(Plugin.audioClips[audioID], clientVolume);
			}
			else
			{
				AudioSource.PlayClipAtPoint(Plugin.audioClips[audioID], startPosition + Vector3.up * 2f, clientVolume);
			}
		}

		public static void Audio(int[] audioIDs, Vector3 position, float volume, bool adjust = true)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			AudioClip[] array = audioIDs.Select((int id) => Plugin.audioClips[id]).ToArray();
			Vector3 val = position;
			if (adjust)
			{
				val += Vector3.up * 2f;
			}
			GameObject val2 = new GameObject("One shot audio");
			val2.transform.position = val;
			AudioSource val3 = (AudioSource)val2.AddComponent(typeof(AudioSource));
			val3.spatialBlend = 1f;
			val3.rolloffMode = (AudioRolloffMode)1;
			val3.minDistance = 0f;
			val3.maxDistance = 20f;
			val3.volume = volume;
			RoundManager.PlayRandomClip(val3, array, true, volume, 0, 1000);
			Object val4 = (Object)(object)val2;
			Object.Destroy(val4, array[^1].length * ((Time.timeScale < 0.01f) ? 0.01f : Time.timeScale));
		}

		public static void Audio3D(int audioID, Vector3 position, float volume = 1f, float distance = 20f)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			GameObject val = new GameObject("One shot audio");
			val.transform.position = position;
			AudioSource val2 = (AudioSource)val.AddComponent(typeof(AudioSource));
			val2.spatialBlend = 1f;
			val2.rolloffMode = (AudioRolloffMode)1;
			val2.minDistance = 0f;
			val2.maxDistance = distance;
			val2.PlayOneShot(Plugin.audioClips[audioID], volume);
			Object.Destroy((Object)(object)val, Plugin.audioClips[audioID].length * ((Time.timeScale < 0.01f) ? 0.01f : Time.timeScale));
		}

		public static IEnumerator FadeOutAudio(AudioSource source, float time)
		{
			yield return (object)new WaitForEndOfFrame();
			float volume = source.volume;
			while (source.volume > 0f)
			{
				source.volume -= volume * Time.deltaTime / time;
				yield return null;
			}
			source.Stop();
			source.volume = volume;
		}

		public static void ActivateWeatherEffect(LevelWeatherType originalWeather = 0)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Invalid comparison between Unknown and I4
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Invalid comparison between Unknown and I4
			for (int i = 0; i < TimeOfDay.Instance.effects.Length; i++)
			{
				WeatherEffect val = TimeOfDay.Instance.effects[i];
				bool flag = (val.effectEnabled = (int)StartOfRound.Instance.currentLevel.currentWeather == i);
				if ((Object)(object)val.effectPermanentObject != (Object)null)
				{
					val.effectPermanentObject.SetActive(flag);
				}
				if ((Object)(object)val.effectObject != (Object)null)
				{
					val.effectObject.SetActive(flag);
				}
				if ((Object)(object)TimeOfDay.Instance.sunAnimator != (Object)null)
				{
					if (flag && !string.IsNullOrEmpty(val.sunAnimatorBool))
					{
						TimeOfDay.Instance.sunAnimator.SetBool(val.sunAnimatorBool, true);
						continue;
					}
					TimeOfDay.Instance.sunAnimator.Rebind();
					TimeOfDay.Instance.sunAnimator.Update(0f);
				}
			}
			if ((int)originalWeather == 4)
			{
				PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
				localPlayerController.isUnderwater = false;
				localPlayerController.sourcesCausingSinking = Mathf.Clamp(localPlayerController.sourcesCausingSinking - 1, 0, 100);
				localPlayerController.isMovementHindered = Mathf.Clamp(localPlayerController.isMovementHindered - 1, 0, 100);
				localPlayerController.hinderedMultiplier = 1f;
			}
		}

		public static void ChangeWeatherWR(LevelWeatherType weather)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			if (((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsHost)
			{
				WeatherController.SetWeatherEffects(weather);
			}
		}

		public static void Message(string title, string bottom, bool warning = false)
		{
			HUDManager.Instance.DisplayTip(title, bottom, warning, false, "LC_Tip1");
		}

		public static IEnumerator Status(string text)
		{
			while (true)
			{
				HUDManager.Instance.DisplayStatusEffect(text);
				yield return (object)new WaitForSeconds(1f);
			}
		}

		public static NetworkObjectReference Spawn(SpawnableEnemyWithRarity enemy, Vector3 position, float yRot = 0f)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(enemy.enemyType.enemyPrefab, position, Quaternion.Euler(new Vector3(0f, yRot, 0f)));
			val.GetComponentInChildren<NetworkObject>().Spawn(true);
			RoundManager.Instance.SpawnedEnemies.Add(val.GetComponent<EnemyAI>());
			return new NetworkObjectReference(val);
		}

		public static void Spawn(SpawnableMapObject trap, Vector3 position)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(trap.prefabToSpawn, position, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform);
			val.GetComponent<NetworkObject>().Spawn(true);
		}

		public static SpawnableItemWithRarity GetScrap(string scrapName)
		{
			string scrapName2 = scrapName;
			return ((IEnumerable<SpawnableItemWithRarity>)RoundManager.Instance.currentLevel.spawnableScrap).FirstOrDefault((Func<SpawnableItemWithRarity, bool>)((SpawnableItemWithRarity i) => ((Object)i.spawnableItem).name.Equals(scrapName2)));
		}

		public static NetworkReference Spawn(SpawnableItemWithRarity scrap, Vector3 position)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			Transform val = (((Object)(object)RoundManager.Instance.spawnedScrapContainer == (Object)null) ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.spawnedScrapContainer);
			GameObject val2 = Object.Instantiate<GameObject>(scrap.spawnableItem.spawnPrefab, position + Vector3.up * 0.25f, Quaternion.identity, val);
			GrabbableObject component = val2.GetComponent<GrabbableObject>();
			((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation);
			component.fallTime = 0f;
			component.scrapValue = (int)((float)Random.Range(scrap.spawnableItem.minValue, scrap.spawnableItem.maxValue) * RoundManager.Instance.scrapValueMultiplier);
			((NetworkBehaviour)component).NetworkObject.Spawn(false);
			component.FallToGround(true);
			return new NetworkReference(NetworkObjectReference.op_Implicit(val2.GetComponent<NetworkObject>()), component.scrapValue);
		}

		public static IEnumerator SyncScrap(NetworkReference reference)
		{
			yield return (object)new WaitForSeconds(3f);
			RoundManager.Instance.SyncScrapValuesClientRpc((NetworkObjectReference[])(object)new NetworkObjectReference[1] { reference.netObjectRef }, new int[1] { reference.value });
		}

		public static void SpawnQuicksand(int nb)
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			Random random = new Random(StartOfRound.Instance.randomMapSeed + 2);
			GameObject[] array = (from x in GameObject.FindGameObjectsWithTag("OutsideAINode")
				orderby Vector3.Distance(x.transform.position, Vector3.zero)
				select x).ToArray();
			NavMeshHit val = default(NavMeshHit);
			for (int i = 0; i < nb; i++)
			{
				Vector3 position = array[random.Next(0, array.Length)].transform.position;
				Vector3 val2 = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(position, 30f, val, random, -1) + Vector3.up;
				GameObject val3 = Object.Instantiate<GameObject>(RoundManager.Instance.quicksandPrefab, val2, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform);
			}
		}
	}
	public class NetworkReference
	{
		public NetworkObjectReference netObjectRef;

		public int value;

		public NetworkReference(NetworkObjectReference netObjectRef, int value)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			this.netObjectRef = netObjectRef;
			this.value = value;
		}
	}
}
namespace NetworkTestMod.Patches
{
	[HarmonyPatch(typeof(GameNetworkManager))]
	internal class GameNetworkManagerPatcher
	{
		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void AddToPrefabs(ref GameNetworkManager __instance)
		{
			((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.instance.netManagerPrefab);
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatcher
	{
		[HarmonyPrefix]
		[HarmonyPatch("KillPlayer")]
		private static void NotifyPlayersOfDeath(PlayerControllerB __instance)
		{
			if (((NetworkBehaviour)__instance).IsOwner && !__instance.isPlayerDead && __instance.AllowPlayerDeath())
			{
				if (((NetworkBehaviour)__instance).IsHost || ((NetworkBehaviour)__instance).IsServer)
				{
					CrystalManager.Instance.DeathNotificationClientRpc(__instance.playerClientId);
				}
				else
				{
					CrystalManager.Instance.RequestDeathNotificationServerRpc(__instance.playerClientId);
				}
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatcher
	{
		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void spawnNetManager(StartOfRound __instance)
		{
			if (((NetworkBehaviour)__instance).IsHost)
			{
				GameObject val = Object.Instantiate<GameObject>(Plugin.instance.netManagerPrefab);
				val.GetComponent<NetworkObject>().Spawn(false);
			}
		}
	}
}
namespace NetworkTestMod.Managers
{
	internal class CrystalManager : NetworkBehaviour
	{
		public static CrystalManager Instance;

		private void Awake()
		{
			Instance = this;
		}

		[ServerRpc(RequireOwnership = false)]
		public void RequestDeathNotificationServerRpc(ulong id)
		{
			//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(896539693u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, id);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 896539693u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					DeathNotificationClientRpc(id);
				}
			}
		}

		[ClientRpc]
		public void DeathNotificationClientRpc(ulong id)
		{
			//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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2489292387u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, id);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2489292387u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					string playerUsername = StartOfRound.Instance.allPlayerObjects[(uint)id].GetComponent<PlayerControllerB>().playerUsername;
				}
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_CrystalManager()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(896539693u, new RpcReceiveHandler(__rpc_handler_896539693));
			NetworkManager.__rpc_func_table.Add(2489292387u, new RpcReceiveHandler(__rpc_handler_2489292387));
		}

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

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

		protected internal override string __getTypeName()
		{
			return "CrystalManager";
		}
	}
}
namespace NetworkTestMod.CustomEffects
{
	internal class Food : PhysicsProp
	{
		public int healPower = 100;

		public float staminaPower = 0.5f;

		public Vector3 originalPosition = new Vector3(-0.05f, 0.05f, -0.045f);

		public Vector3 originalRotation = new Vector3(90f, 0f, -90f);

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && !((GrabbableObject)this).playerHeldBy.activatingItem)
			{
				UpdatePosRotServerRpc(new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, -90f));
				((GrabbableObject)this).playerHeldBy.activatingItem = buttonDown;
				((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("walkieTalkie", true);
				((MonoBehaviour)this).StartCoroutine(FoodEffect(((GrabbableObject)this).playerHeldBy));
			}
		}

		private IEnumerator FoodEffect(PlayerControllerB player)
		{
			yield return (object)new WaitForSeconds(0.8f);
			AudioServerRpc(0, ((Component)player).transform.position, 1f, 0.75f);
			UpdatePosRotServerRpc(originalPosition, originalRotation);
			player.playerBodyAnimator.SetBool("walkieTalkie", false);
			player.activatingItem = false;
			if (!player.isPlayerDead && !StartOfRound.Instance.inShipPhase)
			{
				ulong playerID = StartOfRound.Instance.localPlayerController.playerClientId;
				if (player.sprintMeter + staminaPower > 1f)
				{
					player.sprintMeter = 1f;
				}
				else
				{
					player.sprintMeter += staminaPower;
				}
				if (player.health + healPower > 100)
				{
					HealPlayerServerRpc(playerID, 100);
				}
				else
				{
					HealPlayerServerRpc(playerID, player.health + healPower);
				}
				HUDManager.Instance.UpdateHealthUI(player.health, false);
				DestroyObjectServerRpc(playerID);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void AudioServerRpc(int audioID, Vector3 clientPosition, float hostVolume, float clientVolume = 0f)
		{
			//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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4177421760u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, audioID);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref clientPosition);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref hostVolume, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref clientVolume, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4177421760u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					AudioClientRpc(audioID, clientPosition, hostVolume, (clientVolume == 0f) ? hostVolume : clientVolume);
				}
			}
		}

		[ClientRpc]
		private void AudioClientRpc(int audioID, Vector3 clientPosition, float hostVolume, float clientVolume)
		{
			//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_010d: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2369980635u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, audioID);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref clientPosition);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref hostVolume, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref clientVolume, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2369980635u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Effects.Audio(audioID, clientPosition, hostVolume, clientVolume, ((GrabbableObject)this).playerHeldBy);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void UpdatePosRotServerRpc(Vector3 newPos, Vector3 newRot)
		{
			//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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4239860355u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref newPos);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref newRot);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4239860355u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					UpdatePosRotClientRpc(newPos, newRot);
				}
			}
		}

		[ClientRpc]
		private void UpdatePosRotClientRpc(Vector3 newPos, Vector3 newRot)
		{
			//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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3026571966u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref newPos);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref newRot);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3026571966u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					((GrabbableObject)this).itemProperties.positionOffset = newPos;
					((GrabbableObject)this).itemProperties.rotationOffset = newRot;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void HealPlayerServerRpc(ulong 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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2063936913u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerID);
					BytePacker.WriteValueBitPacked(val2, health);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2063936913u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					HealPlayerClientRpc(playerID, health);
				}
			}
		}

		[ClientRpc]
		private void HealPlayerClientRpc(ulong 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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(802460343u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerID);
					BytePacker.WriteValueBitPacked(val2, health);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 802460343u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Effects.Heal(playerID, health);
				}
			}
		}

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

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

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Food()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(4177421760u, new RpcReceiveHandler(__rpc_handler_4177421760));
			NetworkManager.__rpc_func_table.Add(2369980635u, new RpcReceiveHandler(__rpc_handler_2369980635));
			NetworkManager.__rpc_func_table.Add(4239860355u, new RpcReceiveHandler(__rpc_handler_4239860355));
			NetworkManager.__rpc_func_table.Add(3026571966u, new RpcReceiveHandler(__rpc_handler_3026571966));
			NetworkManager.__rpc_func_table.Add(2063936913u, new RpcReceiveHandler(__rpc_handler_2063936913));
			NetworkManager.__rpc_func_table.Add(802460343u, new RpcReceiveHandler(__rpc_handler_802460343));
			NetworkManager.__rpc_func_table.Add(2017998215u, new RpcReceiveHandler(__rpc_handler_2017998215));
			NetworkManager.__rpc_func_table.Add(4051465698u, new RpcReceiveHandler(__rpc_handler_4051465698));
		}

		private static void __rpc_handler_4177421760(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int audioID = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref audioID);
				Vector3 clientPosition = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref clientPosition);
				float hostVolume = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref hostVolume, default(ForPrimitives));
				float clientVolume = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref clientVolume, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Food)(object)target).AudioServerRpc(audioID, clientPosition, hostVolume, clientVolume);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2369980635(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int audioID = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref audioID);
				Vector3 clientPosition = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref clientPosition);
				float hostVolume = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref hostVolume, default(ForPrimitives));
				float clientVolume = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref clientVolume, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Food)(object)target).AudioClientRpc(audioID, clientPosition, hostVolume, clientVolume);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_4239860355(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 newPos = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newPos);
				Vector3 newRot = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newRot);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Food)(object)target).UpdatePosRotServerRpc(newPos, newRot);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3026571966(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 newPos = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newPos);
				Vector3 newRot = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newRot);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Food)(object)target).UpdatePosRotClientRpc(newPos, newRot);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2063936913(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong playerID = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerID);
				int health = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref health);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Food)(object)target).HealPlayerServerRpc(playerID, health);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_802460343(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong playerID = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerID);
				int health = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref health);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Food)(object)target).HealPlayerClientRpc(playerID, health);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

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

		protected internal override string __getTypeName()
		{
			return "Food";
		}
	}
	internal class GreenCrystal : PhysicsProp
	{
		public int healAmount = 100;

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (buttonDown && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
			{
				if (StartOfRound.Instance.inShipPhase)
				{
					Effects.Message("Can't use the green crystal right now.", "");
					return;
				}
				HealPlayerServerRpc(((GrabbableObject)this).playerHeldBy.playerClientId, healAmount);
				DestroyObjectServerRpc(((GrabbableObject)this).playerHeldBy.playerClientId);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void HealPlayerServerRpc(ulong playerID, int healAmount)
		{
			//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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3186296845u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerID);
				BytePacker.WriteValueBitPacked(val2, healAmount);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3186296845u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			ulong playerID2 = playerID;
			PlayerControllerB val3 = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB p) => (Object)(object)p != (Object)null && p.playerClientId == playerID2));
			if ((Object)(object)val3 != (Object)null)
			{
				PlayerControllerB component = ((Component)val3).GetComponent<PlayerControllerB>();
				if ((Object)(object)component != (Object)null)
				{
					component.health = healAmount;
					Effects.Message("You have been healed by the green crystal!", $"Healed {healAmount} HP", warning: true);
				}
			}
			HealPlayerClientRpc(playerID2, healAmount);
		}

		[ClientRpc]
		private void HealPlayerClientRpc(ulong playerID, int healAmount)
		{
			//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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1267275710u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerID);
				BytePacker.WriteValueBitPacked(val2, healAmount);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1267275710u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			ulong playerID2 = playerID;
			PlayerControllerB val3 = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB pc) => (Object)(object)pc != (Object)null && pc.playerClientId == playerID2));
			if ((Object)(object)val3 != (Object)null)
			{
				PlayerControllerB component = ((Component)val3).GetComponent<PlayerControllerB>();
				if ((Object)(object)component != (Object)null)
				{
					Effects.Message("You have been healed by the green crystal!", $"Healed {healAmount} HP", warning: true);
				}
			}
		}

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

		[ClientRpc]
		private void DestroyObjectClientRpc(ulong playerID)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3036270002u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerID);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3036270002u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			ulong playerID2 = playerID;
			PlayerControllerB val3 = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB pc) => (Object)(object)pc != (Object)null && pc.playerClientId == playerID2));
			if (!((Object)(object)val3 != (Object)null))
			{
				return;
			}
			PlayerControllerB component = ((Component)val3).GetComponent<PlayerControllerB>();
			if ((Object)(object)component != (Object)null)
			{
				Effects.Message("The green crystal has been used up.", "");
				if ((Object)(object)component.currentlyHeldObject != (Object)null && (Object)(object)((Component)component.currentlyHeldObject).GetComponent<GrabbableObject>() != (Object)null)
				{
					((GrabbableObject)this).DestroyObjectInHand(component);
				}
				else
				{
					Debug.LogError((object)"Player does not have a valid grabbable object in hand.");
				}
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_GreenCrystal()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3186296845u, new RpcReceiveHandler(__rpc_handler_3186296845));
			NetworkManager.__rpc_func_table.Add(1267275710u, new RpcReceiveHandler(__rpc_handler_1267275710));
			NetworkManager.__rpc_func_table.Add(2950751942u, new RpcReceiveHandler(__rpc_handler_2950751942));
			NetworkManager.__rpc_func_table.Add(3036270002u, new RpcReceiveHandler(__rpc_handler_3036270002));
		}

		private static void __rpc_handler_3186296845(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong playerID = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerID);
				int num = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref num);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((GreenCrystal)(object)target).HealPlayerServerRpc(playerID, num);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1267275710(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong playerID = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerID);
				int num = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref num);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((GreenCrystal)(object)target).HealPlayerClientRpc(playerID, num);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

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

		protected internal override string __getTypeName()
		{
			return "GreenCrystal";
		}
	}
	internal class PurpleCrystal : PhysicsProp
	{
		public Vector3 originalPosition = new Vector3(-0.05f, 0.05f, -0.045f);

		public Vector3 originalRotation = new Vector3(90f, 0f, -90f);

		public Vector3 previousPosition = new Vector3(0f, 0f, 0f);

		public int uses = 2;

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && !((GrabbableObject)this).playerHeldBy.activatingItem)
			{
				UpdatePosRotServerRpc(new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, -90f));
				((GrabbableObject)this).playerHeldBy.activatingItem = buttonDown;
				((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("walkieTalkie", true);
				((MonoBehaviour)this).StartCoroutine(PurpleEffect(((GrabbableObject)this).playerHeldBy));
			}
		}

		private IEnumerator PurpleEffect(PlayerControllerB player)
		{
			yield return (object)new WaitForSeconds(0.8f);
			AudioServerRpc(0, ((Component)player).transform.position, 1f, 0.75f);
			UpdatePosRotServerRpc(originalPosition, originalRotation);
			player.playerBodyAnimator.SetBool("walkieTalkie", false);
			player.activatingItem = false;
			if (!player.isPlayerDead && !StartOfRound.Instance.inShipPhase)
			{
				uses--;
				ulong playerID = StartOfRound.Instance.localPlayerController.playerClientId;
				if (uses == 1)
				{
					previousPosition = ((Component)player).transform.position;
					TeleportationServerRpc(playerID, new Vector3(0f, 0f, 0f));
				}
				if (uses < 1)
				{
					TeleportationServerRpc(playerID, previousPosition);
					DestroyObjectServerRpc(playerID);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void AudioServerRpc(int audioID, Vector3 clientPosition, float hostVolume, float clientVolume = 0f)
		{
			//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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2560265113u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, audioID);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref clientPosition);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref hostVolume, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref clientVolume, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2560265113u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					AudioClientRpc(audioID, clientPosition, hostVolume, (clientVolume == 0f) ? hostVolume : clientVolume);
				}
			}
		}

		[ClientRpc]
		private void AudioClientRpc(int audioID, Vector3 clientPosition, float hostVolume, float clientVolume)
		{
			//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_010d: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3015287613u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, audioID);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref clientPosition);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref hostVolume, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref clientVolume, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3015287613u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Effects.Audio(audioID, clientPosition, hostVolume, clientVolume, ((GrabbableObject)this).playerHeldBy);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void TeleportationServerRpc(ulong playerId, 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_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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(185789086u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 185789086u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					TeleportationClientRpc(playerId, position);
				}
			}
		}

		[ClientRpc]
		private void TeleportationClientRpc(ulong playerId, 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_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_0096: 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)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(210970010u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 210970010u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					PlayerControllerB player = StartOfRound.Instance.allPlayerScripts[(int)(IntPtr)checked((long)playerId)];
					Effects.Teleportation(player, position);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void UpdatePosRotServerRpc(Vector3 newPos, Vector3 newRot)
		{
			//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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3610279448u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref newPos);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref newRot);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3610279448u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					UpdatePosRotClientRpc(newPos, newRot);
				}
			}
		}

		[ClientRpc]
		private void UpdatePosRotClientRpc(Vector3 newPos, Vector3 newRot)
		{
			//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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1360126645u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref newPos);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref newRot);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1360126645u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					((GrabbableObject)this).itemProperties.positionOffset = newPos;
					((GrabbableObject)this).itemProperties.rotationOffset = newRot;
				}
			}
		}

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

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

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_PurpleCrystal()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(2560265113u, new RpcReceiveHandler(__rpc_handler_2560265113));
			NetworkManager.__rpc_func_table.Add(3015287613u, new RpcReceiveHandler(__rpc_handler_3015287613));
			NetworkManager.__rpc_func_table.Add(185789086u, new RpcReceiveHandler(__rpc_handler_185789086));
			NetworkManager.__rpc_func_table.Add(210970010u, new RpcReceiveHandler(__rpc_handler_210970010));
			NetworkManager.__rpc_func_table.Add(3610279448u, new RpcReceiveHandler(__rpc_handler_3610279448));
			NetworkManager.__rpc_func_table.Add(1360126645u, new RpcReceiveHandler(__rpc_handler_1360126645));
			NetworkManager.__rpc_func_table.Add(1030809254u, new RpcReceiveHandler(__rpc_handler_1030809254));
			NetworkManager.__rpc_func_table.Add(255060976u, new RpcReceiveHandler(__rpc_handler_255060976));
		}

		private static void __rpc_handler_2560265113(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int audioID = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref audioID);
				Vector3 clientPosition = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref clientPosition);
				float hostVolume = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref hostVolume, default(ForPrimitives));
				float clientVolume = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref clientVolume, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PurpleCrystal)(object)target).AudioServerRpc(audioID, clientPosition, hostVolume, clientVolume);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3015287613(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int audioID = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref audioID);
				Vector3 clientPosition = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref clientPosition);
				float hostVolume = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref hostVolume, default(ForPrimitives));
				float clientVolume = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref clientVolume, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PurpleCrystal)(object)target).AudioClientRpc(audioID, clientPosition, hostVolume, clientVolume);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_185789086(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong playerId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PurpleCrystal)(object)target).TeleportationServerRpc(playerId, position);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_210970010(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong playerId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PurpleCrystal)(object)target).TeleportationClientRpc(playerId, position);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3610279448(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 newPos = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newPos);
				Vector3 newRot = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newRot);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PurpleCrystal)(object)target).UpdatePosRotServerRpc(newPos, newRot);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1360126645(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 newPos = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newPos);
				Vector3 newRot = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref newRot);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PurpleCrystal)(object)target).UpdatePosRotClientRpc(newPos, newRot);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

		private static void __rpc_handler_255060976(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager ne