Decompiled source of Brutal Company Minus v0.13.10

BrutalCompanyMinus.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using BrutalCompanyMinus;
using BrutalCompanyMinus.Minus;
using BrutalCompanyMinus.Minus.CustomEvents;
using BrutalCompanyMinus.Minus.Events;
using BrutalCompanyMinus.Minus.Handlers;
using BrutalCompanyMinus.Minus.MonoBehaviours;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Animations.Rigging;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using com.github.zehsteam.ToilHead;
using com.github.zehsteam.ToilHead.MonoBehaviours;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("BrutalCompanyMinus")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+cc9746be7f2b6368a6e71003da9f59e14eaaf709")]
[assembly: AssemblyProduct("BrutalCompanyMinus")]
[assembly: AssemblyTitle("BrutalCompanyMinus")]
[assembly: AssemblyVersion("1.0.0.0")]
internal class <Module>
{
	static <Module>()
	{
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedINetworkSerializable<Weather>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<Weather>();
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedINetworkSerializable<OutsideObjectsToSpawn>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<OutsideObjectsToSpawn>();
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedINetworkSerializable<CurrentWeatherEffect>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<CurrentWeatherEffect>();
		NetworkVariableSerializationTypes.InitializeSerializer_FixedString<FixedString4096Bytes>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<FixedString4096Bytes>();
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace BrutalCompanyMinus
{
	[HarmonyPatch]
	public class Assets
	{
		public enum EnemyName
		{
			Bracken,
			HoardingBug,
			CoilHead,
			Thumper,
			BunkerSpider,
			Jester,
			SnareFlea,
			Hygrodere,
			GhostGirl,
			SporeLizard,
			NutCracker,
			Masked,
			EyelessDog,
			ForestKeeper,
			EarthLeviathan,
			BaboonHawk,
			RoamingLocust,
			Manticoil,
			CircuitBee,
			Lasso,
			Butler,
			OldBird,
			FlowerSnake
		}

		public enum ItemName
		{
			LargeAxle,
			V_TypeEngine,
			PlasticFish,
			MetalSheet,
			LaserPointer,
			BigBolt,
			Bottles,
			Ring,
			SteeringWheel,
			CookieMoldPan,
			EggBeater,
			JarOfPickles,
			DustPan,
			AirHorn,
			ClownHorn,
			CashRegister,
			Candy,
			GoldBar,
			YieldSign,
			HomemadeFlashbang,
			Gift,
			Flask,
			ToyCube,
			Remote,
			ToyRobot,
			MagnifyingGlass,
			StopSign,
			TeaKettle,
			Mug,
			RedSoda,
			OldPhone,
			HairDryer,
			Brush,
			Bell,
			WhoopieCushion,
			Comedy,
			Tragedy,
			RubberDucky,
			ChemicalJug,
			FancyLamp,
			GoldenCup,
			Painting,
			Toothpaste,
			PillBottle,
			PerfumeBottle,
			Teeth,
			Magic7Ball,
			EasterEgg
		}

		public enum ObjectName
		{
			LargeRock1,
			LargeRock2,
			LargeRock3,
			LargeRock4,
			TreeLeaflessBrown1,
			GiantPumkin,
			GreyRockGrouping2,
			GreyRockGrouping4,
			Tree,
			TreeLeafless2,
			TreeLeafless3,
			Landmine,
			Turret,
			SpikeRoofTrap
		}

		public enum AtmosphereName
		{
			RollingGroundFog,
			Rainy,
			Stormy,
			Foggy,
			Flooded,
			Exclipsed
		}

		internal static AssetBundle bundle;

		internal static AssetBundle customAssetBundle;

		public static Dictionary<EnemyName, string> EnemyNameList = new Dictionary<EnemyName, string>
		{
			{
				EnemyName.SnareFlea,
				"Centipede"
			},
			{
				EnemyName.BunkerSpider,
				"SandSpider"
			},
			{
				EnemyName.HoardingBug,
				"HoarderBug"
			},
			{
				EnemyName.Bracken,
				"Flowerman"
			},
			{
				EnemyName.Thumper,
				"Crawler"
			},
			{
				EnemyName.Hygrodere,
				"Blob"
			},
			{
				EnemyName.GhostGirl,
				"DressGirl"
			},
			{
				EnemyName.SporeLizard,
				"Puffer"
			},
			{
				EnemyName.NutCracker,
				"Nutcracker"
			},
			{
				EnemyName.EyelessDog,
				"MouthDog"
			},
			{
				EnemyName.ForestKeeper,
				"ForestGiant"
			},
			{
				EnemyName.EarthLeviathan,
				"SandWorm"
			},
			{
				EnemyName.CircuitBee,
				"RedLocustBees"
			},
			{
				EnemyName.BaboonHawk,
				"BaboonHawk"
			},
			{
				EnemyName.CoilHead,
				"SpringMan"
			},
			{
				EnemyName.Jester,
				"Jester"
			},
			{
				EnemyName.Lasso,
				"LassoMan"
			},
			{
				EnemyName.Masked,
				"MaskedPlayerEnemy"
			},
			{
				EnemyName.Manticoil,
				"Doublewing"
			},
			{
				EnemyName.RoamingLocust,
				"DocileLocustBees"
			},
			{
				EnemyName.Butler,
				"Butler"
			},
			{
				EnemyName.OldBird,
				"RadMech"
			},
			{
				EnemyName.FlowerSnake,
				"FlowerSnake"
			}
		};

		public static Dictionary<ItemName, string> ItemNameList = new Dictionary<ItemName, string>
		{
			{
				ItemName.LargeAxle,
				"Cog1"
			},
			{
				ItemName.V_TypeEngine,
				"EnginePart1"
			},
			{
				ItemName.PlasticFish,
				"FishTestProp"
			},
			{
				ItemName.MetalSheet,
				"MetalSheet"
			},
			{
				ItemName.LaserPointer,
				"FlashLaserPointer"
			},
			{
				ItemName.BigBolt,
				"BigBolt"
			},
			{
				ItemName.Bottles,
				"BottleBin"
			},
			{
				ItemName.Ring,
				"Ring"
			},
			{
				ItemName.SteeringWheel,
				"SteeringWheel"
			},
			{
				ItemName.CookieMoldPan,
				"MoldPan"
			},
			{
				ItemName.EggBeater,
				"EggBeater"
			},
			{
				ItemName.JarOfPickles,
				"PickleJar"
			},
			{
				ItemName.DustPan,
				"DustPan"
			},
			{
				ItemName.AirHorn,
				"Airhorn"
			},
			{
				ItemName.ClownHorn,
				"ClownHorn"
			},
			{
				ItemName.CashRegister,
				"CashRegister"
			},
			{
				ItemName.Candy,
				"Candy"
			},
			{
				ItemName.GoldBar,
				"GoldBar"
			},
			{
				ItemName.YieldSign,
				"YieldSign"
			},
			{
				ItemName.HomemadeFlashbang,
				"DiyFlashbang"
			},
			{
				ItemName.Gift,
				"GiftBox"
			},
			{
				ItemName.Flask,
				"Flask"
			},
			{
				ItemName.ToyCube,
				"ToyCube"
			},
			{
				ItemName.Remote,
				"Remote"
			},
			{
				ItemName.ToyRobot,
				"RobotToy"
			},
			{
				ItemName.MagnifyingGlass,
				"MagnifyingGlass"
			},
			{
				ItemName.StopSign,
				"StopSign"
			},
			{
				ItemName.TeaKettle,
				"TeaKettle"
			},
			{
				ItemName.Mug,
				"Mug"
			},
			{
				ItemName.RedSoda,
				"SodaCanRed"
			},
			{
				ItemName.OldPhone,
				"Phone"
			},
			{
				ItemName.HairDryer,
				"Hairdryer"
			},
			{
				ItemName.Brush,
				"Brush"
			},
			{
				ItemName.Bell,
				"Bell"
			},
			{
				ItemName.WhoopieCushion,
				"WhoopieCushion"
			},
			{
				ItemName.Comedy,
				"ComedyMask"
			},
			{
				ItemName.Tragedy,
				"TragedyMask"
			},
			{
				ItemName.RubberDucky,
				"RubberDuck"
			},
			{
				ItemName.ChemicalJug,
				"ChemicalJug"
			},
			{
				ItemName.FancyLamp,
				"FancyLamp"
			},
			{
				ItemName.Painting,
				"FancyPainting"
			},
			{
				ItemName.GoldenCup,
				"FancyCup"
			},
			{
				ItemName.Toothpaste,
				"Toothpaste"
			},
			{
				ItemName.PillBottle,
				"PillBottle"
			},
			{
				ItemName.PerfumeBottle,
				"PerfumeBottle"
			},
			{
				ItemName.Teeth,
				"Dentures"
			},
			{
				ItemName.Magic7Ball,
				"7Ball"
			},
			{
				ItemName.EasterEgg,
				"EasterEgg"
			}
		};

		public static Dictionary<ObjectName, string> ObjectNameList = new Dictionary<ObjectName, string>
		{
			{
				ObjectName.LargeRock1,
				"LargeRock1"
			},
			{
				ObjectName.LargeRock2,
				"LargeRock2"
			},
			{
				ObjectName.LargeRock3,
				"LargeRock3"
			},
			{
				ObjectName.LargeRock4,
				"LargeRock4"
			},
			{
				ObjectName.GreyRockGrouping2,
				"GreyRockGrouping2"
			},
			{
				ObjectName.GreyRockGrouping4,
				"GreyRockGrouping4"
			},
			{
				ObjectName.GiantPumkin,
				"GiantPumpkin"
			},
			{
				ObjectName.Tree,
				"tree"
			},
			{
				ObjectName.TreeLeaflessBrown1,
				"treeLeaflessBrown.001 Variant"
			},
			{
				ObjectName.TreeLeafless2,
				"treeLeafless.002_LOD0"
			},
			{
				ObjectName.TreeLeafless3,
				"treeLeafless.003_LOD0"
			},
			{
				ObjectName.Landmine,
				"Landmine"
			},
			{
				ObjectName.Turret,
				"TurretContainer"
			},
			{
				ObjectName.SpikeRoofTrap,
				"SpikeRoofTrapHazard"
			}
		};

		public static Dictionary<AtmosphereName, string> AtmosphereNameList = new Dictionary<AtmosphereName, string>
		{
			{
				AtmosphereName.RollingGroundFog,
				"rolling ground fog"
			},
			{
				AtmosphereName.Rainy,
				"rainy"
			},
			{
				AtmosphereName.Stormy,
				"stormy"
			},
			{
				AtmosphereName.Foggy,
				"foggy"
			},
			{
				AtmosphereName.Flooded,
				"flooded"
			},
			{
				AtmosphereName.Exclipsed,
				"eclipsed"
			}
		};

		public static Dictionary<string, EnemyType> EnemyList = new Dictionary<string, EnemyType>();

		public static Dictionary<string, Item> ItemList = new Dictionary<string, Item>();

		public static Dictionary<string, GameObject> ObjectList = new Dictionary<string, GameObject>();

		internal static List<float> factorySizeMultiplierList = new List<float>();

		internal static List<SpawnableMapObject[]> spawnableMapObjects = new List<SpawnableMapObject[]>();

		internal static List<float> averageScrapValueList = new List<float>();

		internal static List<AnimationCurve> insideSpawnChanceCurves = new List<AnimationCurve>();

		internal static List<AnimationCurve> outsideSpawnChanceCurves = new List<AnimationCurve>();

		internal static List<AnimationCurve> daytimeSpawnChanceCurves = new List<AnimationCurve>();

		internal static List<int> insideMaxPowerCounts = new List<int>();

		internal static List<int> outsideMaxPowerCounts = new List<int>();

		internal static List<int> daytimeMaxPowerCounts = new List<int>();

		internal static StormyWeather stormy;

		internal static FloodWeather flooded;

		public static EnemyType antiCoilHead;

		public static EnemyType nutSlayer;

		public static EnemyType kamikazieBug;

		public static EnemyType demolitionist;

		public static Item slayerShotgun;

		public static Item grabbableTurret;

		public static Item grabbableLandmine;

		public static Item greatHammer;

		public static GameObject artilleryShell;

		public static GameObject artillerySirens;

		public static GameObject bunkerEntrance;

		public static GameObject bunkerEscape;

		public static GameObject teleportAudio;

		public static GameObject bloodRain;

		private static bool generatedList = false;

		private static bool generatedOrignalValuesList = false;

		internal static GameObject hangarShip => GameObject.Find("/Environment/HangarShip");

		[HarmonyPostfix]
		[HarmonyPatch(typeof(GameNetworkManager), "Start")]
		private static void GenerateCustom()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Expected O, but got Unknown
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Expected O, but got Unknown
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Expected O, but got Unknown
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Expected O, but got Unknown
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Expected O, but got Unknown
			antiCoilHead = (EnemyType)customAssetBundle.LoadAsset("AntiCoilHead");
			nutSlayer = (EnemyType)customAssetBundle.LoadAsset("NutSlayer");
			kamikazieBug = (EnemyType)customAssetBundle.LoadAsset("KamikazieBug");
			slayerShotgun = (Item)customAssetBundle.LoadAsset("SlayerShotgun");
			grabbableTurret = (Item)customAssetBundle.LoadAsset("GrabbableTurret");
			grabbableLandmine = (Item)customAssetBundle.LoadAsset("GrabbableLandmine");
			greatHammer = (Item)customAssetBundle.LoadAsset("GreatHammer");
			artilleryShell = (GameObject)customAssetBundle.LoadAsset("ArtilleryShell");
			artillerySirens = (GameObject)customAssetBundle.LoadAsset("DDay");
			bunkerEntrance = (GameObject)customAssetBundle.LoadAsset("BunkerEntrance");
			bunkerEscape = (GameObject)customAssetBundle.LoadAsset("BunkerEscape");
			teleportAudio = (GameObject)customAssetBundle.LoadAsset("TeleportAudioSource");
			bloodRain = (GameObject)customAssetBundle.LoadAsset("BloodRainParticleContainer");
			RegisterNetworkPrefabs(antiCoilHead.enemyPrefab, nutSlayer.enemyPrefab, kamikazieBug.enemyPrefab, slayerShotgun.spawnPrefab, grabbableTurret.spawnPrefab, grabbableLandmine.spawnPrefab, artillerySirens, bunkerEntrance, bunkerEscape, greatHammer.spawnPrefab);
		}

		private static void RegisterNetworkPrefabs(params GameObject[] objects)
		{
			foreach (GameObject val in objects)
			{
				NetworkManager.Singleton.AddNetworkPrefab(val);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(TimeOfDay), "Start")]
		private static void OnTimeOfODayStart(ref TimeOfDay __instance)
		{
			//IL_003a: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			GameObject val = Object.Instantiate<GameObject>(bloodRain);
			LocalVolumetricFog component = ((Component)val.transform.Find("Foggy")).GetComponent<LocalVolumetricFog>();
			component.parameters.albedo = new Color(0.25f, 0.35f, 0.55f, 1f);
			component.parameters.meanFreePath = 80f;
			component.parameters.size.y = 255f;
			__instance.effects = __instance.effects.Add(new WeatherEffect
			{
				name = "bloodyrain",
				effectObject = val,
				effectPermanentObject = null,
				lerpPosition = false,
				effectEnabled = false
			});
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(StartOfRound), "Start")]
		private static void OnStartOfRoundStart()
		{
			StartOfRound.Instance.allItemsList.itemsList.AddRange(new List<Item> { slayerShotgun, grabbableTurret, grabbableLandmine, greatHammer });
		}

		internal static void Load()
		{
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("BrutalCompanyMinus.Asset.bcm_assets"))
			{
				bundle = AssetBundle.LoadFromStream(stream);
			}
			using (Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("BrutalCompanyMinus.Asset.bcm_customassets"))
			{
				customAssetBundle = AssetBundle.LoadFromStream(stream2);
			}
			SceneManager.sceneLoaded += OnSceneLoaded;
		}

		private static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			if ((Object)(object)StartOfRound.Instance == (Object)null)
			{
				return;
			}
			StormyWeather[] array = Resources.FindObjectsOfTypeAll<StormyWeather>().Concat(Object.FindObjectsByType<StormyWeather>((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray();
			FloodWeather[] array2 = Resources.FindObjectsOfTypeAll<FloodWeather>().Concat(Object.FindObjectsByType<FloodWeather>((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray();
			if (array.Length != 0)
			{
				stormy = array[0];
			}
			if (array2.Length != 0)
			{
				flooded = array2[0];
			}
			if (generatedList)
			{
				return;
			}
			Log.LogInfo("Generating 'EnemyList'");
			EnemyType[] array3 = Resources.FindObjectsOfTypeAll<EnemyType>().Concat(Object.FindObjectsByType<EnemyType>((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray();
			Array.Reverse(array3);
			array3 = (from x in array3
				group x by ((Object)x).name into x
				select x.FirstOrDefault()).ToArray();
			for (int i = 0; i < array3.Length; i++)
			{
				if ((Object)(object)array3[i].enemyPrefab == (Object)null)
				{
					Log.LogWarning($"Enemy:{((Object)array3[i]).name}, prefab is null, this may cause issues...");
				}
				EnemyList.Add(((Object)array3[i]).name, array3[i]);
			}
			EnemyList.Remove("RedPillEnemyType");
			foreach (KeyValuePair<string, EnemyType> enemy in EnemyList)
			{
				bool flag = false;
				foreach (KeyValuePair<EnemyName, string> enemyName in EnemyNameList)
				{
					if (enemy.Key == enemyName.Value)
					{
						flag = true;
						break;
					}
				}
				if (!flag)
				{
					Log.LogWarning($"Enemy:'{enemy.Key}', isn't matched with enum, this may cause issues...");
				}
			}
			Log.LogInfo($"Finished generating 'EnemyList', Count:{EnemyList.Count}");
			Log.LogInfo("Generating 'ItemList'");
			Item[] array4 = Resources.FindObjectsOfTypeAll<Item>().Concat(Object.FindObjectsByType<Item>((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray();
			Array.Reverse(array4);
			array4 = (from x in array4
				group x by ((Object)x).name into x
				select x.FirstOrDefault()).ToArray();
			for (int j = 0; j < array4.Length; j++)
			{
				if ((Object)(object)array4[j].spawnPrefab == (Object)null)
				{
					Log.LogWarning($"Item:{((Object)array4[j]).name}, prefab is null, this may cause issues...");
				}
				ItemList.Add(((Object)array4[j]).name, array4[j]);
			}
			foreach (KeyValuePair<string, Item> item in ItemList)
			{
				bool flag2 = false;
				foreach (KeyValuePair<ItemName, string> itemName in ItemNameList)
				{
					if (item.Key == itemName.Value)
					{
						flag2 = true;
						break;
					}
				}
				if (!flag2)
				{
					Log.LogWarning($"Item:'{item.Key}', isn't matched with enum, this may cause issues...");
				}
			}
			Log.LogInfo($"Finished generating 'ItemList', Count:{ItemList.Count}");
			Log.LogInfo("Generating 'ObjectList'");
			List<SpawnableMapObject> list = new List<SpawnableMapObject>();
			List<SpawnableOutsideObjectWithRarity> list2 = new List<SpawnableOutsideObjectWithRarity>();
			SelectableLevel[] levels = StartOfRound.Instance.levels;
			foreach (SelectableLevel val in levels)
			{
				if ((Object)(object)val == (Object)null || val.spawnableMapObjects == null)
				{
					continue;
				}
				SpawnableMapObject[] array5 = val.spawnableMapObjects;
				foreach (SpawnableMapObject obj2 in array5)
				{
					if (obj2 != null && !((Object)(object)obj2.prefabToSpawn == (Object)null) && list.FindIndex((SpawnableMapObject o) => ((Object)o.prefabToSpawn).name == ((Object)obj2.prefabToSpawn).name) < 0)
					{
						list.Add(obj2);
					}
				}
				SpawnableOutsideObjectWithRarity[] spawnableOutsideObjects = val.spawnableOutsideObjects;
				foreach (SpawnableOutsideObjectWithRarity obj in spawnableOutsideObjects)
				{
					if (obj != null && !((Object)(object)obj.spawnableObject == (Object)null) && !((Object)(object)obj.spawnableObject.prefabToSpawn == (Object)null) && list2.FindIndex((SpawnableOutsideObjectWithRarity o) => ((Object)o.spawnableObject.prefabToSpawn).name == ((Object)obj.spawnableObject.prefabToSpawn).name) < 0)
					{
						list2.Add(obj);
					}
				}
			}
			foreach (SpawnableMapObject item2 in list)
			{
				ObjectList.Add(((Object)item2.prefabToSpawn).name, item2.prefabToSpawn);
			}
			foreach (SpawnableOutsideObjectWithRarity item3 in list2)
			{
				ObjectList.Add(((Object)item3.spawnableObject.prefabToSpawn).name, item3.spawnableObject.prefabToSpawn);
			}
			foreach (KeyValuePair<string, GameObject> @object in ObjectList)
			{
				bool flag3 = false;
				foreach (KeyValuePair<ObjectName, string> objectName in ObjectNameList)
				{
					if (@object.Key == objectName.Value)
					{
						flag3 = true;
						break;
					}
				}
				if (!flag3)
				{
					Log.LogWarning($"Object:'{@object.Key}', isn't matched with enum, this may cause issues...");
				}
			}
			Log.LogInfo($"Finished generating 'ObjectList', Count:{ObjectList.Count}");
			Log.LogInfo($"Map Count:{factorySizeMultiplierList.Count}");
			Log.LogInfo("Generating configuration");
			Configuration.CreateConfig();
			generatedList = true;
		}

		internal static void generateOriginalValuesLists()
		{
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Expected O, but got Unknown
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected O, but got Unknown
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Expected O, but got Unknown
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			if (generatedOrignalValuesList)
			{
				return;
			}
			SelectableLevel[] levels = StartOfRound.Instance.levels;
			foreach (SelectableLevel val in levels)
			{
				factorySizeMultiplierList.Add(val.factorySizeMultiplier);
				List<SpawnableItemWithRarity> list = new List<SpawnableItemWithRarity>();
				list.AddRange(val.spawnableScrap);
				float num = 0f;
				float num2 = 0f;
				foreach (SpawnableItemWithRarity item in list)
				{
					num += (float)((item.spawnableItem.minValue + item.spawnableItem.maxValue) * item.rarity);
					num2 += (float)item.rarity;
				}
				if (num2 != 0f)
				{
					averageScrapValueList.Add(num / (num2 * 2f));
				}
				else
				{
					averageScrapValueList.Add(80f);
				}
				AnimationCurve val2 = new AnimationCurve();
				AnimationCurve val3 = new AnimationCurve();
				AnimationCurve val4 = new AnimationCurve();
				Keyframe[] keys = val.enemySpawnChanceThroughoutDay.keys;
				foreach (Keyframe val5 in keys)
				{
					val2.AddKey(val5);
				}
				keys = val.outsideEnemySpawnChanceThroughDay.keys;
				foreach (Keyframe val6 in keys)
				{
					val3.AddKey(val6);
				}
				keys = val.daytimeEnemySpawnChanceThroughDay.keys;
				foreach (Keyframe val7 in keys)
				{
					val4.AddKey(val7);
				}
				insideSpawnChanceCurves.Add(val2);
				outsideSpawnChanceCurves.Add(val3);
				daytimeSpawnChanceCurves.Add(val4);
				insideMaxPowerCounts.Add(val.maxEnemyPowerCount);
				outsideMaxPowerCounts.Add(val.maxOutsideEnemyPowerCount);
				daytimeMaxPowerCounts.Add(val.maxDaytimeEnemyPowerCount);
				spawnableMapObjects.Add(val.spawnableMapObjects);
			}
			generatedOrignalValuesList = true;
		}

		public static EnemyType GetEnemy(EnemyName name)
		{
			return GetEnemy(EnemyNameList[name]);
		}

		public static EnemyType GetEnemy(string name)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			if (EnemyList.TryGetValue(name, out EnemyType value))
			{
				return value;
			}
			Log.LogWarning("GetEnemy(" + name + ") failed, returning an empty enemy type");
			return new EnemyType
			{
				enemyName = name,
				name = name
			};
		}

		public static EnemyType GetEnemyOrDefault(string name)
		{
			if (EnemyList.TryGetValue(name, out EnemyType value))
			{
				return value;
			}
			Log.LogWarning("GetEnemyOrDefault(" + name + ") failed, returning kamikazie bug.");
			return kamikazieBug;
		}

		public static Item GetItem(ItemName name)
		{
			return GetItem(ItemNameList[name]);
		}

		public static Item GetItem(string name)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			if (ItemList.TryGetValue(name, out Item value))
			{
				return value;
			}
			Log.LogWarning("GetItem(" + name + ") failed, returning an empty item");
			return new Item
			{
				itemName = name,
				name = name
			};
		}

		public static GameObject GetObject(ObjectName name)
		{
			return GetObject(ObjectNameList[name]);
		}

		public static GameObject GetObject(string name)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			if (ObjectList.TryGetValue(name, out GameObject value))
			{
				return value;
			}
			Log.LogWarning("GetObject(" + name + " failed, returning empty gameObject");
			return new GameObject(name);
		}
	}
	[HarmonyPatch]
	public class Net : NetworkBehaviour
	{
		public NetworkList<Weather> currentWeatherMultipliers;

		public NetworkList<OutsideObjectsToSpawn> outsideObjectsToSpawn;

		public NetworkList<CurrentWeatherEffect> currentWeatherEffects;

		public NetworkVariable<FixedString4096Bytes> textUI = new NetworkVariable<FixedString4096Bytes>(default(FixedString4096Bytes), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		public bool receivedSyncedValues;

		public List<GameObject> objectsToSpawn = new List<GameObject>();

		public List<int> objectsToSpawnAmount = new List<int>();

		public List<float> objectsToSpawnRadius = new List<float>();

		public List<Vector3> objectsToSpawnOffsets = new List<Vector3>();

		private float currentIntervalTime;

		public int _seed = 49;

		public static Net Instance { get; private set; }

		public static GameObject netObject { get; private set; }

		private void Awake()
		{
			currentWeatherMultipliers = new NetworkList<Weather>();
			outsideObjectsToSpawn = new NetworkList<OutsideObjectsToSpawn>();
			currentWeatherEffects = new NetworkList<CurrentWeatherEffect>();
		}

		private void Update()
		{
			//IL_00e7: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			if (currentIntervalTime > 0f)
			{
				currentIntervalTime -= Time.deltaTime;
			}
			else
			{
				currentIntervalTime = 0.5f;
				if (currentWeatherEffects.Count > 0)
				{
					foreach (CurrentWeatherEffect currentWeatherEffect in currentWeatherEffects)
					{
						PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
						if (!((Object)(object)localPlayerController == (Object)null))
						{
							if (localPlayerController.isPlayerDead)
							{
								UpdateAtmosphere(currentWeatherEffect.name, state: false);
							}
							else if (!localPlayerController.isInsideFactory)
							{
								UpdateAtmosphere(currentWeatherEffect.name, currentWeatherEffect.state);
							}
							else
							{
								UpdateAtmosphere(currentWeatherEffect.name, state: false);
							}
						}
					}
				}
			}
			if (objectsToSpawn.Count > 0)
			{
				Manager.Spawn.DoSpawnOutsideObjects(objectsToSpawnAmount[0], objectsToSpawnRadius[0], objectsToSpawnOffsets[0], objectsToSpawn[0]);
				objectsToSpawn.RemoveAt(0);
				objectsToSpawnAmount.RemoveAt(0);
				objectsToSpawnRadius.RemoveAt(0);
				objectsToSpawnOffsets.RemoveAt(0);
			}
		}

		public override void OnNetworkSpawn()
		{
			Instance = this;
			UI.SpawnObject();
			if (((NetworkBehaviour)this).IsServer)
			{
				InitalizeCurrentWeatherMultipliersServerRpc();
			}
			((NetworkBehaviour)this).OnNetworkSpawn();
		}

		public override void OnNetworkDespawn()
		{
			UI.Instance.UnsubscribeFromKeyboardEvent();
			Object.Destroy((Object)(object)GameObject.Find("EventGUI"));
			((NetworkBehaviour)this).OnNetworkDespawn();
		}

		[ServerRpc]
		public FixedString4096Bytes GetSyncedTextServerRpc()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return textUI.Value;
		}

		[ServerRpc(RequireOwnership = false)]
		public int GiveSeed()
		{
			return _seed++;
		}

		[ClientRpc]
		public void ClearGameObjectsClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(174694319u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 174694319u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			for (int i = 0; i != Manager.objectsToClear.Count; i++)
			{
				if (!((Object)(object)Manager.objectsToClear[i] != (Object)null))
				{
					continue;
				}
				NetworkObject component = Manager.objectsToClear[i].GetComponent<NetworkObject>();
				if ((Object)(object)component != (Object)null)
				{
					try
					{
						component.Despawn(true);
					}
					catch
					{
					}
				}
				else
				{
					try
					{
						Object.Destroy((Object)(object)Manager.objectsToClear[i]);
					}
					catch
					{
					}
				}
			}
			Manager.objectsToClear.Clear();
		}

		[ClientRpc]
		public void SyncValuesClientRpc(float factorySizeMultiplier, float scrapValueMultiplier, float scrapAmountMultiplier, int bonusMaxHp)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: 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_00b3: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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(2150416984u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref factorySizeMultiplier, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref scrapValueMultiplier, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref scrapAmountMultiplier, default(ForPrimitives));
					BytePacker.WriteValueBitPacked(val2, bonusMaxHp);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2150416984u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					RoundManager.Instance.currentLevel.factorySizeMultiplier = factorySizeMultiplier;
					Manager.bonusEnemyHp = bonusMaxHp;
					receivedSyncedValues = true;
				}
			}
		}

		[ServerRpc]
		public void SyncScrapValueServerRpc(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_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Invalid comparison between Unknown and I4
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(875794818u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				BytePacker.WriteValueBitPacked(val2, value);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 875794818u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				SyncScrapValueClientRpc(obj, value);
			}
		}

		[ClientRpc]
		private void SyncScrapValueClientRpc(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(268987115u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					BytePacker.WriteValueBitPacked(val2, value);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 268987115u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					NetworkObject val3 = default(NetworkObject);
					((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null);
					((Component)val3).GetComponent<GrabbableObject>().SetScrapValue(value);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void GenerateAndSyncTerminalCodeServerRpc(NetworkObjectReference netObject, int code)
		{
			//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)
			//IL_00e4: 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(2205229909u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObject, default(ForNetworkSerializable));
					BytePacker.WriteValueBitPacked(val2, code);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2205229909u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					GenerateAndSyncTerminalCodeClientRpc(netObject, code);
				}
			}
		}

		[ClientRpc]
		public void GenerateAndSyncTerminalCodeClientRpc(NetworkObjectReference netObject, int code)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3849078077u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObject, default(ForNetworkSerializable));
				BytePacker.WriteValueBitPacked(val2, code);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3849078077u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			NetworkObject val3 = null;
			if (!((NetworkObjectReference)(ref netObject)).TryGet(ref val3, (NetworkManager)null))
			{
				Log.LogError("Network Object is null in GenerateAndSyncTerminalCodeClientRpc()");
				return;
			}
			TerminalAccessibleObject componentInChildren = ((Component)val3).GetComponentInChildren<TerminalAccessibleObject>();
			if ((Object)(object)componentInChildren == (Object)null)
			{
				Log.LogError("Terminal Accessible Object is null in GenerateAndSyncTerminalCodeClientRpc()");
				return;
			}
			componentInChildren.InitializeValues();
			componentInChildren.SetCodeTo(code);
		}

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

		[ClientRpc]
		public void MoveTimeClientRpc(float amount, float speedMultiplier)
		{
			//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(3436861046u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref amount, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speedMultiplier, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3436861046u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Manager.moveTime = true;
					Manager.moveTimeAmount += amount;
					Manager.timeSpeedMultiplier *= speedMultiplier;
				}
			}
		}

		private void UpdateAtmosphere(FixedString128Bytes name, bool state)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < TimeOfDay.Instance.effects.Length; i++)
			{
				FixedString128Bytes val = FixedString128Bytes.op_Implicit(TimeOfDay.Instance.effects[i].name);
				if ((ref val) == (ref name))
				{
					TimeOfDay.Instance.effects[i].effectEnabled = state;
				}
			}
		}

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

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

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

		[ServerRpc(RequireOwnership = false)]
		public void SetRecievedServerRpc(bool state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1853859009u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1853859009u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					SetRecievedClientRpc(state);
				}
			}
		}

		[ClientRpc]
		public void SetRecievedClientRpc(bool state)
		{
			//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(603622741u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 603622741u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					receivedSyncedValues = state;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SetRealityShiftActiveServerRpc(bool state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4203994123u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4203994123u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					SetRealityShiftActiveClientRpc(state);
				}
			}
		}

		[ClientRpc]
		public void SetRealityShiftActiveClientRpc(bool state)
		{
			//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(2568149201u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2568149201u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					BrutalCompanyMinus.Minus.Events.RealityShift.Active = state;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SetAllWeatherActiveServerRpc(bool state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1050877662u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1050877662u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					SetAllWeatherActiveClientRpc(state);
				}
			}
		}

		[ClientRpc]
		public void SetAllWeatherActiveClientRpc(bool state)
		{
			//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(1627891447u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1627891447u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					BrutalCompanyMinus.Minus.Events.AllWeather.Active = state;
				}
			}
		}

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

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

		[ServerRpc(RequireOwnership = false)]
		public void MessWithBreakerServerRpc(bool state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3941924814u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3941924814u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					MessWithBreakerClientRpc(state);
				}
			}
		}

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

		[ServerRpc(RequireOwnership = false)]
		public void MessWithDoorsServerRpc(float openCloseChance, bool messWithLock = false, float messWithLockChance = 0f)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: 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_00b3: 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_00cd: 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(2842285472u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref openCloseChance, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref messWithLock, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref messWithLockChance, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2842285472u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				if (_seed == 0)
				{
					_seed = StartOfRound.Instance.randomMapSeed;
				}
				_seed++;
				MessWithDoorsClientRpc(openCloseChance, _seed, messWithLock, messWithLockChance);
			}
		}

		[ClientRpc]
		public void MessWithDoorsClientRpc(float openCloseChance, int seed, bool messWithLock, float messWithLockChance)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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(1683303265u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref openCloseChance, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, seed);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref messWithLock, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref messWithLockChance, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1683303265u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			DoorLock[] array = Object.FindObjectsOfType<DoorLock>();
			Random random = new Random(seed);
			DoorLock[] array2 = array;
			foreach (DoorLock val3 in array2)
			{
				if ((Object)(object)val3 == (Object)null || random.NextDouble() <= (double)openCloseChance)
				{
					continue;
				}
				if (messWithLock && random.NextDouble() <= (double)messWithLockChance)
				{
					if (random.Next(0, 2) == 0)
					{
						val3.LockDoor(30f);
					}
					else
					{
						val3.UnlockDoor();
					}
					break;
				}
				if (!val3.isLocked)
				{
					((Component)val3).gameObject.GetComponent<AnimatedObjectTrigger>().TriggerAnimationNonPlayer(false, true, false);
					val3.SetDoorAsOpen(Convert.ToBoolean(random.Next(0, 2)));
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void UnlockAndOpenAllDoorsServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1559123307u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1559123307u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				TerminalAccessibleObject[] array = Object.FindObjectsOfType<TerminalAccessibleObject>();
				for (int i = 0; i < array.Length; i++)
				{
					array[i].SetDoorOpenServerRpc(true);
				}
				UnlockAndOpenAllDoorsClientRpc();
			}
		}

		[ClientRpc]
		public void UnlockAndOpenAllDoorsClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(969155834u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 969155834u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
			{
				return;
			}
			DoorLock[] array = Object.FindObjectsOfType<DoorLock>();
			foreach (DoorLock val3 in array)
			{
				if (!((Object)(object)val3 == (Object)null))
				{
					if (val3.isLocked)
					{
						val3.UnlockDoor();
					}
					((Component)val3).gameObject.GetComponent<AnimatedObjectTrigger>().TriggerAnimationNonPlayer(false, true, false);
					val3.SetDoorAsOpen(true);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SpawnMudPilesOutsideServerRpc(int amount)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: 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_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3079998733u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, amount);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3079998733u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				NavMeshHit val3 = default(NavMeshHit);
				Random random = new Random(_seed++);
				for (int i = 0; i < amount; i++)
				{
					Vector3 position = RoundManager.Instance.outsideAINodes[random.Next(0, RoundManager.Instance.outsideAINodes.Length)].transform.position;
					Vector3 position2 = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(position, 30f, val3, random, -1) + Vector3.up;
					SpawnMudPilesOutsideClientRpc(position2, _seed++);
				}
			}
		}

		[ClientRpc]
		public void SpawnMudPilesOutsideClientRpc(Vector3 position, int seed)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: 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(1000423920u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					BytePacker.WriteValueBitPacked(val2, seed);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1000423920u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Object.Instantiate<GameObject>(RoundManager.Instance.quicksandPrefab, position, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void TeleportEnemyServerRpc(NetworkObjectReference enemy, 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(234264786u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref enemy, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 234264786u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					TeleportEnemyClientRpc(enemy, position);
				}
			}
		}

		[ClientRpc]
		private void TeleportEnemyClientRpc(NetworkObjectReference enemy, 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_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: 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(1650168377u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref enemy, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1650168377u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref enemy)).TryGet(ref val3, (NetworkManager)null))
				{
					Object.Instantiate<GameObject>(Assets.teleportAudio, ((Component)val3).transform.position, Quaternion.identity);
					Object.Instantiate<GameObject>(Assets.teleportAudio, position, Quaternion.identity);
					((Component)val3).transform.position = position;
				}
			}
		}

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

		[ClientRpc]
		public void SpawnAllWeatherClientRpc(int seed)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Expected I4, but got Unknown
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: 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(910007267u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, seed);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 910007267u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || RoundManager.Instance.currentLevel.randomWeathers == null)
			{
				return;
			}
			Random random = new Random();
			BrutalCompanyMinus.Minus.Handlers.AllWeather.raining = false;
			RandomWeatherWithVariables[] randomWeathers = RoundManager.Instance.currentLevel.randomWeathers;
			foreach (RandomWeatherWithVariables val3 in randomWeathers)
			{
				if (val3.weatherType == RoundManager.Instance.currentLevel.currentWeather)
				{
					continue;
				}
				LevelWeatherType weatherType = val3.weatherType;
				switch (weatherType - 1)
				{
				case 0:
					BrutalCompanyMinus.Minus.Handlers.AllWeather.raining = true;
					break;
				case 2:
					if (!((Object)(object)TimeOfDay.Instance.foggyWeather == (Object)null))
					{
						LocalVolumetricFog val6 = Object.Instantiate<LocalVolumetricFog>(TimeOfDay.Instance.foggyWeather);
						Manager.objectsToClear.Add(((Component)val6).gameObject);
						val6.parameters.albedo = new Color(0.25f, 0.35f, 0.55f, 1f);
						val6.parameters.meanFreePath = random.Next((int)MathF.Max(4f, val3.weatherVariable), val3.weatherVariable2) * 5;
						val6.parameters.size.y = 255f;
						((Component)val6).gameObject.SetActive(true);
					}
					break;
				case 3:
				{
					FloodWeather val5 = Object.Instantiate<FloodWeather>(Assets.flooded);
					Manager.objectsToClear.Add(((Component)val5).gameObject);
					BrutalCompanyMinus.Minus.Handlers.AllWeather.floodVariable1 = val3.weatherVariable;
					BrutalCompanyMinus.Minus.Handlers.AllWeather.floodVariable2 = val3.weatherVariable2;
					BrutalCompanyMinus.Minus.Handlers.AllWeather.spawnedFloodedWeather = val5;
					((Component)val5).gameObject.SetActive(true);
					break;
				}
				case 1:
				{
					StormyWeather val4 = Object.Instantiate<StormyWeather>(Assets.stormy);
					Manager.objectsToClear.Add(((Component)val4).gameObject);
					BrutalCompanyMinus.Minus.Handlers.AllWeather.lightningVariable1 = val3.weatherVariable;
					BrutalCompanyMinus.Minus.Handlers.AllWeather.LightningVariable2 = val3.weatherVariable2;
					((Component)val4).gameObject.SetActive(true);
					break;
				}
				case 4:
					Manager.minEnemiesToSpawnInside += val3.weatherVariable;
					Manager.minEnemiestoSpawnOutside += val3.weatherVariable2;
					break;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ShiftServerRpc(NetworkObjectReference networkObject)
		{
			//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_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: 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(716805725u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref networkObject, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 716805725u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost) || BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftList.Count == 0 || (Object)(object)BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftList[0] == (Object)null)
			{
				return;
			}
			NetworkObject val3 = null;
			((NetworkObjectReference)(ref networkObject)).TryGet(ref val3, (NetworkManager)null);
			if ((Object)(object)val3 == (Object)null)
			{
				Log.LogError("NetworkObject in ShiftServerRpc() is null.");
				return;
			}
			GrabbableObject component = ((Component)val3).GetComponent<GrabbableObject>();
			GameObject val4 = Object.Instantiate<GameObject>(BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftList[0], ((Component)component).transform.position, Quaternion.identity);
			GrabbableObject component2 = val4.GetComponent<GrabbableObject>();
			if ((Object)(object)component2 == (Object)null)
			{
				Log.LogError("GrabbableObject is null in ShiftServerRpc()");
				return;
			}
			component2.targetFloorPosition = component2.GetItemFloorPosition(((Component)component).transform.position);
			component2.SetScrapValue(BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftListValues[0]);
			((NetworkBehaviour)component2).NetworkObject.Spawn(false);
			SyncScrapValueClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)component2).NetworkObject), BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftListValues[0]);
			AddObjectToGrabToListClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)component2).NetworkObject));
			NetworkObject component3 = ((Component)component).GetComponent<NetworkObject>();
			if ((Object)(object)component3 != (Object)null)
			{
				component3.Despawn(true);
			}
			else
			{
				Log.LogError("NetworkObject is null in ShiftServerRpc(), destroying on client instead.");
				Object.Destroy((Object)(object)component);
			}
			if ((Object)(object)val4 != (Object)null)
			{
				BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftListValues.RemoveAt(0);
				BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftList.RemoveAt(0);
			}
		}

		[ClientRpc]
		public void AddObjectToGrabToListClientRpc(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_00db: 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(4160371367u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4160371367u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftedObjects.Add(obj);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void GenerateShiftableObjectsListServerRpc(NetworkObjectReference[] spawnedScrap)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: 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)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3192420881u, val, (RpcDelivery)0);
				bool flag = spawnedScrap != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(spawnedScrap, default(ForNetworkSerializable));
				}
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3192420881u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				GenerateShiftableObjectsListClientRpc(spawnedScrap);
			}
		}

		[ClientRpc]
		public void GenerateShiftableObjectsListClientRpc(NetworkObjectReference[] spawnedScrap)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: 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_0118: