Decompiled source of EmergencyDice v1.0.6

BepInEx/plugins/MysteryDice.dll

Decompiled a year ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using MysteryDice.Effects;
using MysteryDice.Patches;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MysteryDice")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MysteryDice")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c247d947-5d1a-411b-8d87-6f0bc33e5234")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace MysteryDice
{
	[BepInPlugin("Theronguard.MysteryDice", "Mystery Dice", "1.0.0")]
	public class MysteryDice : BaseUnityPlugin
	{
		public class CustomItemBehaviour : PhysicsProp
		{
			public override void ItemActivate(bool used, bool buttonDown = true)
			{
				//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0111: Unknown result type (might be due to invalid IL or missing references)
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				((GrabbableObject)this).ItemActivate(used, buttonDown);
				if (!buttonDown || (Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded)
				{
					return;
				}
				int num = Random.Range(1, 7);
				List<IEffect> list = new List<IEffect>();
				foreach (IEffect registeredEffect in RegisteredEffects)
				{
					if (registeredEffect.DiceNums.Contains(num))
					{
						list.Add(registeredEffect);
					}
				}
				int index = Random.Range(0, list.Count);
				IEffect effect = list[index];
				effect.Use();
				if (num == 1)
				{
					AudioSource.PlayClipAtPoint(AwfulEffectSFX, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position);
				}
				if (num == 2)
				{
					AudioSource.PlayClipAtPoint(BadEffectSFX, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position);
				}
				if (num >= 3)
				{
					AudioSource.PlayClipAtPoint(GoodEffectSFX, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position);
				}
				if (effect.ShowDefaultTooltip)
				{
					switch (num)
					{
					case 1:
						HUDManager.Instance.DisplayTip($"Rolled {num}", ":)", false, false, "LC_Tip1");
						break;
					case 2:
						HUDManager.Instance.DisplayTip($"Rolled {num}", "Uh oh", false, false, "LC_Tip1");
						break;
					case 3:
						HUDManager.Instance.DisplayTip($"Rolled {num}", "Enjoy.", false, false, "LC_Tip1");
						break;
					case 4:
						HUDManager.Instance.DisplayTip($"Rolled {num}", "Enjoy.", false, false, "LC_Tip1");
						break;
					case 5:
						HUDManager.Instance.DisplayTip($"Rolled {num}", "Enjoy.", false, false, "LC_Tip1");
						break;
					case 6:
						HUDManager.Instance.DisplayTip($"Rolled {num}", "Enjoy.", false, false, "LC_Tip1");
						break;
					}
				}
				else
				{
					HUDManager.Instance.DisplayTip($"Rolled {num}", effect.Tooltip, false, false, "LC_Tip1");
				}
				((GrabbableObject)this).DestroyObjectInHand(GameNetworkManager.Instance.localPlayerController);
			}

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

			protected internal override string __getTypeName()
			{
				return "CustomItemBehaviour";
			}
		}

		private const string modGUID = "Theronguard.MysteryDice";

		private const string modName = "Mystery Dice";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Theronguard.MysteryDice");

		public static ManualLogSource CustomLogger;

		public static AssetBundle LoadedAssets;

		public static GameObject NetworkerPrefab;

		public static List<IEffect> RegisteredEffects = new List<IEffect>();

		public static AudioClip ExplosionSFX;

		public static AudioClip DetonateSFX;

		public static AudioClip MineSFX;

		public static AudioClip AwfulEffectSFX;

		public static AudioClip BadEffectSFX;

		public static AudioClip GoodEffectSFX;

		private void Awake()
		{
			NetcodeWeaver();
			CustomLogger = Logger.CreateLogSource("Theronguard.MysteryDice");
			LoadedAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "mysterydice"));
			ExplosionSFX = LoadedAssets.LoadAsset<AudioClip>("MineDetonate");
			MineSFX = LoadedAssets.LoadAsset<AudioClip>("MineTrigger");
			AwfulEffectSFX = LoadedAssets.LoadAsset<AudioClip>("Bell2");
			BadEffectSFX = LoadedAssets.LoadAsset<AudioClip>("Bad1");
			GoodEffectSFX = LoadedAssets.LoadAsset<AudioClip>("Good2");
			NetworkerPrefab = LoadedAssets.LoadAsset<GameObject>("Networker");
			NetworkerPrefab.AddComponent<Networker>();
			RegisteredEffects.Add(new ModifyPitch());
			RegisteredEffects.Add(new MineOverflowOutside());
			RegisteredEffects.Add(new InstaJester());
			RegisteredEffects.Add(new FakeFireExits());
			RegisteredEffects.Add(new FireExitBlock());
			RegisteredEffects.Add(new ReturnToShip());
			RegisteredEffects.Add(new TeleportInside());
			RegisteredEffects.Add(new BugPlague());
			RegisteredEffects.Add(new ZombieApocalypse());
			RegisteredEffects.Add(new Revive());
			RegisteredEffects.Add(new Detonate());
			Item val = LoadedAssets.LoadAsset<Item>("MysteryDiceItem");
			val.minValue = 100;
			val.maxValue = 130;
			CustomItemBehaviour customItemBehaviour = val.spawnPrefab.AddComponent<CustomItemBehaviour>();
			((GrabbableObject)customItemBehaviour).grabbable = true;
			((GrabbableObject)customItemBehaviour).grabbableToEnemies = true;
			((GrabbableObject)customItemBehaviour).itemProperties = val;
			NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
			Utilities.FixMixerGroups(val.spawnPrefab);
			Items.RegisterScrap(val, 66, (LevelTypes)(-1));
			harmony.PatchAll();
			CustomLogger.LogInfo((object)"The Mystery dice mod was initialized!");
		}

		private static void NetcodeWeaver()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
	internal class Networker : NetworkBehaviour
	{
		public static Networker Instance;

		private static Vector2 TimerRange = new Vector2(3f, 6f);

		private static ulong PlayerIDToExplode;

		private static float ExplosionTimer = 0f;

		public override void OnNetworkSpawn()
		{
			Instance = this;
			((NetworkBehaviour)this).OnNetworkSpawn();
		}

		private void FixedUpdate()
		{
			UpdateMineTimers();
		}

		private void Update()
		{
			ModifyPitch.PitchFluctuate();
		}

		public static bool IsPlayerAlive(PlayerControllerB player)
		{
			return !player.isPlayerDead && ((Behaviour)player).isActiveAndEnabled && ((NetworkBehaviour)player).IsSpawned && player.isPlayerControlled;
		}

		public void UpdateMineTimers()
		{
			if (ExplosionTimer >= 0f)
			{
				ExplosionTimer -= Time.fixedDeltaTime;
				if (ExplosionTimer < 0f)
				{
					DetonateRandomPlayerClientRpc(PlayerIDToExplode);
				}
			}
		}

		public void StartDoomCountdown(ulong playerID)
		{
			PlayerIDToExplode = playerID;
			ExplosionTimer = Random.Range(TimerRange.x, TimerRange.y);
		}

		[ServerRpc(RequireOwnership = false)]
		public void DetonateRandomPlayerServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1471895020u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1471895020u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost) || (Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded)
			{
				return;
			}
			List<PlayerControllerB> list = new List<PlayerControllerB>();
			GameObject[] allPlayerObjects = StartOfRound.Instance.allPlayerObjects;
			foreach (GameObject val3 in allPlayerObjects)
			{
				PlayerControllerB component = val3.GetComponent<PlayerControllerB>();
				if (IsPlayerAlive(component))
				{
					list.Add(component);
				}
			}
			PlayerControllerB val4 = list[Random.Range(0, list.Count)];
			MysteryDice.CustomLogger.LogWarning((object)val4.playerUsername);
			StartDoomCountdown(val4.playerClientId);
		}

		[ClientRpc]
		public void DetonateRandomPlayerClientRpc(ulong clientID)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1863607810u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, clientID);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1863607810u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded)
			{
				return;
			}
			GameObject[] allPlayerObjects = StartOfRound.Instance.allPlayerObjects;
			foreach (GameObject val3 in allPlayerObjects)
			{
				PlayerControllerB component = val3.GetComponent<PlayerControllerB>();
				if (component.playerClientId == clientID && IsPlayerAlive(component))
				{
					AudioSource.PlayClipAtPoint(MysteryDice.MineSFX, ((Component)component).transform.position);
					((MonoBehaviour)this).StartCoroutine(SpawnExplosionAfterSFX(((Component)component).transform.position));
					break;
				}
			}
		}

		private IEnumerator SpawnExplosionAfterSFX(Vector3 position)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			yield return (object)new WaitForSeconds(0.5f);
			Landmine.SpawnExplosion(position, true, 1f, 5f);
		}

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

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

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

		[ClientRpc]
		public void TeleportInsideClientRPC(ulong clientID, Vector3 teleportPos)
		{
			//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_00d7: 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(2679626543u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, clientID);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref teleportPos);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2679626543u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					TeleportInside.TeleportPlayerInside(clientID, teleportPos);
				}
			}
		}

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

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

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

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

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

		[ClientRpc]
		public void FakeFireExitsClientRPC()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2557817672u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2557817672u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			GameObject[] array = Object.FindObjectsOfType<GameObject>(true);
			for (int i = 0; i < array.Length; i++)
			{
				if (((Object)array[i]).name.Contains("AlleyExitDoorContainer"))
				{
					MysteryDice.CustomLogger.LogMessage((object)((Object)array[i]).name);
					array[i].SetActive(true);
				}
			}
		}

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

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

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

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

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

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

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

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Networker()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Expected O, but got Unknown
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Expected O, but got Unknown
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Expected O, but got Unknown
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Expected O, but got Unknown
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Expected O, but got Unknown
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1471895020u, new RpcReceiveHandler(__rpc_handler_1471895020));
			NetworkManager.__rpc_func_table.Add(1863607810u, new RpcReceiveHandler(__rpc_handler_1863607810));
			NetworkManager.__rpc_func_table.Add(3123714467u, new RpcReceiveHandler(__rpc_handler_3123714467));
			NetworkManager.__rpc_func_table.Add(954997453u, new RpcReceiveHandler(__rpc_handler_954997453));
			NetworkManager.__rpc_func_table.Add(905465244u, new RpcReceiveHandler(__rpc_handler_905465244));
			NetworkManager.__rpc_func_table.Add(2679626543u, new RpcReceiveHandler(__rpc_handler_2679626543));
			NetworkManager.__rpc_func_table.Add(658849964u, new RpcReceiveHandler(__rpc_handler_658849964));
			NetworkManager.__rpc_func_table.Add(1685682683u, new RpcReceiveHandler(__rpc_handler_1685682683));
			NetworkManager.__rpc_func_table.Add(758899621u, new RpcReceiveHandler(__rpc_handler_758899621));
			NetworkManager.__rpc_func_table.Add(905636504u, new RpcReceiveHandler(__rpc_handler_905636504));
			NetworkManager.__rpc_func_table.Add(3750907622u, new RpcReceiveHandler(__rpc_handler_3750907622));
			NetworkManager.__rpc_func_table.Add(2557817672u, new RpcReceiveHandler(__rpc_handler_2557817672));
			NetworkManager.__rpc_func_table.Add(642114377u, new RpcReceiveHandler(__rpc_handler_642114377));
			NetworkManager.__rpc_func_table.Add(117164783u, new RpcReceiveHandler(__rpc_handler_117164783));
			NetworkManager.__rpc_func_table.Add(689662337u, new RpcReceiveHandler(__rpc_handler_689662337));
			NetworkManager.__rpc_func_table.Add(1822380635u, new RpcReceiveHandler(__rpc_handler_1822380635));
			NetworkManager.__rpc_func_table.Add(3354025460u, new RpcReceiveHandler(__rpc_handler_3354025460));
			NetworkManager.__rpc_func_table.Add(2611363842u, new RpcReceiveHandler(__rpc_handler_2611363842));
			NetworkManager.__rpc_func_table.Add(2473680354u, new RpcReceiveHandler(__rpc_handler_2473680354));
		}

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

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

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

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

		private static void __rpc_handler_905465244(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 clientID = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref clientID);
				Vector3 teleportPos = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref teleportPos);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Networker)(object)target).TeleportInsideServerRPC(clientID, teleportPos);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2679626543(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 clientID = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref clientID);
				Vector3 teleportPos = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref teleportPos);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Networker)(object)target).TeleportInsideClientRPC(clientID, teleportPos);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

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

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

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

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

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

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

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

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

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

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

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

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

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

		protected internal override string __getTypeName()
		{
			return "Networker";
		}
	}
	internal class Misc
	{
		public static void SpawnEnemy(SpawnableEnemyWithRarity enemy, int amount, bool isInside)
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			if (!((NetworkBehaviour)Networker.Instance).IsHost || !isInside)
			{
				return;
			}
			for (int i = 0; i < amount; i++)
			{
				RoundManager instance = RoundManager.Instance;
				EnemyVent val = instance.allEnemyVents[Random.Range(0, instance.allEnemyVents.Length)];
				instance.SpawnEnemyOnServer(val.floorNode.position, val.floorNode.eulerAngles.y, instance.currentLevel.Enemies.IndexOf(enemy));
				foreach (SpawnableEnemyWithRarity enemy2 in instance.currentLevel.Enemies)
				{
					MysteryDice.CustomLogger.LogWarning((object)enemy2.enemyType.enemyName);
				}
			}
		}

		public static void SpawnEnemyForced(SpawnableEnemyWithRarity enemy, int amount, bool isInside)
		{
			if (!RoundManager.Instance.currentLevel.Enemies.Contains(enemy))
			{
				RoundManager.Instance.currentLevel.Enemies.Add(enemy);
				SpawnEnemy(enemy, amount, isInside);
				RoundManager.Instance.currentLevel.Enemies.Remove(enemy);
			}
			else
			{
				SpawnEnemy(enemy, amount, isInside);
			}
		}

		public static float Map(float x, float inMin, float inMax, float outMin, float outMax)
		{
			return (x - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
		}
	}
}
namespace MysteryDice.Properties
{
	[CompilerGenerated]
	[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")]
	internal sealed class Settings : ApplicationSettingsBase
	{
		private static Settings defaultInstance = (Settings)(object)SettingsBase.Synchronized((SettingsBase)(object)new Settings());

		public static Settings Default => defaultInstance;
	}
}
namespace MysteryDice.Patches
{
	[HarmonyPatch(typeof(EntranceTeleport))]
	internal class FireExitPatch
	{
		public static bool AreFireExitsBlocked;

		[HarmonyPatch("TeleportPlayer")]
		[HarmonyPrefix]
		public static bool BlockEntrance(EntranceTeleport __instance)
		{
			if (AreFireExitsBlocked && __instance.entranceId != 0)
			{
				HUDManager.Instance.DisplayTip("Locked", "Something locked the fire exit?", false, false, "LC_Tip1");
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(HUDManager))]
	internal class ChatPatch
	{
		[HarmonyPatch("SubmitChat_performed")]
		[HarmonyPrefix]
		private static void GameMasterCommands(HUDManager __instance)
		{
			if (__instance.chatTextField.text == "test")
			{
				MysteryDice.CustomLogger.LogMessage((object)"ENEMIES CURRENT:");
				foreach (SpawnableEnemyWithRarity enemy in RoundManager.Instance.currentLevel.Enemies)
				{
					MysteryDice.CustomLogger.LogMessage((object)enemy.enemyType.enemyName);
				}
			}
			if (__instance.chatTextField.text == "dice")
			{
				MysteryDice.RegisteredEffects.First().Use();
			}
		}
	}
	[HarmonyPatch(typeof(GameNetworkManager))]
	internal class GameNetworkManagerPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		public static void AddPrefab(ref GameNetworkManager __instance)
		{
			((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(MysteryDice.NetworkerPrefab);
		}
	}
	[HarmonyPatch(typeof(Terminal))]
	internal class GetEnemies
	{
		public static SpawnableEnemyWithRarity Masked;

		public static SpawnableEnemyWithRarity HoardingBug;

		public static SpawnableEnemyWithRarity Centipede;

		public static SpawnableEnemyWithRarity Jester;

		public static SpawnableEnemyWithRarity Bracken;

		public static SpawnableEnemyWithRarity Stomper;

		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void GetEnemy(Terminal __instance)
		{
			SelectableLevel[] moonsCatalogueList = __instance.moonsCatalogueList;
			foreach (SelectableLevel val in moonsCatalogueList)
			{
				foreach (SpawnableEnemyWithRarity enemy in val.Enemies)
				{
					MysteryDice.CustomLogger.LogWarning((object)((Object)enemy.enemyType).name);
					if (enemy.enemyType.enemyName == "Masked")
					{
						Masked = enemy;
					}
					if (enemy.enemyType.enemyName == "Hoarding bug")
					{
						HoardingBug = enemy;
					}
					if (enemy.enemyType.enemyName == "Centipede")
					{
						Centipede = enemy;
					}
					if (enemy.enemyType.enemyName == "Jester")
					{
						Jester = enemy;
					}
					if (enemy.enemyType.enemyName == "Flowerman")
					{
						Bracken = enemy;
					}
					if (enemy.enemyType.enemyName == "Crawler")
					{
						Stomper = enemy;
					}
				}
			}
		}
	}
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerPatch
	{
		public static List<Vector3> MapObjectsPositions = new List<Vector3>();

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		public static void StartRoundManager(RoundManager __instance)
		{
		}

		[HarmonyPrefix]
		[HarmonyPatch("SpawnMapObjects")]
		public static void SpawnMapObjectsPatch(RoundManager __instance)
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			if (__instance.currentLevel.spawnableMapObjects.Length != 0)
			{
				Random random = new Random(StartOfRound.Instance.randomMapSeed + 587);
				__instance.mapPropsContainer = GameObject.FindGameObjectWithTag("MapPropsContainer");
				RandomMapObject[] array = Object.FindObjectsOfType<RandomMapObject>();
				RandomMapObject[] array2 = array;
				foreach (RandomMapObject val in array2)
				{
					MysteryDice.CustomLogger.LogError((object)((Component)val).transform.position);
					MysteryDice.CustomLogger.LogError((object)val.spawnRange);
					MapObjectsPositions.Add(((Component)val).transform.position);
				}
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		public static SpawnableMapObject SpawnableLandmine;

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		public static void InstantiateNetworker(StartOfRound __instance)
		{
			//IL_0024: 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)
			if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer)
			{
				GameObject val = Object.Instantiate<GameObject>(MysteryDice.NetworkerPrefab, Vector3.zero, Quaternion.identity);
				val.GetComponent<NetworkObject>().Spawn(false);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("StartGame")]
		public static void OnStartGame(StartOfRound __instance)
		{
			FireExitPatch.AreFireExitsBlocked = false;
			ModifyPitch.ResetPitch();
			SpawnableMapObject[] spawnableMapObjects = __instance.currentLevel.spawnableMapObjects;
			foreach (SpawnableMapObject val in spawnableMapObjects)
			{
				if (((Object)val.prefabToSpawn).name == "Landmine")
				{
					SpawnableLandmine = val;
					break;
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("EndGameClientRpc")]
		public static void OnEndGameClient(StartOfRound __instance)
		{
			ModifyPitch.ResetPitch();
		}
	}
}
namespace MysteryDice.Effects
{
	internal class ModifyPitch : IEffect
	{
		private const float PitchSwitchTime = 0.05f;

		private static float PitchSwitchTimer;

		public static bool FluctuatePitch;

		private static float CumulativeRandomFreq;

		public int[] DiceNums => new int[1] { 2 };

		public bool ShowDefaultTooltip => true;

		public string Tooltip => "Good luck communicating";

		public void Use()
		{
			Networker.Instance.ModifyPitchNotifyServerRPC();
		}

		public static void ResetPitch()
		{
			FluctuatePitch = false;
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				SoundManager.Instance.SetPlayerPitch(1f, i);
			}
		}

		public static void PitchFluctuate()
		{
			if (!FluctuatePitch)
			{
				return;
			}
			CumulativeRandomFreq += Random.Range(-0.5f, 0.5f);
			CumulativeRandomFreq = Mathf.Clamp(CumulativeRandomFreq, -1f, 1f) * Time.deltaTime;
			PitchSwitchTimer -= Time.deltaTime;
			if (!(PitchSwitchTimer <= 0f))
			{
				return;
			}
			PitchSwitchTimer = 0.05f;
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				if (StartOfRound.Instance.allPlayerScripts[i].isPlayerControlled && !StartOfRound.Instance.allPlayerScripts[i].isPlayerDead)
				{
					SoundManager.Instance.SetPlayerPitch(Misc.Map(Mathf.Sin((2f + CumulativeRandomFreq) * MathF.PI * Time.time + (float)i), -1f, 1f, 0.6f, 1.4f), i);
				}
			}
		}
	}
	internal class MineOverflowOutside : IEffect
	{
		public static int MaxMinesToSpawn = 80;

		public int[] DiceNums => new int[1] { 2 };

		public bool ShowDefaultTooltip => true;

		public string Tooltip => "Mines spawned outside!";

		public void Use()
		{
			Networker.Instance.MineOverflowOutsideServerRPC();
		}

		public static void SpawnMoreMinesOutside()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			int num = 0;
			Random random = new Random(StartOfRound.Instance.randomMapSeed);
			GameObject[] outsideAINodes = RoundManager.Instance.outsideAINodes;
			foreach (GameObject val in outsideAINodes)
			{
				Vector3 position = val.transform.position;
				for (int j = 0; j < 8; j++)
				{
					if (num > MaxMinesToSpawn)
					{
						return;
					}
					Vector3 randomNavMeshPositionInBoxPredictable = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(position, 15f, RoundManager.Instance.navHit, random, -1);
					MysteryDice.CustomLogger.LogWarning((object)randomNavMeshPositionInBoxPredictable);
					if (!(MineOverflow.GetShortestDistanceSqr(randomNavMeshPositionInBoxPredictable, list) < 1f))
					{
						GameObject val2 = Object.Instantiate<GameObject>(StartOfRoundPatch.SpawnableLandmine.prefabToSpawn, randomNavMeshPositionInBoxPredictable, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform);
						list.Add(randomNavMeshPositionInBoxPredictable);
						val2.transform.eulerAngles = new Vector3(val2.transform.eulerAngles.x, (float)Random.Range(0, 360), val2.transform.eulerAngles.z);
						val2.GetComponent<NetworkObject>().Spawn(true);
						num++;
					}
				}
			}
		}
	}
	internal class MineOverflow : IEffect
	{
		public static int MaxMinesToSpawn = 50;

		public int[] DiceNums => new int[1] { 2 };

		public bool ShowDefaultTooltip => true;

		public string Tooltip => "More mines spawned inside!";

		public void Use()
		{
			Networker.Instance.MineOverflowServerRPC();
		}

		public static void SpawnMoreMines()
		{
			//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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: 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_00a4: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			int num = 0;
			Random random = new Random(StartOfRound.Instance.randomMapSeed);
			foreach (Vector3 mapObjectsPosition in RoundManagerPatch.MapObjectsPositions)
			{
				for (int i = 0; i < 8; i++)
				{
					if (num > MaxMinesToSpawn)
					{
						return;
					}
					Vector3 val = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(mapObjectsPosition, 10f, default(NavMeshHit), random, -5);
					if (i > 3)
					{
						val = RoundManager.Instance.insideAINodes[Random.Range(0, RoundManager.Instance.insideAINodes.Length)].transform.position;
					}
					if (!(GetShortestDistanceSqr(val, list) < 1f))
					{
						GameObject val2 = Object.Instantiate<GameObject>(StartOfRoundPatch.SpawnableLandmine.prefabToSpawn, val, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform);
						list.Add(val);
						val2.transform.eulerAngles = new Vector3(val2.transform.eulerAngles.x, (float)Random.Range(0, 360), val2.transform.eulerAngles.z);
						val2.GetComponent<NetworkObject>().Spawn(true);
						num++;
					}
				}
			}
		}

		public static float GetShortestDistanceSqr(Vector3 position, List<Vector3> positions)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			float num = float.MaxValue;
			foreach (Vector3 position2 in positions)
			{
				Vector3 val = position - position2;
				float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude;
				if (sqrMagnitude < num)
				{
					num = sqrMagnitude;
				}
			}
			return num;
		}
	}
	internal class OutsideBracken : IEffect
	{
		public int[] DiceNums => new int[1] { 1 };

		public bool ShowDefaultTooltip => true;

		public string Tooltip => "Spawned a bracken outside!";

		public void Use()
		{
			Networker.Instance.OutsideBrackenServerRPC();
		}

		public static void SpawnOutsideBracken()
		{
			if (GetEnemies.Bracken != null)
			{
				RoundManager.Instance.currentOutsideEnemyPower = 0;
				Misc.SpawnEnemyForced(GetEnemies.Bracken, 1, isInside: true);
				MysteryDice.CustomLogger.LogInfo((object)"SPAWNED BRACKEN1");
				((MonoBehaviour)Networker.Instance).StartCoroutine(DelayedBrackenTeleportOutside());
			}
		}

		public static IEnumerator DelayedBrackenTeleportOutside()
		{
			yield return (object)new WaitForSeconds(3f);
			foreach (EnemyAI enemy in RoundManager.Instance.SpawnedEnemies)
			{
				if (!(enemy is FlowermanAI))
				{
					continue;
				}
				FlowermanAI bracken = (FlowermanAI)enemy;
				EntranceTeleport[] allEntrances = Object.FindObjectsOfType<EntranceTeleport>();
				EntranceTeleport mainEntrance = null;
				for (int i = 0; i < allEntrances.Length; i++)
				{
					if (allEntrances[i].isEntranceToBuilding)
					{
						mainEntrance = allEntrances[i];
						break;
					}
				}
				if (!((Object)(object)mainEntrance == (Object)null))
				{
					((EnemyAI)bracken).allAINodes = GameObject.FindGameObjectsWithTag("OutsideAINode");
					((EnemyAI)bracken).isOutside = true;
					((EnemyAI)bracken).ChangeOwnershipOfEnemy(GameNetworkManager.Instance.localPlayerController.actualClientId);
					((EnemyAI)bracken).serverPosition = mainEntrance.entrancePoint.position;
					((Component)bracken).transform.position = ((EnemyAI)bracken).serverPosition;
					((EnemyAI)bracken).agent.Warp(((EnemyAI)bracken).serverPosition);
					((EnemyAI)bracken).SyncPositionToClients();
					((EnemyAI)bracken).EnableEnemyMesh(true, false);
					continue;
				}
				yield break;
			}
		}

		public static void SetNavmeshBrackenClient()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
			{
				if (spawnedEnemy is FlowermanAI)
				{
					FlowermanAI val = (FlowermanAI)spawnedEnemy;
					((EnemyAI)val).allAINodes = GameObject.FindGameObjectsWithTag("OutsideAINode");
				}
			}
		}
	}
	internal class InstaJester : IEffect
	{
		public int[] DiceNums => new int[1] { 1 };

		public bool ShowDefaultTooltip => true;

		public string Tooltip => "Spawned a popped jester!";

		public void Use()
		{
			Networker.Instance.InstaJesterServerRPC();
		}

		public static void SpawnInstaJester()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Expected O, but got Unknown
			if (GetEnemies.Jester == null)
			{
				return;
			}
			Misc.SpawnEnemyForced(GetEnemies.Jester, 1, isInside: true);
			foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
			{
				if (spawnedEnemy is JesterAI)
				{
					JesterAI val = (JesterAI)spawnedEnemy;
					((EnemyAI)val).SwitchToBehaviourState(1);
					((MonoBehaviour)val).StartCoroutine(DelayPop(val));
				}
			}
		}

		public static IEnumerator DelayPop(JesterAI jester)
		{
			yield return (object)new WaitForSeconds(1f);
			((EnemyAI)jester).SwitchToBehaviourState(2);
		}
	}
	internal class BugPlague : IEffect
	{
		public int[] DiceNums => new int[1] { 2 };

		public bool ShowDefaultTooltip => true;

		public string Tooltip => "Spawned a lot of bugs!";

		public void Use()
		{
			int amount = Random.Range(15, 30);
			int amount2 = Random.Range(15, 30);
			if (GetEnemies.HoardingBug != null && GetEnemies.Centipede != null)
			{
				Misc.SpawnEnemyForced(GetEnemies.HoardingBug, amount2, isInside: true);
				Misc.SpawnEnemyForced(GetEnemies.Centipede, amount, isInside: true);
			}
		}
	}
	internal class FakeFireExits : IEffect
	{
		public int[] DiceNums => new int[1] { 2 };

		public bool ShowDefaultTooltip => true;

		public string Tooltip => "More fire exits!";

		public void Use()
		{
			Networker.Instance.FakeFireExitsServerRPC();
		}
	}
	internal class FireExitBlock : IEffect
	{
		public int[] DiceNums => new int[1] { 2 };

		public bool ShowDefaultTooltip => true;

		public string Tooltip => "Fire exit blocked!";

		public void Use()
		{
			Networker.Instance.BlockFireExitsServerRPC();
		}
	}
	internal class ReturnToShip : IEffect
	{
		public int[] DiceNums => new int[4] { 3, 4, 5, 6 };

		public bool ShowDefaultTooltip => false;

		public string Tooltip => "Returning to ship with items!";

		public void Use()
		{
			Networker.Instance.TeleportToShipServerRPC(StartOfRound.Instance.localPlayerController.playerClientId);
		}

		public static void TeleportPlayerToShip(ulong clientID)
		{
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB val = null;
			GameObject[] allPlayerObjects = StartOfRound.Instance.allPlayerObjects;
			foreach (GameObject val2 in allPlayerObjects)
			{
				PlayerControllerB component = val2.GetComponent<PlayerControllerB>();
				if (component.playerClientId == clientID)
				{
					val = component;
					break;
				}
			}
			if (!((Object)(object)val == (Object)null))
			{
				if (Object.op_Implicit((Object)(object)Object.FindObjectOfType<AudioReverbPresets>()))
				{
					Object.FindObjectOfType<AudioReverbPresets>().audioPresets[3].ChangeAudioReverbForPlayer(val);
				}
				val.isInElevator = true;
				val.isInHangarShipRoom = true;
				val.isInsideFactory = false;
				val.averageVelocity = 0f;
				val.velocityLastFrame = Vector3.zero;
				val.TeleportPlayer(StartOfRound.Instance.middleOfShipNode.position, true, 160f, false, true);
				val.beamOutParticle.Play();
				if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
				}
			}
		}
	}
	internal class TeleportInside : IEffect
	{
		public int[] DiceNums => new int[1] { 2 };

		public bool IsNegative => true;

		public bool ShowDefaultTooltip => true;

		public string Tooltip => "Teleported inside";

		public void Use()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = RoundManager.Instance.insideAINodes[Random.Range(0, RoundManager.Instance.insideAINodes.Length)].transform.position;
			HUDManager.Instance.DisplayTip(":)", "", false, false, "LC_Tip1");
			Networker.Instance.TeleportInsideServerRPC(StartOfRound.Instance.localPlayerController.playerClientId, position);
		}

		public static void TeleportPlayerInside(ulong clientID, Vector3 teleportPos)
		{
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB val = null;
			GameObject[] allPlayerObjects = StartOfRound.Instance.allPlayerObjects;
			foreach (GameObject val2 in allPlayerObjects)
			{
				PlayerControllerB component = val2.GetComponent<PlayerControllerB>();
				if (component.playerClientId == clientID)
				{
					val = component;
					break;
				}
			}
			if (!((Object)(object)val == (Object)null))
			{
				if (Object.op_Implicit((Object)(object)Object.FindObjectOfType<AudioReverbPresets>()))
				{
					Object.FindObjectOfType<AudioReverbPresets>().audioPresets[2].ChangeAudioReverbForPlayer(val);
				}
				val.isInElevator = false;
				val.isInHangarShipRoom = false;
				val.isInsideFactory = true;
				val.averageVelocity = 0f;
				val.velocityLastFrame = Vector3.zero;
				val.TeleportPlayer(teleportPos, false, 0f, false, true);
				val.beamOutParticle.Play();
				if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
				}
			}
		}
	}
	internal class ZombieApocalypse : IEffect
	{
		public int[] DiceNums => new int[1] { 1 };

		public bool ShowDefaultTooltip => true;

		public string Tooltip => "Zombie apocalypse!";

		public void Use()
		{
			int amount = Random.Range(8, 20);
			HUDManager.Instance.DisplayTip(":)", "", false, false, "LC_Tip1");
			if (GetEnemies.Masked != null)
			{
				Misc.SpawnEnemyForced(GetEnemies.Masked, amount, isInside: true);
			}
		}
	}
	internal class Revive : IEffect
	{
		public int[] DiceNums => new int[4] { 3, 4, 5, 6 };

		public bool IsNegative => false;

		public bool ShowDefaultTooltip => false;

		public string Tooltip => "Reviving everyone";

		public void Use()
		{
			Networker.Instance.ReviveAllPlayersServerRpc();
		}
	}
	internal class Detonate : IEffect
	{
		public int[] DiceNums => new int[1] { 1 };

		public bool ShowDefaultTooltip => true;

		public string Tooltip => "A random player will soon explode";

		public void Use()
		{
			Networker.Instance.DetonateRandomPlayerServerRpc();
		}
	}
	public interface IEffect
	{
		int[] DiceNums { get; }

		bool ShowDefaultTooltip { get; }

		string Tooltip { get; }

		void Use();
	}
}