Decompiled source of SawTapes v1.1.6

SawTapes.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 System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DunGen;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SawTapes.Behaviours;
using SawTapes.Behaviours.Items;
using SawTapes.Behaviours.Tapes;
using SawTapes.Files;
using SawTapes.Files.Values;
using SawTapes.Managers;
using SawTapes.NetcodePatcher;
using SawTapes.Patches;
using SawTapes.Values;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Rendering.HighDefinition;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SawTapes")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SawTapes")]
[assembly: AssemblyTitle("SawTapes")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace SawTapes
{
	public class Constants
	{
		public const string IMPOSSIBLE_ACTION = "Impossible Action";

		public const string INFORMATION = "Information";

		public const string MESSAGE_INFO_CHEAT = "You tried to cheat, the rules were clear";

		public const string MESSAGE_IMPAC_KEY = "This key is needed by the tested player to survive";

		public const string MESSAGE_IMPAC_SAW = "This saw is needed by the tested players to survive";

		public const string MESSAGE_IMPAC_TESTED_PLAYER = "You are not the tested player, the game can't start";

		public const string MESSAGE_INFO_LOCKED = "You've been locked in, find the tape to get out";

		public const string MESSAGE_IMPAC_LOCKED_DOOR = "You can't open the door until the end of the game!";

		public const string MESSAGE_IMPAC_LOCKED_ENTRANCE = "You can't use the entrance until the end of the game!";

		public const string MESSAGE_INFO_ERR_PATH_ESCAPE = "An error occurred while determining the path, the game has been cancelled";

		public const string GLOBAL = "_Global_";

		public const string HUD = "_HUD_";

		public const string GASSING_SYSTEM = "_Gassing system_";

		public const string SURVIVAL_GAME = "Survival Game";

		public const string HUNTING_GAME = "Hunting Game";

		public const string ESCAPE_GAME = "Escape Game";

		public const string SHOVEL = "Shovel";

		public const string SAW = "Saw";
	}
	public class ConfigManager
	{
		public static ConfigEntry<int> rarityIncrement;

		public static ConfigEntry<bool> isDebug;

		public static ConfigEntry<bool> isInfoInGame;

		public static ConfigEntry<bool> isSawTheme;

		public static ConfigEntry<bool> isSubtitles;

		public static ConfigEntry<float> chronoPosX;

		public static ConfigEntry<float> chronoPosY;

		public static ConfigEntry<int> sawValue;

		public static ConfigEntry<int> sawMaxUse;

		public static ConfigEntry<float> gassingDistance;

		public static ConfigEntry<float> gassingCheatDistance;

		public static ConfigEntry<int> survivalRarity;

		public static ConfigEntry<bool> penalizePlayerWhoCamp;

		public static ConfigEntry<int> campDuration;

		public static ConfigEntry<string> survivalInteriorExclusions;

		public static ConfigEntry<int> huntingRarity;

		public static ConfigEntry<int> huntingDuration;

		public static ConfigEntry<int> huntingBillyValue;

		public static ConfigEntry<int> huntingReverseBearTrapValue;

		public static ConfigEntry<float> huntingAura;

		public static ConfigEntry<string> huntingExclusions;

		public static ConfigEntry<string> huntingInteriorExclusions;

		public static ConfigEntry<int> escapeRarity;

		public static ConfigEntry<int> escapeDuration;

		public static ConfigEntry<int> escapeBillyValue;

		public static ConfigEntry<string> escapeHazards;

		public static ConfigEntry<string> escapeInteriorExclusions;

		public static int SurvivalRarity => survivalRarity.Value;

		public static int HuntingRarity => huntingRarity.Value;

		public static int EscapeRarity => escapeRarity.Value;

		public static void Load()
		{
			rarityIncrement = SawTapes.configFile.Bind<int>("_Global_", "Rarity increment", 10, "By how much does the chance of a Saw game appearing increase with each round if it hasn't appeared?");
			isDebug = SawTapes.configFile.Bind<bool>("_Global_", "Enable debugging", false, "Is debugging enabled?");
			isInfoInGame = SawTapes.configFile.Bind<bool>("_Global_", "Enable Saw theme", true, "Display a tip when the player enters the mini-game to inform them to find the tape");
			isSawTheme = SawTapes.configFile.Bind<bool>("_Global_", "Enable Saw theme", true, "Is Saw theme enabled?");
			isSubtitles = SawTapes.configFile.Bind<bool>("_HUD_", "Enable subtitles", false, "Is subtitles enabled?");
			chronoPosX = SawTapes.configFile.Bind<float>("_HUD_", "Chrono pos X", 106f, "X position of chrono on interface.");
			chronoPosY = SawTapes.configFile.Bind<float>("_HUD_", "Chrono pos Y", -50f, "Y position of chrono on interface.");
			sawValue = SawTapes.configFile.Bind<int>("Saw", "Value", 60, "Saw value");
			sawMaxUse = SawTapes.configFile.Bind<int>("Saw", "Max use", 3, "Maximum number of uses before the Saw breaks");
			gassingDistance = SawTapes.configFile.Bind<float>("_Gassing system_", "Distance", 15f, "Maximum distance between the player and the tape before he is gassed");
			gassingCheatDistance = SawTapes.configFile.Bind<float>("_Gassing system_", "Cheat distance", 15f, "Maximum distance the player can move before launching the tape. Beyond that, he'll be killed.");
			survivalRarity = SawTapes.configFile.Bind<int>("Survival Game", "Rarity", 20, "Default probability of the Survival Game mini-game appearing");
			penalizePlayerWhoCamp = SawTapes.configFile.Bind<bool>("Survival Game", "Penalize campers", true, "Enable the possibility to penalize the player who is camping by spawning a Nutcracker");
			campDuration = SawTapes.configFile.Bind<int>("Survival Game", "Camping duration", 5, "Total camping duration before the player is killed");
			survivalInteriorExclusions = SawTapes.configFile.Bind<string>("Survival Game", "Interiors exclusion list", "", "List of interiors in which the Survival Game will not appear.");
			huntingRarity = SawTapes.configFile.Bind<int>("Hunting Game", "Rarity", 20, "Default probability of the Hunting Game mini-game appearing");
			huntingDuration = SawTapes.configFile.Bind<int>("Hunting Game", "Duration", 150, "Duration of the Hunting Game");
			huntingBillyValue = SawTapes.configFile.Bind<int>("Hunting Game", "Billy value", 90, "Billy value for the Hunting Game");
			huntingReverseBearTrapValue = SawTapes.configFile.Bind<int>("Hunting Game", "Reverse bear trap value", 30, "Reverse Bear Trap value for the Hunting Game");
			huntingAura = SawTapes.configFile.Bind<float>("Hunting Game", "Aura duration", 20f, "Duration for which the enemy's aura is visible through walls");
			huntingExclusions = SawTapes.configFile.Bind<string>("Hunting Game", "Enemies exclusion list", "Blob,Maneater,Lasso,Red pill", "List of creatures that will not be selected by the Hunting Game.\nYou can add enemies by separating them with a comma.");
			huntingInteriorExclusions = SawTapes.configFile.Bind<string>("Hunting Game", "Interiors exclusion list", "", "List of interiors in which the Hunting Game will not appear.");
			escapeRarity = SawTapes.configFile.Bind<int>("Escape Game", "Rarity", 20, "Default probability of the Escape Game mini-game appearing");
			escapeDuration = SawTapes.configFile.Bind<int>("Escape Game", "Duration", 150, "Duration of the Escape Game");
			escapeBillyValue = SawTapes.configFile.Bind<int>("Escape Game", "Billy value", 90, "Billy value for the Escape Game");
			escapeHazards = SawTapes.configFile.Bind<string>("Escape Game", "Hazards list", "Landmine:2:false:false:false:false,SpikeRoofTrapHazard:3:false:true:true:true,TurretContainer:1:true:false:false:false,LaserTurret:2:false:false:false:false,FanTrapAnimated:2:false:false:false:false,FunctionalMicrowave:1:false:false:false:false", "List of spawnable hazards for the Escape Game.\nThe format is 'HazardName:Weight:SpawnFacingAwayFromWall:SpawnFacingWall:SpawnWithBackToWall:SpawnWithBackFlushAgainstWall'.");
			escapeInteriorExclusions = SawTapes.configFile.Bind<string>("Escape Game", "Interiors exclusion list", "GrandArmoryFlow,Level3Flow,StorehouseFlow", "List of interiors in which the Escape Game will not appear.");
		}
	}
	[BepInPlugin("Lega.SawTapes", "Saw Tapes", "1.1.6")]
	public class SawTapes : BaseUnityPlugin
	{
		private const string modGUID = "Lega.SawTapes";

		private const string modName = "Saw Tapes";

		private const string modVersion = "1.1.6";

		private readonly Harmony harmony = new Harmony("Lega.SawTapes");

		private static readonly AssetBundle bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "sawtapes"));

		internal static ManualLogSource mls;

		public static ConfigFile configFile;

		public static GameObject managerPrefab = NetworkPrefabs.CreateNetworkPrefab("SawTapesNetworkManager");

		public static List<SawTapeValue> sawTapeValues = new List<SawTapeValue>();

		public static GameObject billyPuppetObj;

		public static GameObject reverseBearTrapObj;

		public static GameObject sawKeyObj;

		public static GameObject pursuerEyeObj;

		public static Item sawItem;

		public static GameObject chainObj;

		public static GameObject sawTheme;

		public static GameObject sawRecordingSurvival;

		public static GameObject sawRecordingHunting;

		public static GameObject sawRecordingEscape;

		public static GameObject billyRecordingSurvival;

		public static GameObject steamAudio;

		public static GameObject tapeParticle;

		public static GameObject spawnParticle;

		public static GameObject despawnParticle;

		public static GameObject steamParticle;

		public static GameObject pathParticle;

		public static EnemyType billyEnemy;

		public static Material wallhackShader;

		public static HashSet<EnemyType> allEnemies = new HashSet<EnemyType>();

		public static List<Tile> eligibleTiles = new List<Tile>();

		public static HashSet<SurvivalRoom> rooms = new HashSet<SurvivalRoom>();

		public static HashSet<SurvivalHorde> hordes = new HashSet<SurvivalHorde>();

		public void Awake()
		{
			mls = Logger.CreateLogSource("SawTapes");
			configFile = ((BaseUnityPlugin)this).Config;
			ConfigManager.Load();
			LoadManager();
			NetcodePatcher();
			LoadItems();
			LoadEnemies();
			LoadParticles();
			LoadAudios();
			LoadShaders();
			harmony.PatchAll(typeof(HUDManagerPatch));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			harmony.PatchAll(typeof(DungeonPatch));
			harmony.PatchAll(typeof(TilePatch));
			harmony.PatchAll(typeof(DoorLockPatch));
			harmony.PatchAll(typeof(ManualCameraRendererPatch));
			harmony.PatchAll(typeof(ShipTeleporterPatch));
			harmony.PatchAll(typeof(RoundManagerPatch));
			harmony.PatchAll(typeof(EnemyAIPatch));
		}

		public static void LoadManager()
		{
			Utilities.FixMixerGroups(managerPrefab);
			managerPrefab.AddComponent<SawTapesNetworkManager>();
		}

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

		public void LoadItems()
		{
			List<SawTapeValue> list = new List<SawTapeValue>();
			list.Add(new SawTapeValue(typeof(SurvivalTape), bundle.LoadAsset<Item>("Assets/SawTape/SurvivalTapeItem.asset"), ConfigManager.SurvivalRarity, isTileGame: true, ConfigManager.survivalInteriorExclusions.Value));
			list.Add(new SawTapeValue(typeof(HuntingTape), bundle.LoadAsset<Item>("Assets/SawTape/HuntingTapeItem.asset"), ConfigManager.HuntingRarity, isTileGame: false, ConfigManager.huntingInteriorExclusions.Value));
			list.Add(new SawTapeValue(typeof(EscapeTape), bundle.LoadAsset<Item>("Assets/SawTape/EscapeTapeItem.asset"), ConfigManager.EscapeRarity, isTileGame: false, ConfigManager.escapeInteriorExclusions.Value));
			sawTapeValues = list;
			foreach (SawTapeValue sawTapeValue in sawTapeValues)
			{
				RegisterItem(sawTapeValue.Type, sawTapeValue.Item);
			}
			billyPuppetObj = RegisterItem(typeof(BillyPuppet), bundle.LoadAsset<Item>("Assets/BillyPuppet/BillyPuppetItem.asset")).spawnPrefab;
			reverseBearTrapObj = RegisterItem(typeof(ReverseBearTrap), bundle.LoadAsset<Item>("Assets/ReverseBearTrap/ReverseBearTrapItem.asset")).spawnPrefab;
			sawKeyObj = RegisterItem(typeof(SawKey), bundle.LoadAsset<Item>("Assets/SawKey/SawKeyItem.asset")).spawnPrefab;
			pursuerEyeObj = RegisterItem(typeof(PursuerEye), bundle.LoadAsset<Item>("Assets/PursuerEye/PursuerEyeItem.asset")).spawnPrefab;
			sawItem = RegisterItem(typeof(Saw), bundle.LoadAsset<Item>("Assets/Saw/SawItem.asset"));
			chainObj = RegisterItem(typeof(Chain), bundle.LoadAsset<Item>("Assets/Chain/ChainItem.asset")).spawnPrefab;
		}

		public Item RegisterItem(Type type, Item item)
		{
			if ((Object)(object)item.spawnPrefab.GetComponent(type) == (Object)null)
			{
				Component obj = item.spawnPrefab.AddComponent(type);
				PhysicsProp val = (PhysicsProp)(object)((obj is PhysicsProp) ? obj : null);
				((GrabbableObject)val).grabbable = true;
				((GrabbableObject)val).grabbableToEnemies = true;
				((GrabbableObject)val).itemProperties = item;
			}
			NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab);
			Utilities.FixMixerGroups(item.spawnPrefab);
			Items.RegisterItem(item);
			return item;
		}

		public void LoadEnemies()
		{
			billyEnemy = bundle.LoadAsset<EnemyType>("Assets/BillyPuppet/BillyEnemy.asset");
			billyEnemy.enemyPrefab.AddComponent<Billy>();
			NetworkPrefabs.RegisterNetworkPrefab(billyEnemy.enemyPrefab);
		}

		public void LoadParticles()
		{
			HashSet<GameObject> hashSet = new HashSet<GameObject>
			{
				tapeParticle = bundle.LoadAsset<GameObject>("Assets/Particles/TapeParticle.prefab"),
				spawnParticle = bundle.LoadAsset<GameObject>("Assets/Particles/SpawnParticle.prefab"),
				despawnParticle = bundle.LoadAsset<GameObject>("Assets/Particles/DespawnParticle.prefab"),
				steamParticle = bundle.LoadAsset<GameObject>("Assets/Particles/SteamParticle.prefab"),
				pathParticle = bundle.LoadAsset<GameObject>("Assets/Particles/PathParticle.prefab")
			};
			foreach (GameObject item in hashSet)
			{
				NetworkPrefabs.RegisterNetworkPrefab(item);
				Utilities.FixMixerGroups(item);
			}
		}

		public void LoadAudios()
		{
			HashSet<GameObject> hashSet = new HashSet<GameObject>
			{
				sawTheme = bundle.LoadAsset<GameObject>("Assets/Audios/SawTheme.prefab"),
				sawRecordingSurvival = bundle.LoadAsset<GameObject>("Assets/Audios/SawRecording_Survival.prefab"),
				sawRecordingHunting = bundle.LoadAsset<GameObject>("Assets/Audios/SawRecording_Hunting.prefab"),
				sawRecordingEscape = bundle.LoadAsset<GameObject>("Assets/Audios/SawRecording_Escape.prefab"),
				billyRecordingSurvival = bundle.LoadAsset<GameObject>("Assets/Audios/BillyRecording_Survival.prefab"),
				steamAudio = bundle.LoadAsset<GameObject>("Assets/Audios/SteamAudio.prefab")
			};
			foreach (GameObject item in hashSet)
			{
				NetworkPrefabs.RegisterNetworkPrefab(item);
				Utilities.FixMixerGroups(item);
			}
		}

		public static void LoadShaders()
		{
			wallhackShader = bundle.LoadAsset<Material>("Assets/Shaders/WallhackMaterial.mat");
		}
	}
	public class STUtilities
	{
		public static void Shuffle<T>(List<T> list)
		{
			for (int num = list.Count - 1; num > 0; num--)
			{
				int num2 = Random.Range(0, num + 1);
				int index = num2;
				int index2 = num;
				T value = list[num];
				T value2 = list[num2];
				list[index] = value;
				list[index2] = value2;
			}
		}

		public static IEnumerator ShowEnemyCoroutine(EnemyAI enemy)
		{
			if ((Object)(object)enemy == (Object)null || enemy.isEnemyDead)
			{
				SawKey sawKey = Object.FindFirstObjectByType<SawKey>();
				if ((Object)(object)sawKey != (Object)null)
				{
					CustomPassManager.SetupCustomPassForObject((GrabbableObject)(object)sawKey);
				}
			}
			else
			{
				CustomPassManager.SetupCustomPassForEnemy(enemy);
			}
			yield return (object)new WaitForSeconds(ConfigManager.huntingAura.Value);
			CustomPassManager.RemoveAura();
		}

		public static Transform FindMainEntrancePoint()
		{
			return ((IEnumerable<EntranceTeleport>)Object.FindObjectsOfType<EntranceTeleport>()).FirstOrDefault((Func<EntranceTeleport, bool>)((EntranceTeleport e) => e.entranceId == 0 && !e.isEntranceToBuilding)).entrancePoint;
		}

		public static Vector3 GetFurthestPositionScrapSpawn(Vector3 position, Item itemToSpawn)
		{
			//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_0094: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			RandomScrapSpawn val = (from p in Object.FindObjectsOfType<RandomScrapSpawn>()
				where !p.spawnUsed
				orderby Vector3.Distance(position, ((Component)p).transform.position) descending
				select p).FirstOrDefault();
			if ((Object)(object)val == (Object)null)
			{
				val = (from p in Object.FindObjectsOfType<RandomScrapSpawn>()
					orderby Vector3.Distance(position, ((Component)p).transform.position) descending
					select p).FirstOrDefault();
			}
			if (val.spawnedItemsCopyPosition)
			{
				val.spawnUsed = true;
			}
			else
			{
				((Component)val).transform.position = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(((Component)val).transform.position, val.itemSpawnRange, RoundManager.Instance.navHit, RoundManager.Instance.AnomalyRandom, -1) + Vector3.up * itemToSpawn.verticalOffset;
			}
			return ((Component)val).transform.position + Vector3.up * 0.5f;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "SawTapes";

		public const string PLUGIN_NAME = "SawTapes";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace SawTapes.Values
{
	public class EscapeHazard
	{
		public string HazardName { get; internal set; }

		public bool SpawnFacingAwayFromWall { get; internal set; }

		public bool SpawnFacingWall { get; internal set; }

		public bool SpawnWithBackToWall { get; internal set; }

		public bool SpawnWithBackFlushAgainstWall { get; internal set; }

		public EscapeHazard(string hazardName, bool spawnFacingAwayFromWall, bool spawnFacingWall, bool spawnWithBackToWall, bool spawnWithBackFlushAgainstWall)
		{
			HazardName = hazardName;
			SpawnFacingAwayFromWall = spawnFacingAwayFromWall;
			SpawnFacingWall = spawnFacingWall;
			SpawnWithBackToWall = spawnWithBackToWall;
			SpawnWithBackFlushAgainstWall = spawnWithBackFlushAgainstWall;
			base..ctor();
		}
	}
	public class SawTapeValue
	{
		public Type Type { get; internal set; }

		public Item Item { get; internal set; }

		public int DefaultRarity { get; internal set; }

		public int Rarity { get; internal set; }

		public bool IsTileGame { get; internal set; }

		public string InteriorsExclusion { get; internal set; }

		public SawTapeValue(Type type, Item item, int rarity, bool isTileGame, string interiorsExclusion)
		{
			Type = type;
			Item = item;
			DefaultRarity = rarity;
			Rarity = rarity;
			IsTileGame = isTileGame;
			InteriorsExclusion = interiorsExclusion;
			base..ctor();
		}
	}
	public class SurvivalHorde
	{
		public string HordeName { get; internal set; }

		public int GameDuration { get; internal set; }

		public int BillyValue { get; internal set; }

		public int MinHour { get; internal set; }

		public int MaxHour { get; internal set; }

		public Dictionary<int, EnemyType> EnemiesSpawn { get; internal set; }

		public SurvivalHorde(string hordeName, int gameDuration, int billyValue, int minHour, int maxHour, Dictionary<int, EnemyType> enemiesSpawn)
		{
			HordeName = hordeName;
			GameDuration = gameDuration;
			BillyValue = billyValue;
			MinHour = minHour;
			MaxHour = maxHour;
			EnemiesSpawn = enemiesSpawn;
			base..ctor();
		}
	}
	public class SurvivalRoom
	{
		public string RoomName { get; internal set; }

		public List<string> DoorsNames { get; internal set; }

		public int Weight { get; internal set; }

		public List<SurvivalHorde> Hordes { get; internal set; }

		public SurvivalRoom(string roomName, List<string> doorsNames, int weight, List<SurvivalHorde> hordes)
		{
			RoomName = roomName;
			DoorsNames = doorsNames;
			Weight = weight;
			Hordes = hordes;
			base..ctor();
		}
	}
}
namespace SawTapes.Patches
{
	internal class DoorLockPatch
	{
		public static Dictionary<DoorLock, Tile> blockedDoors = new Dictionary<DoorLock, Tile>();

		[HarmonyPatch(typeof(DoorLock), "OnTriggerStay")]
		[HarmonyPrefix]
		private static bool OpenDoorAsEnemy(ref DoorLock __instance)
		{
			return !IsDoorBlocked(__instance);
		}

		[HarmonyPatch(typeof(DoorLock), "TryDoorHaunt")]
		[HarmonyPrefix]
		private static bool OpenDoorAsHaunt(ref DoorLock __instance)
		{
			return !IsDoorBlocked(__instance);
		}

		[HarmonyPatch(typeof(DoorLock), "OpenOrCloseDoor")]
		[HarmonyPrefix]
		private static bool OpenDoorAsPlayer(ref DoorLock __instance, ref PlayerControllerB playerWhoTriggered)
		{
			if (!IsDoorBlocked(__instance))
			{
				return true;
			}
			if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerWhoTriggered)
			{
				HUDManager.Instance.DisplayTip("Impossible Action", "You can't open the door until the end of the game!", false, false, "LC_Tip1");
			}
			return false;
		}

		public static bool IsDoorBlocked(DoorLock doorLock)
		{
			return blockedDoors.ContainsKey(doorLock);
		}
	}
	internal class DungeonPatch
	{
		public static bool isGenerateTileGame = true;

		[HarmonyPatch(typeof(Dungeon), "SpawnDoorPrefab")]
		[HarmonyPrefix]
		private static void SpawnDoor(ref Doorway a, ref Doorway b)
		{
			if (isGenerateTileGame)
			{
				RemoveSpawnEmptyDoor(a);
				RemoveSpawnEmptyDoor(b);
			}
		}

		private static void RemoveSpawnEmptyDoor(Doorway doorway)
		{
			SurvivalRoom room = SawTapes.rooms.FirstOrDefault((SurvivalRoom r) => ((Object)doorway.tile).name.Equals(r.RoomName));
			if (room != null && DungeonUtil.HasAnyViableEntries(doorway.ConnectorPrefabWeights) && DungeonUtil.HasAnyViableEntries(doorway.ConnectedDoorway.ConnectorPrefabWeights) && doorway.ConnectorPrefabWeights.Any(delegate(GameObjectWeight d)
			{
				List<string> doorsNames = room.DoorsNames;
				GameObject gameObject = d.GameObject;
				return doorsNames.Contains((gameObject != null) ? ((Object)gameObject).name : null);
			}))
			{
				doorway.ConnectorPrefabWeights.RemoveAll((GameObjectWeight d) => !room.DoorsNames.Contains(((Object)d.GameObject).name));
				doorway.ConnectedDoorway.ConnectorPrefabWeights.RemoveAll((GameObjectWeight d) => !room.DoorsNames.Contains(((Object)d.GameObject).name));
				if (!SawTapes.eligibleTiles.Contains(doorway.tile))
				{
					for (int i = 0; i < room.Weight; i++)
					{
						SawTapes.eligibleTiles.Add(doorway.tile);
					}
				}
			}
			else if (SawTapes.eligibleTiles.Contains(doorway.tile))
			{
				SawTapes.eligibleTiles.RemoveAll((Tile t) => (Object)(object)t == (Object)(object)doorway.tile);
			}
		}
	}
	internal class EnemyAIPatch
	{
		[HarmonyPatch(typeof(EnemyAI), "HitEnemy")]
		[HarmonyPostfix]
		private static void HitEnemy(ref EnemyAI __instance, int force = 1, PlayerControllerB playerWhoHit = null)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			EnemyAI val = ((playerWhoHit == null) ? null : ((Component)playerWhoHit).GetComponent<PlayerSTBehaviour>().huntingTape?.assignedEnemy);
			if (!__instance.isEnemyDead && (float)(__instance.enemyHP - force) <= 0f && (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerWhoHit && (Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)__instance)
			{
				SawTapesNetworkManager.Instance.SpawnPursuerEyeServerRpc(((Component)__instance).transform.position);
			}
		}

		[HarmonyPatch(typeof(EnemyAI), "KillEnemy")]
		[HarmonyPostfix]
		private static void KillEnemy(ref EnemyAI __instance)
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			if (((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsHost || ((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsServer)
			{
				EnemyAI val = Object.FindFirstObjectByType<HuntingTape>()?.assignedEnemy;
				if ((Object)(object)val != (Object)null && (Object)(object)__instance == (Object)(object)val)
				{
					SawTapesNetworkManager.Instance.SpawnSawKeyServerRpc(((Component)__instance).transform.position);
				}
			}
		}

		[HarmonyPatch(typeof(EnemyAI), "PlayerIsTargetable")]
		[HarmonyPrefix]
		private static bool IsPlayerTargetable(ref bool __result, PlayerControllerB playerScript)
		{
			PlayerSTBehaviour component = ((Component)playerScript).GetComponent<PlayerSTBehaviour>();
			if ((Object)(object)component != (Object)null)
			{
				__result = component.isTargetable;
				return component.isTargetable;
			}
			return true;
		}
	}
	internal class HUDManagerPatch
	{
		public static TextMeshProUGUI chronoText;

		public static TextMeshProUGUI subtitleText;

		public static bool isChronoEnded = false;

		public static Dictionary<EntranceTeleport, Tile> blockedEntrances = new Dictionary<EntranceTeleport, Tile>();

		public static bool isFlashFilterUsed = false;

		[HarmonyPatch(typeof(HUDManager), "Start")]
		[HarmonyPostfix]
		private static void StartHUDManager()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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_0046: 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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			chronoText = HUDSTManager.CreateUIElement("ChronoUI", new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(ConfigManager.chronoPosX.Value, ConfigManager.chronoPosY.Value), new Vector2(300f, 300f), (TextAlignmentOptions)257);
			if (ConfigManager.isSubtitles.Value)
			{
				subtitleText = HUDSTManager.CreateUIElement("SubtitleUI", new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, -125f), new Vector2(600f, 200f), (TextAlignmentOptions)514);
			}
		}

		public static IEnumerator StartChronoCoroutine(int seconds)
		{
			while (!IsChronoEnded(seconds))
			{
				seconds--;
				yield return (object)new WaitForSeconds(1f);
			}
		}

		private static bool IsChronoEnded(int totalSeconds)
		{
			int num = (int)Math.Floor((double)totalSeconds / 60.0);
			int num2 = (int)Math.Floor((double)totalSeconds % 60.0);
			((TMP_Text)chronoText).text = $"{num:D2}:{num2:D2}";
			if (GameNetworkManager.Instance.localPlayerController.isPlayerDead || isChronoEnded || (num == 0 && num2 == 0))
			{
				((TMP_Text)chronoText).text = "";
				isChronoEnded = false;
				return true;
			}
			return false;
		}

		[HarmonyPatch(typeof(HUDManager), "HoldInteractionFill")]
		[HarmonyPostfix]
		private static void HoldInteraction(ref bool __result)
		{
			if (!__result)
			{
				return;
			}
			InteractTrigger hoveringOverTrigger = GameNetworkManager.Instance.localPlayerController.hoveringOverTrigger;
			if (!((Object)(object)hoveringOverTrigger == (Object)null))
			{
				EntranceTeleport component = ((Component)hoveringOverTrigger).GetComponent<EntranceTeleport>();
				if ((Object)(object)component != (Object)null && IsEntranceBlocked(component))
				{
					HUDManager.Instance.DisplayTip("Impossible Action", "You can't use the entrance until the end of the game!", false, false, "LC_Tip1");
					__result = false;
				}
			}
		}

		public static bool IsEntranceBlocked(EntranceTeleport entranceTeleport)
		{
			return blockedEntrances.ContainsKey(entranceTeleport);
		}

		[HarmonyPatch(typeof(HUDManager), "SetScreenFilters")]
		[HarmonyPrefix]
		private static bool UpdateScreenFilters()
		{
			return !isFlashFilterUsed;
		}
	}
	internal class ManualCameraRendererPatch
	{
		[HarmonyPatch(typeof(ManualCameraRenderer), "updateMapTarget")]
		[HarmonyPostfix]
		private static void MapCameraText(ref ManualCameraRenderer __instance)
		{
			MapCameraSTManager.UpdateMapCamera(__instance);
		}
	}
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		private static void StartPlayerControllerB(ref PlayerControllerB __instance)
		{
			PlayerSTManager.AddPlayerBehaviour(__instance);
		}

		[HarmonyPatch(typeof(PlayerControllerB), "TeleportPlayer")]
		[HarmonyPrefix]
		private static bool TeleportPlayer(ref PlayerControllerB __instance)
		{
			return !PlayerSTManager.PreventTeleportPlayer(__instance);
		}

		[HarmonyPatch(typeof(PlayerControllerB), "spawnPlayerAnimTimer")]
		[HarmonyPrefix]
		private static void SpawnPlayerAnim(ref PlayerControllerB __instance)
		{
			PlayerSTBehaviour component = ((Component)__instance).GetComponent<PlayerSTBehaviour>();
			if ((Object)(object)component != (Object)null)
			{
				((MonoBehaviour)__instance).StartCoroutine(PlayerSTManager.SetUntargetablePlayerCoroutine(component, 4f));
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ItemSecondaryUse_performed")]
		[HarmonyPrefix]
		private static void SecondaryUsePerformed(ref PlayerControllerB __instance)
		{
			if (!((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController))
			{
				PlayerSTBehaviour component = ((Component)__instance).GetComponent<PlayerSTBehaviour>();
				if ((Object)(object)component != (Object)null)
				{
					PlayerSTManager.SecondaryUsePerformed(component);
				}
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "KillPlayerClientRpc")]
		[HarmonyPostfix]
		private static void PlayerDeath(ref PlayerControllerB __instance, int playerId)
		{
			PlayerSTBehaviour componentInChildren = __instance.playersManager.allPlayerObjects[playerId].GetComponentInChildren<PlayerSTBehaviour>();
			if (!((Object)(object)componentInChildren == (Object)null))
			{
				TileSTManager.OpenTileDoors(componentInChildren);
				PlayerSTManager.ResetPlayerGame(componentInChildren);
			}
		}
	}
	internal class RoundManagerPatch
	{
		public static SawTapeValue tapeToSpawn;

		[HarmonyPatch(typeof(RuntimeDungeon), "Generate")]
		[HarmonyPrefix]
		private static void LoadNewGame()
		{
			SawTapes.eligibleTiles.Clear();
			tapeToSpawn = null;
			if (!((NetworkBehaviour)RoundManager.Instance).IsServer)
			{
				return;
			}
			STUtilities.Shuffle(SawTapes.sawTapeValues);
			foreach (SawTapeValue item in SawTapes.sawTapeValues.Where((SawTapeValue s) => string.IsNullOrEmpty(s.InteriorsExclusion) || !s.InteriorsExclusion.Contains(((Object)RoundManager.Instance.dungeonGenerator.Generator.DungeonFlow).name)))
			{
				if (tapeToSpawn == null && new Random().Next(1, 100) <= item.Rarity)
				{
					tapeToSpawn = item;
					item.Rarity = item.DefaultRarity;
				}
				else if (item.Rarity > 0 && item.Rarity < 100)
				{
					item.Rarity = Mathf.Min(100, item.Rarity + ConfigManager.rarityIncrement.Value);
				}
			}
			SawTapesNetworkManager.Instance.SetGenerateGameTileClientRpc(tapeToSpawn != null && tapeToSpawn.IsTileGame);
		}

		[HarmonyPatch(typeof(RoundManager), "SpawnScrapInLevel")]
		[HarmonyPostfix]
		private static void SpawnItems()
		{
			AddNewItems();
		}

		public static void AddNewItems()
		{
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			if (tapeToSpawn == null)
			{
				return;
			}
			List<RandomScrapSpawn> list = (from s in Object.FindObjectsOfType<RandomScrapSpawn>()
				where !s.spawnUsed
				select s).ToList();
			if (tapeToSpawn.IsTileGame)
			{
				STUtilities.Shuffle(SawTapes.eligibleTiles);
				{
					foreach (Tile tile in SawTapes.eligibleTiles.ToList())
					{
						SurvivalRoom room = SawTapes.rooms.FirstOrDefault((SurvivalRoom r) => ((Object)tile).name.Equals(r.RoomName));
						List<DoorLock> doorLocks = new List<DoorLock>();
						if (!tile.UsedDoorways.All(IsDoorwayValid))
						{
							SawTapes.eligibleTiles.RemoveAll((Tile t) => (Object)(object)t == (Object)(object)tile);
							continue;
						}
						List<RandomScrapSpawn> list2 = Object.FindObjectsOfType<RandomScrapSpawn>().Where(delegate(RandomScrapSpawn s)
						{
							//IL_0006: Unknown result type (might be due to invalid IL or missing references)
							//IL_000b: Unknown result type (might be due to invalid IL or missing references)
							//IL_0014: Unknown result type (might be due to invalid IL or missing references)
							Bounds bounds3 = tile.Bounds;
							return ((Bounds)(ref bounds3)).Contains(((Component)s).transform.position);
						}).ToList();
						if (list2.Count <= 0)
						{
							list2 = Object.FindObjectsOfType<RandomScrapSpawn>().Where(delegate(RandomScrapSpawn s)
							{
								//IL_0006: Unknown result type (might be due to invalid IL or missing references)
								//IL_000b: Unknown result type (might be due to invalid IL or missing references)
								//IL_0014: Unknown result type (might be due to invalid IL or missing references)
								Bounds bounds2 = tile.Bounds;
								return ((Bounds)(ref bounds2)).Contains(((Component)s).transform.position);
							}).ToList();
							if (list2.Count <= 0)
							{
								SawTapes.eligibleTiles.RemoveAll((Tile t) => (Object)(object)t == (Object)(object)tile);
								continue;
							}
						}
						GrabbableObject val = SpawnTape(list2.OrderBy(delegate(RandomScrapSpawn s)
						{
							//IL_0006: Unknown result type (might be due to invalid IL or missing references)
							//IL_0011: 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)
							//IL_0019: Unknown result type (might be due to invalid IL or missing references)
							Vector3 position = ((Component)s).transform.position;
							Bounds bounds = tile.Bounds;
							return Vector3.Distance(position, ((Bounds)(ref bounds)).center);
						}).FirstOrDefault());
						List<NetworkObjectReference> list3 = (list3 = CollectEntranceAndExitTeleports(tile));
						Vector3[] doorsPos = doorLocks.Select((DoorLock d) => ((Component)d).transform.position).ToArray();
						SawTapesNetworkManager.Instance.AddTileInfosClientRpc(((Component)tile).transform.position, doorsPos, list3.ToArray(), NetworkObjectReference.op_Implicit(((Component)val).GetComponent<NetworkObject>()));
						SawTapes.eligibleTiles.RemoveAll((Tile t) => (Object)(object)t != (Object)(object)tile);
						break;
						bool IsDoorwayValid(Doorway doorway)
						{
							if ((Object)(object)doorway.doorComponent == (Object)null)
							{
								return false;
							}
							if (!doorway.ConnectedDoorway.ConnectorPrefabWeights.Any())
							{
								return false;
							}
							if (!room.DoorsNames.Contains(((Object)doorway.doorComponent).name.Replace("(Clone)", "").Trim()))
							{
								return false;
							}
							DoorLock val2 = (from d in Object.FindObjectsOfType<DoorLock>()
								where Vector3.Distance(((Component)d).transform.position, ((Component)doorway.doorComponent).transform.position) < 2f
								orderby Vector3.Distance(((Component)d).transform.position, ((Component)doorway.doorComponent).transform.position)
								select d).FirstOrDefault();
							if ((Object)(object)val2 != (Object)null)
							{
								doorLocks.Add(val2);
							}
							return true;
						}
					}
					return;
				}
			}
			int index = new Random().Next(0, list.Count);
			SpawnTape(list[index]);
		}

		public static List<NetworkObjectReference> CollectEntranceAndExitTeleports(Tile tile)
		{
			//IL_0079: 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)
			List<NetworkObjectReference> list = new List<NetworkObjectReference>();
			foreach (EntranceTeleport entranceTeleport in Object.FindObjectsOfType<EntranceTeleport>().Where(delegate(EntranceTeleport e)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				Bounds bounds = tile.Bounds;
				return ((Bounds)(ref bounds)).Contains(((Component)e).transform.position);
			}))
			{
				NetworkObject component = ((Component)entranceTeleport).GetComponent<NetworkObject>();
				if (!((Object)(object)component != (Object)null))
				{
					continue;
				}
				list.Add(NetworkObjectReference.op_Implicit(component));
				foreach (EntranceTeleport item in from e in Object.FindObjectsOfType<EntranceTeleport>()
					where e.isEntranceToBuilding != entranceTeleport.isEntranceToBuilding && e.entranceId == entranceTeleport.entranceId
					select e)
				{
					NetworkObject component2 = ((Component)item).GetComponent<NetworkObject>();
					if ((Object)(object)component2 != (Object)null)
					{
						list.Add(NetworkObjectReference.op_Implicit(component2));
					}
				}
			}
			return list;
		}

		public static GrabbableObject SpawnTape(RandomScrapSpawn randomScrapSpawn)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)randomScrapSpawn == (Object)null)
			{
				return null;
			}
			if (randomScrapSpawn.spawnedItemsCopyPosition)
			{
				randomScrapSpawn.spawnUsed = true;
			}
			else
			{
				((Component)randomScrapSpawn).transform.position = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(((Component)randomScrapSpawn).transform.position, randomScrapSpawn.itemSpawnRange, RoundManager.Instance.navHit, RoundManager.Instance.AnomalyRandom, -1) + Vector3.up * tapeToSpawn.Item.verticalOffset;
			}
			return SpawnItem(tapeToSpawn.Item.spawnPrefab, ((Component)randomScrapSpawn).transform.position + Vector3.up * 0.5f);
		}

		public static GrabbableObject SpawnItem(GameObject spawnPrefab, Vector3 position)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			return SpawnItem(spawnPrefab, position, Quaternion.identity);
		}

		public static GrabbableObject SpawnItem(GameObject spawnPrefab, Vector3 position, Quaternion rotation)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			if (((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsServer || ((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsHost)
			{
				try
				{
					GameObject val = Object.Instantiate<GameObject>(spawnPrefab, position, rotation, StartOfRound.Instance.propsContainer);
					GrabbableObject component = val.GetComponent<GrabbableObject>();
					component.fallTime = 0f;
					val.GetComponent<NetworkObject>().Spawn(false);
					if (component is SawTape || component is Saw)
					{
						SawTapesNetworkManager.Instance.SpawnBlackParticleClientRpc(NetworkObjectReference.op_Implicit(((Component)component).GetComponent<NetworkObject>()));
					}
					return component;
				}
				catch (Exception arg)
				{
					SawTapes.mls.LogError((object)$"Error in SpawnItem: {arg}");
				}
			}
			return null;
		}

		[HarmonyPatch(typeof(RoundManager), "DetectElevatorIsRunning")]
		[HarmonyPostfix]
		private static void EndGame()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			SawTape[] array = Object.FindObjectsOfType<SawTape>();
			foreach (SawTape sawTape in array)
			{
				SawTapesNetworkManager.Instance.DestroyObjectServerRpc(NetworkObjectReference.op_Implicit(((Component)sawTape).GetComponent<NetworkObject>()));
			}
		}
	}
	internal class ShipTeleporterPatch
	{
		[HarmonyPatch(typeof(ShipTeleporter), "PressTeleportButtonOnLocalClient")]
		[HarmonyPrefix]
		private static bool PreventTeleport(ref ShipTeleporter __instance)
		{
			if (!__instance.isInverseTeleporter && (Object)(object)StartOfRound.Instance.mapScreen.targetedPlayer != (Object)null)
			{
				PlayerSTBehaviour component = ((Component)StartOfRound.Instance.mapScreen.targetedPlayer).GetComponent<PlayerSTBehaviour>();
				if ((Object)(object)component != (Object)null && component.isInGame)
				{
					return false;
				}
			}
			return true;
		}
	}
	internal class StartOfRoundPatch
	{
		[HarmonyPatch(typeof(StartOfRound), "Start")]
		[HarmonyBefore(new string[] { "evaisa.lethallib" })]
		[HarmonyPostfix]
		private static void StartRound(ref StartOfRound __instance)
		{
			if (NetworkManager.Singleton.IsHost && (Object)(object)SawTapesNetworkManager.Instance == (Object)null)
			{
				GameObject val = Object.Instantiate<GameObject>(SawTapes.managerPrefab, ((Component)__instance).transform.parent);
				val.GetComponent<NetworkObject>().Spawn(false);
				SawTapes.mls.LogInfo((object)"Spawning SawTapesNetworkManager");
			}
			SawTapes.allEnemies.Clear();
			EnemyAI val2 = default(EnemyAI);
			foreach (EnemyType item in (from e in Resources.FindObjectsOfTypeAll<EnemyType>()
				where (Object)(object)e?.enemyPrefab != (Object)null && e.enemyPrefab.TryGetComponent<EnemyAI>(ref val2) && (Object)(object)val2 != (Object)null
				select e).Distinct())
			{
				SawTapes.allEnemies.Add(item);
			}
			SurvivalGameFile.LoadJSON();
			SubtitleFile.LoadJSON();
		}

		[HarmonyPatch(typeof(StartOfRound), "OnDisable")]
		[HarmonyPostfix]
		public static void OnDisable()
		{
			SawTapesNetworkManager.Instance = null;
		}

		[HarmonyPatch(typeof(StartOfRound), "OnPlayerConnectedClientRpc")]
		[HarmonyPostfix]
		private static void PlayerConnection(ref StartOfRound __instance)
		{
			PlayerControllerB[] allPlayerScripts = __instance.allPlayerScripts;
			foreach (PlayerControllerB player in allPlayerScripts)
			{
				PlayerSTManager.AddPlayerBehaviour(player);
			}
		}
	}
	internal class TilePatch
	{
		[HarmonyPatch(typeof(Tile), "OnTriggerEnter")]
		[HarmonyPrefix]
		private static void EnterTile(ref Tile __instance, Collider other)
		{
			TileSTManager.LogTileDebugInfo(__instance, other);
			TileSTManager.HandleTileBehaviour(__instance, other);
		}
	}
}
namespace SawTapes.Managers
{
	public class CustomPassManager : MonoBehaviour
	{
		public static WallhackCustomPass wallhackPass;

		public static CustomPassVolume customPassVolume;

		public static CustomPassVolume CustomPassVolume
		{
			get
			{
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)customPassVolume == (Object)null)
				{
					customPassVolume = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).gameObject.AddComponent<CustomPassVolume>();
					if ((Object)(object)customPassVolume != (Object)null)
					{
						customPassVolume.targetCamera = GameNetworkManager.Instance.localPlayerController.gameplayCamera;
						customPassVolume.injectionPoint = (CustomPassInjectionPoint)1;
						customPassVolume.isGlobal = true;
						wallhackPass = new WallhackCustomPass();
						customPassVolume.customPasses.Add((CustomPass)(object)wallhackPass);
					}
				}
				return customPassVolume;
			}
		}

		public static void SetupCustomPassForEnemy(EnemyAI enemy)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			LayerMask wallhackLayer = LayerMask.op_Implicit(524288);
			List<Renderer> list = (from r in ((Component)enemy).GetComponentsInChildren<Renderer>()
				where (LayerMask.op_Implicit(wallhackLayer) & (1 << ((Component)r).gameObject.layer)) != 0
				select r).ToList();
			if (list.Any((Renderer r) => ((Object)r).name.Contains("LOD")))
			{
				list.RemoveAll((Renderer r) => !((Object)r).name.Contains("LOD"));
			}
			if (list == null || list.Count == 0)
			{
				SawTapes.mls.LogError((object)("No renderer could be found on " + enemy.enemyType.enemyName + "."));
			}
			else
			{
				SetupCustomPass(list.ToArray());
			}
		}

		public static void SetupCustomPassForObject(GrabbableObject grabbableObject)
		{
			List<Renderer> list = ((Component)grabbableObject).GetComponentsInChildren<Renderer>().ToList();
			if (list == null || list.Count == 0)
			{
				SawTapes.mls.LogError((object)("No renderer could be found on " + grabbableObject.itemProperties.itemName + "."));
			}
			else
			{
				SetupCustomPass(list.ToArray());
			}
		}

		public static void SetupCustomPass(Renderer[] renderers)
		{
			if ((Object)(object)CustomPassVolume == (Object)null)
			{
				SawTapes.mls.LogError((object)"CustomPassVolume is not assigned.");
				return;
			}
			wallhackPass = CustomPassVolume.customPasses.Find((CustomPass pass) => pass is WallhackCustomPass) as WallhackCustomPass;
			if (wallhackPass == null)
			{
				SawTapes.mls.LogError((object)"WallhackCustomPass could not be found in CustomPassVolume.");
			}
			else
			{
				wallhackPass.SetTargetRenderers(renderers, SawTapes.wallhackShader);
			}
		}

		public static void RemoveAura()
		{
			wallhackPass?.ClearTargetRenderers();
		}
	}
	public class EnemySTManager
	{
		public static Vector3 GetFurthestPositionFromPlayer(PlayerControllerB player)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			return RoundManager.Instance.insideAINodes.OrderByDescending((GameObject n) => Vector3.Distance(((Component)player).transform.position, n.transform.position)).FirstOrDefault().transform.position;
		}

		public static NetworkObject SpawnEnemy(EnemyType enemyType, Vector3 spawnPosition)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(enemyType.enemyPrefab, spawnPosition, Quaternion.identity);
			NetworkObject componentInChildren = val.GetComponentInChildren<NetworkObject>();
			componentInChildren.Spawn(true);
			return componentInChildren;
		}

		public static void DespawnEnemy(NetworkObject spawnedEnemy)
		{
			//IL_0023: 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)
			EnemyAI componentInChildren = ((Component)spawnedEnemy).GetComponentInChildren<EnemyAI>();
			if ((Object)(object)componentInChildren != (Object)null && !componentInChildren.isEnemyDead)
			{
				SawTapesNetworkManager.Instance.PlayDespawnParticleClientRpc(((Component)spawnedEnemy).transform.position);
				NutcrackerEnemyAI val = (NutcrackerEnemyAI)(object)((componentInChildren is NutcrackerEnemyAI) ? componentInChildren : null);
				if (val != null && (Object)(object)val.gun != (Object)null)
				{
					SawTapesNetworkManager.Instance.DestroyObjectClientRpc(NetworkObjectReference.op_Implicit(((Component)val.gun).GetComponent<NetworkObject>()));
				}
				spawnedEnemy.Despawn(true);
			}
		}
	}
	public class HUDSTManager
	{
		public static TextMeshProUGUI CreateUIElement(string name, Vector2 anchorMin, Vector2 anchorMax, Vector2 pivot, Vector2 anchoredPosition, Vector2 sizeDelta, TextAlignmentOptions alignment)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_001d: 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_003e: 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_004c: 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)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = GameObject.Find("Systems/UI/Canvas/Panel/GameObject/PlayerScreen").transform;
			GameObject val = new GameObject(name);
			val.transform.localPosition = Vector3.zero;
			RectTransform val2 = val.AddComponent<RectTransform>();
			((Transform)val2).SetParent(transform, false);
			val2.anchorMin = anchorMin;
			val2.anchorMax = anchorMax;
			val2.pivot = pivot;
			val2.anchoredPosition = anchoredPosition;
			val2.sizeDelta = sizeDelta;
			TextMeshProUGUI val3 = val.AddComponent<TextMeshProUGUI>();
			((TMP_Text)val3).alignment = alignment;
			((TMP_Text)val3).font = ((TMP_Text)HUDManager.Instance.controlTipLines[0]).font;
			((TMP_Text)val3).fontSize = 14f;
			return val3;
		}
	}
	public class MapCameraSTManager
	{
		public static void UpdateMapCamera(ManualCameraRenderer mapScreen)
		{
			if (StartOfRound.Instance.shipHasLanded && (Object)(object)mapScreen.targetedPlayer != (Object)null)
			{
				PlayerSTBehaviour component = ((Component)StartOfRound.Instance.mapScreen.targetedPlayer).GetComponent<PlayerSTBehaviour>();
				if (component.isInGame)
				{
					((Behaviour)StartOfRound.Instance.mapScreenPlayerName).enabled = false;
					((Behaviour)StartOfRound.Instance.screenLevelDescription).enabled = true;
					((TMP_Text)StartOfRound.Instance.screenLevelDescription).text = mapScreen.targetedPlayer.playerUsername + " is playing a game";
				}
				else
				{
					((Behaviour)StartOfRound.Instance.mapScreenPlayerName).enabled = true;
					((Behaviour)StartOfRound.Instance.screenLevelDescription).enabled = false;
					((TMP_Text)StartOfRound.Instance.screenLevelDescription).text = "";
				}
			}
		}
	}
	public class ObjectSTManager
	{
		public static void SpawnBlackParticle(GrabbableObject grabbableObject)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			if (grabbableObject is SawTape || grabbableObject is Saw)
			{
				GameObject val = Object.Instantiate<GameObject>(SawTapes.tapeParticle, ((Component)grabbableObject).transform.position, Quaternion.identity);
				val.transform.SetParent(((Component)grabbableObject).transform);
				if (grabbableObject is SawTape sawTape)
				{
					sawTape.particleEffect = val;
				}
				else if (grabbableObject is Saw saw)
				{
					saw.particleEffect = val;
				}
			}
		}

		public static void EnableBlackParticle(GrabbableObject grabbableObject, bool enable)
		{
			if ((Object)(object)grabbableObject != (Object)null)
			{
				if (grabbableObject is SawTape sawTape && (Object)(object)sawTape.particleEffect != (Object)null)
				{
					sawTape.particleEffect.SetActive(enable);
				}
				else if (grabbableObject is Saw saw && (Object)(object)saw.particleEffect != (Object)null)
				{
					saw.particleEffect.SetActive(enable);
				}
			}
		}

		public static void ChangeObjectPosition(GrabbableObject grabbableObject, Vector3 position)
		{
			//IL_0015: 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)
			//IL_0028: 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 (!grabbableObject.isHeld)
			{
				grabbableObject.EnableItemMeshes(false);
				((Component)grabbableObject).transform.localPosition = position;
				((Component)grabbableObject).transform.position = position;
				grabbableObject.startFallingPosition = position;
				grabbableObject.FallToGround(false);
				grabbableObject.hasHitGround = false;
				grabbableObject.EnableItemMeshes(true);
				EnableBlackParticle(grabbableObject, enable: true);
			}
		}
	}
	public class PlayerSTManager
	{
		public static void AddPlayerBehaviour(PlayerControllerB player)
		{
			if (player.isPlayerControlled && (Object)(object)((Component)player).GetComponent<PlayerSTBehaviour>() == (Object)null)
			{
				PlayerSTBehaviour playerSTBehaviour = ((Component)player).gameObject.AddComponent<PlayerSTBehaviour>();
				playerSTBehaviour.playerProperties = player;
			}
		}

		public static IEnumerator SetUntargetablePlayerCoroutine(PlayerSTBehaviour playerBehaviour, float duration)
		{
			playerBehaviour.isTargetable = false;
			yield return (object)new WaitForSeconds(duration);
			playerBehaviour.isTargetable = true;
		}

		public static bool PreventTeleportPlayer(PlayerControllerB player)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: 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)
			PlayerSTBehaviour component = ((Component)player).GetComponent<PlayerSTBehaviour>();
			if ((Object)(object)component != (Object)null && component.isInGame && ((Object)(object)component.tileGame != (Object)null || component.hasBeenGassed))
			{
				player.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3));
				if ((Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					HUDManager.Instance.DisplayTip("Information", "You tried to cheat, the rules were clear", false, false, "LC_Tip1");
				}
				return true;
			}
			return false;
		}

		public static void ResetPlayerGame(PlayerSTBehaviour playerBehaviour)
		{
			playerBehaviour.campTime = 0;
			playerBehaviour.isInGame = false;
			playerBehaviour.tileGame = null;
			playerBehaviour.hasBeenGassed = false;
			playerBehaviour.huntingTape = null;
			playerBehaviour.escapeTape = null;
		}

		public static void SecondaryUsePerformed(PlayerSTBehaviour playerBehaviour)
		{
			int currentControlTipState = playerBehaviour.currentControlTipState;
			if (currentControlTipState != 0 && currentControlTipState == 1)
			{
				TeleportSawToPlayer(playerBehaviour);
			}
		}

		public static void TeleportSawToPlayer(PlayerSTBehaviour playerBehaviour)
		{
			//IL_002f: 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)
			//IL_0044: 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_0053: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)playerBehaviour.escapeTape?.saw != (Object)null)
			{
				SawTapesNetworkManager.Instance.ChangeObjectPositionServerRpc(NetworkObjectReference.op_Implicit(((Component)playerBehaviour.escapeTape.saw).GetComponent<NetworkObject>()), ((Component)playerBehaviour.playerProperties).transform.position + Vector3.up * 0.5f);
			}
		}
	}
	public class SawGameSTManager
	{
		public static void SpawnPathParticle(Vector3 position)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0070: 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_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(position + Vector3.up * 2f, Vector3.down, ref val, 10f))
			{
				position = ((RaycastHit)(ref val)).point;
			}
			GameObject val2 = Object.Instantiate<GameObject>(SawTapes.pathParticle, position, Quaternion.Euler(-90f, 0f, 0f));
			ParticleSystem component = val2.GetComponent<ParticleSystem>();
			MainModule main = component.main;
			float duration = ((MainModule)(ref main)).duration;
			main = component.main;
			MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime;
			Object.Destroy((Object)(object)val2, duration + ((MinMaxCurve)(ref startLifetime)).constantMax);
		}

		public static void PlayerEndPathGuide(PlayerSTBehaviour playerBehaviour)
		{
			if ((Object)(object)playerBehaviour.playerProperties == (Object)(object)GameNetworkManager.Instance.localPlayerController && playerBehaviour.currentControlTipState != 1)
			{
				playerBehaviour.currentControlTipState = 1;
				HUDManager.Instance.ChangeControlTip(0, "Attract Saw : [Q]", true);
			}
		}

		public static void DespawnHazard(GameObject hazard)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)hazard == (Object)null) && !((Object)(object)hazard.transform == (Object)null))
			{
				SawTapesNetworkManager.Instance.PlayDespawnParticleClientRpc(hazard.transform.position);
				hazard.GetComponent<NetworkObject>().Despawn(true);
			}
		}
	}
	public class SawTapesNetworkManager : NetworkBehaviour
	{
		public static SawTapesNetworkManager Instance;

		public void Awake()
		{
			Instance = this;
		}

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

		[ClientRpc]
		public void SetScrapValueClientRpc(NetworkObjectReference obj, int value)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2854845142u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					BytePacker.WriteValueBitPacked(val2, value);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2854845142u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null))
				{
					GrabbableObject componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<GrabbableObject>();
					componentInChildren.SetScrapValue(value);
				}
			}
		}

		[ClientRpc]
		public void SpawnBlackParticleClientRpc(NetworkObjectReference obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3242098891u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3242098891u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null))
				{
					GrabbableObject componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<GrabbableObject>();
					ObjectSTManager.SpawnBlackParticle(componentInChildren);
				}
			}
		}

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

		[ClientRpc]
		public void OpenTileDoorsClientRpc(int playerId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4004738587u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4004738587u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					PlayerSTBehaviour componentInChildren = StartOfRound.Instance.allPlayerObjects[playerId].GetComponentInChildren<PlayerSTBehaviour>();
					TileSTManager.OpenTileDoors(componentInChildren);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ChangeObjectPositionServerRpc(NetworkObjectReference obj, 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_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(603606525u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 603606525u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ChangeObjectPositionClientRpc(obj, position);
				}
			}
		}

		[ClientRpc]
		public void ChangeObjectPositionClientRpc(NetworkObjectReference obj, 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_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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)
			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(2827975664u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2827975664u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null))
				{
					GrabbableObject componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<GrabbableObject>();
					ObjectSTManager.ChangeObjectPosition(componentInChildren, position);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void EnableBlackParticleServerRpc(NetworkObjectReference obj, bool enable)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: 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(1935419068u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enable, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1935419068u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					EnableBlackParticleClientRpc(obj, enable);
				}
			}
		}

		[ClientRpc]
		public void EnableBlackParticleClientRpc(NetworkObjectReference obj, bool enable)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(420288302u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enable, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 420288302u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null))
				{
					GrabbableObject componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<GrabbableObject>();
					ObjectSTManager.EnableBlackParticle(componentInChildren, enable);
				}
			}
		}

		[ClientRpc]
		public void AddTileInfosClientRpc(Vector3 tilePos, Vector3[] doorsPos, NetworkObjectReference[] entrancesObj, NetworkObjectReference obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: 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(4233735192u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref tilePos);
				bool flag = doorsPos != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(doorsPos);
				}
				bool flag2 = entrancesObj != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives));
				if (flag2)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(entrancesObj, default(ForNetworkSerializable));
				}
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4233735192u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				TileSTManager.AddTileInfos(tilePos, doorsPos, entrancesObj, obj);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void DestroyObjectServerRpc(NetworkObjectReference obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_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 != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3111254174u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3111254174u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					DestroyObjectClientRpc(obj);
				}
			}
		}

		[ClientRpc]
		public void DestroyObjectClientRpc(NetworkObjectReference obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2084577577u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2084577577u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null))
				{
					GrabbableObject componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<GrabbableObject>();
					componentInChildren.DestroyObjectInHand(componentInChildren.playerHeldBy);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void KillPlayerServerRpc(int playerId, Vector3 velocity, bool spawnBody, int causeOfDeath)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: 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(2527174329u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref velocity);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref spawnBody, default(ForPrimitives));
					BytePacker.WriteValueBitPacked(val2, causeOfDeath);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2527174329u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					KillPlayerClientRpc(playerId, velocity, spawnBody, causeOfDeath);
				}
			}
		}

		[ClientRpc]
		public void KillPlayerClientRpc(int playerId, Vector3 velocity, bool spawnBody, int causeOfDeath)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: 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)
			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(998721621u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref velocity);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref spawnBody, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, causeOfDeath);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 998721621u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>();
				if ((Object)(object)component == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					component.KillPlayer(velocity, spawnBody, (CauseOfDeath)causeOfDeath, 0, default(Vector3));
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SpawnSawKeyServerRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: 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(3499751603u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3499751603u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					RoundManagerPatch.SpawnItem(SawTapes.sawKeyObj, position);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SpawnPursuerEyeServerRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: 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(1100417780u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1100417780u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					RoundManagerPatch.SpawnItem(SawTapes.pursuerEyeObj, position);
				}
			}
		}

		[ClientRpc]
		public void PlayDespawnParticleClientRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: 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(3869059331u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3869059331u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					GameObject val3 = Object.Instantiate<GameObject>(SawTapes.despawnParticle, position, Quaternion.identity);
					ParticleSystem component = val3.GetComponent<ParticleSystem>();
					MainModule main = component.main;
					float duration = ((MainModule)(ref main)).duration;
					main = component.main;
					MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime;
					Object.Destroy((Object)(object)val3, duration + ((MinMaxCurve)(ref startLifetime)).constantMax);
				}
			}
		}

		[ClientRpc]
		public void PlayerEndPathGuideClientRpc(int playerId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2123486123u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2123486123u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					PlayerSTBehaviour componentInChildren = StartOfRound.Instance.allPlayerObjects[playerId].GetComponentInChildren<PlayerSTBehaviour>();
					SawGameSTManager.PlayerEndPathGuide(componentInChildren);
				}
			}
		}

		[ClientRpc]
		public void SpawnPathParticleClientRpc(Vector3 leftPosition, Vector3 rightPosition, int[] playerIds)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Invalid comparison between Unknown and I4
			//IL_005f: Unkn